internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: AUTOMATIC1111/stable-diffusion-webui

Issue:
[Bug]: Cannot disable writing of PNG Info
### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What happened?

Unchecking this setting (and applying) 
Save text information about generation parameters as chunks to png files

No longer prevents this information being written to the PNG.


### Steps to reproduce the problem

1. Go to Settings
2. Uncheck "Save text information about generation parameters as chunks to png files"
3. Apply settings (also tested after a restart)
4. Generate image and check with PNG Info and NotePad++ Info is still there.


### What should have happened?

When this option is unchecked generation parameters should not be written to png

### Commit where the problem happens

Commit hash: 737eb28faca8be2bb996ee0930ec77d1f7ebd939

### What platforms do you use to access UI ?

Windows

### What browsers do you use to access the UI ?

Google Chrome

### Command Line Arguments

_No response_

### Additional information, context and logs

Tested with and without aesthetic extension and any embeddings 


Discussion:
Forgot to mention this was operating as expected on a version downloaded about the 03/10/22
This seems to have started happening on 0cd74602.

Resolving patch:
diff --git a/modules/images.py b/modules/images.py
--- a/modules/images.py
+++ b/modules/images.py
@@ -510,8 +510,9 @@ def exif_bytes():
 
     if extension.lower() == '.png':
         pnginfo_data = PngImagePlugin.PngInfo()
-        for k, v in params.pnginfo.items():
-            pnginfo_data.add_text(k, str(v))
+        if opts.enable_pnginfo:
+            for k, v in params.pnginfo.items():
+                pnginfo_data.add_text(k, str(v))
 
         image.save(fullfn, quality=opts.jpeg_quality, pnginfo=pnginfo_data)
 


Test patch:
Repository: AUTOMATIC1111/stable-diffusion-webui

Issue:
[Feature Request]: Add newest DPM-Solver++
### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What would your feature do ?

Support the newest DPM-Solver++, the state-of-the-art fast sampler for guided sampling by diffusion models.

DPM-Solver++ can achieve great sample quality in only 15 to 20 steps.

References:
https://github.com/LuChengTHU/dpm-solver

https://arxiv.org/abs/2211.01095

https://github.com/huggingface/diffusers/pull/1132

https://github.com/CompVis/stable-diffusion/pull/440

### Proposed workflow

I can help to add the algorithm code.

### Additional information

_No response_


Discussion:
please! this looks very clean.
asked also in https://github.com/crowsonkb/k-diffusion/issues/40
Looks like a useful additional sampler to add to A111.

Resolving patch:
diff --git a/launch.py b/launch.py
--- a/launch.py
+++ b/launch.py
@@ -142,7 +142,7 @@ def prepare_enviroment():
 
     stable_diffusion_commit_hash = os.environ.get('STABLE_DIFFUSION_COMMIT_HASH', "69ae4b35e0a0f6ee1af8bb9a5d0016ccb27e36dc")
     taming_transformers_commit_hash = os.environ.get('TAMING_TRANSFORMERS_COMMIT_HASH', "24268930bf1dce879235a7fddd0b2355b84d7ea6")
-    k_diffusion_commit_hash = os.environ.get('K_DIFFUSION_COMMIT_HASH', "f4e99857772fc3a126ba886aadf795a332774878")
+    k_diffusion_commit_hash = os.environ.get('K_DIFFUSION_COMMIT_HASH', "60e5042ca0da89c14d1dd59d73883280f8fce991")
     codeformer_commit_hash = os.environ.get('CODEFORMER_COMMIT_HASH', "c5b4593074ba6214284d6acd5f1719b6c5d739af")
     blip_commit_hash = os.environ.get('BLIP_COMMIT_HASH', "48211a1594f1321b00f14c9f7a5b4813144b2fb9")
 
diff --git a/modules/sd_samplers.py b/modules/sd_samplers.py
--- a/modules/sd_samplers.py
+++ b/modules/sd_samplers.py
@@ -24,11 +24,15 @@
     ('Heun', 'sample_heun', ['k_heun'], {}),
     ('DPM2', 'sample_dpm_2', ['k_dpm_2'], {}),
     ('DPM2 a', 'sample_dpm_2_ancestral', ['k_dpm_2_a'], {}),
