From 57a3d146e3e193904c1c5e148f7244b9d045f157 Mon Sep 17 00:00:00 2001 From: Sakura-Luna <53183413+Sakura-Luna@users.noreply.github.com> Date: Fri, 14 Apr 2023 01:23:54 +0800 Subject: [PATCH 01/93] Tooltip localization support --- javascript/hints.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/javascript/hints.js b/javascript/hints.js index f48a0eb69..a836d755c 100644 --- a/javascript/hints.js +++ b/javascript/hints.js @@ -117,16 +117,16 @@ titles = { onUiUpdate(function(){ gradioApp().querySelectorAll('span, button, select, p').forEach(function(span){ - tooltip = titles[span.textContent]; + tooltip = localization[titles[span.textContent]] || titles[span.textContent]; if(!tooltip){ - tooltip = titles[span.value]; + tooltip = localization[titles[span.value]] || titles[span.value]; } if(!tooltip){ for (const c of span.classList) { if (c in titles) { - tooltip = titles[c]; + tooltip = localization[titles[c]] || titles[c]; break; } } @@ -141,7 +141,7 @@ onUiUpdate(function(){ if (select.onchange != null) return; select.onchange = function(){ - select.title = titles[select.value] || ""; + select.title = localization[titles[select.value]] || titles[select.value] || ""; } }) }) From 2c24e09dfc431ef7617134a807bf741f0b0c9fa3 Mon Sep 17 00:00:00 2001 From: Sakura-Luna <53183413+Sakura-Luna@users.noreply.github.com> Date: Thu, 20 Apr 2023 14:53:04 +0800 Subject: [PATCH 02/93] Fix gallery not being refreshed correctly --- modules/txt2img.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/txt2img.py b/modules/txt2img.py index 16841d0f2..6ebca656a 100644 --- a/modules/txt2img.py +++ b/modules/txt2img.py @@ -7,6 +7,7 @@ from modules.shared import opts, cmd_opts import modules.shared as shared import modules.processing as processing from modules.ui import plaintext_to_html +from time import time def txt2img(id_task: str, prompt: str, negative_prompt: str, prompt_styles, steps: int, sampler_index: int, restore_faces: bool, tiling: bool, n_iter: int, batch_size: int, cfg_scale: float, seed: int, subseed: int, subseed_strength: float, seed_resize_from_h: int, seed_resize_from_w: int, seed_enable_extras: bool, height: int, width: int, enable_hr: bool, denoising_strength: float, hr_scale: float, hr_upscaler: str, hr_second_pass_steps: int, hr_resize_x: int, hr_resize_y: int, override_settings_texts, *args): @@ -63,6 +64,9 @@ def txt2img(id_task: str, prompt: str, negative_prompt: str, prompt_styles, step if opts.samples_log_stdout: print(generation_info_js) + for img in processed.images: + img.already_saved_as += f'?{int(time())}' + if opts.do_not_show_images: processed.images = [] From 988dd02632bf38e64bc0cf394ece2a5f7a64e15b Mon Sep 17 00:00:00 2001 From: Sakura-Luna <53183413+Sakura-Luna@users.noreply.github.com> Date: Thu, 20 Apr 2023 15:08:31 +0800 Subject: [PATCH 03/93] Add img2img refreshed correctly --- modules/img2img.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/img2img.py b/modules/img2img.py index 953ac5d2d..6da974e45 100644 --- a/modules/img2img.py +++ b/modules/img2img.py @@ -15,6 +15,7 @@ import modules.processing as processing from modules.ui import plaintext_to_html import modules.images as images import modules.scripts +from time import time def process_batch(p, input_dir, output_dir, inpaint_mask_dir, args): @@ -179,6 +180,9 @@ def img2img(id_task: str, mode: int, prompt: str, negative_prompt: str, prompt_s if opts.samples_log_stdout: print(generation_info_js) + for img in processed.images: + img.already_saved_as += f'?{int(time())}' + if opts.do_not_show_images: processed.images = [] From eff00413ae76e01b9a24b13dee6a0dda98f643f2 Mon Sep 17 00:00:00 2001 From: Sakura-Luna <53183413+Sakura-Luna@users.noreply.github.com> Date: Thu, 20 Apr 2023 21:23:56 +0800 Subject: [PATCH 04/93] Refresh bug fix --- modules/img2img.py | 3 ++- modules/txt2img.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/img2img.py b/modules/img2img.py index 6da974e45..fea51667b 100644 --- a/modules/img2img.py +++ b/modules/img2img.py @@ -181,7 +181,8 @@ def img2img(id_task: str, mode: int, prompt: str, negative_prompt: str, prompt_s print(generation_info_js) for img in processed.images: - img.already_saved_as += f'?{int(time())}' + if hasattr(img, 'already_saved_as'): + img.already_saved_as += f'?{int(time())}' if opts.do_not_show_images: processed.images = [] diff --git a/modules/txt2img.py b/modules/txt2img.py index 6ebca656a..57278bdc3 100644 --- a/modules/txt2img.py +++ b/modules/txt2img.py @@ -65,7 +65,8 @@ def txt2img(id_task: str, prompt: str, negative_prompt: str, prompt_styles, step print(generation_info_js) for img in processed.images: - img.already_saved_as += f'?{int(time())}' + if hasattr(img, 'already_saved_as'): + img.already_saved_as += f'?{int(time())}' if opts.do_not_show_images: processed.images = [] From efe98ca0900bdf1098a5a957f576b86e4ddebbea Mon Sep 17 00:00:00 2001 From: Acncagua Slt Date: Wed, 3 May 2023 00:44:16 +0900 Subject: [PATCH 05/93] Initialize the upscalers Add modelloader.load_upscalers to def initialize() --- webui.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/webui.py b/webui.py index 357bf4c19..dd385a382 100644 --- a/webui.py +++ b/webui.py @@ -185,6 +185,9 @@ def initialize(): modules.scripts.load_scripts() startup_timer.record("load scripts") + modelloader.load_upscalers() + #startup_timer.record("load upscalers") #Is this necessary? I don't know. + modules.sd_vae.refresh_vae_list() startup_timer.record("refresh VAE") From 14e55a330146bda01f883a79e3900314a79eb22c Mon Sep 17 00:00:00 2001 From: w-e-w <40751091+w-e-w@users.noreply.github.com> Date: Wed, 3 May 2023 14:28:59 +0900 Subject: [PATCH 06/93] print PIL.UnidentifiedImageError --- modules/img2img.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/img2img.py b/modules/img2img.py index 56c846d62..9fc3a698e 100644 --- a/modules/img2img.py +++ b/modules/img2img.py @@ -48,7 +48,8 @@ def process_batch(p, input_dir, output_dir, inpaint_mask_dir, args): try: img = Image.open(image) - except UnidentifiedImageError: + except UnidentifiedImageError as e: + print(e) continue # Use the EXIF orientation of photos taken by smartphones. img = ImageOps.exif_transpose(img) From 251be61a80e9363fabe1d1881e32a8c09366e8d6 Mon Sep 17 00:00:00 2001 From: Weiming Dong Date: Thu, 4 May 2023 07:59:52 +0800 Subject: [PATCH 07/93] Add extra `None` option for VAE --- scripts/xyz_grid.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/xyz_grid.py b/scripts/xyz_grid.py index cfc7737b4..01d97791e 100644 --- a/scripts/xyz_grid.py +++ b/scripts/xyz_grid.py @@ -222,7 +222,7 @@ axis_options = [ AxisOption("Denoising", float, apply_field("denoising_strength")), AxisOptionTxt2Img("Hires upscaler", str, apply_field("hr_upscaler"), choices=lambda: [*shared.latent_upscale_modes, *[x.name for x in shared.sd_upscalers]]), AxisOptionImg2Img("Cond. Image Mask Weight", float, apply_field("inpainting_mask_weight")), - AxisOption("VAE", str, apply_vae, cost=0.7, choices=lambda: list(sd_vae.vae_dict)), + AxisOption("VAE", str, apply_vae, cost=0.7, choices=lambda: ['None'] + list(sd_vae.vae_dict)), AxisOption("Styles", str, apply_styles, choices=lambda: list(shared.prompt_styles.styles)), AxisOption("UniPC Order", int, apply_uni_pc_order, cost=0.5), AxisOption("Face restore", str, apply_face_restore, format_value=format_value), @@ -346,7 +346,7 @@ class SharedSettingsStackHelper(object): self.CLIP_stop_at_last_layers = opts.CLIP_stop_at_last_layers self.vae = opts.sd_vae self.uni_pc_order = opts.uni_pc_order - + def __exit__(self, exc_type, exc_value, tb): opts.data["sd_vae"] = self.vae opts.data["uni_pc_order"] = self.uni_pc_order @@ -399,7 +399,7 @@ class Script(scripts.Script): include_sub_grids = gr.Checkbox(label='Include Sub Grids', value=False, elem_id=self.elem_id("include_sub_grids")) with gr.Column(): margin_size = gr.Slider(label="Grid margins (px)", minimum=0, maximum=500, value=0, step=2, elem_id=self.elem_id("margin_size")) - + with gr.Row(variant="compact", elem_id="swap_axes"): swap_xy_axes_button = gr.Button(value="Swap X/Y axes", elem_id="xy_grid_swap_axes_button") swap_yz_axes_button = gr.Button(value="Swap Y/Z axes", elem_id="yz_grid_swap_axes_button") @@ -490,7 +490,7 @@ class Script(scripts.Script): start = int(mc.group(1)) end = int(mc.group(2)) num = int(mc.group(3)) if mc.group(3) is not None else 1 - + valslist_ext += [int(x) for x in np.linspace(start=start, stop=end, num=num).tolist()] else: valslist_ext.append(val) @@ -512,7 +512,7 @@ class Script(scripts.Script): start = float(mc.group(1)) end = float(mc.group(2)) num = int(mc.group(3)) if mc.group(3) is not None else 1 - + valslist_ext += np.linspace(start=start, stop=end, num=num).tolist() else: valslist_ext.append(val) From 1bebb50da977dfb93d78ae161e0f28d332f408ea Mon Sep 17 00:00:00 2001 From: Acncagua Slt Date: Thu, 4 May 2023 11:59:22 +0900 Subject: [PATCH 08/93] No double calls will be made Do not call load_upscalers in list_builtin_upscalers --- modules/modelloader.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/modules/modelloader.py b/modules/modelloader.py index 522affc6e..2bfdc1dfa 100644 --- a/modules/modelloader.py +++ b/modules/modelloader.py @@ -133,12 +133,9 @@ forbidden_upscaler_classes = set() def list_builtin_upscalers(): - load_upscalers() - builtin_upscaler_classes.clear() builtin_upscaler_classes.extend(Upscaler.__subclasses__()) - def forbid_loaded_nonbuiltin_upscalers(): for cls in Upscaler.__subclasses__(): if cls not in builtin_upscaler_classes: From 29e13867bff5a00388e5eb1dd04c16c6e8f33e4f Mon Sep 17 00:00:00 2001 From: Sakura-Luna <53183413+Sakura-Luna@users.noreply.github.com> Date: Thu, 4 May 2023 14:08:20 +0800 Subject: [PATCH 09/93] Revert "Refresh bug fix" This reverts commit eff00413ae76e01b9a24b13dee6a0dda98f643f2. --- modules/img2img.py | 3 +-- modules/txt2img.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/img2img.py b/modules/img2img.py index fea51667b..6da974e45 100644 --- a/modules/img2img.py +++ b/modules/img2img.py @@ -181,8 +181,7 @@ def img2img(id_task: str, mode: int, prompt: str, negative_prompt: str, prompt_s print(generation_info_js) for img in processed.images: - if hasattr(img, 'already_saved_as'): - img.already_saved_as += f'?{int(time())}' + img.already_saved_as += f'?{int(time())}' if opts.do_not_show_images: processed.images = [] diff --git a/modules/txt2img.py b/modules/txt2img.py index 57278bdc3..6ebca656a 100644 --- a/modules/txt2img.py +++ b/modules/txt2img.py @@ -65,8 +65,7 @@ def txt2img(id_task: str, prompt: str, negative_prompt: str, prompt_styles, step print(generation_info_js) for img in processed.images: - if hasattr(img, 'already_saved_as'): - img.already_saved_as += f'?{int(time())}' + img.already_saved_as += f'?{int(time())}' if opts.do_not_show_images: processed.images = [] From 35e5916af9ccf1661c6b262b768d4b241ab9eee7 Mon Sep 17 00:00:00 2001 From: Sakura-Luna <53183413+Sakura-Luna@users.noreply.github.com> Date: Thu, 4 May 2023 14:08:21 +0800 Subject: [PATCH 10/93] Revert "Add img2img refreshed correctly" This reverts commit 988dd02632bf38e64bc0cf394ece2a5f7a64e15b. --- modules/img2img.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/img2img.py b/modules/img2img.py index 6da974e45..953ac5d2d 100644 --- a/modules/img2img.py +++ b/modules/img2img.py @@ -15,7 +15,6 @@ import modules.processing as processing from modules.ui import plaintext_to_html import modules.images as images import modules.scripts -from time import time def process_batch(p, input_dir, output_dir, inpaint_mask_dir, args): @@ -180,9 +179,6 @@ def img2img(id_task: str, mode: int, prompt: str, negative_prompt: str, prompt_s if opts.samples_log_stdout: print(generation_info_js) - for img in processed.images: - img.already_saved_as += f'?{int(time())}' - if opts.do_not_show_images: processed.images = [] From 5c66fedb641841958020c0f8693fc69dee7a96a1 Mon Sep 17 00:00:00 2001 From: Sakura-Luna <53183413+Sakura-Luna@users.noreply.github.com> Date: Thu, 4 May 2023 14:08:22 +0800 Subject: [PATCH 11/93] Revert "Fix gallery not being refreshed correctly" This reverts commit 2c24e09dfc431ef7617134a807bf741f0b0c9fa3. --- modules/txt2img.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/txt2img.py b/modules/txt2img.py index 6ebca656a..16841d0f2 100644 --- a/modules/txt2img.py +++ b/modules/txt2img.py @@ -7,7 +7,6 @@ from modules.shared import opts, cmd_opts import modules.shared as shared import modules.processing as processing from modules.ui import plaintext_to_html -from time import time def txt2img(id_task: str, prompt: str, negative_prompt: str, prompt_styles, steps: int, sampler_index: int, restore_faces: bool, tiling: bool, n_iter: int, batch_size: int, cfg_scale: float, seed: int, subseed: int, subseed_strength: float, seed_resize_from_h: int, seed_resize_from_w: int, seed_enable_extras: bool, height: int, width: int, enable_hr: bool, denoising_strength: float, hr_scale: float, hr_upscaler: str, hr_second_pass_steps: int, hr_resize_x: int, hr_resize_y: int, override_settings_texts, *args): @@ -64,9 +63,6 @@ def txt2img(id_task: str, prompt: str, negative_prompt: str, prompt_styles, step if opts.samples_log_stdout: print(generation_info_js) - for img in processed.images: - img.already_saved_as += f'?{int(time())}' - if opts.do_not_show_images: processed.images = [] From 91a15dca80f44e32461f0ab7219de632781a2622 Mon Sep 17 00:00:00 2001 From: Sakura-Luna <53183413+Sakura-Luna@users.noreply.github.com> Date: Thu, 4 May 2023 14:38:15 +0800 Subject: [PATCH 12/93] Use a new way to solve webpage refresh --- modules/ui_tempdir.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/ui_tempdir.py b/modules/ui_tempdir.py index 21945235e..82b9c4e48 100644 --- a/modules/ui_tempdir.py +++ b/modules/ui_tempdir.py @@ -2,6 +2,7 @@ import os import tempfile from collections import namedtuple from pathlib import Path +from time import time import gradio as gr @@ -34,7 +35,7 @@ def check_tmp_file(gradio, filename): def save_pil_to_file(pil_image, dir=None): already_saved_as = getattr(pil_image, 'already_saved_as', None) if already_saved_as and os.path.isfile(already_saved_as): - register_tmp_file(shared.demo, already_saved_as) + register_tmp_file(shared.demo, f'{already_saved_as}?{int(time())}') file_obj = Savedfile(already_saved_as) return file_obj From 8bc4a3a2a8d6ad9b439cb90d52600cc50e9b4f42 Mon Sep 17 00:00:00 2001 From: Sakura-Luna <53183413+Sakura-Luna@users.noreply.github.com> Date: Thu, 4 May 2023 15:55:57 +0800 Subject: [PATCH 13/93] Refresh fix --- modules/ui_tempdir.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/ui_tempdir.py b/modules/ui_tempdir.py index 82b9c4e48..42a85d3b8 100644 --- a/modules/ui_tempdir.py +++ b/modules/ui_tempdir.py @@ -35,7 +35,8 @@ def check_tmp_file(gradio, filename): def save_pil_to_file(pil_image, dir=None): already_saved_as = getattr(pil_image, 'already_saved_as', None) if already_saved_as and os.path.isfile(already_saved_as): - register_tmp_file(shared.demo, f'{already_saved_as}?{int(time())}') + already_saved_as += f'?{int(time())}' + register_tmp_file(shared.demo, already_saved_as) file_obj = Savedfile(already_saved_as) return file_obj From c3eced22fc7b9da4fbb2f55f2d53a7e5e511cfbd Mon Sep 17 00:00:00 2001 From: Leo Mozoloa Date: Thu, 4 May 2023 16:14:33 +0200 Subject: [PATCH 14/93] Fix some Lora's not working --- extensions-builtin/Lora/lora.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/extensions-builtin/Lora/lora.py b/extensions-builtin/Lora/lora.py index 6f246921e..bcf36d77e 100644 --- a/extensions-builtin/Lora/lora.py +++ b/extensions-builtin/Lora/lora.py @@ -165,8 +165,10 @@ def load_lora(name, filename): module = torch.nn.Linear(weight.shape[1], weight.shape[0], bias=False) elif type(sd_module) == torch.nn.MultiheadAttention: module = torch.nn.Linear(weight.shape[1], weight.shape[0], bias=False) - elif type(sd_module) == torch.nn.Conv2d: + elif type(sd_module) == torch.nn.Conv2d and weight.shape[2:] == (1, 1): module = torch.nn.Conv2d(weight.shape[1], weight.shape[0], (1, 1), bias=False) + elif type(sd_module) == torch.nn.Conv2d and weight.shape[2:] == (3, 3): + module = torch.nn.Conv2d(weight.shape[1], weight.shape[0], (3, 3), bias=False) else: print(f'Lora layer {key_diffusers} matched a layer with unsupported type: {type(sd_module).__name__}') continue @@ -232,6 +234,8 @@ def lora_calc_updown(lora, module, target): if up.shape[2:] == (1, 1) and down.shape[2:] == (1, 1): updown = (up.squeeze(2).squeeze(2) @ down.squeeze(2).squeeze(2)).unsqueeze(2).unsqueeze(3) + elif up.shape[2:] == (3, 3) or down.shape[2:] == (3, 3): + updown = torch.nn.functional.conv2d(down.permute(1, 0, 2, 3), up).permute(1, 0, 2, 3) else: updown = up @ down From 16f0739db022de6b49b6572d565f1c72e72dc3a7 Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Sun, 30 Apr 2023 23:01:39 +0300 Subject: [PATCH 15/93] Make localization.js do nothing if there's no localization to do --- javascript/localization.js | 68 +++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 31 deletions(-) diff --git a/javascript/localization.js b/javascript/localization.js index e1ffa271d..0123b877b 100644 --- a/javascript/localization.js +++ b/javascript/localization.js @@ -25,6 +25,10 @@ re_emoji = /[\p{Extended_Pictographic}\u{1F3FB}-\u{1F3FF}\u{1F9B0}-\u{1F9B3}]/u original_lines = {} translated_lines = {} +function hasLocalization() { + return window.localization && Object.keys(window.localization).length > 0; +} + function textNodesUnder(el){ var n, a=[], walk=document.createTreeWalker(el,NodeFilter.SHOW_TEXT,null,false); while(n=walk.nextNode()) a.push(n); @@ -119,37 +123,6 @@ function dumpTranslations(){ return dumped } -onUiUpdate(function(m){ - m.forEach(function(mutation){ - mutation.addedNodes.forEach(function(node){ - processNode(node) - }) - }); -}) - - -document.addEventListener("DOMContentLoaded", function() { - processNode(gradioApp()) - - if (localization.rtl) { // if the language is from right to left, - (new MutationObserver((mutations, observer) => { // wait for the style to load - mutations.forEach(mutation => { - mutation.addedNodes.forEach(node => { - if (node.tagName === 'STYLE') { - observer.disconnect(); - - for (const x of node.sheet.rules) { // find all rtl media rules - if (Array.from(x.media || []).includes('rtl')) { - x.media.appendMedium('all'); // enable them - } - } - } - }) - }); - })).observe(gradioApp(), { childList: true }); - } -}) - function download_localization() { var text = JSON.stringify(dumpTranslations(), null, 4) @@ -163,3 +136,36 @@ function download_localization() { document.body.removeChild(element); } + +if(hasLocalization()) { + onUiUpdate(function (m) { + m.forEach(function (mutation) { + mutation.addedNodes.forEach(function (node) { + processNode(node) + }) + }); + }) + + + document.addEventListener("DOMContentLoaded", function () { + processNode(gradioApp()) + + if (localization.rtl) { // if the language is from right to left, + (new MutationObserver((mutations, observer) => { // wait for the style to load + mutations.forEach(mutation => { + mutation.addedNodes.forEach(node => { + if (node.tagName === 'STYLE') { + observer.disconnect(); + + for (const x of node.sheet.rules) { // find all rtl media rules + if (Array.from(x.media || []).includes('rtl')) { + x.media.appendMedium('all'); // enable them + } + } + } + }) + }); + })).observe(gradioApp(), { childList: true }); + } + }) +} From a3cdf9aaf85399d6ddfb5bc3245d8f154802fe58 Mon Sep 17 00:00:00 2001 From: Sakura-Luna <53183413+Sakura-Luna@users.noreply.github.com> Date: Fri, 5 May 2023 15:51:01 +0800 Subject: [PATCH 16/93] Reopen image fix --- modules/generation_parameters_copypaste.py | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/generation_parameters_copypaste.py b/modules/generation_parameters_copypaste.py index 6df76858f..ae855627d 100644 --- a/modules/generation_parameters_copypaste.py +++ b/modules/generation_parameters_copypaste.py @@ -59,6 +59,7 @@ def image_from_url_text(filedata): is_in_right_dir = ui_tempdir.check_tmp_file(shared.demo, filename) assert is_in_right_dir, 'trying to open image file outside of allowed directories' + filename = filename.rsplit('?', 1)[0] return Image.open(filename) if type(filedata) == list: From 79a6c5a666ba2261068afad969e0bda25bbbf6a9 Mon Sep 17 00:00:00 2001 From: missionfloyd Date: Fri, 5 May 2023 03:51:51 -0600 Subject: [PATCH 17/93] Fix stretched thumbnails on extras tab --- style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/style.css b/style.css index 3f56087a0..88bf6ad80 100644 --- a/style.css +++ b/style.css @@ -246,7 +246,7 @@ button.custom-button{ } } -#txt2img_gallery img, #img2img_gallery img{ +#txt2img_gallery img, #img2img_gallery img, #extras_gallery img{ object-fit: scale-down; } #txt2img_actions_column, #img2img_actions_column { From cde0d642f34b2e008159eaeafb870d5efd1a3315 Mon Sep 17 00:00:00 2001 From: w-e-w <40751091+w-e-w@users.noreply.github.com> Date: Sat, 6 May 2023 02:20:33 +0900 Subject: [PATCH 18/93] add denoising strength filename pattern --- modules/images.py | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/images.py b/modules/images.py index fd1738299..6ceb7c7c7 100644 --- a/modules/images.py +++ b/modules/images.py @@ -357,6 +357,7 @@ class FilenameGenerator: 'generation_number': lambda self: NOTHING_AND_SKIP_PREVIOUS_TEXT if self.p.n_iter == 1 and self.p.batch_size == 1 else self.p.iteration * self.p.batch_size + self.p.batch_index + 1, 'hasprompt': lambda self, *args: self.hasprompt(*args), # accepts formats:[hasprompt..] 'clip_skip': lambda self: opts.data["CLIP_stop_at_last_layers"], + 'denoising': lambda self: self.p.denoising_strength if self.p and self.p.denoising_strength else NOTHING_AND_SKIP_PREVIOUS_TEXT, } default_time_format = '%Y%m%d%H%M%S' From 381674739eff32156bdd88239ab7538e553b1b3d Mon Sep 17 00:00:00 2001 From: w-e-w <40751091+w-e-w@users.noreply.github.com> Date: Sat, 6 May 2023 02:24:33 +0900 Subject: [PATCH 19/93] add denoising strength filename pattern --- javascript/hints.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/javascript/hints.js b/javascript/hints.js index 8d1967a76..c55fedfb3 100644 --- a/javascript/hints.js +++ b/javascript/hints.js @@ -66,8 +66,8 @@ titles = { "Interrogate": "Reconstruct prompt from existing image and put it into the prompt field.", - "Images filename pattern": "Use following tags to define how filenames for images are chosen: [steps], [cfg], [clip_skip], [batch_number], [generation_number], [prompt_hash], [prompt], [prompt_no_styles], [prompt_spaces], [width], [height], [styles], [sampler], [seed], [model_hash], [model_name], [prompt_words], [date], [datetime], [datetime], [datetime