jumbo commit see changelog for details

This commit is contained in:
Vladimir Mandic
2024-01-12 15:00:02 -05:00
parent 8b2e06147f
commit 011bac41df
22 changed files with 260 additions and 634 deletions
+16 -6
View File
@@ -1,11 +1,13 @@
# Change Log for SD.Next
## Update for 2023-01-11
## Update for 2023-01-12
Following-up on a major release, here is a lot more functionality in new Control module and FaceID & IPAdapter modules
Plus welcome additions to UI accessibility and flexibility of deployment
Another release with a lot more functionality in new Control module and FaceID & IPAdapter modules
Plus welcome additions to UI performance and accessibility and flexibility of deployment
And it also includes fixes for all reported issues so far
However,
- **Control**:
- add **inpaint** support
applies to both *img2img* and *controlnet* workflows
@@ -65,13 +67,21 @@ And it also includes fixes for all reported issues so far
this does not work with gradio-default themes as css is created by gradio itself
- modularized blip/booru interrogate
now appears as toolbuttons on image/gallery output
- faster browser page load
- cleanup hints
- cleanup settings
- **server startup**: performance
- reduced module imports
ldm support is now only loaded when running in backend=original
- faster extension load
- faster json parsing
- faster lora indexing
- lazy load optional imports
- lazy load optional imports
- **extra networks**
- 4x faster civitai metadata and previews lookup
- better display and selection of tags & trigger words
- better search
- reduce html overhead
- **offline deployment**: allow deployment without git clone
for example, you can now deploy a zip of the sdnext folder
- **latent upscale**: updated latent upscalers (some are new)
@@ -97,7 +107,7 @@ And it also includes fixes for all reported issues so far
- major internal ui module refactoring
this may cause compatibility issues if an extension is doing a direct import from `ui.py`
in which case, report it so i can add a compatibility layer
- **Compile**
- **compile**
- new option: **fused projections**
pretty much free 5% performance boost for compatible models
enable in settings -> compute settings
@@ -124,7 +134,7 @@ And it also includes fixes for all reported issues so far
OpenVINO is faster than IPEX now
- reduce system memory usage after compile
- fix cache loading with multiple models
- **Fixes**
- **fixes**
- ipadapter: allow changing of model/image on-the-fly
- ipadapter: fix fallback of cross-attention on unload
- python: fix python 3.9 compatibility
+1 -1
View File
@@ -159,7 +159,7 @@ def load_networks(names, te_multipliers=None, unet_multipliers=None, dyn_dims=No
failed_to_load_networks = []
recompile_model = False
if shared.compiled_model_state is not None and shared.compiled_model_state.is_compiled == True:
if shared.compiled_model_state is not None and shared.compiled_model_state.is_compiled:
if len(names) == len(shared.compiled_model_state.lora_model):
for i, name in enumerate(names):
if shared.compiled_model_state.lora_model[i] != f"{name}:{te_multipliers[i] if te_multipliers else 1.0}":
@@ -55,38 +55,44 @@ class ExtraNetworksPageLora(ui_extra_networks.ExtraNetworksPage):
words = [str(w).replace('.json', '') for w in words]
if words[0] == '{}':
words[0] = 0
tag = ' '.join(words[1:])
tag = ' '.join(words[1:]).lower()
tags[tag] = words[0]
versions = info.get('modelVersions', []) # trigger words from info json
for v in versions:
for v in info.get('modelVersions', []): # trigger words from info json
possible_tags = v.get('trainedWords', [])
if isinstance(possible_tags, list):
for tag in possible_tags:
if tag not in tags:
tags[tag] = 0
search = {}
for tag_str in possible_tags:
for tag in tag_str.split(','):
tag = tag.strip().lower()
if tag not in tags:
tags[tag] = 0
possible_tags = info.get('tags', []) # tags from info json
if not isinstance(possible_tags, list):
possible_tags = [v for v in possible_tags.values()]
for v in possible_tags:
search[v] = 0
if len(list(tags)) == 0:
tags = search
for tag in possible_tags:
tag = tag.strip().lower()
if tag not in tags:
tags[tag] = 0
bad_chars = [';', ':', '<', ">", "*", '?', '\'', '\"']
bad_chars = [';', ':', '<', ">", "*", '?', '\'', '\"', '(', ')', '[', ']', '{', '}', '\\', '/']
clean_tags = {}
for k, v in tags.items():
tag = ''.join(i for i in k if not i in bad_chars)
tag = ''.join(i for i in k if not i in bad_chars).strip()
clean_tags[tag] = v
clean_tags.pop('img', None)
clean_tags.pop('dataset', None)
item["info"] = info
item["description"] = self.find_description(l.filename, info) # use existing info instead of double-read
item["tags"] = clean_tags
item["search_term"] = f'{self.search_terms_from_path(l.filename)} {" ".join(tags.keys())} {" ".join(search.keys())}'
return item
except Exception as e:
shared.log.debug(f"Extra networks error: type=lora file={name} {e}")
from modules import errors
errors.display('e', 'Lora')
return None
def list_items(self):
+31 -429
View File
@@ -1,12 +1,4 @@
{"icons": [
{"id":"","label":"📘","localized":"","hint":"Read parameters from last generated image"},
{"id":"","label":"🚮","localized":"","hint":"Clear prompt"},
{"id":"","label":"🌐","localized":"","hint":"Show/hide extra networks"},
{"id":"","label":"⏩","localized":"","hint":"Apply selected styles to current prompt"},
{"id":"","label":"⬇️","localized":"","hint":"Save parameters from last generated image as style template"},
{"id":"","label":"🔄","localized":"","hint":"Refresh"},
{"id":"","label":"🛗","localized":"","hint":"Close"},
{"id":"","label":"⏫","localized":"","hint":"Fill"},
{"id":"","label":"🎲️","localized":"","hint":"Use random seed"},
{"id":"","label":"♻️","localized":"","hint":"Reuse previous seed"},
{"id":"","label":"⇅","localized":"","hint":"Swap values"},
@@ -36,11 +28,7 @@
"common keywords": [
{"id":"","label":"fp16","localized":"","hint":"Number representation in 16-bit floating point format"},
{"id":"","label":"fp32","localized":"","hint":"Number representation in 32-bit floating point format"},
{"id":"","label":"bf16","localized":"","hint":"Number representation in alternative 16-bit floating point format"},
{"id":"","label":"Run","localized":"","hint":""},
{"id":"","label":"all","localized":"","hint":""},
{"id":"","label":"none","localized":"","hint":""},
{"id":"","label":"disabled","localized":"","hint":""}
{"id":"","label":"bf16","localized":"","hint":"Number representation in alternative 16-bit floating point format"}
],
"tabs": [
{"id":"","label":"Text","localized":"","hint":"Create image from text"},
@@ -63,39 +51,21 @@
{"id":"","label":"Enqueue","localized":"","hint":"Add task to background queue in Agent Scheduler"},
{"id":"","label":"Stop","localized":"","hint":"Stop processing"},
{"id":"","label":"Skip","localized":"","hint":"Stop processing current job and continue processing"},
{"id":"","label":"Interrupt","localized":"","hint":"Interrupt current processing job"},
{"id":"","label":"Pause","localized":"","hint":"Pause processing"},
{"id":"","label":"Restore","localized":"","hint":"Restore parameters from current prompt or last known generated image"},
{"id":"","label":"Clear","localized":"","hint":"Clear prompts"},
{"id":"","label":"Networks","localized":"","hint":"Open extra network interface"},
{"id":"","label":"Interrogate\nCLIP","localized":"","hint":"Run interrogate using CLIP model"},
{"id":"","label":"Interrogate\nDeepBooru","localized":"","hint":"Run interrogate using DeepBooru model"}
{"id":"","label":"Networks","localized":"","hint":"Open extra network interface"}
],
"extra networks": [
{"id":"","label":"UI position","localized":"","hint":"Location of extra networks"},
{"id":"","label":"ui position","localized":"","hint":"Location of extra networks"},
{"id":"","label":"cover","localized":"","hint":"cover full area"},
{"id":"","label":"inline","localized":"","hint":"inline with all additional elements (scrollable)"},
{"id":"","label":"sidebar","localized":"","hint":"sidebar on the right side of the screen"},
{"id":"","label":"UI height (%)","localized":"","hint":""},
{"id":"","label":"UI sidebar width (%)","localized":"","hint":""},
{"id":"","label":"UI card preview lazy loading","localized":"","hint":""},
{"id":"","label":"UI card size (px)","localized":"","hint":""},
{"id":"","label":"UI disable variable aspect ratio","localized":"","hint":""},
{"id":"","label":"UI image contain method","localized":"","hint":""},
{"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":"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":"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":"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"}
],
@@ -108,7 +78,7 @@
{"id":"","label":"➠ image","localized":"","hint":"Transfer image to image interface"},
{"id":"","label":"➠ inpaint","localized":"","hint":"Transfer image to inpaint interface"},
{"id":"","label":"➠ sketch","localized":"","hint":"Transfer image to sketch interface"},
{"id":"","label":"➠ inpaint sketch","localized":"","hint":"Transfer image to inpaint sketch interface"},
{"id":"","label":"➠ composite","localized":"","hint":"Transfer image to inpaint sketch interface"},
{"id":"","label":"➠ process","localized":"","hint":"Transfer image to process interface"}
],
"extensions": [
@@ -126,26 +96,17 @@
{"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"},
{"id":"","label":"View changes","localized":"","hint":"Review changes between default user interface values and current values"},
{"id":"","label":"Set new defaults","localized":"","hint":"Set current values as default values for the user interface"},
{"id":"","label":"Benchmark","localized":"","hint":"Run benchmarks"},
{"id":"","label":"Models & Networks","localized":"","hint":"View lists of all available models and networks"},
{"id":"","label":"Restore defaults","localized":"","hint":"Restore default user interface values"}
],
"txt2img tab": [
{"id":"","label":"Batch","localized":"","hint":"Additional batching options"},
{"id":"","label":"Sampler","localized":"","hint":"Additional sampling options"},
{"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":"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"},
@@ -169,7 +130,6 @@
{"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":"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","localized":"","hint":"Second seed to be mixed with primary seed"},
{"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)"},
{"id":"","label":"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"},
@@ -200,66 +160,20 @@
{"id":"sett_reload_sd_model","label":"Reload checkpoint","localized":"","hint":"Reload currently selected model checkpoint"}
],
"settings sections": [
{"id":"","label":"execution & models","localized":"","hint":""},
{"id":"","label":"Optimizations","localized":"","hint":""},
{"id":"","label":"Compute Settings","localized":"","hint":""},
{"id":"","label":"Diffusers Settings","localized":"","hint":""},
{"id":"","label":"System Paths","localized":"","hint":""},
{"id":"","label":"Image Options","localized":"","hint":""},
{"id":"","label":"image naming & paths","localized":"","hint":""},
{"id":"","label":"User Interface","localized":"","hint":""},
{"id":"","label":"Live Previews","localized":"","hint":""},
{"id":"","label":"Sampler Settings","localized":"","hint":""},
{"id":"","label":"Postprocessing","localized":"","hint":""},
{"id":"","label":"Training","localized":"","hint":""},
{"id":"","label":"Interrogate","localized":"","hint":""},
{"id":"","label":"Extra Networks","localized":"","hint":""},
{"id":"","label":"Licenses","localized":"","hint":"View licenses of all additional included libraries"},
{"id":"","label":"Show all pages","localized":"","hint":"Show all settings pages"},
{"id":"","label":"Request browser notifications","localized":"","hint":""}
],
"img2img tabs": [
{"id":"","label":"Image","localized":"","hint":""},
{"id":"","label":"Sketch","localized":"","hint":""},
{"id":"","label":"Inpaint","localized":"","hint":""},
{"id":"","label":"Inpaint sketch","localized":"","hint":""},
{"id":"","label":"Inpaint upload","localized":"","hint":""}
{"id":"","label":"Show all pages","localized":"","hint":"Show all settings pages"}
],
"img2img tab": [
{"id":"","label":"Inpaint batch input directory","localized":"","hint":""},
{"id":"","label":"Inpaint batch output directory","localized":"","hint":""},
{"id":"","label":"Inpaint batch mask directory","localized":"","hint":""},
{"id":"","label":"Fixed","localized":"","hint":"Resize image to target resolution. Unless height and width match, you will get incorrect aspect ratio"},
{"id":"","label":"Crop","localized":"","hint":"Resize the image so that entirety of target resolution is filled with the image. Crop parts that stick out"},
{"id":"","label":"Fill","localized":"","hint":"Resize the image so that entirety of image is inside target resolution. Fill empty space with image's colors"},
{"id":"","label":"Latent","localized":"","hint":""},
{"id":"","label":"Mask blur","localized":"","hint":"How much to blur the mask before processing, in pixels"},
{"id":"","label":"Mask transparency","localized":"","hint":""},
{"id":"","label":"Inpaint masked","localized":"","hint":""},
{"id":"","label":"Inpaint not masked","localized":"","hint":""},
{"id":"","label":"fill","localized":"","hint":"fill"},
{"id":"","label":"original","localized":"","hint":"keep whatever was there originally"},
{"id":"","label":"latent noise","localized":"","hint":"fill it with latent space noise"},
{"id":"","label":"latent nothing","localized":"","hint":"fill it with latent space zeroes"},
{"id":"","label":"Whole picture","localized":"","hint":""},
{"id":"","label":"Only masked","localized":"","hint":""},
{"id":"","label":"Masked padding","localized":"","hint":""},
{"id":"","label":"Scale","localized":"","hint":""},
{"id":"","label":"Unused","localized":"","hint":""},
{"id":"","label":"Image CFG scale","localized":"","hint":""}
{"id":"","label":"latent nothing","localized":"","hint":"fill it with latent space zeroes"}
],
"models tabs": [
{"id":"","label":"Convert","localized":"","hint":""},
{"id":"","label":"Merge","localized":"","hint":""},
{"id":"","label":"Validate","localized":"","hint":""},
{"id":"","label":"List model details","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":""},
{"id":"","label":"specify model revision","localized":"","hint":""},
{"id":"","label":"huggingface token","localized":"","hint":""},
{"id":"","label":"huggingface mirror","localized":"","hint":""},
{"id":"","label":"Weights Clip","localized":"","hint":"Forced merged weights to be no heavier than the original model, preventing burn in and overly saturated models"},
{"id":"","label":"ReBasin","localized":"","hint":"Performs multiple merges with permutations in order to keep more features from both models"},
{"id":"","label":"Number of ReBasin Iterations","localized":"","hint":"Number of times to merge and permute the model before saving"},
@@ -272,130 +186,26 @@
{"id":"","label":"Out Block","localized":"","hint":"Upsampling Blocks of the UNet (12 values for SD1.5, 9 values for SDXL)"},
{"id":"","label":"Preset Interpolation Ratio","localized":"","hint":"If two presets are selected, interpolate between them"}
],
"train tabs": [
{"id":"","label":"Preprocess","localized":"","hint":""},
{"id":"","label":"Preprocess images","localized":"","hint":""},
{"id":"","label":"Train embedding","localized":"","hint":""},
{"id":"","label":"Train hypernetwork","localized":"","hint":""},
{"id":"","label":"Create embedding","localized":"","hint":""},
{"id":"","label":"Create hypernetwork","localized":"","hint":""}
],
"train tab": [
{"id":"","label":"Primary model","localized":"","hint":""},
{"id":"","label":"Secondary model","localized":"","hint":""},
{"id":"","label":"Tertiary model","localized":"","hint":""},
{"id":"","label":"New model name","localized":"","hint":""},
{"id":"","label":"No interpolation","localized":"","hint":"Requires one model. No interpolation will be used, allows for format conversion and VAE baking"},
{"id":"","label":"Weighted sum","localized":"","hint":"Requires two models. Weighted sum will be used for interpolation, result is calculated as A * (1 - M) + B * M"},
{"id":"","label":"Add difference","localized":"","hint":"Requires three models. Difference between the last two models will be added to the first, result is calculated as A + (B - C) * M"},
{"id":"","label":"Interpolation ratio from Primary to Secondary","localized":"","hint":""},
{"id":"","label":"ckpt","localized":"","hint":""},
{"id":"","label":"safetensors","localized":"","hint":""},
{"id":"","label":"Save metadata","localized":"","hint":""},
{"id":"","label":"Primary","localized":"","hint":""},
{"id":"","label":"Secondary","localized":"","hint":""},
{"id":"","label":"Tertiary","localized":"","hint":""},
{"id":"","label":"Bake in VAE","localized":"","hint":""},
{"id":"","label":"Discard weights with matching name","localized":"","hint":"Regular expression; if weight's name matches it, the weights are not written to the resulting checkpoint. Use ^model_ema to discard EMA weights"},
{"id":"","label":"Name","localized":"","hint":""},
{"id":"","label":"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":"","label":"Number of vectors per token","localized":"","hint":""},
{"id":"","label":"Overwrite Old Embedding","localized":"","hint":""},
{"id":"","label":"Enter hypernetwork layer structure","localized":"","hint":""},
{"id":"","label":"Select activation function of hypernetwork","localized":"","hint":"Recommended : Swish / Linear(none)"},
{"id":"","label":"Select Layer weights initialization","localized":"","hint":"Recommended: Kaiming for relu-like, Xavier for sigmoid-like, Normal otherwise"},
{"id":"","label":"Add layer normalization","localized":"","hint":""},
{"id":"","label":"Use dropout","localized":"","hint":""},
{"id":"","label":"Enter hypernetwork Dropout structure","localized":"","hint":"Recommended : leave empty or 0~0.35 incrementing sequence: 0, 0.05, 0.15"},
{"id":"","label":"Overwrite Old Hypernetwork","localized":"","hint":""},
{"id":"","label":"Source directory","localized":"","hint":""},
{"id":"","label":"Destination directory","localized":"","hint":""},
{"id":"","label":"Existing caption text action","localized":"","hint":""},
{"id":"","label":"Keep original size","localized":"","hint":""},
{"id":"","label":"Keep original image channels","localized":"","hint":""},
{"id":"","label":"Create flipped copies","localized":"","hint":""},
{"id":"","label":"Split oversized images","localized":"","hint":""},
{"id":"","label":"Auto focal point crop","localized":"","hint":""},
{"id":"","label":"Auto-sized crop","localized":"","hint":""},
{"id":"","label":"Create captions only","localized":"","hint":""},
{"id":"","label":"Create BLIP captions","localized":"","hint":""},
{"id":"","label":"Create Deepbooru captions","localized":"","hint":""},
{"id":"","label":"Split image threshold","localized":"","hint":""},
{"id":"","label":"Split image overlap ratio","localized":"","hint":""},
{"id":"","label":"Focal point face weight","localized":"","hint":""},
{"id":"","label":"Focal point entropy weight","localized":"","hint":""},
{"id":"","label":"Focal point edges weight","localized":"","hint":""},
{"id":"","label":"Create debug image","localized":"","hint":""},
{"id":"","label":"Dimension lower bound","localized":"","hint":""},
{"id":"","label":"Dimension upper bound","localized":"","hint":""},
{"id":"","label":"Area lower bound","localized":"","hint":""},
{"id":"","label":"Area upper bound","localized":"","hint":""},
{"id":"","label":"Maximize area","localized":"","hint":""},
{"id":"","label":"Minimize error","localized":"","hint":""},
{"id":"","label":"Error threshold","localized":"","hint":""},
{"id":"","label":"Hypernetwork","localized":"","hint":""},
{"id":"","label":"Embedding Learning rate","localized":"","hint":""},
{"id":"","label":"Hypernetwork Learning rate","localized":"","hint":""},
{"id":"","label":"Gradient Clipping","localized":"","hint":""},
{"id":"","label":"Gradient accumulation steps","localized":"","hint":""},
{"id":"","label":"Dataset directory","localized":"","hint":""},
{"id":"","label":"Log directory","localized":"","hint":""},
{"id":"","label":"Prompt template","localized":"","hint":""},
{"id":"","label":"Do not resize images","localized":"","hint":""},
{"id":"","label":"Max steps","localized":"","hint":""},
{"id":"","label":"Create interim images","localized":"","hint":"Save an image to log directory every N steps, 0 to disable"},
{"id":"","label":"Create interim embeddings","localized":"","hint":"Save a copy of embedding to log directory every N steps, 0 to disable"},
{"id":"","label":"Use PNG alpha channel as loss weight","localized":"","hint":""},
{"id":"","label":"Save images with embedding in PNG chunks","localized":"","hint":""},
{"id":"","label":"Use current settings for previews","localized":"","hint":"Read parameters (prompt, etc...) from txt2img tab when making previews"},
{"id":"","label":"Shuffle tags","localized":"","hint":"Shuffle tags by ',' when creating prompts"},
{"id":"","label":"Drop out tags when creating prompts","localized":"","hint":""},
{"id":"","label":"once","localized":"","hint":""},
{"id":"","label":"deterministic","localized":"","hint":""},
{"id":"","label":"select embedding","localized":"","hint":""},
{"id":"","label":"create embedding","localized":"","hint":""},
{"id":"","label":"gradient clip value","localized":"","hint":""},
{"id":"","label":"create interim hypernetworks","localized":"","hint":""},
{"id":"","label":"Original model","localized":"","hint":""}
{"id":"","label":"Shuffle tags","localized":"","hint":"Shuffle tags by ',' when creating prompts"}
],
"settings": [
{"id":"","label":"base model","localized":"","hint":"Main model used for all operations"},
{"id":"","label":"refiner model","localized":"","hint":"Refiner model used for second-pass operations"},
{"id":"","label":"model autoload on server start","localized":"","hint":""},
{"id":"","label":"use baseline data from a different model","localized":"","hint":""},
{"id":"","label":"Disallow usage of models in ckpt format","localized":"","hint":""},
{"id":"","label":"model compile fullgraph","localized":"","hint":""},
{"id":"","label":"create zip archive when downloading multiple images","localized":"","hint":""},
{"id":"","label":"samplers solver order where applicable","localized":"","hint":""},
{"id":"","label":"samplers use karras sigmas where applicable","localized":"","hint":""},
{"id":"","label":"samplers use simplified solvers in final steps where applicable","localized":"","hint":""},
{"id":"","label":"samplers use dynamic thresholding where applicable","localized":"","hint":""},
{"id":"","label":"Number of cached models","localized":"","hint":"The amount of models to store in RAM for quick access"},
{"id":"","label":"Number of cached VAEs","localized":"","hint":"The amount of VAE files to store in RAM for quick access"},
{"id":"","label":"Cached models","localized":"","hint":"The number of models to store in RAM for quick access"},
{"id":"","label":"Cached VAEs","localized":"","hint":"The number of VAE files to store in RAM for quick access"},
{"id":"","label":"VAE model","localized":"","hint":"VAE helps with fine details in the final image and may also alter colors"},
{"id":"","label":"Enable splitting of hires batch processing","localized":"","hint":"Reduces VRAM usage when using hires fix on batches of images"},
{"id":"","label":"Load models using stream loading method","localized":"","hint":"When loading models attempt stream loading optimized for slow or network storage"},
{"id":"","label":"When loading models attempt to reuse previous model dictionary","localized":"","hint":""},
{"id":"","label":"Disabled","localized":"","hint":""},
{"id":"","label":"xFormers","localized":"","hint":"Memory optimization. Non-Deterministic (different results each time)"},
{"id":"","label":"Scaled-Dot-Product","localized":"","hint":"Memory optimization. Non-Deterministic unless SDP memory attention is disabled."},
{"id":"","label":"Doggettx's","localized":"","hint":""},
{"id":"","label":"InvokeAI's","localized":"","hint":""},
{"id":"","label":"Sub-quadratic","localized":"","hint":""},
{"id":"","label":"Split attention","localized":"","hint":""},
{"id":"","label":"xFormers enable flash Attention","localized":"","hint":""},
{"id":"","label":"SDP disable memory attention","localized":"","hint":""},
{"id":"","label":"cross-attention query chunk size","localized":"","hint":""},
{"id":"","label":"cross-attention kv chunk size","localized":"","hint":""},
{"id":"","label":"cross-attention chunking threshold","localized":"","hint":""},
{"id":"","label":"Full parser","localized":"","hint":""},
{"id":"","label":"Compel parser","localized":"","hint":""},
{"id":"","label":"A1111 parser","localized":"","hint":""},
{"id":"","label":"Fixed attention","localized":"","hint":""},
{"id":"","label":"Prompt attention mean normalization","localized":"","hint":""},
{"id":"","label":"Disable conditional batching enabled on low memory systems","localized":"","hint":""},
{"id":"","label":"Enable samplers quantization for sharper and cleaner results","localized":"","hint":""},
{"id":"","label":"Prompt padding for long prompts","localized":"","hint":"Increase coherency by padding from the last comma within n tokens when using more than 75 tokens"},
{"id":"","label":"Prompt padding","localized":"","hint":"Increase coherency by padding from the last comma within n tokens when using more than 75 tokens"},
{"id":"","label":"Original","localized":"","hint":"Original LDM backend"},
{"id":"","label":"Diffusers","localized":"","hint":"Diffusers backend"},
{"id":"","label":"Autocast","localized":"","hint":"Automatically determine precision during runtime"},
@@ -403,275 +213,67 @@
{"id":"","label":"FP32","localized":"","hint":"Use 32-bit floating point precision for calculations"},
{"id":"","label":"FP16","localized":"","hint":"Use 16-bit floating point precision for calculations"},
{"id":"","label":"BF16","localized":"","hint":"Use modified 16-bit floating point precision for calculations"},
{"id":"","label":"Use full precision for model (--no-half)","localized":"","hint":"Uses FP32 for the model. May produce better results while using more VRAM and slower generation"},
{"id":"","label":"Use full precision for VAE (--no-half-vae)","localized":"","hint":"Uses FP32 for the VAE. May produce better results while using more VRAM and slower generation"},
{"id":"","label":"Enable upcast sampling","localized":"","hint":"Usually produces similar results to --no-half with better performance while using less memory"},
{"id":"","label":"Enable upcast cross attention layer","localized":"","hint":""},
{"id":"","label":"Disable NaN check in produced images/latent spaces","localized":"","hint":""},
{"id":"","label":"Attempt VAE roll back when produced NaN values","localized":"","hint":"Requires Torch 2.1 and NaN check enabled"},
{"id":"","label":"Use channels last as torch memory format","localized":"","hint":""},
{"id":"","label":"Enable full-depth cuDNN benchmark feature","localized":"","hint":""},
{"id":"","label":"Enable model compile","localized":"","hint":""},
{"id":"","label":"inductor","localized":"","hint":""},
{"id":"","label":"cudagraphs","localized":"","hint":""},
{"id":"","label":"aot_ts_nvfuser","localized":"","hint":""},
{"id":"","label":"hidet","localized":"","hint":""},
{"id":"","label":"ipex","localized":"","hint":""},
{"id":"","label":"Model compile verbose mode","localized":"","hint":""},
{"id":"","label":"Model compile suppress errors","localized":"","hint":""},
{"id":"","label":"Directory for temporary images; leave empty for default","localized":"","hint":""},
{"id":"","label":"Enable IPEX Optimize for Intel GPUs","localized":"","hint":""},
{"id":"","label":"Cleanup non-default temporary directory when starting webui","localized":"","hint":""},
{"id":"","label":"Folder with stable diffusion models","localized":"","hint":""},
{"id":"","label":"Folder with stable diffusion diffusers","localized":"","hint":""},
{"id":"","label":"Folder with VAE files","localized":"","hint":""},
{"id":"","label":"Folder with textual inversion embeddings","localized":"","hint":""},
{"id":"","label":"Folder with Hypernetwork models","localized":"","hint":""},
{"id":"","label":"Folder with codeformer Folder","localized":"","hint":""},
{"id":"","label":"Folder with GFPGAN models","localized":"","hint":""},
{"id":"","label":"Folder with ESRGAN models","localized":"","hint":""},
{"id":"","label":"Folder with BSRGAN models","localized":"","hint":""},
{"id":"","label":"Folder with RealESRGAN models","localized":"","hint":""},
{"id":"","label":"Folder with SCUNet models","localized":"","hint":""},
{"id":"","label":"Folder with SwinIR models","localized":"","hint":""},
{"id":"","label":"Folder with LDSR models","localized":"","hint":""},
{"id":"","label":"Folder with CLIP models","localized":"","hint":""},
{"id":"","label":"Folder with Lora networks","localized":"","hint":""},
{"id":"","label":"Folder with LyCORIS networks","localized":"","hint":""},
{"id":"","label":"Path to user-defined styles file","localized":"","hint":""},
{"id":"","label":"Always save all generated images","localized":"","hint":""},
{"id":"","label":"File format for generated images","localized":"","hint":"Select file format for images"},
{"id":"","label":"Include metadata in saved images","localized":"","hint":"Save image create parameters as metadata tags inside image file"},
{"id":"","label":"Full precision for model (--no-half)","localized":"","hint":"Uses FP32 for the model. May produce better results while using more VRAM and slower generation"},
{"id":"","label":"Full precision for VAE (--no-half-vae)","localized":"","hint":"Uses FP32 for the VAE. May produce better results while using more VRAM and slower generation"},
{"id":"","label":"Upcast sampling","localized":"","hint":"Usually produces similar results to --no-half with better performance while using less memory"},
{"id":"","label":"Attempt VAE roll back for NaN values","localized":"","hint":"Requires Torch 2.1 and NaN check enabled"},
{"id":"","label":"File format","localized":"","hint":"Select file format for images"},
{"id":"","label":"Include metadata","localized":"","hint":"Save image create parameters as metadata tags inside image file"},
{"id":"","label":"Images filename pattern","localized":"","hint":"Use following tags to define how filenames for images are chosen:<br><pre>seq, uuid<br>date, datetime, job_timestamp<br>generation_number, batch_number<br>model, model_shortname<br>model_hash, model_name<br>sampler, seed, steps, cfg<br>clip_skip, denoising<br>hasprompt, prompt, styles<br>prompt_hash, prompt_no_styles<br>prompt_spaces, prompt_words<br>height, width, image_hash<br></pre>"},
{"id":"","label":"Add number to filename when saving","localized":"","hint":""},
{"id":"","label":"Always save all generated image grids","localized":"","hint":""},
{"id":"","label":"File format for grids","localized":"","hint":""},
{"id":"","label":"Add extended info (seed, prompt) to filename when saving grid","localized":"","hint":""},
{"id":"","label":"Grid row count","localized":"","hint":"Use -1 for autodetect and 0 for it to be same as batch size"},
{"id":"","label":"Create info file for each every image","localized":"","hint":""},
{"id":"","label":"Create JSON log file for each saved image","localized":"","hint":"Save image information to a JSON file"},
{"id":"","label":"Save copy of image before doing face restoration","localized":"","hint":""},
{"id":"","label":"Save copy of image before applying hires","localized":"","hint":""},
{"id":"","label":"Save copy of image before applying color correction","localized":"","hint":""},
{"id":"","label":"Save copy of the inpainting greyscale mask","localized":"","hint":""},
{"id":"","label":"Save copy of inpainting masked composite","localized":"","hint":""},
{"id":"","label":"Save copy of img2img init images","localized":"","hint":""},
{"id":"","label":"Quality for saved jpeg images","localized":"","hint":""},
{"id":"","label":"Use lossless compression for webp images","localized":"","hint":""},
{"id":"","label":"Maximum allowed image size in megapixels","localized":"","hint":""},
{"id":"","label":"Use original name for output filename during batch process","localized":"","hint":""},
{"id":"","label":"Use upscaler name as filename suffix in the extras tab","localized":"","hint":""},
{"id":"","label":"When using 'Save' button, only save a single selected image","localized":"","hint":""},
{"id":"","label":"Save images to a subdirectory","localized":"","hint":""},
{"id":"","label":"Save grids to a subdirectory","localized":"","hint":""},
{"id":"","label":"Save images to a subdirectory when using Save button","localized":"","hint":""},
{"id":"","label":"Row count","localized":"","hint":"Use -1 for autodetect and 0 for it to be same as batch size"},
{"id":"","label":"Update JSON log file per image","localized":"","hint":"Save image information to a JSON file"},
{"id":"","label":"Directory name pattern","localized":"","hint":"Use following tags to define how subdirectories for images and grids 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<Format>], [datetime<Format><Time Zone>], [job_timestamp]; leave empty for default"},
{"id":"","label":"Max prompt words for [prompt_words] pattern","localized":"","hint":""},
{"id":"","label":"Apply color correction to match original colors","localized":"","hint":""},
{"id":"","label":"For image processing do exact number of steps as specified","localized":"","hint":""},
{"id":"","label":"Image transparent color fill","localized":"","hint":""},
{"id":"","label":"Inpainting conditioning mask strength","localized":"","hint":"Determines how strongly to mask off the original image for inpainting and img2img. 1.0 means fully masked (default). 0.0 means a fully unmasked conditioning. Lower values will help preserve the overall composition of the image, but will struggle with large changes"},
{"id":"","label":"Noise multiplier for image processing","localized":"","hint":""},
{"id":"","label":"Clip skip","localized":"","hint":"Early stopping parameter for CLIP model; 1 is stop at last layer as usual, 2 is stop at penultimate layer, etc"},
{"id":"","label":"Output directory for images","localized":"","hint":"If empty, defaults to three directories below"},
{"id":"","label":"Output directory for txt2img images","localized":"","hint":""},
{"id":"","label":"Output directory for img2img images","localized":"","hint":""},
{"id":"","label":"Output directory for images from extras tab","localized":"","hint":""},
{"id":"","label":"Output directory for grids","localized":"","hint":"If empty, defaults to two directories below"},
{"id":"","label":"Output directory for txt2img grids","localized":"","hint":""},
{"id":"","label":"Output directory for img2img grids","localized":"","hint":""},
{"id":"","label":"Directory for saving images using the Save button","localized":"","hint":""},
{"id":"","label":"Directory for saving init images when using img2img","localized":"","hint":""},
{"id":"","label":"UI theme","localized":"","hint":""},
{"id":"","label":"Auto","localized":"","hint":""},
{"id":"","label":"Dark","localized":"","hint":""},
{"id":"","label":"Light","localized":"","hint":""},
{"id":"","label":"Show grid in results","localized":"","hint":""},
{"id":"","label":"Inpainting include greyscale mask in results","localized":"","hint":""},
{"id":"","label":"Inpainting include masked composite in results","localized":"","hint":""},
{"id":"","label":"Do not change selected model when reading generation parameters","localized":"","hint":""},
{"id":"","label":"Send seed when sending prompt or image to other interface","localized":"","hint":""},
{"id":"","label":"Send size when sending prompt or image to another interface","localized":"","hint":""},
{"id":"","label":"Font for image grids that have text","localized":"","hint":""},
{"id":"","label":"Ctrl+up/down precision when editing (attention:1.1)","localized":"","hint":""},
{"id":"","label":"Ctrl+up/down precision when editing <extra networks:0.9>","localized":"","hint":""},
{"id":"","label":"Ctrl+up/down word delimiters","localized":"","hint":""},
{"id":"","label":"Images folder","localized":"","hint":"If empty, defaults to three directories below"},
{"id":"","label":"Grids folder","localized":"","hint":"If empty, defaults to two directories below"},
{"id":"","label":"Quicksettings list","localized":"","hint":"List of setting names, separated by commas, for settings that should go to the quick access bar at the top instead the setting tab"},
{"id":"","label":"UI scripts order","localized":"","hint":""},
{"id":"","label":"Show progressbar","localized":"","hint":""},
{"id":"","label":"Show live previews of the created image","localized":"","hint":""},
{"id":"","label":"Show previews of all images generated in a batch as a grid","localized":"","hint":""},
{"id":"","label":"Play a sound when images are finished generating","localized":"","hint":""},
{"id":"","label":"Path to notification sound","localized":"","hint":""},
{"id":"","label":"Live preview display period","localized":"","hint":"Request preview image every n steps, set to 0 to disable"},
{"id":"","label":"Full VAE","localized":"","hint":""},
{"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"},
{"id":"","label":"Euler a","localized":"","hint":"Euler Ancestral - very creative, each can get a completely different picture depending on step count, setting steps higher than 30-40 does not help"},
{"id":"","label":"Euler","localized":"","hint":""},
{"id":"","label":"LMS","localized":"","hint":""},
{"id":"","label":"Heun","localized":"","hint":""},
{"id":"","label":"DPM2","localized":"","hint":""},
{"id":"","label":"DPM2 a","localized":"","hint":""},
{"id":"","label":"DPM++ 2S a","localized":"","hint":""},
{"id":"","label":"DPM++ 2M","localized":"","hint":""},
{"id":"","label":"DPM++ SDE","localized":"","hint":""},
{"id":"","label":"DPM++ 2M SDE","localized":"","hint":""},
{"id":"","label":"DPM fast","localized":"","hint":""},
{"id":"","label":"DPM adaptive","localized":"","hint":"Ignores step count - uses a number of steps determined by the CFG and resolution"},
{"id":"","label":"LMS Karras","localized":"","hint":""},
{"id":"","label":"DPM2 Karras","localized":"","hint":""},
{"id":"","label":"DPM2 a Karras","localized":"","hint":""},
{"id":"","label":"DPM++ 2S a Karras","localized":"","hint":""},
{"id":"","label":"DPM++ 2M Karras","localized":"","hint":""},
{"id":"","label":"DPM++ SDE Karras","localized":"","hint":""},
{"id":"","label":"DPM++ 2M SDE Karras","localized":"","hint":""},
{"id":"","label":"DDIM","localized":"","hint":"Denoising Diffusion Implicit Models - best at inpainting"},
{"id":"","label":"UniPC","localized":"","hint":"Unified Predictor-Corrector Framework for Fast Sampling of Diffusion Models"},
{"id":"","label":"Noise multiplier for ancestral samplers (eta)","localized":"","hint":""},
{"id":"","label":"Noise multiplier for DDIM (eta)","localized":"","hint":""},
{"id":"","label":"uniform","localized":"","hint":""},
{"id":"","label":"quad","localized":"","hint":""},
{"id":"","label":"sigma churn","localized":"","hint":""},
{"id":"","label":"sigma negative guidance minimum","localized":"","hint":"Skip negative prompt for some steps when the image is almost ready, 0=disable"},
{"id":"","label":"sigma tmin","localized":"","hint":""},
{"id":"","label":"sigma noise","localized":"","hint":""},
{"id":"","label":"Noise seed delta (eta)","localized":"","hint":""},
{"id":"","label":"Always discard next-to-last sigma","localized":"","hint":""},
{"id":"","label":"bh1","localized":"","hint":""},
{"id":"","label":"bh2","localized":"","hint":""},
{"id":"","label":"vary_coeff","localized":"","hint":""},
{"id":"","label":"time_uniform","localized":"","hint":""},
{"id":"","label":"time_quadratic","localized":"","hint":""},
{"id":"","label":"logSNR","localized":"","hint":""},
{"id":"","label":"UniPC order (must be < sampling steps)","localized":"","hint":""},
{"id":"","label":"UniPC lower order final","localized":"","hint":""},
{"id":"","label":"Enable additional postprocessing operations","localized":"","hint":""},
{"id":"","label":"Postprocessing operation order","localized":"","hint":""},
{"id":"","label":"Maximum number of images in upscaling cache","localized":"","hint":""},
{"id":"","label":"Move VAE and CLIP to RAM when training if possible","localized":"","hint":""},
{"id":"","label":"Pin training dataset to memory","localized":"","hint":""},
{"id":"","label":"Save resumable optimizer state when training","localized":"","hint":""},
{"id":"","label":"Save training settings to a text file on training start","localized":"","hint":""},
{"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":"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"},
{"id":"","label":"Interrogate: keep models in VRAM","localized":"","hint":""},
{"id":"","label":"Interrogate: include ranks of model tags matches in results","localized":"","hint":""},
{"id":"","label":"Interrogate: num_beams for BLIP","localized":"","hint":""},
{"id":"","label":"Interrogate: minimum description length","localized":"","hint":"Interrogate: minimum description length (excluding artists, etc..)"},
{"id":"","label":"Interrogate: maximum description length","localized":"","hint":""},
{"id":"","label":"CLIP: maximum number of lines in text file","localized":"","hint":"CLIP: maximum number of lines in text file (0 = No limit)"},
{"id":"","label":"flavors","localized":"","hint":""},
{"id":"","label":"artists","localized":"","hint":""},
{"id":"","label":"mediums","localized":"","hint":""},
{"id":"","label":"movements","localized":"","hint":""},
{"id":"","label":"Interrogate: deepbooru score threshold","localized":"","hint":""},
{"id":"","label":"Interrogate: deepbooru sort alphabetically","localized":"","hint":""},
{"id":"","label":"Use spaces for tags in deepbooru","localized":"","hint":""},
{"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":"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"},
{"id":"","label":"CodeFormer weight parameter","localized":"","hint":"0 = maximum effect; 1 = minimum effect"},
{"id":"","label":"Move face restoration model from VRAM into RAM after processing","localized":"","hint":""},
{"id":"","label":"Token merging ratio (txt2img)","localized":"","hint":"Enable redundant token merging via tomesd for speed and memory improvements, 0=disabled"},
{"id":"","label":"Token merging ratio (img2img)","localized":"","hint":"Enable redundant token merging for img2img via tomesd for speed and memory improvements, 0=disabled"},
{"id":"","label":"Token merging ratio (hires)","localized":"","hint":"Enable redundant token merging for hires pass via tomesd for speed and memory improvements, 0=disabled"},
{"id":"","label":"Token merging ratio for txt2img","localized":"","hint":"Enable redundant token merging via tomesd for speed and memory improvements, 0=disabled"},
{"id":"","label":"Token merging ratio for img2img","localized":"","hint":"Enable redundant token merging for img2img via tomesd for speed and memory improvements, 0=disabled"},
{"id":"","label":"Token merging ratio for hires","localized":"","hint":"Enable redundant token merging for hires pass via tomesd for speed and memory improvements, 0=disabled"},
{"id":"","label":"Diffusers pipeline","localized":"","hint":"If autodetect does not detect model automatically, select model type before loading a model"},
{"id":"","label":"Move base model to CPU when using refiner","localized":"","hint":""},
{"id":"","label":"Move base model to CPU when using VAE","localized":"","hint":""},
{"id":"","label":"Move refiner model to CPU when not in use","localized":"","hint":""},
{"id":"","label":"Use model EMA weights when possible","localized":"","hint":""},
{"id":"","label":"Generator device","localized":"","hint":""},
{"id":"","label":"Enable sequential CPU offload (--lowvram)","localized":"","hint":"Reduces GPU memory usage by transferring weights to the CPU. Increases inference time approximately 10%"},
{"id":"","label":"Enable model CPU offload (--medvram)","localized":"","hint":"Transferring of entire models to the CPU, negligible impact on inference time while still providing some memory savings"},
{"id":"","label":"Enable VAE slicing","localized":"","hint":"Decodes batch latents one image at a time with limited VRAM. Small performance boost in VAE decode on multi-image batches"},
{"id":"","label":"Enable VAE tiling","localized":"","hint":"Divide large images into overlapping tiles with limited VRAM. Results in a minor increase in processing time"},
{"id":"","label":"Enable attention slicing","localized":"","hint":"Performs attention computation in steps instead of all at once. Slower inference times, but greatly reduced memory usage"},
{"id":"","label":"Diffusers force inpaint pipeline","localized":"","hint":"Force inpaint pipeline for all img2img tasks. Results in slightly different results that may be more precise"},
{"id":"","label":"Diffusers model loading variant","localized":"","hint":""},
{"id":"","label":"Diffusers VAE loading variant","localized":"","hint":""},
{"id":"","label":"Diffusers LoRA loading variant","localized":"","hint":"'sequential apply' loads and applies each LoRA in order of appearance, 'merge and apply' loads all LoRAs and merges them in-memory before applying to model, 'diffusers' uses diffusers default LoRA loading method"},
{"id":"","label":"Torch inference mode","localized":"","hint":"Use torch inference mode"},
{"id":"","label":"Sequential CPU offload (--lowvram)","localized":"","hint":"Reduces GPU memory usage by transferring weights to the CPU. Increases inference time approximately 10%"},
{"id":"","label":"Model CPU offload (--medvram)","localized":"","hint":"Transferring of entire models to the CPU, negligible impact on inference time while still providing some memory savings"},
{"id":"","label":"VAE slicing","localized":"","hint":"Decodes batch latents one image at a time with limited VRAM. Small performance boost in VAE decode on multi-image batches"},
{"id":"","label":"VAE tiling","localized":"","hint":"Divide large images into overlapping tiles with limited VRAM. Results in a minor increase in processing time"},
{"id":"","label":"Attention slicing","localized":"","hint":"Performs attention computation in steps instead of all at once. Slower inference times, but greatly reduced memory usage"},
{"id":"","label":"inference-mode","localized":"","hint":"Use torch.inference_mode"},
{"id":"","label":"no-grad","localized":"","hint":"Use torch.no_grad"},
{"id":"","label":"vae slicing (original)","localized":"","hint":"Run VAE on sliced samples to reduce memory requirements when processing high resolution images"},
{"id":"","label":"use fixed unet precision","localized":"","hint":""},
{"id":"","label":"enable model compile","localized":"","hint":"Enable usage of torch.compile"},
{"id":"","label":"reduce-overhead","localized":"","hint":""},
{"id":"","label":"max-autotune","localized":"","hint":""},
{"id":"","label":"model compile precompile","localized":"","hint":"Run model compile immediately on model load instead of first use"},
{"id":"","label":"sequential apply","localized":"","hint":"When loading multiple LoRAs, apply each in order of loading"},
{"id":"","label":"merge and apply","localized":"","hint":"When loading multiple LoRAs, load all and merge them before applying to model"},
{"id":"","label":"force zeros for prompts when empty","localized":"","hint":"Force full zero tensor when prompt is empty to remove any residual noise"},
{"id":"","label":"require aesthetics score","localized":"","hint":"Automatically guide model towards higher-pleasing results, applicable only to refiner model"},
{"id":"","label":"include watermark in saved images","localized":"","hint":"Add invisible watermark to image by altering some pixel values"},
{"id":"","label":"image watermark string","localized":"","hint":"Watermark string to add to image. Keep very short to avoid image corruption."},
{"id":"","label":"include watermark","localized":"","hint":"Add invisible watermark to image by altering some pixel values"},
{"id":"","label":"watermark string","localized":"","hint":"Watermark string to add to image. Keep very short to avoid image corruption."},
{"id":"","label":"show log view","localized":"","hint":"Show log view at the bottom of the main window"},
{"id":"","label":"Log view update period","localized":"","hint":"Log view update period, in miliseconds"}
],
"scripts": [
{"id":"","label":"Swap X/Y","localized":"","hint":""},
{"id":"","label":"Swap Y/Z","localized":"","hint":""},
{"id":"","label":"Swap X/Z","localized":"","hint":""},
{"id":"","label":"Resize to","localized":"","hint":""},
{"id":"","label":"Resize by","localized":"","hint":""},
{"id":"","label":"Use via API","localized":"","hint":""},
{"id":"","label":"Put variable parts at start of prompt","localized":"","hint":""},
{"id":"","label":"Use different seed for each picture","localized":"","hint":""},
{"id":"","label":"positive","localized":"","hint":""},
{"id":"","label":"negative","localized":"","hint":""},
{"id":"","label":"comma","localized":"","hint":""},
{"id":"","label":"space","localized":"","hint":""},
{"id":"","label":"Iterate seed every line","localized":"","hint":""},
{"id":"","label":"Use same random seed for all lines","localized":"","hint":""},
{"id":"","label":"List of prompt inputs","localized":"","hint":""},
{"id":"","label":"X type","localized":"","hint":""},
{"id":"","label":"X values","localized":"","hint":"Separate values for X axis using commas"},
{"id":"","label":"Y type","localized":"","hint":""},
{"id":"","label":"Y values","localized":"","hint":"Separate values for Y axis using commas"},
{"id":"","label":"Z type","localized":"","hint":""},
{"id":"","label":"Z values","localized":"","hint":""},
{"id":"","label":"Draw legend","localized":"","hint":""},
{"id":"","label":"Keep random for seeds","localized":"","hint":""},
{"id":"","label":"Do not create grid","localized":"","hint":""},
{"id":"","label":"Include Sub Images","localized":"","hint":""},
{"id":"","label":"Include Sub Grids","localized":"","hint":""},
{"id":"","label":"Override `Sampling method` to Euler","localized":"","hint":"(this method is built for it)"},
{"id":"","label":"Override `prompt` to the same value as `original prompt`","localized":"","hint":""},
{"id":"","label":"Original prompt","localized":"","hint":""},
{"id":"","label":"Original negative prompt","localized":"","hint":""},
{"id":"","label":"Override `Sampling Steps` to the same value as `Decode steps`?","localized":"","hint":""},
{"id":"","label":"Decode steps","localized":"","hint":""},
{"id":"","label":"Override `Denoising strength` to 1?","localized":"","hint":""},
{"id":"","label":"Decode CFG scale","localized":"","hint":""},
{"id":"","label":"Randomness","localized":"","hint":""},
{"id":"","label":"Sigma adjustment for finding noise for image","localized":"","hint":""},
{"id":"","label":"Loops","localized":"","hint":"How many times to process an image. Each output is used as the input of the next loop. If set to 1, behavior will be as if this script were not used"},
{"id":"","label":"Final denoising strength","localized":"","hint":"The denoising strength for the final loop of each image in the batch"},
{"id":"","label":"Denoising strength curve","localized":"","hint":"The denoising curve controls the rate of denoising strength change each loop. Aggressive: Most of the change will happen towards the start of the loops. Linear: Change will be constant through all loops. Lazy: Most of the change will happen towards the end of the loops"},
{"id":"","label":"Append interrogated prompt at each iteration","localized":"","hint":""},
{"id":"","label":"Pixels to expand","localized":"","hint":""},
{"id":"","label":"left","localized":"","hint":""},
{"id":"","label":"right","localized":"","hint":""},
{"id":"","label":"up","localized":"","hint":""},
{"id":"","label":"down","localized":"","hint":""},
{"id":"","label":"Fall-off exponent (lower=higher detail)","localized":"","hint":""},
{"id":"","label":"Color variation","localized":"","hint":""},
{"id":"","label":"Tile overlap","localized":"","hint":"For SD upscale, how much overlap in pixels should there be between tiles. Tiles overlap so that when they are merged back into one picture, there is no clearly visible seam"},
{"id":"","label":"Scale Factor","localized":"","hint":""},
{"id":"","label":"None","localized":"","hint":"Do not do anything special"},
{"id":"","label":"Grid margins","localized":"","hint":""}
{"id":"","label":"Tile overlap","localized":"","hint":"For SD upscale, how much overlap in pixels should there be between tiles. Tiles overlap so that when they are merged back into one picture, there is no clearly visible seam"}
]
}
+1 -1
View File
@@ -85,7 +85,7 @@ const appendContextMenuOption = initResponse[0];
const removeContextMenuOption = initResponse[1];
const addContextMenuEventListener = initResponse[2];
function initContextMenu() {
async function initContextMenu() {
const generateForever = (genbuttonid, interruptbuttonid) => {
if (window.generateOnRepeatInterval) {
log('generateForever: cancel');
+1 -1
View File
@@ -10,7 +10,7 @@ function controlInputMode(inputMode, ...args) {
return [inputMode, ...args];
}
function setupControlUI() {
async function setupControlUI() {
const tabs = ['input', 'output', 'preview'];
for (const tab of tabs) {
const btn = gradioApp().getElementById(`control-${tab}-button`);
+9 -5
View File
@@ -119,8 +119,12 @@ async function filterExtraNetworksForTab(searchTerm) {
if (searchTerm === '') {
elem.style.display = '';
} else {
let text = elem.dataset.search.toLowerCase();
text = text.toLowerCase().replace('models--', 'Diffusers').replace('\\', '/');
let text = '';
if (elem.dataset.filename) text += `${elem.dataset.filename} `;
if (elem.dataset.name) text += `${elem.dataset.name} `;
if (elem.dataset.title) text += `${elem.dataset.title} `;
if (elem.dataset.tags) text += `${elem.dataset.title} `;
text = text.toLowerCase().replace('models--', 'diffusers').replace('\\', '/');
if (text.indexOf(searchTerm) === -1) {
elem.style.display = 'none';
} else {
@@ -180,8 +184,8 @@ function sortExtraNetworks() {
if (num === 0) return 'sort: no cards';
cards.sort((a, b) => { // eslint-disable-line no-loop-func
switch (sortVal) {
case 0: return a.dataset.search ? a.dataset.search.localeCompare(b.dataset.search) : 0;
case 1: return b.dataset.search ? b.dataset.search.localeCompare(a.dataset.search) : 0;
case 0: return a.dataset.name ? a.dataset.name.localeCompare(b.dataset.name) : 0;
case 1: return b.dataset.name ? b.dataset.name.localeCompare(a.dataset.name) : 0;
case 2: return a.dataset.mtime && !isNaN(a.dataset.mtime) ? parseFloat(b.dataset.mtime) - parseFloat(a.dataset.mtime) : 0;
case 3: return b.dataset.mtime && !isNaN(b.dataset.mtime) ? parseFloat(a.dataset.mtime) - parseFloat(b.dataset.mtime) : 0;
case 4: return a.dataset.size && !isNaN(a.dataset.size) ? parseFloat(b.dataset.size) - parseFloat(a.dataset.size) : 0;
@@ -398,7 +402,7 @@ function setupExtraNetworksForTab(tabname) {
intersectionObserver.observe(en); // monitor visibility of
}
function setupExtraNetworks() {
async function setupExtraNetworks() {
setupExtraNetworksForTab('txt2img');
setupExtraNetworksForTab('img2img');
setupExtraNetworksForTab('control');
+1 -1
View File
@@ -18,7 +18,7 @@ let img2img_gallery;
let modal;
let generationParamsInitialized = false;
function initiGenerationParams() {
async function initiGenerationParams() {
if (generationParamsInitialized) return;
if (!modal) modal = gradioApp().getElementById('lightboxModal');
if (!modal) return;
+4 -5
View File
@@ -202,13 +202,12 @@ table.settings-value-table td { padding: 0.4em; border: 1px solid #ccc; max-widt
.extra-networks-page { display: flex }
.extra-network-cards { display: flex; flex-wrap: wrap; overflow-y: auto; overflow-x: hidden; align-content: flex-start; width: -moz-available; width: -webkit-fill-available; }
.extra-network-cards .card { height: fit-content; margin: 0 0 0.5em 0.5em; position: relative; scroll-snap-align: start; scroll-margin-top: 0; }
.extra-network-cards .card .overlay { position: absolute; bottom: 0; padding: 0.2em; z-index: 10; width: 100%; background: none; }
.extra-network-cards .card .overlay .name { font-size: var(--text-lg); font-weight: bold; text-shadow: 1px 1px black; color: white; overflow-wrap: break-word; }
.extra-network-cards .card .overlay { z-index: 10; width: 100%; background: none; }
.extra-network-cards .card .overlay .name { font-size: var(--text-lg); font-weight: bold; text-shadow: 1px 1px black; color: white; overflow-wrap: break-word; position: absolute; bottom: 0; padding: 0.2em; z-index: 10; }
.extra-network-cards .card .preview { box-shadow: var(--button-shadow); min-height: 30px; }
.extra-network-cards .card:hover .overlay { background: rgba(0, 0, 0, 0.40); }
.extra-network-cards .card:hover .overlay { background: rgba(0, 0, 0, 0.70); }
.extra-network-cards .card:hover .preview { box-shadow: none; filter: grayscale(100%); }
.extra-network-cards .card:hover .overlay { background: rgba(0, 0, 0, 0.40); }
.extra-network-cards .card .overlay .tags { display: none; overflow-wrap: break-word; }
.extra-network-cards .card .overlay .tags { display: none; overflow-wrap: anywhere; position: absolute; top: 100%; z-index: 20; background: var(--body-background-fill); }
.extra-network-cards .card .overlay .tag { padding: 2px; margin: 2px; background: rgba(70, 70, 70, 0.60); font-size: var(--text-md); cursor: pointer; display: inline-block; }
.extra-network-cards .card .actions>span { padding: 4px; font-size: 34px !important; }
.extra-network-cards .card .actions>span:hover { color: var(--highlight-color); }
+2 -2
View File
@@ -6,7 +6,7 @@ const localeData = {
el: null,
};
function tooltipCreate() {
async function tooltipCreate() {
localeData.el = document.createElement('div');
localeData.el.className = 'tooltip';
localeData.el.id = 'tooltip-container';
@@ -83,7 +83,7 @@ async function setHints() {
log('setHints', { type: localeData.type, elements: elements.length, localized, hints, data: localeData.data.length, time: t1 - t0 });
// sortUIElements();
removeSplash();
// validateHints(elements, localeData.data);
validateHints(elements, localeData.data);
}
onAfterUiUpdate(async () => {
+2 -2
View File
@@ -133,9 +133,9 @@ def draw_grid_annotations(im, width, height, hor_texts, ver_texts, margin=0, tit
def get_font(fontsize):
try:
return ImageFont.truetype(shared.opts.font or 'javascript/roboto.ttf', fontsize)
return ImageFont.truetype(shared.opts.font or 'javascript/notosans-nerdfont-regular.ttf', fontsize)
except Exception:
return ImageFont.truetype('javascript/roboto.ttf', fontsize)
return ImageFont.truetype('javascript/notosans-nerdfont-regular.ttf', fontsize)
def draw_texts(drawing: ImageDraw, draw_x, draw_y, lines, initial_fnt, initial_fontsize):
for line in lines:
+104 -104
View File
@@ -295,43 +295,43 @@ options_templates.update(options_section(('sd', "Execution & Models"), {
"sd_model_checkpoint": OptionInfo(default_checkpoint, "Base model", gr.Dropdown, lambda: {"choices": list_checkpoint_tiles()}, refresh=refresh_checkpoints),
"sd_model_refiner": OptionInfo('None', "Refiner model", gr.Dropdown, lambda: {"choices": ['None'] + list_checkpoint_tiles()}, refresh=refresh_checkpoints),
"sd_vae": OptionInfo("Automatic", "VAE model", gr.Dropdown, lambda: {"choices": shared_items.sd_vae_items()}, refresh=shared_items.refresh_vae_list),
"sd_checkpoint_autoload": OptionInfo(True, "Model autoload on server start"),
"sd_model_dict": OptionInfo('None', "Use baseline data from a different model", gr.Dropdown, lambda: {"choices": ['None'] + list_checkpoint_tiles()}, refresh=refresh_checkpoints),
"sd_checkpoint_autoload": OptionInfo(True, "Model autoload on start"),
"sd_model_dict": OptionInfo('None', "Use separate base dict", gr.Dropdown, lambda: {"choices": ['None'] + list_checkpoint_tiles()}, refresh=refresh_checkpoints),
"stream_load": OptionInfo(False, "Load models using stream loading method", gr.Checkbox, {"visible": backend == Backend.ORIGINAL }),
"model_reuse_dict": OptionInfo(False, "When loading models attempt to reuse previous model dictionary", gr.Checkbox, {"visible": False}),
"model_reuse_dict": OptionInfo(False, "Reuse loaded model dictionary", gr.Checkbox, {"visible": False}),
"prompt_attention": OptionInfo("Full parser", "Prompt attention parser", gr.Radio, {"choices": ["Full parser", "Compel parser", "A1111 parser", "Fixed attention"] }),
"prompt_mean_norm": OptionInfo(True, "Prompt attention mean normalization", gr.Checkbox, {"visible": backend == Backend.ORIGINAL }),
"comma_padding_backtrack": OptionInfo(20, "Prompt padding for long prompts", gr.Slider, {"minimum": 0, "maximum": 74, "step": 1, "visible": backend == Backend.ORIGINAL }),
"sd_checkpoint_cache": OptionInfo(0, "Number of cached models", gr.Slider, {"minimum": 0, "maximum": 10, "step": 1, "visible": backend == Backend.ORIGINAL }),
"sd_vae_checkpoint_cache": OptionInfo(0, "Number of cached VAEs", gr.Slider, {"minimum": 0, "maximum": 10, "step": 1, "visible": False}),
"sd_disable_ckpt": OptionInfo(False, "Disallow usage of models in ckpt format"),
"prompt_mean_norm": OptionInfo(True, "Prompt attention normalization", gr.Checkbox, {"visible": backend == Backend.ORIGINAL }),
"comma_padding_backtrack": OptionInfo(20, "Prompt padding", gr.Slider, {"minimum": 0, "maximum": 74, "step": 1, "visible": backend == Backend.ORIGINAL }),
"sd_checkpoint_cache": OptionInfo(0, "Cached models", gr.Slider, {"minimum": 0, "maximum": 10, "step": 1, "visible": backend == Backend.ORIGINAL }),
"sd_vae_checkpoint_cache": OptionInfo(0, "Cached VAEs", gr.Slider, {"minimum": 0, "maximum": 10, "step": 1, "visible": False}),
"sd_disable_ckpt": OptionInfo(False, "Disallow models in ckpt format"),
}))
options_templates.update(options_section(('cuda', "Compute Settings"), {
"math_sep": OptionInfo("<h2>Execution precision</h2>", "", gr.HTML),
"precision": OptionInfo("Autocast", "Precision type", gr.Radio, {"choices": ["Autocast", "Full"]}),
"cuda_dtype": OptionInfo("FP32" if sys.platform == "darwin" or cmd_opts.use_openvino else "BF16" if devices.backend == "ipex" else "FP16", "Device precision type", gr.Radio, {"choices": ["FP32", "FP16", "BF16"]}),
"no_half": OptionInfo(False if not cmd_opts.use_openvino else True, "Use full precision for model (--no-half)", None, None, None),
"no_half_vae": OptionInfo(False if not cmd_opts.use_openvino else True, "Use full precision for VAE (--no-half-vae)"),
"upcast_sampling": OptionInfo(False if sys.platform != "darwin" else True, "Enable upcast sampling"),
"upcast_attn": OptionInfo(False, "Enable upcast cross attention layer"),
"cuda_cast_unet": OptionInfo(False, "Use fixed UNet precision"),
"disable_nan_check": OptionInfo(True, "Disable NaN check in produced images/latent spaces", gr.Checkbox, {"visible": False}),
"rollback_vae": OptionInfo(False, "Attempt VAE roll back when produced NaN values"),
"no_half": OptionInfo(False if not cmd_opts.use_openvino else True, "Full precision for model (--no-half)", None, None, None),
"no_half_vae": OptionInfo(False if not cmd_opts.use_openvino else True, "Full precision for VAE (--no-half-vae)"),
"upcast_sampling": OptionInfo(False if sys.platform != "darwin" else True, "Upcast sampling"),
"upcast_attn": OptionInfo(False, "Upcast attention layer"),
"cuda_cast_unet": OptionInfo(False, "Fixed UNet precision"),
"disable_nan_check": OptionInfo(True, "Disable NaN check", gr.Checkbox, {"visible": False}),
"rollback_vae": OptionInfo(False, "Attempt VAE roll back for NaN values"),
"cross_attention_sep": OptionInfo("<h2>Cross-attention</h2>", "", gr.HTML),
"cross_attention_optimization": OptionInfo(cross_attention_optimization_default, "Cross-attention optimization method", gr.Radio, lambda: {"choices": shared_items.list_crossattention() }),
"cross_attention_options": OptionInfo([], "Cross-attention advanced options", gr.CheckboxGroup, {"choices": ['xFormers enable flash Attention', 'SDP disable memory attention']}),
"cross_attention_sep": OptionInfo("<h2>Attention</h2>", "", gr.HTML),
"cross_attention_optimization": OptionInfo(cross_attention_optimization_default, "Attention optimization method", gr.Radio, lambda: {"choices": shared_items.list_crossattention() }),
"cross_attention_options": OptionInfo([], "Attention advanced options", gr.CheckboxGroup, {"choices": ['xFormers enable flash Attention', 'SDP disable memory attention']}),
"sub_quad_sep": OptionInfo("<h3>Sub-quadratic options</h3>", "", gr.HTML),
"sub_quad_q_chunk_size": OptionInfo(512, "cross-attention query chunk size", gr.Slider, {"minimum": 16, "maximum": 8192, "step": 8}),
"sub_quad_kv_chunk_size": OptionInfo(512, "cross-attention kv chunk size", gr.Slider, {"minimum": 0, "maximum": 8192, "step": 8}),
"sub_quad_chunk_threshold": OptionInfo(80, "cross-attention chunking threshold", gr.Slider, {"minimum": 0, "maximum": 100, "step": 1}),
"sub_quad_q_chunk_size": OptionInfo(512, "Attention query chunk size", gr.Slider, {"minimum": 16, "maximum": 8192, "step": 8}),
"sub_quad_kv_chunk_size": OptionInfo(512, "Attention kv chunk size", gr.Slider, {"minimum": 0, "maximum": 8192, "step": 8}),
"sub_quad_chunk_threshold": OptionInfo(80, "Attention chunking threshold", gr.Slider, {"minimum": 0, "maximum": 100, "step": 1}),
"other_sep": OptionInfo("<h2>Execution precision</h2>", "", gr.HTML),
"opt_channelslast": OptionInfo(False, "Use channels last as torch memory format "),
"cudnn_benchmark": OptionInfo(False, "Enable full-depth cuDNN benchmark feature"),
"diffusers_fuse_projections": OptionInfo(False, "Enable fused projections"),
"torch_gc_threshold": OptionInfo(80, "Memory usage threshold before running Torch GC", gr.Slider, {"minimum": 0, "maximum": 100, "step": 1}),
"opt_channelslast": OptionInfo(False, "Use channels last "),
"cudnn_benchmark": OptionInfo(False, "Full-depth cuDNN benchmark feature"),
"diffusers_fuse_projections": OptionInfo(False, "Fused projections"),
"torch_gc_threshold": OptionInfo(80, "Memory usage threshold for GC", gr.Slider, {"minimum": 0, "maximum": 100, "step": 1}),
"cuda_compile_sep": OptionInfo("<h2>Model Compile</h2>", "", gr.HTML),
"cuda_compile": OptionInfo(False if not cmd_opts.use_openvino else True, "Compile UNet"),
@@ -344,53 +344,53 @@ options_templates.update(options_section(('cuda', "Compute Settings"), {
"cuda_compile_precompile": OptionInfo(False, "Model compile precompile"),
"cuda_compile_verbose": OptionInfo(False, "Model compile verbose mode"),
"cuda_compile_errors": OptionInfo(True, "Model compile suppress errors"),
"diffusers_quantization": OptionInfo(False, "Enable dynamic quantization with torchao"),
"diffusers_quantization": OptionInfo(False, "Dynamic quantization with TorchAO"),
"nncf_sep": OptionInfo("<h2>NNCF</h2>", "", gr.HTML),
"nncf_compress_weights": OptionInfo(False, "Compress Model weights with NNCF"),
"nncf_compress_vae_weights": OptionInfo(False, "Compress VAE weights with NNCF"),
"nncf_compress_text_encoder_weights": OptionInfo(False, "Compress Text Encoder weights with NNCF"),
"nncf_compress_text_encoder_weights": OptionInfo(False, "Compress TextEncoder weights with NNCF"),
"directml_sep": OptionInfo("<h2>DirectML</h2>", "", gr.HTML),
"directml_memory_provider": OptionInfo(default_memory_provider, 'DirectML memory stats provider', gr.Radio, {"choices": memory_providers}),
"directml_catch_nan": OptionInfo(False, "DirectML retry specific operation when NaN is produced if possible. (makes generation slower)"),
"directml_catch_nan": OptionInfo(False, "DirectML retry ops for NaN"),
"ipex_sep": OptionInfo("<h2>IPEX</h2>", "", gr.HTML),
"ipex_optimize": OptionInfo(False if not devices.backend == "ipex" else True, "Enable IPEX Optimize for Intel GPUs"),
"ipex_optimize_vae": OptionInfo(False if not devices.backend == "ipex" else True, "Enable IPEX Optimize for Intel GPUs with VAE"),
"ipex_optimize_text_encoder": OptionInfo(False if not devices.backend == "ipex" else True, "Enable IPEX Optimize for Intel GPUs with Text Encoder"),
"ipex_optimize_upscaler": OptionInfo(False if not devices.backend == "ipex" else True, "Enable IPEX Optimize for Intel GPUs with Upscalers"),
"ipex_optimize": OptionInfo(False if not devices.backend == "ipex" else True, "IPEX Optimize for Intel GPUs"),
"ipex_optimize_vae": OptionInfo(False if not devices.backend == "ipex" else True, "IPEX Optimize for Intel GPUs with VAE"),
"ipex_optimize_text_encoder": OptionInfo(False if not devices.backend == "ipex" else True, "IPEX Optimize for Intel GPUs with Text Encoder"),
"ipex_optimize_upscaler": OptionInfo(False if not devices.backend == "ipex" else True, "IPEX Optimize for Intel GPUs with Upscalers"),
"openvino_sep": OptionInfo("<h2>OpenVINO</h2>", "", gr.HTML),
"openvino_disable_model_caching": OptionInfo(False, "OpenVINO disable model caching"),
"openvino_hetero_gpu": OptionInfo(False, "OpenVINO use Hetero Device for single inference with multiple devices"),
"openvino_hetero_gpu": OptionInfo(False, "OpenVINO use Hetero Device"),
"openvino_remove_cpu_from_hetero": OptionInfo(False, "OpenVINO remove CPU from Hetero Device"),
"openvino_remove_igpu_from_hetero": OptionInfo(False, "OpenVINO remove iGPU from Hetero Device"),
"nncf_compress_weights_mode": OptionInfo("INT8", "OpenVINO compress mode for NNCF (CPU Only)", gr.Radio, {"choices": ['INT8', 'INT4_SYM', 'INT4_ASYM', 'NF4']}),
"nncf_compress_weights_raito": OptionInfo(1.0, "OpenVINO compress ratio for NNCF with 4-bit modes", gr.Slider, {"minimum": 0, "maximum": 1, "step": 0.01}),
"nncf_compress_weights_mode": OptionInfo("INT8", "OpenVINO compress mode for NNCF", gr.Radio, {"choices": ['INT8', 'INT4_SYM', 'INT4_ASYM', 'NF4']}),
"nncf_compress_weights_raito": OptionInfo(1.0, "OpenVINO compress ratio for NNCF", gr.Slider, {"minimum": 0, "maximum": 1, "step": 0.01}),
}))
options_templates.update(options_section(('advanced', "Inference Settings"), {
"token_merging_sep": OptionInfo("<h2>Token merging</h2>", "", 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 (hires)", gr.Slider, {"minimum": 0.0, "maximum": 0.9, "step": 0.1}),
"token_merging_ratio": OptionInfo(0.0, "Token merging ratio for txt2img", gr.Slider, {"minimum": 0.0, "maximum": 0.9, "step": 0.1}),
"token_merging_ratio_img2img": OptionInfo(0.0, "Token merging ratio for 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}),
"freeu_sep": OptionInfo("<h2>FreeU</h2>", "", gr.HTML),
"freeu_enabled": OptionInfo(False, "FreeU enabled"),
"freeu_enabled": OptionInfo(False, "FreeU"),
"freeu_b1": OptionInfo(1.2, "1st stage backbone factor", gr.Slider, {"minimum": 1.0, "maximum": 2.0, "step": 0.01}),
"freeu_b2": OptionInfo(1.4, "2nd stage backbone factor", gr.Slider, {"minimum": 1.0, "maximum": 2.0, "step": 0.01}),
"freeu_s1": OptionInfo(0.9, "1st stage skip factor", gr.Slider, {"minimum": 0.0, "maximum": 1.0, "step": 0.01}),
"freeu_s2": OptionInfo(0.2, "2nd stage skip factor", gr.Slider, {"minimum": 0.0, "maximum": 1.0, "step": 0.01}),
"hypertile_sep": OptionInfo("<h2>HyperTile</h2>", "", gr.HTML),
"hypertile_unet_enabled": OptionInfo(False, "HyperTile for UNet enabled"),
"hypertile_unet_tile": OptionInfo(256, "HyperTile for UNet tile size", gr.Slider, {"minimum": 0, "maximum": 1024, "step": 8}),
"hypertile_vae_enabled": OptionInfo(False, "HyperTile for VAE enabled", gr.Checkbox),
"hypertile_vae_tile": OptionInfo(128, "HyperTile for VAE tile size", gr.Slider, {"minimum": 0, "maximum": 1024, "step": 8}),
"hypertile_unet_enabled": OptionInfo(False, "HyperTile UNet"),
"hypertile_unet_tile": OptionInfo(256, "HyperTile UNet tile size", gr.Slider, {"minimum": 0, "maximum": 1024, "step": 8}),
"hypertile_vae_enabled": OptionInfo(False, "HyperTile VAE", gr.Checkbox),
"hypertile_vae_tile": OptionInfo(128, "HyperTile VAE tile size", gr.Slider, {"minimum": 0, "maximum": 1024, "step": 8}),
"inference_other_sep": OptionInfo("<h2>Other</h2>", "", gr.HTML),
"batch_frame_mode": OptionInfo(False, "Process multiple images in batch in parallel"),
"batch_frame_mode": OptionInfo(False, "Parallel process images in batch"),
"inference_mode": OptionInfo("no-grad", "Torch inference mode", gr.Radio, {"choices": ["no-grad", "inference-mode", "none"]}),
"sd_vae_sliced_encode": OptionInfo(False, "VAE sliced encode"),
}))
@@ -402,20 +402,20 @@ options_templates.update(options_section(('diffusers', "Diffusers Settings"), {
"diffusers_move_refiner": OptionInfo(True, "Move refiner model to CPU when not in use"),
"diffusers_extract_ema": OptionInfo(True, "Use model EMA weights when possible"),
"diffusers_generator_device": OptionInfo("GPU", "Generator device", gr.Radio, {"choices": ["GPU", "CPU", "Unset"]}),
"diffusers_model_cpu_offload": OptionInfo(False, "Enable model CPU offload (--medvram)"),
"diffusers_seq_cpu_offload": OptionInfo(False, "Enable sequential CPU offload (--lowvram)"),
"diffusers_model_cpu_offload": OptionInfo(False, "Model CPU offload (--medvram)"),
"diffusers_seq_cpu_offload": OptionInfo(False, "Sequential CPU offload (--lowvram)"),
"diffusers_vae_upcast": OptionInfo("default", "VAE upcasting", gr.Radio, {"choices": ['default', 'true', 'false']}),
"diffusers_vae_slicing": OptionInfo(True, "Enable VAE slicing"),
"diffusers_vae_tiling": OptionInfo(True if not cmd_opts.use_openvino else False, "Enable VAE tiling"),
"diffusers_attention_slicing": OptionInfo(False, "Enable attention slicing"),
"diffusers_model_load_variant": OptionInfo("default", "Diffusers model loading variant", gr.Radio, {"choices": ['default', 'fp32', 'fp16']}),
"diffusers_vae_load_variant": OptionInfo("default", "Diffusers VAE loading variant", gr.Radio, {"choices": ['default', 'fp32', 'fp16']}),
"diffusers_vae_slicing": OptionInfo(True, "VAE slicing"),
"diffusers_vae_tiling": OptionInfo(True if not cmd_opts.use_openvino else False, "VAE tiling"),
"diffusers_attention_slicing": OptionInfo(False, "Attention slicing"),
"diffusers_model_load_variant": OptionInfo("default", "Preferred Model variant", gr.Radio, {"choices": ['default', 'fp32', 'fp16']}),
"diffusers_vae_load_variant": OptionInfo("default", "Preferred VAE variant", gr.Radio, {"choices": ['default', 'fp32', 'fp16']}),
"custom_diffusers_pipeline": OptionInfo('', 'Load custom Diffusers pipeline'),
"diffusers_eval": OptionInfo(True, "Force model eval"),
"disable_accelerate": OptionInfo(False, "Disable use of accelerate library"),
"disable_accelerate": OptionInfo(False, "Disable accelerate"),
"diffusers_force_zeros": OptionInfo(True, "Force zeros for prompts when empty"),
"diffusers_aesthetics_score": OptionInfo(False, "Require aesthetics score"),
"diffusers_pooled": OptionInfo("default", "Diffusers SDXL pooled embeds (experimental)", gr.Radio, {"choices": ['default', 'weighted']}),
"diffusers_pooled": OptionInfo("default", "Diffusers SDXL pooled embeds", gr.Radio, {"choices": ['default', 'weighted']}),
}))
options_templates.update(options_section(('system-paths', "System Paths"), {
@@ -450,66 +450,66 @@ options_templates.update(options_section(('system-paths', "System Paths"), {
options_templates.update(options_section(('saving-images', "Image Options"), {
"keep_incomplete": OptionInfo(True, "Keep incomplete images"),
"samples_save": OptionInfo(True, "Always save all generated images"),
"samples_format": OptionInfo('jpg', 'File format for generated images', gr.Dropdown, {"choices": ["jpg", "png", "webp", "tiff", "jp2"]}),
"jpeg_quality": OptionInfo(90, "Quality for saved images", gr.Slider, {"minimum": 1, "maximum": 100, "step": 1}),
"samples_save": OptionInfo(True, "Save all generated images"),
"samples_format": OptionInfo('jpg', 'File format', gr.Dropdown, {"choices": ["jpg", "png", "webp", "tiff", "jp2"]}),
"jpeg_quality": OptionInfo(90, "Image quality", gr.Slider, {"minimum": 1, "maximum": 100, "step": 1}),
"img_max_size_mp": OptionInfo(250, "Maximum image size (MP)", gr.Slider, {"minimum": 100, "maximum": 2000, "step": 1}),
"webp_lossless": OptionInfo(False, "Use lossless compression for webp images"),
"save_selected_only": OptionInfo(True, "When using 'Save' button, only save a single selected image"),
"samples_save_zip": OptionInfo(True, "Create zip archive when downloading multiple images"),
"webp_lossless": OptionInfo(False, "WebP lossless compression"),
"save_selected_only": OptionInfo(True, "Save only saves selected image"),
"samples_save_zip": OptionInfo(True, "Create ZIP archive"),
"image_sep_metadata": OptionInfo("<h2>Metadata/Logging</h2>", "", gr.HTML),
"image_metadata": OptionInfo(True, "Include metadata in saved images"),
"save_txt": OptionInfo(False, "Create info file for each every image"),
"save_log_fn": OptionInfo("", "Create JSON log file for each saved image", component_args=hide_dirs),
"image_watermark_enabled": OptionInfo(False, "Include watermark in saved images"),
"image_watermark": OptionInfo('', "Image watermark string"),
"image_metadata": OptionInfo(True, "Include metadata"),
"save_txt": OptionInfo(False, "Create info file per image"),
"save_log_fn": OptionInfo("", "Update JSON log file per image", component_args=hide_dirs),
"image_watermark_enabled": OptionInfo(False, "Include watermark"),
"image_watermark": OptionInfo('', "Watermark string"),
"image_sep_grid": OptionInfo("<h2>Grid Options</h2>", "", gr.HTML),
"grid_save": OptionInfo(True, "Always save all generated image grids"),
"grid_format": OptionInfo('jpg', 'File format for grids', gr.Dropdown, {"choices": ["jpg", "png", "webp", "tiff", "jp2"]}),
"n_rows": OptionInfo(-1, "Grid row count", gr.Slider, {"minimum": -1, "maximum": 16, "step": 1}),
"grid_background": OptionInfo("#000000", "Grid background color", ui_components.FormColorPicker, {}),
"grid_save": OptionInfo(True, "Save all generated image grids"),
"grid_format": OptionInfo('jpg', 'File format', gr.Dropdown, {"choices": ["jpg", "png", "webp", "tiff", "jp2"]}),
"n_rows": OptionInfo(-1, "Row count", gr.Slider, {"minimum": -1, "maximum": 16, "step": 1}),
"grid_background": OptionInfo("#000000", "Background color", ui_components.FormColorPicker, {}),
"font": OptionInfo("", "Font file"),
"font_color": OptionInfo("#FFFFFF", "Font color", ui_components.FormColorPicker, {}),
"save_sep_options": OptionInfo("<h2>Intermediate Image Saving</h2>", "", gr.HTML),
"save_init_img": OptionInfo(False, "Save copy of img2img init images"),
"save_images_before_highres_fix": OptionInfo(False, "Save copy of image before applying hires"),
"save_images_before_refiner": OptionInfo(False, "Save copy of image before running refiner"),
"save_images_before_face_restoration": OptionInfo(False, "Save copy of image before doing face restoration"),
"save_images_before_color_correction": OptionInfo(False, "Save copy of image before applying color correction"),
"save_mask": OptionInfo(False, "Save copy of the inpainting greyscale mask"),
"save_mask_composite": OptionInfo(False, "Save copy of inpainting masked composite"),
"save_init_img": OptionInfo(False, "Save img2img init images"),
"save_images_before_highres_fix": OptionInfo(False, "Save image before applying hires"),
"save_images_before_refiner": OptionInfo(False, "Save image before running refiner"),
"save_images_before_face_restoration": OptionInfo(False, "Save image before doing face restoration"),
"save_images_before_color_correction": OptionInfo(False, "Save image before applying color correction"),
"save_mask": OptionInfo(False, "Save the inpainting greyscale mask"),
"save_mask_composite": OptionInfo(False, "Save inpainting masked composite"),
}))
options_templates.update(options_section(('saving-paths', "Image Naming & Paths"), {
"saving_sep_images": OptionInfo("<h2>Save options</h2>", "", gr.HTML),
"save_images_add_number": OptionInfo(True, "Add number to filename when saving", component_args=hide_dirs),
"use_original_name_batch": OptionInfo(True, "Use original name during batch process"),
"save_images_add_number": OptionInfo(True, "Numbered filenames", component_args=hide_dirs),
"use_original_name_batch": OptionInfo(True, "Batch uses original name"),
"use_upscaler_name_as_suffix": OptionInfo(True, "Use upscaler as suffix", gr.Checkbox, {"visible": False}),
"samples_filename_pattern": OptionInfo("[seq]-[model_name]-[prompt_words]", "Images filename pattern", component_args=hide_dirs),
"directories_max_prompt_words": OptionInfo(8, "Max words for [prompt_words] pattern", gr.Slider, {"minimum": 1, "maximum": 99, "step": 1, **hide_dirs}),
"use_save_to_dirs_for_ui": OptionInfo(False, "Save images to a subdirectory when using Save button", gr.Checkbox, {"visible": False}),
"save_to_dirs": OptionInfo(False, "Save images to a subdirectory"),
"directories_filename_pattern": OptionInfo("[date]", "Directory name pattern", component_args=hide_dirs),
"samples_filename_pattern": OptionInfo("[seq]-[model_name]-[prompt_words]", "Images filename pattern", component_args=hide_dirs),
"directories_max_prompt_words": OptionInfo(8, "Max words per pattern", gr.Slider, {"minimum": 1, "maximum": 99, "step": 1, **hide_dirs}),
"use_save_to_dirs_for_ui": OptionInfo(False, "Save images to a subdirectory when using Save button", gr.Checkbox, {"visible": False}),
"outdir_sep_dirs": OptionInfo("<h2>Directories</h2>", "", gr.HTML),
"outdir_samples": OptionInfo("", "Output directory for images", component_args=hide_dirs, folder=True),
"outdir_txt2img_samples": OptionInfo("outputs/text", 'Directory for text generate', component_args=hide_dirs, folder=True),
"outdir_img2img_samples": OptionInfo("outputs/image", 'Directory for image generate', component_args=hide_dirs, folder=True),
"outdir_control_samples": OptionInfo("outputs/control", 'Directory for control generate', component_args=hide_dirs, folder=True),
"outdir_extras_samples": OptionInfo("outputs/extras", 'Directory for processed images', component_args=hide_dirs, folder=True),
"outdir_save": OptionInfo("outputs/save", "Directory for manually saved images", component_args=hide_dirs, folder=True),
"outdir_video": OptionInfo("outputs/video", "Directory for videos", component_args=hide_dirs, folder=True),
"outdir_init_images": OptionInfo("outputs/init-images", "Directory for init images", component_args=hide_dirs, folder=True),
"outdir_sep_dirs": OptionInfo("<h2>Folders</h2>", "", gr.HTML),
"outdir_samples": OptionInfo("", "Images folder", component_args=hide_dirs, folder=True),
"outdir_txt2img_samples": OptionInfo("outputs/text", 'Folder for text generate', component_args=hide_dirs, folder=True),
"outdir_img2img_samples": OptionInfo("outputs/image", 'Folder for image generate', component_args=hide_dirs, folder=True),
"outdir_control_samples": OptionInfo("outputs/control", 'Folder for control generate', component_args=hide_dirs, folder=True),
"outdir_extras_samples": OptionInfo("outputs/extras", 'Folder for processed images', component_args=hide_dirs, folder=True),
"outdir_save": OptionInfo("outputs/save", "Folder for manually saved images", component_args=hide_dirs, folder=True),
"outdir_video": OptionInfo("outputs/video", "Folder for videos", component_args=hide_dirs, folder=True),
"outdir_init_images": OptionInfo("outputs/init-images", "Folder for init images", component_args=hide_dirs, folder=True),
"outdir_sep_grids": OptionInfo("<h2>Grids</h2>", "", gr.HTML),
"grid_extended_filename": OptionInfo(True, "Add extended info (seed, prompt) to filename when saving grid", gr.Checkbox, {"visible": False}),
"grid_extended_filename": OptionInfo(True, "Add extended info to filename when saving grid", gr.Checkbox, {"visible": False}),
"grid_save_to_dirs": OptionInfo(False, "Save grids to a subdirectory", gr.Checkbox, {"visible": False}),
"outdir_grids": OptionInfo("", "Output directory for grids", component_args=hide_dirs, folder=True),
"outdir_txt2img_grids": OptionInfo("outputs/grids", 'Output directory for txt2img grids', component_args=hide_dirs, folder=True),
"outdir_img2img_grids": OptionInfo("outputs/grids", 'Output directory for img2img grids', component_args=hide_dirs, folder=True),
"outdir_control_grids": OptionInfo("outputs/grids", 'Output directory for control grids', component_args=hide_dirs, folder=True),
"outdir_grids": OptionInfo("", "Grids folder", component_args=hide_dirs, folder=True),
"outdir_txt2img_grids": OptionInfo("outputs/grids", 'Folder for txt2img grids', component_args=hide_dirs, folder=True),
"outdir_img2img_grids": OptionInfo("outputs/grids", 'Folder for img2img grids', component_args=hide_dirs, folder=True),
"outdir_control_grids": OptionInfo("outputs/grids", 'Folder for control grids', component_args=hide_dirs, folder=True),
}))
options_templates.update(options_section(('ui', "User Interface"), {
@@ -535,9 +535,9 @@ options_templates.update(options_section(('ui', "User Interface"), {
options_templates.update(options_section(('live-preview', "Live Previews"), {
"show_progressbar": OptionInfo(True, "Show progressbar", gr.Checkbox, {"visible": False}),
"live_previews_enable": OptionInfo(True, "Show live previews of the created image", gr.Checkbox, {"visible": False}),
"show_progress_grid": OptionInfo(True, "Show previews of all images generated in a batch as a grid", gr.Checkbox, {"visible": False}),
"notification_audio_enable": OptionInfo(False, "Play a sound when images are finished generating"),
"live_previews_enable": OptionInfo(True, "Show live previews", gr.Checkbox, {"visible": False}),
"show_progress_grid": OptionInfo(True, "Show previews as a grid", gr.Checkbox, {"visible": False}),
"notification_audio_enable": OptionInfo(False, "Play a notification upon completion"),
"notification_audio_path": OptionInfo("html/notification.mp3","Path to notification sound", component_args=hide_dirs, folder=True),
"show_progress_every_n_steps": OptionInfo(1, "Live preview display period", gr.Slider, {"minimum": 0, "maximum": 32, "step": 1}),
"show_progress_type": OptionInfo("Approximate", "Live preview method", gr.Radio, {"choices": ["Simple", "Approximate", "TAESD", "Full VAE"]}),
@@ -573,8 +573,8 @@ options_templates.update(options_section(('sampler-params', "Sampler Settings"),
# managed from ui.py for backend original k-diffusion
"schedulers_sep_kdiffusers": OptionInfo("<h2>K-Diffusion specific config</h2>", "", gr.HTML),
"always_batch_cond_uncond": OptionInfo(False, "Disable conditional batching enabled on low memory systems"),
"enable_quantization": OptionInfo(True, "Enable quantization for sharper and cleaner results"),
"always_batch_cond_uncond": OptionInfo(False, "Disable conditional batching"),
"enable_quantization": OptionInfo(True, "Use quantization"),
's_churn': OptionInfo(0.0, "Sigma churn", gr.Slider, {"minimum": 0.0, "maximum": 1.0, "step": 0.01}),
's_min_uncond': OptionInfo(0.0, "Sigma negative guidance minimum ", gr.Slider, {"minimum": 0.0, "maximum": 4.0, "step": 0.01}),
's_tmin': OptionInfo(0.0, "Sigma tmin", gr.Slider, {"minimum": 0.0, "maximum": 1.0, "step": 0.01}),
@@ -592,7 +592,7 @@ options_templates.update(options_section(('sampler-params', "Sampler Settings"),
}))
options_templates.update(options_section(('postprocessing', "Postprocessing"), {
'postprocessing_enable_in_main_ui': OptionInfo([], "Enable additional postprocessing operations", ui_components.DropdownMulti, lambda: {"choices": [x.name for x in shared_items.postprocessing_scripts()]}),
'postprocessing_enable_in_main_ui': OptionInfo([], "Additional postprocessing operations", ui_components.DropdownMulti, lambda: {"choices": [x.name for x in shared_items.postprocessing_scripts()]}),
'postprocessing_operation_order': OptionInfo([], "Postprocessing operation order", ui_components.DropdownMulti, lambda: {"choices": [x.name for x in shared_items.postprocessing_scripts()]}),
"postprocessing_sep_img2img": OptionInfo("<h2>Img2Img & Inpainting</h2>", "", gr.HTML),
@@ -607,7 +607,7 @@ options_templates.update(options_section(('postprocessing', "Postprocessing"), {
"postprocessing_sep_face_restoration": OptionInfo("<h2>Face Restoration</h2>", "", gr.HTML),
"face_restoration_model": OptionInfo("CodeFormer", "Face restoration model", gr.Radio, lambda: {"choices": [x.name() for x in face_restorers]}),
"code_former_weight": OptionInfo(0.2, "CodeFormer weight parameter", gr.Slider, {"minimum": 0, "maximum": 1, "step": 0.01}),
"face_restoration_unload": OptionInfo(False, "Move face restoration model from VRAM into RAM after processing"),
"face_restoration_unload": OptionInfo(False, "Move face restoration model to CPU when complete"),
"postprocessing_sep_upscalers": OptionInfo("<h2>Upscaling</h2>", "", gr.HTML),
"upscaler_unload": OptionInfo(False, "Unload upscaler after processing"),
@@ -617,10 +617,10 @@ options_templates.update(options_section(('postprocessing', "Postprocessing"), {
}))
options_templates.update(options_section(('training', "Training"), {
"unload_models_when_training": OptionInfo(False, "Move VAE and CLIP to RAM when training if possible"),
"unload_models_when_training": OptionInfo(False, "Move VAE and CLIP to RAM when training"),
"pin_memory": OptionInfo(True, "Pin training dataset to memory"),
"save_optimizer_state": OptionInfo(False, "Save resumable optimizer state when training"),
"save_training_settings_to_txt": OptionInfo(True, "Save training settings to a text file on training start"),
"save_training_settings_to_txt": OptionInfo(True, "Save training settings to a text file"),
"dataset_filename_word_regex": OptionInfo("", "Filename word regex"),
"dataset_filename_join_string": OptionInfo(" ", "Filename join string"),
"embeddings_templates_dir": OptionInfo(os.path.join(paths.script_path, 'train', 'templates'), "Embeddings train templates directory", folder=True),
@@ -665,7 +665,7 @@ options_templates.update(options_section(('extra_networks', "Extra Networks"), {
"lora_add_hashes_to_infotext": OptionInfo(True, "LoRA add hash info"),
"lora_force_diffusers": OptionInfo(False if not cmd_opts.use_openvino else True, "LoRA use alternative loading method"),
"lora_fuse_diffusers": OptionInfo(False if not cmd_opts.use_openvino else True, "LoRA use merge when using alternative method"),
"lora_in_memory_limit": OptionInfo(0, "LoRA memory cache", gr.Slider, {"minimum": 0, "maximum": 24, "step": 1}),
"lora_in_memory_limit": OptionInfo(1, "LoRA memory cache", gr.Slider, {"minimum": 0, "maximum": 24, "step": 1}),
"lora_functional": OptionInfo(False, "Use Kohya method for handling multiple LoRA", gr.Checkbox, { "visible": False }),
"sd_hypernetwork": OptionInfo("None", "Add hypernetwork to prompt", gr.Dropdown, { "choices": ["None"], "visible": False }),
}))
+14 -14
View File
@@ -1,8 +1,8 @@
import base64
import json
import numpy as np
import zlib
from PIL import Image, PngImagePlugin, ImageDraw, ImageFont
import numpy as np
from PIL import Image, ImageDraw, ImageFont
import torch
from modules.shared import opts
@@ -133,7 +133,7 @@ def caption_image_overlay(srcimage, title, footerLeft, footerMid, footerRight, t
image = srcimage.copy()
fontsize = 32
if textfont is None:
textfont = opts.font or 'javascript/roboto.ttf'
textfont = opts.font or 'javascript/notosans-nerdfont-regular.ttf'
factor = 1.5
gradient = Image.new('RGBA', (1, image.size[1]), color=(0, 0, 0, 0))
@@ -148,17 +148,17 @@ def caption_image_overlay(srcimage, title, footerLeft, footerMid, footerRight, t
font = ImageFont.truetype(textfont, fontsize)
padding = 10
_, _, w, h = draw.textbbox((0, 0), title, font=font)
_, _, w, _h = draw.textbbox((0, 0), title, font=font)
fontsize = min(int(fontsize * (((image.size[0]*0.75)-(padding*4))/w)), 72)
font = ImageFont.truetype(textfont, fontsize)
_, _, w, h = draw.textbbox((0, 0), title, font=font)
_, _, w, _h = draw.textbbox((0, 0), title, font=font)
draw.text((padding, padding), title, anchor='lt', font=font, fill=(255, 255, 255, 230))
_, _, w, h = draw.textbbox((0, 0), footerLeft, font=font)
_, _, w, _h = draw.textbbox((0, 0), footerLeft, font=font)
fontsize_left = min(int(fontsize * (((image.size[0]/3)-(padding))/w)), 72)
_, _, w, h = draw.textbbox((0, 0), footerMid, font=font)
_, _, w, _h = draw.textbbox((0, 0), footerMid, font=font)
fontsize_mid = min(int(fontsize * (((image.size[0]/3)-(padding))/w)), 72)
_, _, w, h = draw.textbbox((0, 0), footerRight, font=font)
_, _, w, _h = draw.textbbox((0, 0), footerRight, font=font)
fontsize_right = min(int(fontsize * (((image.size[0]/3)-(padding))/w)), 72)
font = ImageFont.truetype(textfont, min(fontsize_left, fontsize_mid, fontsize_right))
@@ -173,14 +173,14 @@ def caption_image_overlay(srcimage, title, footerLeft, footerMid, footerRight, t
if __name__ == '__main__':
testEmbed = Image.open('test_embedding.png')
data = extract_image_data_embed(testEmbed)
assert data is not None
test_data = extract_image_data_embed(testEmbed)
assert test_data is not None
data = embedding_from_b64(testEmbed.text['sd-ti-embedding'])
assert data is not None
test_data = embedding_from_b64(testEmbed.text['sd-ti-embedding'])
assert test_data is not None
image = Image.new('RGBA', (512, 512), (255, 255, 200, 255))
cap_image = caption_image_overlay(image, 'title', 'footerLeft', 'footerMid', 'footerRight')
new_image = Image.new('RGBA', (512, 512), (255, 255, 200, 255))
cap_image = caption_image_overlay(new_image, 'title', 'footerLeft', 'footerMid', 'footerRight')
test_embed = {'string_to_param': {'*': torch.from_numpy(np.random.random((2, 4096)))}}
-3
View File
@@ -148,9 +148,6 @@ class ExtraNetworksPage:
preview = f"./sd_extra_networks/thumb?filename={quoted_filename}&mtime={mtime}"
return preview
def search_terms_from_path(self, filename):
return filename.replace('\\', '/')
def is_empty(self, folder):
for f in shared.listdir(folder):
_fn, ext = os.path.splitext(f)
-2
View File
@@ -30,7 +30,6 @@ class ExtraNetworksPageCheckpoints(ui_extra_networks.ExtraNetworksPage):
"name": name,
"title": name,
"filename": url,
"search_term": self.search_terms_from_path(name),
"preview": self.find_preview(os.path.join(reference_dir, preview)),
"local_preview": self.find_preview_file(os.path.join(reference_dir, preview)),
"onclick": '"' + html.escape(f"""return selectReference({json.dumps(url)})""") + '"',
@@ -53,7 +52,6 @@ class ExtraNetworksPageCheckpoints(ui_extra_networks.ExtraNetworksPage):
"title": checkpoint.title,
"filename": checkpoint.filename,
"hash": checkpoint.shorthash,
"search_term": self.search_terms_from_path(checkpoint.title),
"preview": self.find_preview(checkpoint.filename),
"local_preview": f"{os.path.splitext(checkpoint.filename)[0]}.{shared.opts.samples_format}",
"metadata": checkpoint.metadata,
-1
View File
@@ -21,7 +21,6 @@ class ExtraNetworksPageHypernetworks(ui_extra_networks.ExtraNetworksPage):
"preview": self.find_preview(path),
"description": self.find_description(path),
"info": self.find_info(path),
"search_term": self.search_terms_from_path(name),
"prompt": json.dumps(f"<hypernet:{os.path.basename(name)}:{shared.opts.extra_networks_default_multiplier}>"),
"local_preview": f"{os.path.splitext(path)[0]}.{shared.opts.samples_format}",
"mtime": os.path.getmtime(path),
-2
View File
@@ -53,7 +53,6 @@ class ExtraNetworksPageStyles(ui_extra_networks.ExtraNetworksPage):
"name": name,
"title": name,
"filename": fn,
"search_term": f'{self.search_terms_from_path(fn)} {params.get("Prompt", "")}',
"preview": self.find_preview(name),
"description": '',
"prompt": params.get('Prompt', ''),
@@ -79,7 +78,6 @@ class ExtraNetworksPageStyles(ui_extra_networks.ExtraNetworksPage):
"name": name,
"title": k,
"filename": style.filename,
"search_term": f'{self.search_terms_from_path(name)} {txt}',
"preview": style.preview if getattr(style, 'preview', None) is not None and style.preview.startswith('data:') else self.find_preview(fn),
"description": style.description if getattr(style, 'description', None) is not None and len(style.description) > 0 else txt,
"prompt": getattr(style, 'prompt', ''),
@@ -32,7 +32,6 @@ class ExtraNetworksPageTextualInversion(ui_extra_networks.ExtraNetworksPage):
"name": name,
"filename": embedding.filename,
"preview": self.find_preview(embedding.filename),
"search_term": self.search_terms_from_path(name),
"prompt": json.dumps(f" {os.path.splitext(embedding.name)[0]}"),
"local_preview": f"{path}.{shared.opts.samples_format}",
"tags": tags,
-1
View File
@@ -20,7 +20,6 @@ class ExtraNetworksPageVAEs(ui_extra_networks.ExtraNetworksPage):
"title": name,
"filename": filename,
"hash": hashes.sha256_from_cache(filename, f"vae/{filename}"),
"search_term": self.search_terms_from_path(filename),
"preview": self.find_preview(filename),
"local_preview": f"{os.path.splitext(filename)[0]}.{shared.opts.samples_format}",
"metadata": {},
+52 -37
View File
@@ -1,4 +1,5 @@
import os
import time
import json
import inspect
from datetime import datetime
@@ -7,7 +8,7 @@ from modules import sd_models, sd_vae, extras
from modules.ui_components import FormRow, ToolButton
from modules.ui_common import create_refresh_button
from modules.call_queue import wrap_gradio_gpu_call
from modules.shared import opts, log, req, readfile
from modules.shared import opts, log, req, readfile, max_workers
import modules.errors
import modules.hashes
from modules.merging import merge_methods
@@ -502,11 +503,50 @@ def create_ui():
list_models()
return res
def civit_search_metadata(civit_previews_rehash, title):
def atomic_civit_search_metadata(item, res, rehash):
from modules.modelloader import download_civit_preview, download_civit_meta
meta = os.path.splitext(item['filename'])[0] + '.json'
has_meta = os.path.isfile(meta) and os.stat(meta).st_size > 0
if ('card-no-preview.png' in item['preview'] or not has_meta) and os.path.isfile(item['filename']):
sha = item.get('hash', None)
found = False
if sha is not None and len(sha) > 0:
r = req(f'https://civitai.com/api/v1/model-versions/by-hash/{sha}')
log.debug(f'CivitAI search: name="{item["name"]}" hash={sha} status={r.status_code}')
if r.status_code == 200:
d = r.json()
res.append(download_civit_meta(item['filename'], d['modelId']))
if d.get('images') is not None:
for i in d['images']:
preview_url = i['url']
img_res = download_civit_preview(item['filename'], preview_url)
res.append(img_res)
if 'error' not in img_res:
found = True
break
if not found and rehash and os.stat(item['filename']).st_size < (1024 * 1024 * 1024):
sha = modules.hashes.calculate_sha256(item['filename'], quiet=True)[:10]
r = req(f'https://civitai.com/api/v1/model-versions/by-hash/{sha}')
log.debug(f'CivitAI search: name="{item["name"]}" hash={sha} status={r.status_code}')
if r.status_code == 200:
d = r.json()
res.append(download_civit_meta(item['filename'], d['modelId']))
if d.get('images') is not None:
for i in d['images']:
preview_url = i['url']
img_res = download_civit_preview(item['filename'], preview_url)
res.append(img_res)
if 'error' not in img_res:
found = True
break
def civit_search_metadata(rehash, title):
log.debug(f'CivitAI search metadata: {title if type(title) == str else "all"}')
from modules.ui_extra_networks import get_pages
from modules.modelloader import download_civit_preview, download_civit_meta
res = []
i = 0
t0 = time.time()
candidates = []
for page in get_pages():
if type(title) == str:
if page.title != title:
@@ -514,40 +554,15 @@ def create_ui():
if page.name == 'style':
continue
for item in page.list_items():
meta = os.path.splitext(item['filename'])[0] + '.json'
has_meta = os.path.isfile(meta) and os.stat(meta).st_size > 0
if ('card-no-preview.png' in item['preview'] or not has_meta) and os.path.isfile(item['filename']):
sha = item.get('hash', None)
found = False
if sha is not None and len(sha) > 0:
r = req(f'https://civitai.com/api/v1/model-versions/by-hash/{sha}')
log.debug(f'CivitAI search: name="{item["name"]}" hash={sha} status={r.status_code}')
if r.status_code == 200:
d = r.json()
res.append(download_civit_meta(item['filename'], d['modelId']))
if d.get('images') is not None:
for i in d['images']:
preview_url = i['url']
img_res = download_civit_preview(item['filename'], preview_url)
res.append(img_res)
if 'error' not in img_res:
found = True
break
if not found and civit_previews_rehash and os.stat(item['filename']).st_size < (1024 * 1024 * 1024):
sha = modules.hashes.calculate_sha256(item['filename'], quiet=True)[:10]
r = req(f'https://civitai.com/api/v1/model-versions/by-hash/{sha}')
log.debug(f'CivitAI search: name="{item["name"]}" hash={sha} status={r.status_code}')
if r.status_code == 200:
d = r.json()
res.append(download_civit_meta(item['filename'], d['modelId']))
if d.get('images') is not None:
for i in d['images']:
preview_url = i['url']
img_res = download_civit_preview(item['filename'], preview_url)
res.append(img_res)
if 'error' not in img_res:
found = True
break
i += 1
candidates.append(item)
# atomic_civit_search_metadata(item, res, rehash)
import concurrent
with concurrent.futures.ThreadPoolExecutor(max_workers=max_workers) as executor:
for fn in candidates:
executor.submit(atomic_civit_search_metadata, fn, res, rehash)
t1 = time.time()
log.debug(f'CivitAI search metadata: items={i} time={t1-t0:.2f}')
txt = '<br>'.join([r for r in res if len(r) > 0])
return txt
+1 -1
Submodule wiki updated: 1c90ea2065...b9fc6d1284