+    ('DPM-Solver++(2S) a', 'sample_dpmpp_2s_ancestral', ['k_dpmpp_2s_a'], {}),
+    ('DPM-Solver++(2M)', 'sample_dpmpp_2m', ['k_dpmpp_2m'], {}),
     ('DPM fast', 'sample_dpm_fast', ['k_dpm_fast'], {}),
     ('DPM adaptive', 'sample_dpm_adaptive', ['k_dpm_ad'], {}),
     ('LMS Karras', 'sample_lms', ['k_lms_ka'], {'scheduler': 'karras'}),
     ('DPM2 Karras', 'sample_dpm_2', ['k_dpm_2_ka'], {'scheduler': 'karras'}),
     ('DPM2 a Karras', 'sample_dpm_2_ancestral', ['k_dpm_2_a_ka'], {'scheduler': 'karras'}),
+    ('DPM-Solver++(2S) a Karras', 'sample_dpmpp_2s_ancestral', ['k_dpmpp_2s_a_ka'], {'scheduler': 'karras'}),
+    ('DPM-Solver++(2M) Karras', 'sample_dpmpp_2m', ['k_dpmpp_2m_ka'], {'scheduler': 'karras'}),
 ]
 
 samplers_data_k_diffusion = [


Test patch:
Repository: AUTOMATIC1111/stable-diffusion-webui

Issue:
[Bug]: X/Y plot ignores file format settings for grids
### Is there an existing issue for this?

- [x] I have searched the existing issues and checked the recent builds/commits

### What happened?

Files are saved in PNG format.

### Steps to reproduce the problem

1. Set File format for grids to jpg
2. Generate grid using X/Y plot


### What should have happened?

Files should be saved in specified format.

### Commit where the problem happens

ca5a9e79dc28eeaa3a161427a82e34703bf15765

### What platforms do you use to access UI ?

Other/Cloud

### What browsers do you use to access the UI ?

Google Chrome

### Command Line Arguments

_No response_

### Additional information, context and logs

_No response_


Discussion:
Can confirm, I found that the img2img is jpg correctly, only txt2img grid bugged

Resolving patch:
diff --git a/scripts/prompt_matrix.py b/scripts/prompt_matrix.py
--- a/scripts/prompt_matrix.py
+++ b/scripts/prompt_matrix.py
@@ -82,6 +82,6 @@ def run(self, p, put_at_start):
         processed.images.insert(0, grid)
 
         if opts.grid_save:
-            images.save_image(processed.images[0], p.outpath_grids, "prompt_matrix", prompt=original_prompt, seed=processed.seed, grid=True, p=p)
+            images.save_image(processed.images[0], p.outpath_grids, "prompt_matrix", extension=opts.grid_format, prompt=original_prompt, seed=processed.seed, grid=True, p=p)
 
         return processed
diff --git a/scripts/xy_grid.py b/scripts/xy_grid.py
--- a/scripts/xy_grid.py
+++ b/scripts/xy_grid.py
@@ -393,6 +393,6 @@ def cell(x, y):
             )
 
         if opts.grid_save:
-            images.save_image(processed.images[0], p.outpath_grids, "xy_grid", prompt=p.prompt, seed=processed.seed, grid=True, p=p)
+            images.save_image(processed.images[0], p.outpath_grids, "xy_grid", extension=opts.grid_format, prompt=p.prompt, seed=processed.seed, grid=True, p=p)
 
         return processed


Test patch:
Repository: AUTOMATIC1111/stable-diffusion-webui

Issue:
even with -medvram,VRAM usage spikes to 6GB at peak,causing generation paused for a while

