From 6bda4fbc7103510da7ea4a2aaea9d5b305e943e3 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Thu, 19 Oct 2023 11:43:29 -0400 Subject: [PATCH] use short model name and update hints --- CHANGELOG.md | 1 + html/locale_en.json | 42 +++++++++++++++++------------------------- javascript/setHints.js | 21 ++++++++------------- modules/images.py | 4 ++-- modules/processing.py | 13 ++++++++----- modules/shared.py | 4 ++-- modules/ui_models.py | 2 +- wiki | 2 +- 8 files changed, 40 insertions(+), 49 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0099be32a..97677921d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ Service release addressing all zero-day issues reported so far... - fix batch img2img - fix diffusers dpm++ 2m and 1s samplers - fix new style filename template +- fix image name template using model name - force second requirements check on startup - remove lyco, multiple_tqdm - enhance extension compatibility for exensions directly importing codeformers diff --git a/html/locale_en.json b/html/locale_en.json index e1a6cc93c..de35d33ec 100644 --- a/html/locale_en.json +++ b/html/locale_en.json @@ -79,26 +79,23 @@ {"id":"","label":"Do not automatically build extra network pages","localized":"","hint":""}, {"id":"","label":"Use LyCoris handler for all Lora types","localized":"","hint":""}, {"id":"","label":"Use Kohya method for handling multiple LoRA","localized":"","hint":""}, - {"id":"","label":"Multiplier for extra networks","localized":"","hint":"When adding extra network such as Hypernetwork or Lora to prompt, use this multiplier for it"}, + {"id":"","label":"Default multiplier for extra networks","localized":"","hint":"When adding extra network such as Lora to prompt, use this multiplier for it"}, {"id":"","label":"Add hypernetwork to prompt","localized":"","hint":""}, {"id":"","label":"Add Lora to prompt","localized":"","hint":""}, {"id":"","label":"shuffle tags by ',' when creating prompts.","localized":"","hint":""}, {"id":"","label":"When adding to prompt, refer to Lora by","localized":"","hint":""}, {"id":"","label":"add lora hashes to infotext","localized":"","hint":""}, - {"id":"","label":"Checkpoints","localized":"","hint":"Trained model checkpoints"}, + {"id":"","label":"Model","localized":"","hint":"Trained model checkpoints"}, + {"id":"","label":"Style","localized":"","hint":"Additional styles to be applied on selected generation paramters"}, {"id":"","label":"Styles","localized":"","hint":"Additional styles to be applied on selected generation paramters"}, {"id":"","label":"Lora","localized":"","hint":"LoRA: Low-Rank Adaptation. Fine-tuned model that is applied on top of a loaded model"}, {"id":"","label":"LyCORIS","localized":"","hint":"LyCORIS: Lora beYond Conventional methods. Fine-tuned model that is applied on top of a loaded model"}, - {"id":"","label":"Textual Inversion","localized":"","hint":"Textual inversion embedding is a trained embedded information about the subject"}, - {"id":"","label":"Hypernetworks","localized":"","hint":"Small trained neural network that modifies behavior of the loaded model"}, - {"id":"","label":"Save preview","localized":"","hint":"Save current image as extra network preview"}, - {"id":"","label":"Save description","localized":"","hint":"Save current text as extra network description"}, - {"id":"","label":"Read description","localized":"","hint":"Read stored extra network description"} + {"id":"","label":"Embedding","localized":"","hint":"Textual inversion embedding is a trained embedded information about the subject"}, + {"id":"","label":"Hypernetwork","localized":"","hint":"Small trained neural network that modifies behavior of the loaded model"} ], "gallery buttons": [ {"id":"","label":"show","localized":"","hint":"Show image location"}, {"id":"","label":"save","localized":"","hint":"Save image"}, - {"id":"","label":"zip","localized":"","hint":"Create zip archive from images"}, {"id":"","label":"delete","localized":"","hint":"Delete image"}, {"id":"","label":"replace","localized":"","hint":"Replace image"}, {"id":"","label":"➠ text","localized":"","hint":"Transfer image to text interface"}, @@ -118,8 +115,8 @@ {"id":"","label":"Specific branch name","localized":"","hint":"Specify extension branch name, leave blank for default"}, {"id":"","label":"Local directory name","localized":"","hint":"Directory where to install extension, leave blank for default"}, {"id":"","label":"Refresh extension list","localized":"","hint":"Refresh list of available extensions"}, - {"id":"","label":"Update installed extensions","localized":"","hint":"Update installed extensions to their latest available version"}, - {"id":"","label":"Apply changes & restart server","localized":"","hint":"Apply all changes and restart server"}, + {"id":"","label":"Update all installed","localized":"","hint":"Update installed extensions to their latest available version"}, + {"id":"","label":"Apply changes","localized":"","hint":"Apply all changes and restart server"}, {"id":"","label":"install","localized":"","hint":"install this extension"}, {"id":"","label":"uninstall","localized":"","hint":"uninstall this extension"}, {"id":"","label":"User interface","localized":"","hint":"Review and set current values as default values for the user interface"}, @@ -135,13 +132,15 @@ {"id":"","label":"Advanced","localized":"","hint":"Additional advanced options"}, {"id":"","label":"Sampling method","localized":"","hint":"Which algorithm to use to produce the image"}, {"id":"","label":"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":"","label":"Sampler options","localized":"","hint":"Advanced sampler options"}, + {"id":"","label":"Sigma algorithm","localized":"","hint":"Algorithm to progress noise resolution on each sampler step"}, {"id":"","label":"Restore faces","localized":"","hint":"Use a pre-trained model to correct the generated faces. See GFPGAN or Codeformer."}, {"id":"","label":"Tiling","localized":"","hint":"Produce an image that can be tiled"}, {"id":"","label":"full quality","localized":"","hint":"Use full quality VAE to decode latent samples"}, {"id":"","label":"face restore","localized":"","hint":"Run processed image through additional face restoration model"}, {"id":"","label":"denoise","localized":"","hint":"Denoising details for img2img"}, {"id":"","label":"remove background","localized":"","hint":"Run processed image through additional background removal model"}, - {"id":"","label":"Second pass","localized":"","hint":"Use a similar process as image to image to upscale and/or add detail to the final image. Optionally uses refiner model to enhance image details."}, + {"id":"","label":"Enable second pass","localized":"","hint":"Use a similar process as image to image to upscale and/or add detail to the final image. Optionally uses refiner model to enhance image details."}, {"id":"","label":"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":"","label":"Denoise start","localized":"","hint":"Override denoise strength by stating how early base model should finish and when refiner should start. Only applicable to refiner usage. If set to 0 or 1, denoising strength will be used"}, {"id":"","label":"Hires steps","localized":"","hint":"Number of sampling steps for upscaled picture. If 0, uses same as for original"}, @@ -163,7 +162,7 @@ {"id":"","label":"Batch size","localized":"","hint":"How many image to create in a single batch (increases generation performance at cost of higher VRAM usage)"}, {"id":"","label":"cfg scale","localized":"","hint":"Classifier Free Guidance scale: how strongly the image should conform to prompt. Lower values produce more creative results, higher values make it follow the prompt more strictly; recommended values between 5-10"}, {"id":"","label":"CLIP skip","localized":"","hint":"Clip skip is a feature that allows users to control the level of specificity of the prompt, the higher the CLIP skip value, the less deep the prompt will be interpreted. CLIP Skip 1 is typical while some anime models produce better results at CLIP skip 2"}, - {"id":"","label":"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":"","label":"Initial 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":"","label":"Extra","localized":"","hint":"Show additional options"}, {"id":"","label":"Variation seed","localized":"","hint":"Seed of a different picture to be mixed into the generation"}, {"id":"","label":"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)"}, @@ -183,10 +182,7 @@ {"id":"","label":"Resize","localized":"","hint":"Resizing details. Higher resolutions require additional processing memory."}, {"id":"","label":"Crop to fit","localized":"","hint":"If the dimensions of your source image (e.g. 512x510) deviate from your target dimensions (e.g. 1024x768) this function will fit your upscaled image into your target size image. Excess will be cropped"}, {"id":"","label":"Secondary Upscaler","localized":"","hint":"Select secondary upscaler to run after initial upscaler"}, - {"id":"","label":"Upscaler 2 visibility","localized":"","hint":"Strength of the secondary upscaler"}, - {"id":"","label":"GFPGAN visibility","localized":"","hint":"Strength of GFPGAN face restore network, 0=disabled"}, - {"id":"","label":"CodeFormer visibility","localized":"","hint":"Strength of CodeFormer face restore network, 0=disabled"}, - {"id":"","label":"CodeFormer weight","localized":"","hint":"0=maximum strength, 1=minimum strength"} + {"id":"","label":"Upscaler 2 visibility","localized":"","hint":"Strength of the secondary upscaler"} ], "settings menu": [ {"id":"settings_submit","label":"Apply settings","localized":"","hint":"Save current settings, server restart is recommended"}, @@ -251,7 +247,7 @@ {"id":"","label":"Merge","localized":"","hint":""}, {"id":"","label":"Validate","localized":"","hint":""}, {"id":"","label":"List model details","localized":"","hint":""}, - {"id":"","label":"Calculate hash for all models (may take a long time)","localized":"","hint":""}, + {"id":"","label":"Calculate hash for all models","localized":"","hint":"Calculates hash for all available models which may take a very long time"}, {"id":"","label":"search models","localized":"","hint":""}, {"id":"","label":"select model","localized":"","hint":""}, {"id":"","label":"specify model variant","localized":"","hint":""}, @@ -492,8 +488,8 @@ {"id":"","label":"Path to notification sound","localized":"","hint":""}, {"id":"","label":"Live preview display period","localized":"","hint":""}, {"id":"","label":"Full VAE","localized":"","hint":""}, - {"id":"","label":"Approximate NN","localized":"","hint":"Cheap neural network approximation. Very fast compared to VAE, but produces pictures with 4 times smaller horizontal/vertical resolution and lower quality"}, - {"id":"","label":"Approximate simple","localized":"","hint":"Very cheap approximation. Very fast compared to VAE, but produces pictures with 8 times smaller horizontal/vertical resolution and extremely low quality"}, + {"id":"","label":"Approximate","localized":"","hint":"Cheap neural network approximation. Very fast compared to VAE, but produces pictures with 4 times smaller horizontal/vertical resolution and lower quality"}, + {"id":"","label":"Simple","localized":"","hint":"Very cheap approximation. Very fast compared to VAE, but produces pictures with 8 times smaller horizontal/vertical resolution and extremely low quality"}, {"id":"","label":"TAESD","localized":"","hint":""}, {"id":"","label":"Combined","localized":"","hint":""}, {"id":"","label":"Progress update period","localized":"","hint":"Update period for UI progress bar and preview checks, in miliseconds"}, @@ -546,8 +542,6 @@ {"id":"","label":"Filename word regex","localized":"","hint":"This regular expression will be used extract words from filename, and they will be joined using the option below into label text used for training. Leave empty to keep filename text as it is"}, {"id":"","label":"Filename join string","localized":"","hint":"This string will be used to join split words into a single line if the option above is enabled"}, {"id":"","label":"Embeddings train templates directory","localized":"","hint":""}, - {"id":"","label":"Number of repeats for a single input image per epoch","localized":"","hint":"Used only for displaying epoch number"}, - {"id":"","label":"Save CSV file containing the loss to log directory","localized":"","hint":"Save CSV file containing the loss to log directory every N steps, 0 to disable"}, {"id":"","label":"Enable tensorboard logging","localized":"","hint":""}, {"id":"","label":"Save generated images within tensorboard","localized":"","hint":""}, {"id":"","label":"Tensorboard flush period","localized":"","hint":"How often, in seconds, to flush the pending Tensorboard events and summaries to disk"}, @@ -567,10 +561,8 @@ {"id":"","label":"Escape brackets in deepbooru","localized":"","hint":"Escape (\\) brackets in deepbooru so they are used as literal brackets and not for emphasis"}, {"id":"","label":"Filter out tags from deepbooru output","localized":"","hint":"Filter out those tags from deepbooru output (separated by comma)"}, {"id":"","label":"Default upscaler for image resize operations","localized":"","hint":""}, - {"id":"","label":"Tile size for ESRGAN upscalers","localized":"","hint":"0 = no tiling"}, - {"id":"","label":"Tile overlap in pixels for ESRGAN upscalers","localized":"","hint":"Low values = visible seam"}, - {"id":"","label":"Tile size for SCUNET upscalers","localized":"","hint":"0 = no tiling"}, - {"id":"","label":"Tile overlap for SCUNET upscalers","localized":"","hint":" Low values = visible seam"}, + {"id":"","label":"Upscaler tile size","localized":"","hint":"0 = no tiling"}, + {"id":"","label":"Upscaler tile overlap","localized":"","hint":"Low values = visible seam"}, {"id":"","label":"Do not fix prompt schedule for second order samplers","localized":"","hint":""}, {"id":"","label":"CodeFormer","localized":"","hint":""}, {"id":"","label":"GFPGAN","localized":"","hint":"Restore low quality faces using GFPGAN neural network"}, diff --git a/javascript/setHints.js b/javascript/setHints.js index 1ce221723..726d83dfa 100644 --- a/javascript/setHints.js +++ b/javascript/setHints.js @@ -30,20 +30,15 @@ async function tooltipHide(e) { async function validateHints(elements, data) { let original = elements.map((e) => e.textContent.toLowerCase().trim()).sort((a, b) => a > b); - original = [...new Set(original)]; - log('all hints:', original); - log('hints-differences', { elements: original.length, hints: data.length }); + original = [...new Set(original)]; // remove duplicates const current = data.map((e) => e.label.toLowerCase().trim()).sort((a, b) => a > b); - let missing = []; - for (let i = 0; i < original.length; i++) { - if (!current.includes(original[i])) missing.push(original[i]); - } - log('missing in locale:', missing); - missing = []; - for (let i = 0; i < current.length; i++) { - if (!original.includes(current[i])) missing.push(current[i]); - } - log('in locale but not ui:', missing); + log('all elements:', original); + log('all hints:', current); + log('hints-differences', { elements: original.length, hints: current.length }); + const missingLocale = original.filter((e) => !current.includes(e)); + log('missing in locale:', missingLocale); + const missingUI = current.filter((e) => !original.includes(e)); + log('in locale but not ui:', missingUI); } async function setHints() { diff --git a/modules/images.py b/modules/images.py index b84d44eee..4b0d198a2 100644 --- a/modules/images.py +++ b/modules/images.py @@ -294,8 +294,8 @@ class FilenameGenerator: 'job_timestamp': lambda self: getattr(self.p, "job_timestamp", shared.state.job_timestamp), 'model': lambda self: shared.sd_model.sd_checkpoint_info.title, - 'model_shortname': lambda self: shared.sd_model.sd_checkpoint_info.name, - 'model_name': lambda self: shared.sd_model.sd_checkpoint_info.name, + 'model_shortname': lambda self: shared.sd_model.sd_checkpoint_info.model_name, + 'model_name': lambda self: shared.sd_model.sd_checkpoint_info.model_name, 'model_hash': lambda self: shared.sd_model.sd_checkpoint_info.shorthash, 'prompt': lambda self: self.prompt, diff --git a/modules/processing.py b/modules/processing.py index 2c6deb0b1..0b3e461da 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -172,12 +172,15 @@ class StableDiffusionProcessing: self.s_max = shared.opts.s_max self.s_tmin = shared.opts.s_tmin self.s_tmax = float('inf') # not representable as a standard ui option - self.refiner_switch_at = 0 # a1111 compatibility item - self.all_hr_prompts = [] # a1111 compatibility item - self.hr_prompt = '' # a1111 compatibility item - self.comments = {} # a1111 compatibility item - self.is_api = False # a1111 compatibility item shared.opts.data['clip_skip'] = clip_skip + # TODO a1111 compatibility items + self.refiner_switch_at = 0 + self.hr_prompt = '' + self.all_hr_prompts = [] + self.hr_negative_prompt = '' + self.all_hr_negative_prompts = [] + self.comments = {} + self.is_api = False @property def sd_model(self): diff --git a/modules/shared.py b/modules/shared.py index fff70fa2b..9c0b8058e 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -160,7 +160,7 @@ def list_samplers(): def temp_disable_extensions(): disabled = [] if cmd_opts.safe: - for ext in ['sd-webui-controlnet', 'multidiffusion-upscaler-for-automatic1111', 'a1111-sd-webui-lycoris', 'sd-webui-agent-scheduler', 'clip-interrogator-ext', 'stable-diffusion-webui-rembg', 'sd-extension-chainner']: + for ext in ['sd-webui-controlnet', 'multidiffusion-upscaler-for-automatic1111', 'a1111-sd-webui-lycoris', 'sd-webui-agent-scheduler', 'clip-interrogator-ext', 'stable-diffusion-webui-rembg', 'sd-extension-chainner', 'stable-diffusion-webui-images-browser']: if ext not in opts.disabled_extensions: disabled.append(ext) log.info(f'Safe mode disabling extensions: {disabled}') @@ -297,7 +297,7 @@ options_templates.update(options_section(('advanced', "Inference Settings"), { "token_merging_sep": OptionInfo("

Token merging

", "", gr.HTML), "token_merging_ratio": OptionInfo(0.0, "Token merging ratio (txt2img)", gr.Slider, {"minimum": 0.0, "maximum": 0.9, "step": 0.1}), "token_merging_ratio_img2img": OptionInfo(0.0, "Token merging ratio (img2img)", gr.Slider, {"minimum": 0.0, "maximum": 0.9, "step": 0.1}), - "token_merging_ratio_hr": OptionInfo(0.0, "Token merging ratio for (hires)", gr.Slider, {"minimum": 0.0, "maximum": 0.9, "step": 0.1}), + "token_merging_ratio_hr": OptionInfo(0.0, "Token merging ratio (hires)", gr.Slider, {"minimum": 0.0, "maximum": 0.9, "step": 0.1}), "freeu_sep": OptionInfo("

FreeU

", "", gr.HTML), "freeu_enabled": OptionInfo(False, "FreeU enabled"), diff --git a/modules/ui_models.py b/modules/ui_models.py index 817ec607d..717fe15d8 100644 --- a/modules/ui_models.py +++ b/modules/ui_models.py @@ -143,7 +143,7 @@ def create_ui(): with gr.Row(): model_list_btn = gr.Button(value="List model details", variant='primary') - model_checkhash_btn = gr.Button(value="Calculate hash for all models (may take a long time)", variant='primary') + model_checkhash_btn = gr.Button(value="Calculate hash for all models", variant='primary') model_checkhash_btn.click(fn=sd_models.update_model_hashes, inputs=[], outputs=[models_outcome]) with gr.Row(): model_table = gr.DataFrame( diff --git a/wiki b/wiki index 3b4fb16cb..58e8d11f9 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit 3b4fb16cb127069f76dc2ae049603f8a951864d8 +Subproject commit 58e8d11f94503d86f0b9b3f73046c5996a2fc000