From c0a824d8c6d8d60c24998e0feb5e1a2100c66941 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Mon, 5 Jun 2023 10:32:08 -0400 Subject: [PATCH 01/27] add extra networks to xyz --- CHANGELOG.md | 2 + .../Lora/ui_extra_networks_lora.py | 9 ++-- extensions-builtin/sd-webui-agent-scheduler | 2 +- extensions-builtin/sd-webui-controlnet | 2 +- .../stable-diffusion-webui-images-browser | 2 +- javascript/set-hints.js | 8 ++++ modules/devices.py | 44 +++++++++++++------ modules/lora | 2 +- modules/memstats.py | 4 ++ modules/shared.py | 7 ++- modules/ui_extra_networks.py | 31 ++++++++++--- scripts/xyz_grid.py | 41 +++++++++-------- webui.py | 2 +- 13 files changed, 104 insertions(+), 52 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fbeb78785..8dd418e4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Update for 06/03/2023 +- added extra networks to xyz grid options + now you can have more fun with all your loras :) - new vae decode method to help with larger batch sizes, thanks @bigdog - profiling of scripts/extensions callbacks - additional exception handling so bad exception does not crash main app diff --git a/extensions-builtin/Lora/ui_extra_networks_lora.py b/extensions-builtin/Lora/ui_extra_networks_lora.py index 259e99ac8..dad4500e7 100644 --- a/extensions-builtin/Lora/ui_extra_networks_lora.py +++ b/extensions-builtin/Lora/ui_extra_networks_lora.py @@ -14,21 +14,20 @@ class ExtraNetworksPageLora(ui_extra_networks.ExtraNetworksPage): def list_items(self): for name, lora_on_disk in lora.available_loras.items(): - path, ext = os.path.splitext(lora_on_disk.filename) - + path, _ext = os.path.splitext(lora_on_disk.filename) alias = lora_on_disk.get_alias() - yield { "name": name, "filename": path, "preview": self.find_preview(path), "description": self.find_description(path), "search_term": self.search_terms_from_path(lora_on_disk.filename), - "prompt": json.dumps(f""), + "prompt": json.dumps(f""), "local_preview": f"{path}.{shared.opts.samples_format}", "metadata": json.dumps(lora_on_disk.metadata, indent=4) if lora_on_disk.metadata else None, } def allowed_directories_for_previews(self): return [shared.cmd_opts.lora_dir] - diff --git a/extensions-builtin/sd-webui-agent-scheduler b/extensions-builtin/sd-webui-agent-scheduler index b07031958..08cdc1854 160000 --- a/extensions-builtin/sd-webui-agent-scheduler +++ b/extensions-builtin/sd-webui-agent-scheduler @@ -1 +1 @@ -Subproject commit b0703195833b8ea055e07b80902cbda1a01363f6 +Subproject commit 08cdc1854f126ec213f8462bdf81cdb0032bee69 diff --git a/extensions-builtin/sd-webui-controlnet b/extensions-builtin/sd-webui-controlnet index d8551e447..f36493878 160000 --- a/extensions-builtin/sd-webui-controlnet +++ b/extensions-builtin/sd-webui-controlnet @@ -1 +1 @@ -Subproject commit d8551e447d8718e15b8ff5de04036d3fd1b3c5ce +Subproject commit f36493878b299c367bc51f2935fd7e6d19188569 diff --git a/extensions-builtin/stable-diffusion-webui-images-browser b/extensions-builtin/stable-diffusion-webui-images-browser index 5795886be..488c5393d 160000 --- a/extensions-builtin/stable-diffusion-webui-images-browser +++ b/extensions-builtin/stable-diffusion-webui-images-browser @@ -1 +1 @@ -Subproject commit 5795886bee895c2e69e5c64e67aa643da423511c +Subproject commit 488c5393db60f0b1ddfb8ab18f3db9119227c962 diff --git a/javascript/set-hints.js b/javascript/set-hints.js index 64d18b43b..029db6422 100644 --- a/javascript/set-hints.js +++ b/javascript/set-hints.js @@ -18,3 +18,11 @@ onUiUpdate(() => { select.onchange = () => select.title = titles[select.value] || ''; }); }); + +/* +// dump elements +const elements = [ + ...Array.from(gradioApp().querySelectorAll('button')).map(el => ({id: el.id, text: el.textContent, title: el.title })), + ...Array.from(gradioApp().querySelectorAll('label > span')).map(el => ({id: el.id, text: el.textContent, title: el.title })), +]; +*/ diff --git a/modules/devices.py b/modules/devices.py index 510e02a03..5a2785974 100644 --- a/modules/devices.py +++ b/modules/devices.py @@ -98,6 +98,17 @@ def test_fp16(): shared.opts.no_half_vae = True return False +def test_bf16(): + if shared.cmd_opts.experimental: + return True + try: + import torch.nn.functional as F + image = torch.randn(1, 4, 32, 32).to(device="cuda", dtype=torch.bfloat16) + _out = F.interpolate(image, size=(64, 64), mode="nearest") + except: + shared.log.warning('Torch BF16 test failed: Fallback to FP16 operations') + return False + def set_cuda_params(): shared.log.debug('Verifying Torch settings') @@ -117,25 +128,32 @@ def set_cuda_params(): except: pass global dtype, dtype_vae, dtype_unet, unet_needs_upcast # pylint: disable=global-statement - ok = test_fp16() if shared.cmd_opts.use_directml and not shared.cmd_opts.experimental: # TODO DirectML does not have full autocast capabilities shared.opts.no_half = True shared.opts.no_half_vae = True - if ok and shared.opts.cuda_dtype == 'FP32': - shared.log.info('CUDA FP16 test passed but desired mode is set to FP32') - if shared.opts.cuda_dtype == 'FP16' and ok: - dtype = torch.float16 - dtype_vae = torch.float16 - dtype_unet = torch.float16 - if shared.opts.cuda_dtype == 'BF16' and ok: - dtype = torch.bfloat16 - dtype_vae = torch.bfloat16 - dtype_unet = torch.bfloat16 - if shared.opts.cuda_dtype == 'FP32' or shared.opts.no_half or not ok: + if shared.opts.cuda_dtype == 'FP32': + dtype = torch.float32 + dtype_vae = torch.float32 + dtype_unet = torch.float32 + if shared.opts.cuda_dtype == 'BF16' or dtype == torch.bfloat16: + bf16_ok = test_bf16() + dtype = torch.bfloat16 if bf16_ok else torch.float16 + dtype_vae = torch.bfloat16 if bf16_ok else torch.float16 + dtype_unet = torch.bfloat16 if bf16_ok else torch.float16 + if shared.opts.cuda_dtype == 'FP16' or dtype == torch.bfloat16: + fp16_ok = test_fp16() + dtype = torch.float16 if fp16_ok else torch.float32 + dtype_vae = torch.float16 if fp16_ok else torch.float32 + dtype_unet = torch.float16 if fp16_ok else torch.float32 + else: + pass + if shared.opts.no_half: + shared.log.info('Torch override dtype: no-half set') dtype = torch.float32 dtype_vae = torch.float32 dtype_unet = torch.float32 if shared.opts.no_half_vae: # set dtype again as no-half-vae options take priority + shared.log.info('Torch override VAE dtype: no-half-vae set') dtype_vae = torch.float32 unet_needs_upcast = shared.opts.upcast_sampling shared.log.debug(f'Desired Torch parameters: dtype={shared.opts.cuda_dtype} no-half={shared.opts.no_half} no-half-vae={shared.opts.no_half_vae} upscast={shared.opts.upcast_sampling}') @@ -150,7 +168,7 @@ if args.use_ipex: CondFunc('torch.nn.modules.GroupNorm.forward', lambda orig_func, *args, **kwargs: orig_func(args[0], args[1].to(args[0].weight.data.dtype)), lambda *args, **kwargs: args[2].dtype != args[1].weight.data.dtype) - + #Use XPU instead of CPU. %20 Perf improvement on weak CPUs. if args.device_id is not None: cpu = torch.device(f"xpu:{args.device_id}") diff --git a/modules/lora b/modules/lora index 7c38c33ed..0fe1afd4e 160000 --- a/modules/lora +++ b/modules/lora @@ -1 +1 @@ -Subproject commit 7c38c33ed62fa1becab94f967a52aca18ffaccc0 +Subproject commit 0fe1afd4efda89d3d4c8f25c5193c6859a32bc42 diff --git a/modules/memstats.py b/modules/memstats.py index 00260bebf..792d1fdc5 100644 --- a/modules/memstats.py +++ b/modules/memstats.py @@ -19,6 +19,8 @@ def memory_stats(): s = torch.cuda.mem_get_info() gpu = { 'used': gb(s[1] - s[0]), 'total': gb(s[1]) } s = dict(torch.cuda.memory_stats()) + if s['num_ooms'] > 0: + shared.state.oom = True mem.update({ 'gpu': gpu, 'retries': s['num_alloc_retries'], @@ -35,6 +37,8 @@ def memory_stats(): 'retries': s['num_alloc_retries'], 'oom': s['num_ooms'] }) + if s['num_ooms'] > 0: + shared.state.oom = True return mem except: pass diff --git a/modules/shared.py b/modules/shared.py index e30532978..88f1ce227 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -102,6 +102,7 @@ class State: time_start = None need_restart = False server_start = None + oom = False def skip(self): log.debug('Requested skip') @@ -496,8 +497,10 @@ options_templates.update(options_section(('upscaling', "Upscaling"), { "lora_functional": OptionInfo(False, "Use Kohya method for handling multiple Loras", gr.Checkbox, { "visible": False }), })) -# options_templates.update(options_section(('lora', "Lora"), { -# })) +options_templates.update(options_section(('lora', "Lora"), { + "lyco_patch_lora": OptionInfo(False, "Use LyCoris handler for all Lora types", gr.Checkbox, { "visible": True }), # TODO: lyco-patch-lora + "lora_functional": OptionInfo(False, "Use Kohya method for handling multiple Loras", gr.Checkbox, { "visible": True }), +})) options_templates.update(options_section(('face-restoration', "Face restoration"), { "face_restoration_model": OptionInfo("CodeFormer", "Face restoration model", gr.Radio, lambda: {"choices": [x.name() for x in face_restorers]}), diff --git a/modules/ui_extra_networks.py b/modules/ui_extra_networks.py index 79e5c5ae1..929f671c5 100644 --- a/modules/ui_extra_networks.py +++ b/modules/ui_extra_networks.py @@ -4,7 +4,7 @@ import os.path import urllib.parse from pathlib import Path import gradio as gr -from modules import shared +from modules import shared, scripts from modules.generation_parameters_copypaste import image_from_url_text from modules.ui_components import ToolButton @@ -54,10 +54,27 @@ class ExtraNetworksPage: self.card_short = shared.html("extra-networks-card-short.html") self.allow_negative_prompt = False self.metadata = {} + self.items = [] def refresh(self): pass + def create_xyz_grid(self): + xyz_grid = [x for x in scripts.scripts_data if x.script_class.__module__ == "xyz_grid.py"][0].module + + def add_prompt(p, opt, x): + for item in [x for x in self.items if x["name"] == opt]: + try: + p.prompt = f'{p.prompt} {eval(item["prompt"])}' # pylint: disable=eval-used + except Exception as e: + shared.log.error(f'Cannot evaluate extra network prompt: {item["prompt"]} {e}') + + if not any(self.title in x.label for x in xyz_grid.axis_options): + if self.title == 'Checkpoints': + return + opt = xyz_grid.AxisOption(f"[Network] {self.title}", str, add_prompt, choices=lambda: [x["name"] for x in self.items]) + xyz_grid.axis_options.append(opt) + def link_preview(self, filename): quoted_filename = urllib.parse.quote(filename.replace('\\', '/')) mtime = os.path.getmtime(filename) @@ -93,12 +110,14 @@ class ExtraNetworksPage: if subdirs: subdirs = {"": 1, **subdirs} subdirs_html = "".join([f""" - -""" for subdir in subdirs]) + + """ for subdir in subdirs]) try: - for item in self.list_items(): + self.items = list(self.list_items()) + self.create_xyz_grid() + for item in self.items: metadata = item.get("metadata") if metadata: self.metadata[item["name"]] = metadata diff --git a/scripts/xyz_grid.py b/scripts/xyz_grid.py index cfa56fa12..43304cb4b 100644 --- a/scripts/xyz_grid.py +++ b/scripts/xyz_grid.py @@ -207,35 +207,34 @@ class AxisOptionTxt2Img(AxisOption): axis_options = [ AxisOption("Nothing", str, do_nothing, fmt=format_nothing), - AxisOption("Seed", int, apply_field("seed")), - AxisOption("Var. seed", int, apply_field("subseed")), - AxisOption("Var. strength", float, apply_field("subseed_strength")), - AxisOption("Steps", int, apply_field("steps")), - AxisOptionTxt2Img("Hires steps", int, apply_field("hr_second_pass_steps")), - AxisOption("CFG Scale", float, apply_field("cfg_scale")), - AxisOptionImg2Img("Image CFG Scale", float, apply_field("image_cfg_scale")), + AxisOption("Checkpoint name", str, apply_checkpoint, fmt=format_value, confirm=confirm_checkpoints, cost=1.0, choices=lambda: list(sd_models.checkpoints_list)), + AxisOption("VAE", str, apply_vae, cost=0.7, choices=lambda: ['None'] + list(sd_vae.vae_dict)), AxisOption("Prompt S/R", str, apply_prompt, fmt=format_value), - AxisOption("Prompt order", str_permutations, apply_order, fmt=format_value_join_list), + AxisOption("Styles", str, apply_styles, choices=lambda: list(shared.prompt_styles.styles)), AxisOptionTxt2Img("Sampler", str, apply_sampler, fmt=format_value, confirm=confirm_samplers, choices=lambda: [x.name for x in sd_samplers.samplers]), AxisOptionImg2Img("Sampler", str, apply_sampler, fmt=format_value, confirm=confirm_samplers, choices=lambda: [x.name for x in sd_samplers.samplers_for_img2img]), - AxisOption("Checkpoint name", str, apply_checkpoint, fmt=format_value, confirm=confirm_checkpoints, cost=1.0, choices=lambda: list(sd_models.checkpoints_list)), - AxisOption("Sigma Churn", float, apply_field("s_churn")), - AxisOption("Sigma min", float, apply_field("s_tmin")), - AxisOption("Sigma max", float, apply_field("s_tmax")), - AxisOption("Sigma noise", float, apply_field("s_noise")), - AxisOption("Eta", float, apply_field("eta")), + AxisOption("Seed", int, apply_field("seed")), + AxisOption("Steps", int, apply_field("steps")), + AxisOption("CFG Scale", float, apply_field("cfg_scale")), + AxisOption("Var. seed", int, apply_field("subseed")), + AxisOption("Var. strength", float, apply_field("subseed_strength")), AxisOption("Clip skip", int, apply_clip_skip), AxisOption("Denoising", float, apply_field("denoising_strength")), + AxisOptionTxt2Img("Hires steps", int, apply_field("hr_second_pass_steps")), + AxisOptionImg2Img("Image CFG Scale", float, apply_field("image_cfg_scale")), + AxisOption("Prompt order", str_permutations, apply_order, fmt=format_value_join_list), + AxisOption("Sampler Sigma Churn", float, apply_field("s_churn")), + AxisOption("Sampler Sigma min", float, apply_field("s_tmin")), + AxisOption("Sampler Sigma max", float, apply_field("s_tmax")), + AxisOption("Sampler Sigma noise", float, apply_field("s_noise")), + AxisOption("Sampler Eta", float, apply_field("eta")), AxisOptionTxt2Img("Hires upscaler", str, apply_field("hr_upscaler"), choices=lambda: [*shared.latent_upscale_modes, *[x.name for x in shared.sd_upscalers]]), - AxisOptionTxt2Img("Fallback latent upscaler sampler", str, apply_fallback, fmt=format_value, confirm=confirm_samplers, choices=lambda: [x.name for x in sd_samplers.samplers]), - AxisOptionImg2Img("Cond. Image Mask Weight", float, apply_field("inpainting_mask_weight")), - 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)), + AxisOptionImg2Img("Image Mask Weight", float, apply_field("inpainting_mask_weight")), AxisOption("UniPC Order", int, apply_uni_pc_order, cost=0.5), AxisOption("Face restore", str, apply_face_restore, fmt=format_value), - AxisOption("ToMe ratio",float,apply_token_merging_ratio), - AxisOption("ToMe ratio for Hires fix",float,apply_token_merging_ratio_hr), - AxisOption("ToMe random pertubations",str,apply_token_merging_random, choices = lambda: ["Yes","No"]) + AxisOption("ToMe ratio",float, apply_token_merging_ratio), + AxisOption("ToMe ratio for Hires fix",float, apply_token_merging_ratio_hr), + AxisOption("ToMe random pertubations",str, apply_token_merging_random, choices = lambda: ["Yes","No"]) ] diff --git a/webui.py b/webui.py index 13d7faa9f..8f090b415 100644 --- a/webui.py +++ b/webui.py @@ -222,7 +222,7 @@ def start_ui(): gradio_auth_creds += [x.strip() for x in line.split(',') if x.strip()] import installer - global local_url + global local_url # pylint: disable=global-statement app, local_url, share_url = shared.demo.launch( share=cmd_opts.share, server_name=server_name, From c52fb69dded135b0a53f9116049f85ebc8377578 Mon Sep 17 00:00:00 2001 From: Disty0 Date: Mon, 5 Jun 2023 20:49:18 +0300 Subject: [PATCH 02/27] Fix bf16 test --- modules/devices.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/devices.py b/modules/devices.py index 5a2785974..dfdcf57af 100644 --- a/modules/devices.py +++ b/modules/devices.py @@ -103,8 +103,9 @@ def test_bf16(): return True try: import torch.nn.functional as F - image = torch.randn(1, 4, 32, 32).to(device="cuda", dtype=torch.bfloat16) + image = torch.randn(1, 4, 32, 32).to(device=device, dtype=torch.bfloat16) _out = F.interpolate(image, size=(64, 64), mode="nearest") + return True except: shared.log.warning('Torch BF16 test failed: Fallback to FP16 operations') return False @@ -140,7 +141,7 @@ def set_cuda_params(): dtype = torch.bfloat16 if bf16_ok else torch.float16 dtype_vae = torch.bfloat16 if bf16_ok else torch.float16 dtype_unet = torch.bfloat16 if bf16_ok else torch.float16 - if shared.opts.cuda_dtype == 'FP16' or dtype == torch.bfloat16: + if shared.opts.cuda_dtype == 'FP16' or dtype == torch.float16: fp16_ok = test_fp16() dtype = torch.float16 if fp16_ok else torch.float32 dtype_vae = torch.float16 if fp16_ok else torch.float32 From 46d410687ed59fbcb26a35b8e6e3f3f787c4ef8c Mon Sep 17 00:00:00 2001 From: Patrick von Platen Date: Mon, 5 Jun 2023 18:22:17 +0000 Subject: [PATCH 03/27] Improve when loading from diffusers --- modules/modelloader.py | 9 ++++++++- modules/sd_models.py | 24 +++++++++++++++++------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/modules/modelloader.py b/modules/modelloader.py index 188ee6db2..aa68b5701 100644 --- a/modules/modelloader.py +++ b/modules/modelloader.py @@ -9,9 +9,16 @@ from modules.paths import script_path, models_path diffuser_repos = [] -def load_diffusers(model_path: str, command_path: str = None): +def load_diffusers(model_path: str, hub_url: str = None, command_path: str = None): import huggingface_hub as hf + from diffusers import DiffusionPipeline + places = [] + + # download repo + if hub_url is not None: + DiffusionPipeline.download(hub_url, cache_dir=model_path) + places.append(model_path) if command_path is not None and command_path != model_path and os.path.isdir(command_path): places.append(command_path) diff --git a/modules/sd_models.py b/modules/sd_models.py index f658d35f9..676075ef8 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -108,7 +108,8 @@ def list_models(): if shared.backend == shared.Backend.ORIGINAL: model_list = modelloader.load_models(model_path=os.path.join(models_path, 'Stable-diffusion'), model_url=None, command_path=shared.opts.ckpt_dir, ext_filter=[".ckpt", ".safetensors"], download_name=None, ext_blacklist=[".vae.ckpt", ".vae.safetensors"]) else: - model_list = modelloader.load_diffusers(model_path=os.path.join(models_path, 'Diffusers'), command_path=shared.opts.diffusers_dir) + model_path = os.path.join(models_path, 'Diffusers') + model_list = modelloader.load_diffusers(model_path=model_path, command_path=shared.opts.diffusers_dir) for filename in sorted(model_list, key=str.lower): checkpoint_info = CheckpointInfo(filename) if checkpoint_info.name is not None: @@ -125,16 +126,25 @@ def list_models(): elif shared.cmd_opts.ckpt != shared.default_sd_model_file and shared.cmd_opts.ckpt is not None: shared.log.warning(f"Checkpoint not found: {shared.cmd_opts.ckpt}") shared.log.info(f'Available models: {shared.opts.ckpt_dir} {len(checkpoints_list)}') + if len(checkpoints_list) == 0: if not shared.cmd_opts.no_download: key = input('Download the default model? (y/N) ') if key.lower().startswith('y'): - model_url = "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors" - shared.opts.data['sd_model_checkpoint'] = "v1-5-pruned-emaonly.safetensors" - model_list = modelloader.load_models(model_path=model_path, model_url=model_url, command_path=shared.opts.ckpt_dir, ext_filter=[".ckpt", ".safetensors"], download_name="v1-5-pruned-emaonly.safetensors", ext_blacklist=[".vae.ckpt", ".vae.safetensors"]) - for filename in sorted(model_list, key=str.lower): - checkpoint_info = CheckpointInfo(filename) - checkpoint_info.register() + if shared.backend == shared.Backend.ORIGINAL: + model_url = "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors" + shared.opts.data['sd_model_checkpoint'] = "v1-5-pruned-emaonly.safetensors" + model_list = modelloader.load_models(model_path=model_path, model_url=model_url, command_path=shared.opts.ckpt_dir, ext_filter=[".ckpt", ".safetensors"], download_name="v1-5-pruned-emaonly.safetensors", ext_blacklist=[".vae.ckpt", ".vae.safetensors"]) + for filename in sorted(model_list, key=str.lower): + checkpoint_info = CheckpointInfo(filename) + checkpoint_info.register() + else: + hub_url = "runwayml/stable-diffusion-v1-5" + model_list = modelloader.load_diffusers(model_path=model_path, hub_url=hub_url, command_path=shared.opts.diffusers_dir) + for filename in sorted(model_list, key=str.lower): + checkpoint_info = CheckpointInfo(filename) + if checkpoint_info.name is not None: + checkpoint_info.register() def update_model_hashes(): From 9cf58884790e13c40e945a6a324ad4968e507161 Mon Sep 17 00:00:00 2001 From: Patrick von Platen Date: Mon, 5 Jun 2023 18:23:35 +0000 Subject: [PATCH 04/27] dedup code --- modules/sd_models.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/sd_models.py b/modules/sd_models.py index 676075ef8..17dab145d 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -135,16 +135,14 @@ def list_models(): model_url = "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors" shared.opts.data['sd_model_checkpoint'] = "v1-5-pruned-emaonly.safetensors" model_list = modelloader.load_models(model_path=model_path, model_url=model_url, command_path=shared.opts.ckpt_dir, ext_filter=[".ckpt", ".safetensors"], download_name="v1-5-pruned-emaonly.safetensors", ext_blacklist=[".vae.ckpt", ".vae.safetensors"]) - for filename in sorted(model_list, key=str.lower): - checkpoint_info = CheckpointInfo(filename) - checkpoint_info.register() else: hub_url = "runwayml/stable-diffusion-v1-5" model_list = modelloader.load_diffusers(model_path=model_path, hub_url=hub_url, command_path=shared.opts.diffusers_dir) - for filename in sorted(model_list, key=str.lower): - checkpoint_info = CheckpointInfo(filename) - if checkpoint_info.name is not None: - checkpoint_info.register() + + for filename in sorted(model_list, key=str.lower): + checkpoint_info = CheckpointInfo(filename) + if checkpoint_info.name is not None: + checkpoint_info.register() def update_model_hashes(): From efbe364f7dc5073d2ad35ce510c7c364c5985941 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Mon, 5 Jun 2023 14:25:57 -0400 Subject: [PATCH 05/27] js optimizations --- .eslintrc.json | 5 +- CHANGELOG.md | 16 +- cli/{hfsearch.py => hf-search.py} | 2 + cli/validate-locale.py | 31 ++ extensions-builtin/a1111-sd-webui-lycoris | 2 +- html/locale_en.json | 570 ++++++++++++++++++++++ installer.py | 9 +- javascript/aspectRatioOverlay.js | 4 +- javascript/contextMenus.js | 4 +- javascript/generationParams.js | 3 +- javascript/hires.js | 1 - javascript/imageMaskFix.js | 3 +- javascript/imageParams.js | 1 - javascript/imageviewer.js | 3 +- javascript/notification.js | 2 +- javascript/progressbar.js | 1 - javascript/script.js | 36 +- javascript/set-hints.js | 6 +- javascript/ui.js | 7 +- modules/cmd_args.py | 1 + modules/devices.py | 2 +- modules/extensions.py | 2 + modules/paths.py | 1 + modules/scripts.py | 27 +- modules/shared.py | 2 +- modules/ui.py | 14 +- modules/ui_extensions.py | 2 +- scripts/prompt_matrix.py | 2 +- scripts/xyz_grid.py | 2 +- webui.py | 6 +- 30 files changed, 697 insertions(+), 70 deletions(-) rename cli/{hfsearch.py => hf-search.py} (96%) mode change 100644 => 100755 create mode 100755 cli/validate-locale.py create mode 100755 html/locale_en.json diff --git a/.eslintrc.json b/.eslintrc.json index 2958fbc79..e34b2792c 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -51,13 +51,14 @@ "globals": { //script.js "gradioApp": "readonly", + "executeCallbacks": "readonly", + "onAfterUiUpdate": "readonly", + "onOptionsChanged": "readonly", "onUiLoaded": "readonly", "onUiUpdate": "readonly", - "onOptionsChanged": "readonly", "uiCurrentTab": "writable", "uiElementIsVisible": "readonly", "uiElementInSight": "readonly", - "executeCallbacks": "readonly", //ui.js "opts": "writable", "all_gallery_buttons": "readonly", diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dd418e4b..5c62d2c26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,12 +2,16 @@ ## Update for 06/03/2023 -- added extra networks to xyz grid options - now you can have more fun with all your loras :) -- new vae decode method to help with larger batch sizes, thanks @bigdog -- profiling of scripts/extensions callbacks -- additional exception handling so bad exception does not crash main app -- additional background removal models +- added extra networks to **xyz grid** options + now you can have more fun with all your embeddings and loras :) +- new **vae decode** method to help with larger batch sizes, thanks @bigdog +- new setting -> lora -> **use lycoris to handle all lora types** + this is still experimental, but the goal is to obsolete old built-in lora module + as it doesn't understand many new loras and built-in lyco module can handle it all +- optimize browser page loading +- profiling of scripts/extensions callbacks +- additional exception handling so bad exception does not crash main app +- additional background removal models ## Update for 06/02/2023 diff --git a/cli/hfsearch.py b/cli/hf-search.py old mode 100644 new mode 100755 similarity index 96% rename from cli/hfsearch.py rename to cli/hf-search.py index b0fc9040c..bbb4a4f0f --- a/cli/hfsearch.py +++ b/cli/hf-search.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + import sys import huggingface_hub as hf from rich import print # pylint: disable=redefined-builtin diff --git a/cli/validate-locale.py b/cli/validate-locale.py new file mode 100755 index 000000000..45841b7a3 --- /dev/null +++ b/cli/validate-locale.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python + +import sys +import json +from rich import print # pylint: disable=redefined-builtin + +if __name__ == "__main__": + sys.argv.pop(0) + fn = sys.argv[0] if len(sys.argv) > 0 else 'locale_en.json' + with open(fn, 'r') as f: + data = json.load(f) + keys = [] + t_names = 0 + t_hints = 0 + for k in data.keys(): + print(f'Section: {k}') + names = len(data[k]) + t_names += names + print(f' Names: {names}') + hints = len([k for k in data[k] if k["hint"] != ""]) + t_hints += hints + print(f' Hints: {hints}') + print(f' Missing: {names - hints}') + for v in data[k]: + if v['text'] in keys: + print(f' Duplicate: {k}.{v["text"]}') + else: + keys.append(v['text']) + print(f'Total entries: {t_names}') + print(f'Total hints: {t_hints}') + print(f'Total missing: {t_names - t_hints}') diff --git a/extensions-builtin/a1111-sd-webui-lycoris b/extensions-builtin/a1111-sd-webui-lycoris index 21e9ea0f5..1e5db3921 160000 --- a/extensions-builtin/a1111-sd-webui-lycoris +++ b/extensions-builtin/a1111-sd-webui-lycoris @@ -1 +1 @@ -Subproject commit 21e9ea0f58dfdbee12b08389fd2cd1aa545e058d +Subproject commit 1e5db39210df4dd3bb6f3667d9e690c447939e71 diff --git a/html/locale_en.json b/html/locale_en.json new file mode 100755 index 000000000..448bb79a0 --- /dev/null +++ b/html/locale_en.json @@ -0,0 +1,570 @@ +{ "icons": [ + {"id":"","text":"📘","localized":"","hint":"Read generation parameters from prompt or last generation if prompt is empty into user interface"}, + {"id":"","text":"🚮","localized":"","hint":"Clear prompt"}, + {"id":"","text":"🌐","localized":"","hint":"Show/hide extra networks"}, + {"id":"","text":"🧳","localized":"","hint":"Apply selected styles to current prompt"}, + {"id":"","text":"🛅","localized":"","hint":"Save style"}, + {"id":"","text":"🔄","localized":"","hint":"Refresh"}, + {"id":"","text":"❌","localized":"","hint":"Close"}, + {"id":"","text":"📒","localized":"","hint":"Fill"}, + {"id":"","text":"🎲️","localized":"","hint":"Use random seed"}, + {"id":"","text":"♻️","localized":"","hint":"Reuse previous seed"}, + {"id":"","text":"⇅","localized":"","hint":"Switch values"} + ], + "prompts": [ + {"id":"","text":"Prompt","localized":"","hint":"Prompt"}, + {"id":"","text":"Negative prompt","localized":"","hint":"Negative Prompt"} + ], + "tabs": [ + {"id":"","text":"From Text ","localized":"","hint":"Create image from text"}, + {"id":"","text":"From Image ","localized":"","hint":"Create image from image"}, + {"id":"","text":"Process Image ","localized":"","hint":"Process existing image"}, + {"id":"","text":"Train ","localized":"","hint":"Run training or model merging"}, + {"id":"","text":"Settings ","localized":"","hint":"Application settings"}, + {"id":"","text":"Extensions ","localized":"","hint":"Application extensions"} + ], + "action panel": [ + {"id":"","text":"Generate","localized":"","hint":"Start processing"}, + {"id":"","text":"Stop","localized":"","hint":"Stop processing"}, + {"id":"","text":"Skip","localized":"","hint":"Stop processing current job and continue processing"}, + {"id":"","text":"Pause","localized":"","hint":"Pause processing"}, + {"id":"","text":"Interrogate\nCLIP","localized":"","hint":"Run interrogate using CLIP model"}, + {"id":"","text":"Interrogate\nDeepBooru","localized":"","hint":"Run interrogate using DeepBooru model"} + ], + "extra networks": [ + {"id":"","text":"Save preview","localized":"","hint":"Save current image as extra network preview"}, + {"id":"","text":"Save description","localized":"","hint":"Save current text as extra network description"}, + {"id":"","text":"Read description","localized":"","hint":"Read stored extra network description"} + ], + "gallery buttons": [ + {"id":"","text":"show","localized":"","hint":"Show image location"}, + {"id":"","text":"save","localized":"","hint":"Save image"}, + {"id":"","text":"zip","localized":"","hint":"Create zip archive from images"}, + {"id":"","text":"delete","localized":"","hint":"Delete image"}, + {"id":"","text":"➠ text","localized":"","hint":"Transfer image to text interface"}, + {"id":"","text":"➠ image","localized":"","hint":"Transfer image to image interface"}, + {"id":"","text":"➠ inpaint","localized":"","hint":"Transfer image to inpaint interface"}, + {"id":"","text":"➠ sketch","localized":"","hint":"Transfer image to sketch interface"}, + {"id":"","text":"➠ inpaint sketch","localized":"","hint":"Transfer image to inpaint sketch interface"}, + {"id":"","text":"➠ process","localized":"","hint":"Transfer image to process interface"} + ], + "extensions": [ + {"id":"","text":"Install","localized":"","hint":""}, + {"id":"","text":"Search","localized":"","hint":""}, + {"id":"","text":"Sort by","localized":"","hint":""}, + {"id":"","text":"Manage Extensions ","localized":"","hint":""}, + {"id":"","text":"Manual install ","localized":"","hint":""}, + {"id":"","text":"Extension GIT repository URL","localized":"","hint":""}, + {"id":"","text":"Specific branch name","localized":"","hint":""}, + {"id":"","text":"Local directory name","localized":"","hint":""}, + {"id":"","text":"Refresh extension list","localized":"","hint":""}, + {"id":"","text":"Update installed extensions","localized":"","hint":""}, + {"id":"","text":"Apply changes & restart server","localized":"","hint":""} + ], + "txt2img tab": [ + {"id":"","text":"Sampling method","localized":"","hint":"Which algorithm to use to produce the image"}, + {"id":"","text":"Sampling steps","localized":"","hint":"How many times to improve the generated image iteratively; higher values take longer; very low values can produce bad results"}, + {"id":"","text":"Restore faces","localized":"","hint":""}, + {"id":"","text":"Tiling","localized":"","hint":"Produce an image that can be tiled"}, + {"id":"","text":"Hires fix","localized":"","hint":""}, + {"id":"","text":"Denoising strength","localized":"","hint":"Determines how little respect the algorithm should have for image's content. At 0, nothing will change, and at 1 you'll get an unrelated image. With values below 1.0, processing will take less steps than the Sampling Steps slider specifies"}, + {"id":"","text":"Hires steps","localized":"","hint":"Number of sampling steps for upscaled picture. If 0, uses same as for original"}, + {"id":"","text":"Upscaler","localized":"","hint":""}, + {"id":"","text":"Upscale by","localized":"","hint":"Adjusts the size of the image by multiplying the original width and height by the selected value. Ignored if either Resize width to or Resize height to are non-zero"}, + {"id":"","text":"Resize width to","localized":"","hint":"Resizes image to this width. If 0, width is inferred from either of two nearby sliders"}, + {"id":"","text":"Resize height to","localized":"","hint":"Resizes image to this height. If 0, height is inferred from either of two nearby sliders"}, + {"id":"","text":"Width","localized":"","hint":""}, + {"id":"","text":"Height","localized":"","hint":""}, + {"id":"","text":"Batch count","localized":"","hint":"How many batches of images to create (has no impact on generation performance or VRAM usage)"}, + {"id":"","text":"Batch size","localized":"","hint":"How many image to create in a single batch (increases generation performance at cost of higher VRAM usage)"}, + {"id":"","text":"CFG Scale","localized":"","hint":"Classifier Free Guidance Scale - how strongly the image should conform to prompt - lower values produce more creative results"}, + {"id":"","text":"CLIP skip","localized":"","hint":""}, + {"id":"","text":"Seed","localized":"","hint":"A value that determines the output of random number generator - if you create an image with same parameters and seed as another image, you'll get the same result"}, + {"id":"","text":"Extra","localized":"","hint":""}, + {"id":"","text":"Variation seed","localized":"","hint":"Seed of a different picture to be mixed into the generation"}, + {"id":"","text":"Variation strength","localized":"","hint":"How strong of a variation to produce. At 0, there will be no effect. At 1, you will get the complete picture with variation seed (except for ancestral samplers, where you will just get something)"}, + {"id":"","text":"Resize seed from width","localized":"","hint":"Make an attempt to produce a picture similar to what would have been produced with same seed at specified resolution"}, + {"id":"","text":"Resize seed from height","localized":"","hint":"Make an attempt to produce a picture similar to what would have been produced with same seed at specified resolution"}, + {"id":"","text":"Override settings","localized":"","hint":""} + ], + "process tab": [ + {"id":"","text":"Single Image ","localized":"","hint":""}, + {"id":"","text":"Process Batch ","localized":"","hint":""}, + {"id":"","text":"Process Folder ","localized":"","hint":""}, + {"id":"","text":"Scale by ","localized":"","hint":""}, + {"id":"","text":"Scale to ","localized":"","hint":""}, + {"id":"","text":"Input directory","localized":"","hint":""}, + {"id":"","text":"Output directory","localized":"","hint":""}, + {"id":"","text":"Show result images","localized":"","hint":""}, + {"id":"","text":"Resize","localized":"","hint":""}, + {"id":"","text":"Crop to fit","localized":"","hint":""}, + {"id":"","text":"Secondary Upscaler","localized":"","hint":""}, + {"id":"","text":"Upscaler 2 visibility","localized":"","hint":""}, + {"id":"","text":"GFPGAN visibility","localized":"","hint":""}, + {"id":"","text":"CodeFormer visibility","localized":"","hint":""}, + {"id":"","text":"CodeFormer weight (0 = max), 1 = min)","localized":"","hint":""} + ], + "settings menu": [ + {"id":"settings_submit","text":"Apply settings","localized":"","hint":""}, + {"id":"restart_submit","text":"Restart server","localized":"","hint":""}, + {"id":"shutdown_submit","text":"Shutdown server","localized":"","hint":""}, + {"id":"settings_preview_theme","text":"Preview theme","localized":"","hint":""}, + {"id":"defaults_submit","text":"Restore defaults","localized":"","hint":""}, + {"id":"sett_unload_sd_model","text":"Unload checkpoint","localized":"","hint":""}, + {"id":"sett_reload_sd_model","text":"Reload checkpoint","localized":"","hint":""} + ], + "settings sections": [ + {"id":"","text":"Stable Diffusion ","localized":"","hint":""}, + {"id":"","text":"Compute Settings ","localized":"","hint":""}, + {"id":"","text":"System Paths ","localized":"","hint":""}, + {"id":"","text":"Image Options ","localized":"","hint":""}, + {"id":"","text":"Image Processing ","localized":"","hint":""}, + {"id":"","text":"Output Paths ","localized":"","hint":""}, + {"id":"","text":"User interface ","localized":"","hint":""}, + {"id":"","text":"Live previews ","localized":"","hint":""}, + {"id":"","text":"Sampler Settings ","localized":"","hint":""}, + {"id":"","text":"Postprocessing ","localized":"","hint":""}, + {"id":"","text":"Training ","localized":"","hint":""}, + {"id":"","text":"Interrogate ","localized":"","hint":""}, + {"id":"","text":"Upscaling ","localized":"","hint":""}, + {"id":"","text":"Lora ","localized":"","hint":""}, + {"id":"","text":"Face restoration ","localized":"","hint":""}, + {"id":"","text":"Extra Networks ","localized":"","hint":""}, + {"id":"","text":"Token Merging ","localized":"","hint":""}, + {"id":"","text":"Licenses ","localized":"","hint":""}, + {"id":"","text":"Show all pages","localized":"","hint":""}, + {"id":"","text":"Request browser notifications","localized":"","hint":""} + ], + "img2img tabs": [ + {"id":"","text":"Image ","localized":"","hint":""}, + {"id":"","text":"Sketch ","localized":"","hint":""}, + {"id":"","text":"Inpaint ","localized":"","hint":""}, + {"id":"","text":"Inpaint sketch ","localized":"","hint":""}, + {"id":"","text":"Inpaint upload ","localized":"","hint":""}, + {"id":"","text":"Batch ","localized":"","hint":""} + ], + "img2img tab": [ + {"id":"","text":"Inpaint Batch input directory","localized":"","hint":""}, + {"id":"","text":"Inpaint Batch output directory","localized":"","hint":""}, + {"id":"","text":"Inpaint batch mask directory","localized":"","hint":""}, + {"id":"","text":"Resize fixed","localized":"","hint":"Resize image to target resolution. Unless height and width match, you will get incorrect aspect ratio"}, + {"id":"","text":"Crop and resize","localized":"","hint":"Resize the image so that entirety of target resolution is filled with the image. Crop parts that stick out"}, + {"id":"","text":"Resize and fill","localized":"","hint":"Resize the image so that entirety of image is inside target resolution. Fill empty space with image's colors"}, + {"id":"","text":"Resize using Latent upscale","localized":"","hint":""}, + {"id":"","text":"Mask blur","localized":"","hint":"How much to blur the mask before processing, in pixels"}, + {"id":"","text":"Mask transparency","localized":"","hint":""}, + {"id":"","text":"Inpaint masked","localized":"","hint":""}, + {"id":"","text":"Inpaint not masked","localized":"","hint":""}, + {"id":"","text":"fill","localized":"","hint":"fill it with colors of the image"}, + {"id":"","text":"original","localized":"","hint":"keep whatever was there originally"}, + {"id":"","text":"latent noise","localized":"","hint":"fill it with latent space noise"}, + {"id":"","text":"latent nothing","localized":"","hint":"fill it with latent space zeroes"}, + {"id":"","text":"Whole picture","localized":"","hint":""}, + {"id":"","text":"Only masked","localized":"","hint":""}, + {"id":"","text":"Only masked padding, pixels","localized":"","hint":""}, + {"id":"","text":"Scale","localized":"","hint":""}, + {"id":"","text":"Unused","localized":"","hint":""}, + {"id":"","text":"Image CFG Scale","localized":"","hint":""} + ], + "train tabs": [ + {"id":"","text":"Merge models ","localized":"","hint":""}, + {"id":"","text":"Create embedding ","localized":"","hint":""}, + {"id":"","text":"Create hypernetwork ","localized":"","hint":""}, + {"id":"","text":"Preprocess images ","localized":"","hint":""}, + {"id":"","text":"Merge","localized":"","hint":""}, + {"id":"","text":"Calculate hash for all models (may take a long time)","localized":"","hint":""}, + {"id":"","text":"Create embedding","localized":"","hint":""}, + {"id":"","text":"Create hypernetwork","localized":"","hint":""}, + {"id":"","text":"Preprocess","localized":"","hint":""}, + {"id":"","text":"Train Embedding","localized":"","hint":""}, + {"id":"","text":"Train Hypernetwork","localized":"","hint":""} + ], + "train tab": [ + {"id":"","text":"Primary model","localized":"","hint":""}, + {"id":"","text":"Secondary model","localized":"","hint":""}, + {"id":"","text":"Tertiary model","localized":"","hint":""}, + {"id":"","text":"New model name","localized":"","hint":""}, + {"id":"","text":"No interpolation","localized":"","hint":"Result = A"}, + {"id":"","text":"Weighted sum","localized":"","hint":"Result = A * (1 - M) + B * M"}, + {"id":"","text":"Add difference","localized":"","hint":"Result = A + (B - C) * M"}, + {"id":"","text":"Interpolation ratio from Primary to Secondary","localized":"","hint":""}, + {"id":"","text":"ckpt","localized":"","hint":""}, + {"id":"","text":"safetensors","localized":"","hint":""}, + {"id":"","text":"Use FP16","localized":"","hint":""}, + {"id":"","text":"Save metadata","localized":"","hint":""}, + {"id":"","text":"Primary","localized":"","hint":""}, + {"id":"","text":"Secondary","localized":"","hint":""}, + {"id":"","text":"Tertiary","localized":"","hint":""}, + {"id":"","text":"Bake in VAE","localized":"","hint":""}, + {"id":"","text":"Discard weights with matching name","localized":"","hint":"Regular expression; if weights's name matches it, the weights is not written to the resulting checkpoint. Use ^model_ema to discard EMA weights"}, + {"id":"","text":"Name","localized":"","hint":""}, + {"id":"","text":"Initialization text","localized":"","hint":"If the number of tokens is more than the number of vectors, some may be skipped.\nLeave the textbox empty to start with zeroed out vectors"}, + {"id":"","text":"Number of vectors per token","localized":"","hint":""}, + {"id":"","text":"Overwrite Old Embedding","localized":"","hint":""}, + {"id":"","text":"Enter hypernetwork layer structure","localized":"","hint":""}, + {"id":"","text":"Select activation function of hypernetwork. Recommended : Swish / Linear(none)","localized":"","hint":""}, + {"id":"","text":"Select Layer weights initialization. Recommended: Kaiming for relu-like, Xavier for sigmoid-like, Normal otherwise","localized":"","hint":""}, + {"id":"","text":"Add layer normalization","localized":"","hint":""}, + {"id":"","text":"Use dropout","localized":"","hint":""}, + {"id":"","text":"Enter hypernetwork Dropout structure (or empty). Recommended : 0~0.35 incrementing sequence: 0, 0.05, 0.15","localized":"","hint":""}, + {"id":"","text":"Overwrite Old Hypernetwork","localized":"","hint":""}, + {"id":"","text":"Source directory","localized":"","hint":""}, + {"id":"","text":"Destination directory","localized":"","hint":""}, + {"id":"","text":"Existing Caption txt Action","localized":"","hint":""}, + {"id":"","text":"Keep original size","localized":"","hint":""}, + {"id":"","text":"Keep original image channels","localized":"","hint":""}, + {"id":"","text":"Create flipped copies","localized":"","hint":""}, + {"id":"","text":"Split oversized images","localized":"","hint":""}, + {"id":"","text":"Auto focal point crop","localized":"","hint":""}, + {"id":"","text":"Auto-sized crop","localized":"","hint":""}, + {"id":"","text":"Create captions only","localized":"","hint":""}, + {"id":"","text":"Create BLIP captions","localized":"","hint":""}, + {"id":"","text":"Create Deepbooru captions","localized":"","hint":""}, + {"id":"","text":"Split image threshold","localized":"","hint":""}, + {"id":"","text":"Split image overlap ratio","localized":"","hint":""}, + {"id":"","text":"Focal point face weight","localized":"","hint":""}, + {"id":"","text":"Focal point entropy weight","localized":"","hint":""}, + {"id":"","text":"Focal point edges weight","localized":"","hint":""}, + {"id":"","text":"Create debug image","localized":"","hint":""}, + {"id":"","text":"Dimension lower bound","localized":"","hint":""}, + {"id":"","text":"Dimension upper bound","localized":"","hint":""}, + {"id":"","text":"Area lower bound","localized":"","hint":""}, + {"id":"","text":"Area upper bound","localized":"","hint":""}, + {"id":"","text":"Maximize area","localized":"","hint":""}, + {"id":"","text":"Minimize error","localized":"","hint":""}, + {"id":"","text":"Error threshold","localized":"","hint":""}, + {"id":"","text":"Embedding","localized":"","hint":""}, + {"id":"","text":"Hypernetwork","localized":"","hint":""}, + {"id":"","text":"Embedding Learning rate","localized":"","hint":""}, + {"id":"","text":"Hypernetwork Learning rate","localized":"","hint":""}, + {"id":"","text":"Gradient Clipping","localized":"","hint":""}, + {"id":"","text":"Gradient accumulation steps","localized":"","hint":""}, + {"id":"","text":"Dataset directory","localized":"","hint":""}, + {"id":"","text":"Log directory","localized":"","hint":""}, + {"id":"","text":"Prompt template","localized":"","hint":""}, + {"id":"","text":"Do not resize images","localized":"","hint":""}, + {"id":"","text":"Max steps","localized":"","hint":""}, + {"id":"","text":"Save an image to log directory every N steps, 0 to disable","localized":"","hint":""}, + {"id":"","text":"Save a copy of embedding to log directory every N steps, 0 to disable","localized":"","hint":""}, + {"id":"","text":"Use PNG alpha channel as loss weight","localized":"","hint":""}, + {"id":"","text":"Save images with embedding in PNG chunks","localized":"","hint":""}, + {"id":"","text":"Read parameters (prompt, etc...) from txt2img tab when making previews","localized":"","hint":""}, + {"id":"","text":"Shuffle tags by ',' when creating prompts","localized":"","hint":""}, + {"id":"","text":"Drop out tags when creating prompts","localized":"","hint":""}, + {"id":"","text":"once","localized":"","hint":""}, + {"id":"","text":"deterministic","localized":"","hint":""}, + {"id":"","text":"random","localized":"","hint":""} + ], + "settings": [ + {"id":"","text":"Number of cached model checkpoints","localized":"","hint":""}, + {"id":"","text":"Number of cached VAE checkpoints","localized":"","hint":""}, + {"id":"","text":"Select VAE","localized":"","hint":""}, + {"id":"","text":"Enable splitting of hires batch processing","localized":"","hint":""}, + {"id":"","text":"When loading models attempt stream loading optimized for slow or network storage","localized":"","hint":""}, + {"id":"","text":"When loading models attempt to reuse previous model dictionary","localized":"","hint":""}, + {"id":"","text":"Disable cross-attention layer optimization","localized":"","hint":""}, + {"id":"","text":"xFormers","localized":"","hint":""}, + {"id":"","text":"Scaled-Dot-Product","localized":"","hint":""}, + {"id":"","text":"Doggettx's","localized":"","hint":""}, + {"id":"","text":"InvokeAI's","localized":"","hint":""}, + {"id":"","text":"Sub-quadratic","localized":"","hint":""}, + {"id":"","text":"Split attention","localized":"","hint":""}, + {"id":"","text":"xFormers enable flash Attention","localized":"","hint":""}, + {"id":"","text":"SDP disable memory attention","localized":"","hint":""}, + {"id":"","text":"Sub-quadratic cross-attention query chunk size","localized":"","hint":""}, + {"id":"","text":"Sub-quadratic cross-attention kv chunk size","localized":"","hint":""}, + {"id":"","text":"Sub-quadratic cross-attention chunking threshold","localized":"","hint":""}, + {"id":"","text":"Full parser","localized":"","hint":""}, + {"id":"","text":"Compel parser","localized":"","hint":""}, + {"id":"","text":"A1111 parser","localized":"","hint":""}, + {"id":"","text":"Fixed attention","localized":"","hint":""}, + {"id":"","text":"Prompt attention mean normalization","localized":"","hint":""}, + {"id":"","text":"Disable conditional batching enabled on low memory systems","localized":"","hint":""}, + {"id":"","text":"Enable samplers quantization for sharper and cleaner results","localized":"","hint":""}, + {"id":"","text":"Increase coherency by padding from the last comma within n tokens when using more than 75 tokens","localized":"","hint":""}, + {"id":"","text":"Original","localized":"","hint":""}, + {"id":"","text":"Diffusers","localized":"","hint":""}, + {"id":"","text":"VRAM usage polls per second during generation","localized":"","hint":""}, + {"id":"","text":"Autocast","localized":"","hint":""}, + {"id":"","text":"Full","localized":"","hint":""}, + {"id":"","text":"FP32","localized":"","hint":""}, + {"id":"","text":"FP16","localized":"","hint":""}, + {"id":"","text":"BF16","localized":"","hint":""}, + {"id":"","text":"Use full precision for model (--no-half)","localized":"","hint":""}, + {"id":"","text":"Use full precision for VAE (--no-half-vae)","localized":"","hint":""}, + {"id":"","text":"Enable upcast sampling","localized":"","hint":""}, + {"id":"","text":"Enable upcast cross attention layer","localized":"","hint":""}, + {"id":"","text":"Disable NaN check in produced images/latent spaces","localized":"","hint":""}, + {"id":"","text":"Attempt to roll back VAE when produced NaN values, requires NaN check (experimental)","localized":"","hint":""}, + {"id":"","text":"Use channels last as torch memory format ","localized":"","hint":""}, + {"id":"","text":"Enable full-depth cuDNN benchmark feature","localized":"","hint":""}, + {"id":"","text":"Allow TF32 math ops","localized":"","hint":""}, + {"id":"","text":"Allow TF16 reduced precision math ops","localized":"","hint":""}, + {"id":"","text":"Enable model compile (experimental)","localized":"","hint":""}, + {"id":"","text":"inductor","localized":"","hint":""}, + {"id":"","text":"cudagraphs","localized":"","hint":""}, + {"id":"","text":"aot_ts_nvfuser","localized":"","hint":""}, + {"id":"","text":"hidet","localized":"","hint":""}, + {"id":"","text":"ipex","localized":"","hint":""}, + {"id":"","text":"Model compile verbose mode","localized":"","hint":""}, + {"id":"","text":"Model compile suppress errors","localized":"","hint":""}, + {"id":"","text":"Disable Torch memory garbage collection (experimental)","localized":"","hint":""}, + {"id":"","text":"Directory for temporary images; leave empty for default","localized":"","hint":""}, + {"id":"","text":"Cleanup non-default temporary directory when starting webui","localized":"","hint":""}, + {"id":"","text":"Path to directory with stable diffusion checkpoints","localized":"","hint":""}, + {"id":"","text":"Path to directory with stable diffusion diffusers","localized":"","hint":""}, + {"id":"","text":"Path to directory with VAE files","localized":"","hint":""}, + {"id":"","text":"Embeddings directory for textual inversion","localized":"","hint":""}, + {"id":"","text":"Hypernetwork directory","localized":"","hint":""}, + {"id":"","text":"Path to directory with codeformer model file(s)","localized":"","hint":""}, + {"id":"","text":"Path to directory with GFPGAN model file(s)","localized":"","hint":""}, + {"id":"","text":"Path to directory with ESRGAN model file(s)","localized":"","hint":""}, + {"id":"","text":"Path to directory with BSRGAN model file(s)","localized":"","hint":""}, + {"id":"","text":"Path to directory with RealESRGAN model file(s)","localized":"","hint":""}, + {"id":"","text":"Path to directory with ScuNET model file(s)","localized":"","hint":""}, + {"id":"","text":"Path to directory with SwinIR model file(s)","localized":"","hint":""}, + {"id":"","text":"Path to directory with LDSR model file(s)","localized":"","hint":""}, + {"id":"","text":"Path to directory with CLIP model file(s)","localized":"","hint":""}, + {"id":"","text":"Path to directory with Lora network(s)","localized":"","hint":""}, + {"id":"","text":"Path to directory with LyCORIS network(s)","localized":"","hint":""}, + {"id":"","text":"Path to user-defined styles file","localized":"","hint":""}, + {"id":"","text":"Always save all generated images","localized":"","hint":""}, + {"id":"","text":"File format for generated images","localized":"","hint":""}, + {"id":"","text":"Images filename pattern","localized":"","hint":"Use following tags to define how filenames for images are chosen: [steps], [cfg], [prompt_hash], [prompt], [prompt_no_styles], [prompt_spaces], [width], [height], [styles], [sampler], [seed], [model_hash], [model_name], [prompt_words], [date], [datetime], [datetime], [datetime