It consuming like 5G vram at most time which is perfect
![image](https://user-images.githubusercontent.com/115866056/196428911-7ec96c15-fe7d-4004-ac15-46abf16468fb.png)



but sometime it spikes to 5.8~5.9, causing generator stops for minutes
![image](https://user-images.githubusercontent.com/115866056/196429502-500e582c-7458-46a5-96c7-499ad0636828.png)


aleady add this line to the .bat file

set COMMANDLINE_ARGS=--precision full --no-half --medvram  --always-batch-cond-uncond --xformers

no ideal how it happens and how to fix it.
OS:win 10
1660super 6G VRAM 
32G RAM




Discussion:
Remove `--precision full --no-half` then?
> Remove `--precision full --no-half` then?

I tried to removed them but it keeps on generating black squares.
> I tried to removed them but it keeps on generating black squares.

Oh, you're on 1660, sorry.
Did anyone had an ideal to fix it?

Resolving patch:
diff --git a/modules/processing.py b/modules/processing.py
--- a/modules/processing.py
+++ b/modules/processing.py
@@ -530,8 +530,8 @@ def infotext(iteration=0, position_in_batch=0):
             with devices.autocast():
                 samples_ddim = p.sample(conditioning=c, unconditional_conditioning=uc, seeds=seeds, subseeds=subseeds, subseed_strength=p.subseed_strength, prompts=prompts)
 
-            samples_ddim = samples_ddim.to(devices.dtype_vae)
-            x_samples_ddim = decode_first_stage(p.sd_model, samples_ddim)
+            x_samples_ddim = [decode_first_stage(p.sd_model, samples_ddim[i:i+1].to(dtype=devices.dtype_vae))[0].cpu() for i in range(samples_ddim.size(0))]
+            x_samples_ddim = torch.stack(x_samples_ddim).float()
             x_samples_ddim = torch.clamp((x_samples_ddim + 1.0) / 2.0, min=0.0, max=1.0)
 
             del samples_ddim


Test patch:
Repository: AUTOMATIC1111/stable-diffusion-webui

Issue:
[Bug]: Dropdown doesn't set defined Sampling Method from ui-config.json
### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What happened?

Setting my prefferences in ui-config.json should be respected when staring new web ui

### Steps to reproduce the problem

1. Edit your ui.config.json and set sampling methods ie.:
"txt2img/Sampling method/value": "DPM++ SDE Karras",
 "img2img/Sampling method/value": "DPM++ SDE Karras",

2. Launch web ui
3. See wrongly set drop boxes for sampling methoid to "euler a"


### What should have happened?

drop boxes for sampling method set  to default value in ui-config.json ie "DPM++ SDE Karras" 

### Commit where the problem happens

e9fb9bb0c25f59109a816fc53c385bed58965c24

### What platforms do you use to access UI ?

Windows

### What browsers do you use to access the UI ?

Google Chrome

### Command Line Arguments

_No response_

### Additional information, context and logs

_No response_


Discussion:
Seems to be duplicate of #6180 

Resolving patch:
diff --git a/modules/ui.py b/modules/ui.py
--- a/modules/ui.py
+++ b/modules/ui.py
@@ -635,6 +635,7 @@ def create_sampler_and_steps_selection(choices, tabname):
     if opts.samplers_in_dropdown:
         with FormRow(elem_id=f"sampler_selection_{tabname}"):
             sampler_index = gr.Dropdown(label='Sampling method', elem_id=f"{tabname}_sampling", choices=[x.name for x in choices], value=choices[0].name, type="index")
+            sampler_index.save_to_config = True
             steps = gr.Slider(minimum=1, maximum=150, step=1, elem_id=f"{tabname}_steps", label="Sampling Steps", value=20)
     else:
         with FormGroup(elem_id=f"sampler_selection_{tabname}"):


Test patch:
Repository: AUTOMATIC1111/stable-diffusion-webui

Issue:
[Bug]: Typo on Settings / User Interface / "txt2img/ing2img UI item order"
### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What happened?

Thres just a typo on -> Settings / User Interface / "txt2img/ing2img UI item order"

> txt2img/ing2img UI item order

![image](https://user-images.githubusercontent.com/18109442/210893686-2ee58343-9722-43fe-96a0-0944e75350b7.png)


I dont know how to pull a fix, so if anyone knows, be my guest.



### Steps to reproduce the problem

1. Go to Settings / User Interface

txt2img/ing2img UI item order Label


### What should have happened?

> txt2img/img2img UI item order

### Commit where the problem happens

310b71f669e4f2cea11b023c47f7ffedd82ab464

### What platforms do you use to access UI ?

Windows

### What browsers do you use to access the UI ?

Google Chrome

### Command Line Arguments

```Shell
Not relevant
```


### Additional information, context and logs

...


Discussion:

Resolving patch:
diff --git a/modules/shared.py b/modules/shared.py
--- a/modules/shared.py
+++ b/modules/shared.py
@@ -430,7 +430,7 @@ def list_samplers():
     "samplers_in_dropdown": OptionInfo(True, "Use dropdown for sampler selection instead of radio group"),
     "dimensions_and_batch_together": OptionInfo(True, "Show Witdth/Height and Batch sliders in same row"),
     'quicksettings': OptionInfo("sd_model_checkpoint", "Quicksettings list"),
-    'ui_reorder': OptionInfo(", ".join(ui_reorder_categories), "txt2img/ing2img UI item order"),
+    'ui_reorder': OptionInfo(", ".join(ui_reorder_categories), "txt2img/img2img UI item order"),
     'localization': OptionInfo("None", "Localization (requires restart)", gr.Dropdown, lambda: {"choices": ["None"] + list(localization.localizations.keys())}, refresh=lambda: localization.list_localizations(cmd_opts.localizations_dir)),
 }))
 


Test patch:
Repository: AUTOMATIC1111/stable-diffusion-webui

Issue:
[Bug]: dark theme not working in recent commit
### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What happened?

Dark theme is broken, only light theme works

### Steps to reproduce the problem

1. check out any commit past 50059ea661b63967b217e687819cf7a9081e4a0c
2. run with --theme=dark

### What should have happened?

theme should be dark

### Commit where the problem happens

50059ea661b63967b217e687819cf7a9081e4a0c

### What platforms do you use to access UI ?

Linux

### What browsers do you use to access the UI ?

Mozilla Firefox

### Command Line Arguments

```Shell
--xformers --theme=dark
```


### Additional information, context and logs

_No response_


Discussion:
The '--theme dark' form does not work either
Same here. Doesn't work. Light theme hurts my eyes.
You can use: http://127.0.0.1:7860/?__theme=dark

Resolving patch:
diff --git a/modules/ui.py b/modules/ui.py
--- a/modules/ui.py
+++ b/modules/ui.py
@@ -1942,11 +1942,11 @@ def reload_javascript():
     if cmd_opts.theme is not None:
         inline += f"set_theme('{cmd_opts.theme}');"
 
-    head += f'<script type="text/javascript">{inline}</script>\n'
-
     for script in modules.scripts.list_scripts("javascript", ".js"):
         head += f'<script type="text/javascript" src="file={script.path}"></script>\n'
 
+    head += f'<script type="text/javascript">{inline}</script>\n'
+
     def template_response(*args, **kwargs):
         res = shared.GradioTemplateResponseOriginal(*args, **kwargs)
         res.body = res.body.replace(b'</head>', f'{head}</head>'.encode("utf8"))


Test patch:
Repository: AUTOMATIC1111/stable-diffusion-webui

Issue:
[Bug]: vae does not appear when clicking refresh button in models/VAE
### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What happened?

Pressing the button to update the VAE list does not update the VAE list.

### Steps to reproduce the problem

1. Insert new VAE file to models/VAE
2. Press buttion Refresh VAE list 

### What should have happened?

Apprear new VAE file in list

### Commit where the problem happens

Lastest

### What platforms do you use to access the UI ?

_No response_

### What browsers do you use to access the UI ?

_No response_

### Command Line Arguments

```Shell
No
```


### List of extensions

No

### Console logs

```Shell
Nothing
```


### Additional information

_No response_


Discussion:

Resolving patch:
diff --git a/modules/shared_items.py b/modules/shared_items.py
--- a/modules/shared_items.py
+++ b/modules/shared_items.py
@@ -20,4 +20,4 @@ def sd_vae_items():
 def refresh_vae_list():
     import modules.sd_vae
 
-    return modules.sd_vae.refresh_vae_list
+    return modules.sd_vae.refresh_vae_list()


Test patch:
Repository: AUTOMATIC1111/stable-diffusion-webui

Issue:
[Bug]: OSError: cannot write mode I;16 as JPEG
### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What happened?

I used `stable-diffusion-webui-depthmap-script` to generate depthmaps. They are supposed to be saved as 16-bit grayscale PNGs. However, `_atomically_save_image` may also try to export this image for 4chan, meaning saving it as JPEG. The saving then fails with an error, as JPEGs can not be 16-bit. This error may prevent a batch job from completing.


### Steps to reproduce the problem

1. Generate and save depthmap using `stable-diffusion-webui-depthmap-script`, make sure the result is larger than 4 megabytes. For this, try a large file as an input, like the picture attached
2. Observe an error

![example](https://user-images.githubusercontent.com/54073010/209736858-6a8b8314-d184-4a53-8a74-5676f2bd246b.jpg)
![image](https://user-images.githubusercontent.com/54073010/209736822-0e7f7d66-bedb-4f27-ad8c-6cf0b0a27071.png)


### What should have happened?

Either no conversion to JPEG, or a successful conversion to grayscale JPEG.

### Commit where the problem happens

4af3ca5393151d61363c30eef4965e694eeac15e

### What platforms do you use to access UI ?

Windows

### What browsers do you use to access the UI ?

Mozilla Firefox

### Command Line Arguments

```Shell
--medvram --opt-split-attention --xformers
```


### Additional information, context and logs

_No response_
Do not convert to JPEG if not possible
Do not export for 4chan if conversion to JPEG is not possible. This prevents an exception when trying to save large depthmaps when export_for_4chan setting is on. See [#6065](https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/6065)



Discussion:
Still broken in the latest master commit
May I ask, what is this "Export for 4chan" thing? 
@Nacurutu It is an UI setting. If enabled, export every large/heavy image as a shrunk/smaller JPG. The setting has a "4MB" in its wording in the UI (sorry, I am not near a computer rn).
> @Nacurutu It is an UI setting. If enabled, export every large/heavy image as a shrunk/smaller JPG. The setting has a "4MB" in its wording in the UI (sorry, I am not near a computer rn).

thank you!

Resolving patch:
diff --git a/modules/images.py b/modules/images.py
--- a/modules/images.py
+++ b/modules/images.py
@@ -553,6 +553,8 @@ def _atomically_save_image(image_to_save, filename_without_extension, extension)
         elif extension.lower() in (".jpg", ".jpeg", ".webp"):
             if image_to_save.mode == 'RGBA':
                 image_to_save = image_to_save.convert("RGB")
+            elif image_to_save.mode == 'I;16':
+                image_to_save = image_to_save.point(lambda p: p * 0.0038910505836576).convert("RGB" if extension.lower() == ".webp" else "L")
 
             image_to_save.save(temp_file_path, format=image_format, quality=opts.jpeg_quality)
 


Test patch:
Repository: AUTOMATIC1111/stable-diffusion-webui

Issue:
[Feature Request]: Wildcard support for Loras
### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What would your feature do ?

(Not sure if this would fit as a bug report instead,  to be honest)
Would be useful if i want to batch generate various images, each one using a different Lora + their corresponding activation keywords , when specified, if any.
This would be easily done by making it so Wildcards (tried different wildcard extensions,  none worked) are able to use Loras.

Normally when entering a Lora via a wildcard it won't be recognized and won't used when generating an image, this works for embeddings so it makes sense it if worked for loras too




### Proposed workflow

1.- User makes a wildcard file, each line may consist of a different lora.
Like in this example:
<lora:loraname1:1> , activation keyword1, keyword2, etc.
<lora:loraname2:1> , activation keyword1, keyword2, etc.
And so on.
2.- Use the wildcard in the prompt and if there's a lora in the wildcard then it will be used (instead of it just placing "<lora:loraname1:1>" as plain text in the prompt)

### Additional information

_No response_


Discussion:

Resolving patch:
diff --git a/modules/processing.py b/modules/processing.py
--- a/modules/processing.py
+++ b/modules/processing.py
@@ -543,8 +543,6 @@ def infotext(iteration=0, position_in_batch=0):
     if os.path.exists(cmd_opts.embeddings_dir) and not p.do_not_reload_embeddings:
         model_hijack.embedding_db.load_textual_inversion_embeddings()
 
-    _, extra_network_data = extra_networks.parse_prompts(p.all_prompts[0:1])
-
     if p.scripts is not None:
         p.scripts.process(p)
 
@@ -582,9 +580,6 @@ def get_conds_with_caching(function, required_prompts, steps, cache):
             if shared.opts.live_previews_enable and opts.show_progress_type == "Approx NN":
                 sd_vae_approx.model()
 
-            if not p.disable_extra_networks:
-                extra_networks.activate(p, extra_network_data)
-
         with open(os.path.join(paths.data_path, "params.txt"), "w", encoding="utf8") as file:
             processed = Processed(p, [], p.seed, "")
             file.write(processed.infotext(p, 0))
@@ -609,7 +604,11 @@ def get_conds_with_caching(function, required_prompts, steps, cache):
             if len(prompts) == 0:
                 break
 
-            prompts, _ = extra_networks.parse_prompts(prompts)
+            prompts, extra_network_data = extra_networks.parse_prompts(prompts)
+
+            if not p.disable_extra_networks:
+                with devices.autocast():
+                    extra_networks.activate(p, extra_network_data)
 
             if p.scripts is not None:
                 p.scripts.process_batch(p, batch_number=n, prompts=prompts, seeds=seeds, subseeds=subseeds)


Test patch: