diff --git a/CHANGELOG.md b/CHANGELOG.md index d53dfaeb9..4a61a55e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -58,7 +58,7 @@ Plus continued work on modernization of codebase: UI is now fully TypeScript bas in *settings -> attention Dispatcher* allows to use pluggable kernels defines either in packages or in new [kernels](https://huggingface.co/docs/kernels/index) library see [backends](https://huggingface.co/docs/diffusers/optimization/attention_backends#available-backends) for list of available attention backends - *note* compatiblity matrix between torch backend, torch version and model specifics is relatively small at the moment + *note* compatibility matrix between torch backend, torch version and model specifics is relatively small at the moment *note* does not replace existing *attention* settings - **Image metadata** add *wildcards* (if used) info to image if wildcards or styles modify prompt, add original prompt to image metadata as *template* @@ -93,6 +93,8 @@ Plus continued work on modernization of codebase: UI is now fully TypeScript bas - large refactor of `lora` native loader - improve `kanvas` typing - additional strong typing in core, thanks @awsr + - full `codespell` coverage + *note* this resulted in large one-time changeset - enhance automated testing `pnpm test` (uses `--test`) flag runs pipeline init checks `pnpm compile` (new) runs static python compile and import checks @@ -115,7 +117,7 @@ Plus continued work on modernization of codebase: UI is now fully TypeScript bas - `prompt enhance` custom model loader - `styles` loader exception handling - `kanvas` image change notification - - `reinstall` force reinstal of transformers and diffusers + - `reinstall` force reinstall of transformers and diffusers - `ipex` torch install error, thanks @liutyi - `taesd` preview constant size with reduced layers - `output path` use correct base folder for initial folders @@ -246,7 +248,7 @@ For full details, see [ChangeLog](https://github.com/vladmandic/automatic/blob/m *What's New?* - New image models! **ERNIE-Image**, **Zeta-Chroma**, **Nucleus**, **Bria-FIBO**, **Anima-v3**, **SDXS-1B** - New video model: **LTX 2.3 v1.1** *(with audio, refiner and upscaler)* -- Major **Kanvas** update for enhanced inpaint/outpaint and overal more responsive **UI** +- Major **Kanvas** update for enhanced inpaint/outpaint and overall more responsive **UI** - Built-in **Tag-Autocomplete** with support for *10+* tag databases and support for networks! - Additional *Schedulers*, updates to *NudeNet*, *RIFE*, *OpenVINO* and *ROCm* and other features - [Launcher](https://github.com/vladmandic/sdnext-launcher) tweaks @@ -303,7 +305,7 @@ For full details, see [ChangeLog](https://github.com/vladmandic/automatic/blob/m if you want to skip preview, but show finished images, works with batch progression - add **xet cache** to *settings -> paths* and initialize on startup - **Compute** - - **ROCm** futher work on advanced configuration and tuning, thanks @resonantsky + - **ROCm** further work on advanced configuration and tuning, thanks @resonantsky now covers both ROCm on Windows and Linux see *main interface -> scripts -> rocm advanced config* - **OpenVINO** @@ -352,7 +354,7 @@ For full details, see [ChangeLog](https://github.com/vladmandic/automatic/blob/m - new GET `/sdapi/v1/wildcards` endpoint - **Docs** - validation of all links - - syntax/structure/language corrections accross all documents + - syntax/structure/language corrections across all documents - **Obsoleted** - removed *system-info* from *extensions-builtin* - **Internal** @@ -389,7 +391,7 @@ For full details, see [ChangeLog](https://github.com/vladmandic/automatic/blob/m - controlnet processor error handling - error handling for same-device check - error handling for undefined pipeline - - erorr handling for `scripts` loader + - error handling for `scripts` loader - patch `z-image` for fp16 compatibility, thanks @resonantsky - patch `unipc` for timesteps device placement, thanks @resonantsky - `civitai` search and base-model discovery improvements @@ -445,7 +447,7 @@ Just how big? Some stats: *~530 commits over 880 files* apply professional lut-table using .cube file *hint* color grading is available as step during generate or as processing item for already existing images - **Upscaling** - add support for [spandrel](https://github.com/chaiNNer-org/spandrel) engine with suport for new upscaling model families + add support for [spandrel](https://github.com/chaiNNer-org/spandrel) engine with support for new upscaling model families add two new ai upscalers: *RealPLKSR NomosWebPhoto* and *RealPLKSR AnimeSharpV2* add two new **interpolation** methods: *HQX* and *ICB* use high-quality [sharpfin](https://github.com/drhead/Sharpfin) accelerated library @@ -495,7 +497,7 @@ Just how big? Some stats: *~530 commits over 880 files* *note* Enso is work-in-progress and alpha-ready - legacy panels **T2I** and **I2I** are disabled by default you can re-enable them in *settings -> ui -> hide legacy tabs* - - new panel: **Server Info** with detailed runtime informaton + - new panel: **Server Info** with detailed runtime information - rename **Scripts** to **Extras** and reorganize to split internal functionality vs external extensions - **Networks** add **UNet/DiT** - **Localization** improved translation quality and new translations locales: @@ -518,7 +520,7 @@ Just how big? Some stats: *~530 commits over 880 files* - prototype **v2 API** (`/sdapi/v2/`) job-based generation with queue, per-job WebSocket progress, file uploads with TTL, model/network enumeration and a plethora of other improvements *(work-in-progress)* - for the time being ships with Enso, which must be enabled wih `--enso` flag on startup for v2 API to be available + for the time being ships with Enso, which must be enabled with `--enso` flag on startup for v2 API to be available - **rate limiting**: global for all endpoints, guards against abuse and denial-of-service type of attacks configurable in *settings -> server settings* - new `/sdapi/v1/upload` endpoint with support for both POST with form-data or PUT using raw-bytes @@ -562,7 +564,7 @@ Just how big? Some stats: *~530 commits over 880 files* - replace `timestamp` based startup checks with state caching - split monolithic `shared` module and introduce `ui_definitions` - modularize all imports and avoid re-imports - - use `threading` for deferable operatios + - use `threading` for deferable operations - use `threading` for io-independent parallel operations - remove requirements: `clip`, `open-clip` - add new build of `insightface`, thanks @hameerabbasi @@ -593,7 +595,7 @@ Just how big? Some stats: *~530 commits over 880 files* - model detection for `anima` - handle `lora` unwanted unload - improve `preview` error handler - - handle `gallery` over remote/unsecure connections + - handle `gallery` over remote/insecure connections - fix `ltx2-i2v` - handle missing `preview` image - kandinsky 5 t2i/i2i model type detection @@ -671,7 +673,7 @@ Also here are updates to `torch` and additional GPU archs support for `ROCm` bac - further work on type consistency and type checking, thanks @awsr - log captured exceptions - improve temp folder handling and cleanup - - remove torch errors/warings on fast server shutdown + - remove torch errors/warnings on fast server shutdown - add ui placeholders for future agent-scheduler work, thanks @ryanmeador - implement abort system on repeated errors, thanks @awsr currently used by lora and textual-inversion loaders @@ -713,7 +715,7 @@ For full list of changes, see full changelog. - **Models** - [Flux.2 Klein](https://bfl.ai/blog/flux2-klein-towards-interactive-visual-intelligence) - Flux.2-Klein is a new family of compact models from BFL in *4B and 9B sizes* and avaialable as *destilled and base* variants + Flux.2-Klein is a new family of compact models from BFL in *4B and 9B sizes* and available as *destilled and base* variants also includes are *sdnq prequantized variants* *note*: 9B variant is [gated](https://vladmandic.github.io/sdnext-docs/Gated/) - [Qwen-Image-2512](https://qwen.ai/blog?id=qwen-image-2512) @@ -749,7 +751,7 @@ For full list of changes, see full changelog. add support for *pre-fill* mode where prompt enhance can continue from existing caption - **chroma**: add inpaint pipeline support - **taesd preview**: support for more models, thanks @alerikaisattera - - **image ouput paths**: better handling of relative/absolute paths, thanks @CalamitousFelicitousness + - **image output paths**: better handling of relative/absolute paths, thanks @CalamitousFelicitousness - **UI** - kanvas add send-to functionality - kanvas improve support for standardui @@ -793,7 +795,7 @@ For full list of changes, see full changelog. - lora handle null description, thanks @CalamitousFelicitousness - lora loading when using torch without distributed support - lora skip with strength zero - - lora: generate slowdown when consequtive lora-diffusers enabled + - lora: generate slowdown when consecutive lora-diffusers enabled - model: google-genai auth, thanks @CalamitousFelicitousness - model: improve qwen i2i handling - model: kandinsky-5 image and video on non-cuda platforms @@ -859,7 +861,7 @@ End of year release update, just two weeks after previous one, with several new - control input media with non-english locales - handle embeds when on meta device - improve offloading when model has manual modules - - ui section colapsible state, thanks @awsr + - ui section collapsible state, thanks @awsr - ui filter by model type ## Update for 2025-12-11 @@ -919,7 +921,7 @@ Plus a lot of internal improvements and fixes - support for `XiaomiMiMo` ui: - ability to annotate actual image, not just generate captions/answers - e.g. actualy mark detected regions/points + e.g. actually mark detected regions/points features: - ui indicator of model capabilities - support for *prefill* style of prompting/answering @@ -1098,11 +1100,11 @@ Less than 2 weeks since last release, here's a service-pack style update with a - [Tencent HunyuanImage 2.1](https://huggingface.co/tencent/HunyuanImage-2.1) in *full*, *distilled* and *refiner* variants *HunyuanImage-2.1* is a large (51GB) T2I model capable of natively generating 2K images and uses Qwen2.5 + T5 text-encoders and 32x VAE - [Tencent HunyuanImage 3.0](https://huggingface.co/tencent/HunyuanImage-3.0) in [pre-quant](https://huggingface.co/Disty0/HunyuanImage3-SDNQ-uint4-svd-r32) only variant due to massive size - *HunyuanImage 3.0* is very large at 47GB pre-quantized (oherwise its 157GB) that unifies multimodal understanding and generation within an autoregressive framework + *HunyuanImage 3.0* is very large at 47GB pre-quantized (otherwise its 157GB) that unifies multimodal understanding and generation within an autoregressive framework - [nVidia ChronoEdit](https://huggingface.co/nvidia/ChronoEdit-14B-Diffusers) *ChronoEdit* is a 14B image editing model based on *WAN* this model reframes image editing as a video generation task, using input and edited images as start/end frames to leverage pretrained video models with temporal consistency - to extend temporal consistency for image editing, set *settings -> model options -> chrono temporal steps* to desired number of temporaly reasoning steps + to extend temporal consistency for image editing, set *settings -> model options -> chrono temporal steps* to desired number of temporary reasoning steps - [Kandinsky 5 Lite 10s](https://huggingface.co/ai-forever/Kandinsky-5.0-T2V-Lite-sft-10s-Diffusers') in *SFT, CFG-distilled and Steps-distilled* variants second series of models in *Kandinsky5* series is T2V model optimized for 10sec videos and uses Qwen2.5 text encoder - [Pony 7](https://huggingface.co/purplesmartai/pony-v7-base) @@ -1157,7 +1159,7 @@ Less than 2 weeks since last release, here's a service-pack style update with a - fix networks display with extended characters, thanks @awsr - installer handle different `opencv` package variants - fix using pre-quantized shared-t5 - - fix `wan-2.2-14b-vace` single-stage exectution + - fix `wan-2.2-14b-vace` single-stage execution - fix `wan-2.2-5b` tiled vae decode - fix `controlnet` loading with quantization - video use pre-quantized text-encoder if selected model is pre-quantized @@ -1361,7 +1363,7 @@ Highlight are: - fix hf token with extra chars - image viewer refocus on gallery after returning from full screen mode - fix attention guidance metadata save/restore - - vae preview add explicity cuda.sync + - vae preview add explicitly cuda.sync ## Update for 2025-09-15 @@ -1467,7 +1469,7 @@ And check out new **history** tab in the right panel, it now shows visualization - allow setting denoise strength to 0 in control/img2img this allows to run workflows which only refine or detail existing image without changing it - **Fixes** - - normalize path hanlding when deleting images + - normalize path handling when deleting images - unified compile upscalers - fix OpenVINO with ControlNet - fix hidden model tags in networks display @@ -1598,7 +1600,7 @@ SD.Next will warn on startup on unused cache entries that can be removed. Also, **Docs** search: fully-local and works in real-time on all document pages **Wiki** search: uses github api to search online wiki pages - updated real-time hints, thanks @CalamitousFelicitousness - - add **Wilcards** UI + - add **Wildcards** UI in networks display - every heading element is collapsible! - quicksettings reset button to restore all quicksettings to default values @@ -1638,7 +1640,7 @@ SD.Next will warn on startup on unused cache entries that can be removed. Also, - new `offload during pre-forward` option in *settings -> model offloading* switches from explicit offloading to implicit offloading on module execution change - - new `diffusers_offload_nonblocking` exerimental setting + - new `diffusers_offload_nonblocking` experimental setting instructs torch to use non-blocking move operations when possible - **Features** - new `T5: Use shared instance of text encoder` option @@ -1648,10 +1650,10 @@ SD.Next will warn on startup on unused cache entries that can be removed. Also, *note* this will not reduce size of your already downloaded models, but will reduce size of future downloads - **Wan** select which stage to run: *first/second/both* with configurable *boundary ration* when running both stages in settings -> model options - - prompt parser allow explict `BOS` and `EOS` tokens in prompt + - prompt parser allow explicit `BOS` and `EOS` tokens in prompt - **Nunchaku** support for *FLUX.1-Fill* and *FLUX.1-Depth* models - update requirements/packages - - use model vae scale-factor for image width/heigt calculations + - use model vae scale-factor for image width/height calculations - **SDNQ** add `modules_dtype_dict` to quantize *Qwen Image* with mixed dtype - **prompt enhance** add `allura-org/Gemma-3-Glitter-4B`, `Qwen/Qwen3-4B-Instruct-2507`, `Qwen/Qwen2.5-VL-3B-Instruct` model support @@ -1811,7 +1813,7 @@ For details, see [ChangeLog](https://github.com/vladmandic/automatic/blob/master with *t2i, i2i, flf2v* workflows LoRA support, prompt enhance, etc. now fully integrated instead of being a separate extension - - support for optmized [LTXVideo](https://vladmandic.github.io/sdnext-docs/LTX) + - support for optimized [LTXVideo](https://vladmandic.github.io/sdnext-docs/LTX) with *t2i, i2i, v2v* workflows optional native upsampling and video refine workflows LoRA support with different conditioning types such as Canny/Depth/Pose, etc. @@ -1844,7 +1846,7 @@ For details, see [ChangeLog](https://github.com/vladmandic/automatic/blob/master - support **TAESD** preview and remote VAE for **AuraFlow** - support **TAESD** preview for **WanAI** - SD.Next now starts with *locked* state preventing model loading until startup is complete - - warn when modifying legacy settings that are no longer supported, but available for compatibilty + - warn when modifying legacy settings that are no longer supported, but available for compatibility - warn on incompatible sampler and automatically restore default sampler - **XYZ grid** can now work with control tab: if controlnet or processor are selected in xyz grid, they will overwrite settings from first unit in control tab, @@ -1874,7 +1876,7 @@ For details, see [ChangeLog](https://github.com/vladmandic/automatic/blob/master - fix Cosmos-Predict2 retrying TAESD download - better handle startup import errors - fix traceback width preventing copy&paste - - fix ansi controle output from scripts/extensions + - fix ansi controls output from scripts/extensions - fix diffusers models non-unique hash - fix loading of manually downloaded diffuser models - fix api `/sdapi/v1/embeddings` endpoint @@ -2114,7 +2116,7 @@ Take a look at [Docs](https://github.com/vladmandic/sdnext/wiki/Docs), [Hints](h - Fix high RAM usage with pre mode - Fix scale and zero_point not being offloaded - **IPEX** - - Disabe Dynamic Attention by default on PyTorch 2.7 + - Disable Dynamic Attention by default on PyTorch 2.7 - Remove GradScaler hijack and use `torch.amp.GradScaler` instead - **Feature** - TeaCache support for HiDream I1 @@ -2222,7 +2224,7 @@ And if you're a ROCm user, this release brings much faster compile times on Linu ## Update for 2025-05-06 -Minor refesh with several bugfixes and updates to core libraries +Minor refresh with several bugfixes and updates to core libraries Plus new features with **FramePack** and **HiDream-E1** - **Features** @@ -2656,7 +2658,7 @@ Primarily a hotfix/service release plus few UI improvements and one exciting new - add `--extensions-dir` cli arg and `SD_EXTENSIONSDIR` env variable to specify extensions directory - update `zluda==3.9.0` - **Fixes** - - skip trying to register legacy/incompatibile extensions in control ui + - skip trying to register legacy/incompatible extensions in control ui - add additional scripts/extensions callbacks - remove ui splash screen on auth fail - log full config path, full log path, system name, extensions path @@ -2685,7 +2687,7 @@ We're back with another update with nearly 100 commits! now with redesigned captioning UI, batch support, and much more plus **JoyTag**, **JoyCaption**, **PaliGemma**, **ToriiGate**, **Ovis2** added to list of supported models - Some changes to **prompt parsing** to allow more control as well as - more flexibility when mouting SDNext server to custom URL + more flexibility when mounting SDNext server to custom URL - Of course, cumulative fixes... *...and more* - see [changelog](https://github.com/vladmandic/sdnext/blob/dev/CHANGELOG.md) for full details! @@ -2756,10 +2758,10 @@ We're back with another update with nearly 100 commits! due to binary/build dependencies, it should not be done automatically, see [flash-attn](https://github.com/Dao-AILab/flash-attention) for installation instructions - **Docker** - - updated **CUDA** receipe to `torch==2.6.0` with `cuda==12.6` and add prebuilt image - - added **ROCm** receipe and prebuilt image - - added **IPEX** receipe and add prebuilt image - - added **OpenVINO** receipe and prebuilt image + - updated **CUDA** recipe to `torch==2.6.0` with `cuda==12.6` and add prebuilt image + - added **ROCm** recipe and prebuilt image + - added **IPEX** recipe and add prebuilt image + - added **OpenVINO** recipe and prebuilt image - **System** - improve **python==3.12** compatibility - **Torch** @@ -2783,7 +2785,7 @@ We're back with another update with nearly 100 commits! - **Access tokens** persist *models -> hugginface -> token* persist *models -> civitai -> token* - - global switch to lancosz method for all interal resize ops and bicubic for interpolation ops + - global switch to lancosz method for all internal resize ops and bicubic for interpolation ops - **Text encoder** add advanced per-model options for text encoder set in *settings -> text encoder -> Optional* @@ -2863,7 +2865,7 @@ Just one week after latest release and what a week it was with over 50 commits! - new sota remove background model: [BEN2](https://huggingface.co/PramaLLC/BEN2) select in *process -> remove background* or enable postprocessing for txt2img/img2img operations - **Other**: - - **networks**: imporove search/filter and add visual indicators for types + - **networks**: improve search/filter and add visual indicators for types - **balanced offload** new defaults: *lowvram/4gb min threshold: 0, medvram/8gb min threshold: 0, default min threshold 0.25* - **prompt parser**: log stats with tokens, sections and min/avg/max weights - **prompt parser**: add setting to ignore line breaks in prompt @@ -3010,7 +3012,7 @@ Two weeks since last release, time for update! ### Highlights for 2025-01-15 Two weeks since last release, time for update! -This time a bit shorter highligh reel as this is primarily a service release, but still there is more than few updates +This time a bit shorter highlight reel as this is primarily a service release, but still there is more than few updates *(actually, there are ~60 commits, so its not that tiny)* *What's New?" @@ -3081,7 +3083,7 @@ This time a bit shorter highligh reel as this is primarily a service release, bu - **XYZ Grid**: add prompt search&replace options: *primary, refine, detailer, all* - **SysInfo**: update to collected data and benchmarks - **Fixes**: - - explict clear caches on model load + - explicit clear caches on model load - lock adetailer commit: `#a89c01d` - xyzgrid progress calculation - xyzgrid detailer @@ -3244,9 +3246,9 @@ All-in-all, we're around ~180 commits worth of updates, check the changelog for - [Style Aligned Image Generation](https://style-aligned-gen.github.io/) enable in scripts, compatible with sd-xl enter multiple prompts in prompt field separated by new line - style-aligned applies selected attention layers uniformly to all images to achive consistency + style-aligned applies selected attention layers uniformly to all images to achieve consistency can be used with or without input image in which case first prompt is used to establish baseline - *note:* all prompts are processes as a single batch, so vram is limiting factor + *note:* all prompts are processed as a single batch, so vram is limiting factor - [FreeScale](https://github.com/ali-vilab/FreeScale) enable in scripts, compatible with sd-xl for text and img2img run iterative generation of images at different scales to achieve better results @@ -3259,22 +3261,22 @@ All-in-all, we're around ~180 commits worth of updates, check the changelog for model size: 27.75gb support for 0.9.0, 0.9.1 and custom safetensor-based models with full quantization and offloading support support for text-to-video and image-to-video, to use, select in *scripts -> ltx-video* - *refrence values*: steps 50, width 704, height 512, frames 161, guidance scale 3.0 + *reference values*: steps 50, width 704, height 512, frames 161, guidance scale 3.0 - [Hunyuan Video](https://huggingface.co/tencent/HunyuanVideo) model size: 40.92gb support for text-to-video, to use, select in *scripts -> hunyuan video* basic support only - *refrence values*: steps 50, width 1280, height 720, frames 129, guidance scale 6.0 + *reference values*: steps 50, width 1280, height 720, frames 129, guidance scale 6.0 - [Genmo Mochi.1 Preview](https://huggingface.co/genmo/mochi-1-preview) support for text-to-video, to use, select in *scripts -> mochi.1 video* basic support only - *refrence values*: steps 64, width 848, height 480, frames 19, guidance scale 4.5 + *reference values*: steps 64, width 848, height 480, frames 19, guidance scale 4.5 *Notes*: - all video models are very large and resource intensive! any use on gpus below 16gb and systems below 48gb ram is experimental at best - sdnext support for video models is relatively basic with further optimizations pending community interest - any future optimizations would likely have to go into partial loading and excecution instead of offloading inactive parts of the model + any future optimizations would likely have to go into partial loading and execution instead of offloading inactive parts of the model - new video models use generic llms for prompting and due to that requires very long and descriptive prompt - you may need to enable sequential offload for maximum gpu memory savings - optionally enable pre-quantization using bnb for additional memory savings @@ -3322,7 +3324,7 @@ All-in-all, we're around ~180 commits worth of updates, check the changelog for - improved accordion behavior - auto-size networks height for sidebar - control: hide preview column by default - - control: optionn to hide input column + - control: option to hide input column - control: add stats - settings: reorganized and simplified - browser -> server logging framework @@ -3379,7 +3381,7 @@ All-in-all, we're around ~180 commits worth of updates, check the changelog for - uninstall conflicting `wandb` package - dont skip diffusers version check if quick is specified - notify on torch install -- detect pipeline fro diffusers folder-style model +- detect pipeline from diffusers folder-style model - do not recast flux quants - fix xyz-grid with lora none - fix svd image2video @@ -3425,7 +3427,7 @@ For full list and details see changelog... - new top-level **info** tab with access to [changelog](https://github.com/vladmandic/automatic/blob/master/CHANGELOG.md) and [wiki](https://github.com/vladmandic/automatic/wiki) - UI built-in [changelog](https://github.com/vladmandic/automatic/blob/master/CHANGELOG.md) search since changelog is the best up-to-date source of info - go to info -> changelog and search/highligh/navigate directly in UI! + go to info -> changelog and search/highlight/navigate directly in UI! - UI built-in [wiki](https://github.com/vladmandic/automatic/wiki) go to info -> wiki and search wiki pages directly in UI! - major [Wiki](https://github.com/vladmandic/automatic/wiki) and [Home](https://github.com/vladmandic/automatic) updates @@ -3511,9 +3513,9 @@ For full list and details see changelog... - refactor command line params run `webui.sh`/`webui.bat` with `--help` to see all options - added `cli/model-metadata.py` to display metadata in any safetensors file - - added `cli/model-keys.py` to quicky display content of any safetensors file + - added `cli/model-keys.py` to quickly display content of any safetensors file - Internal: - - Auto pipeline switching coveres wrapper classes and nested pipelines + - Auto pipeline switching covers wrapper classes and nested pipelines - Full settings validation on load of `config.json` - Refactor of all params in main processing classes - Improve API scripts usage resiliency @@ -3547,7 +3549,7 @@ This release can be considered an LTS release before we kick off the next round - fix diffusers load from folder - fix lora enum logging on windows - fix xyz grid with batch count - - move dowwloads of some auxillary models to hfcache instead of models folder + - move dowwloads of some auxiliary models to hfcache instead of models folder ## Update for 2024-10-29 @@ -3656,7 +3658,7 @@ A month later and with nearly 300 commits, here is the latest [SD.Next](https:// - Tons of work on **dynamic quantization** that can be applied *on-the-fly* during model load to any model type (*you do not need to use pre-quantized models*) Supported quantization engines include `BitsAndBytes`, `TorchAO`, `Optimum.quanto`, `NNCF` compression, and more... -- Auto-detection of best available **device/dtype** settings for your platform and GPU reduces neeed for manual configuration +- Auto-detection of best available **device/dtype** settings for your platform and GPU reduces need for manual configuration *Note*: This is a breaking change to default settings and its recommended to check your preferred settings after upgrade - Full rewrite of **sampler options**, not far more streamlined with tons of new options to tweak scheduler behavior - Improved **LoRA** detection and handling for all supported models @@ -3817,7 +3819,7 @@ And there are also other goodies like multiple *XYZ grid* improvements, addition - [Meissonic](https://github.com/viiika/Meissonic) - Select from *networks -> models -> reference* - - Experimental as upstream implemenation code is unstable + - Experimental as upstream implementation code is unstable - Must set scheduler:default, generator:unset - [SageAttention](https://github.com/thu-ml/SageAttention) @@ -3830,7 +3832,7 @@ And there are also other goodies like multiple *XYZ grid* improvements, addition - previously `cuda_dtype` in settings defaulted to `fp16` if available - now `cuda_type` defaults to **Auto** which executes `bf16` and `fp16` tests on startup and selects best available dtype if you have specific requirements, you can still set to fp32/fp16/bf16 as desired - if you have gpu that incorrectly identifies bf16 or fp16 availablity, let us know so we can improve the auto-detection + if you have gpu that incorrectly identifies bf16 or fp16 availability, let us know so we can improve the auto-detection - support for torch **expandable segments** enable in *settings -> compute -> torch expandable segments* can provide significant memory savings for some models @@ -4032,7 +4034,7 @@ Examples: enable via *scripts -> color-grading* - **hires** workflow now allows for full resize options not just limited width/height/scale -- **xyz grid** is now availabe as both local and global script! +- **xyz grid** is now available as both local and global script! - **prompt enhance**: improve quality and/or verbosity of your prompts simply select in *scripts -> prompt enhance* uses [gokaygokay/Flux-Prompt-Enhance](https://huggingface.co/gokaygokay/Flux-Prompt-Enhance) model @@ -4109,9 +4111,9 @@ But...For a good reason, new *balanced offload* is magic when it comes to memory To use and of the new models, simply select model from *Networks -> Reference* and it will be auto-downloaded on first use - [Black Forest Labs FLUX.1](https://blackforestlabs.ai/announcing-black-forest-labs/) - FLUX.1 models are based on a hybrid architecture of multimodal and parallel diffusion transformer blocks, scaled to 12B parameters and builing on flow matching + FLUX.1 models are based on a hybrid architecture of multimodal and parallel diffusion transformer blocks, scaled to 12B parameters and building on flow matching This is a very large model at ~32GB in size, its recommended to use a) offloading, b) quantization - For more information on variations, requirements, options, and how to donwload and use FLUX.1, see [Wiki](https://github.com/vladmandic/automatic/wiki/FLUX) + For more information on variations, requirements, options, and how to download and use FLUX.1, see [Wiki](https://github.com/vladmandic/automatic/wiki/FLUX) SD.Next supports: - [FLUX.1 Dev](https://huggingface.co/black-forest-labs/FLUX.1-dev) and [FLUX.1 Schnell](https://huggingface.co/black-forest-labs/FLUX.1-schnell) original variations - additional [qint8](https://huggingface.co/Disty0/FLUX.1-dev-qint8) and [qint4](https://huggingface.co/Disty0/FLUX.1-dev-qint4) quantized variations @@ -4161,7 +4163,7 @@ To use and of the new models, simply select model from *Networks -> Reference* a - don't enable Dynamic Attention by default on platforms that support Flash Attention, thanks @Disty0! - convert offload options into a single choice list, thanks @Disty0! *note*: requires reset of selected offload option -- control module allows reszing of indivudual process override images to match input image +- control module allows reszing of individual process override images to match input image for example: set size->before->method:nearest, mode:fixed or mode:fill - control tab includes superset of txt and img scripts - automatically offload disabled controlnet units @@ -4221,7 +4223,7 @@ This release is primary service release with cumulative fixes and several improv Following zero-day **SD3** release, a 10 days later heres a refresh with 10+ improvements including full prompt attention, support for compressed weights, additional text-encoder quantization modes. -But theres more than SD3: +But there's more than SD3: - support for quantized **T5** text encoder *FP16/FP8/FP4/INT8* in all models that use T5: SD3, PixArt-Σ, etc. - support for **PixArt-Sigma** in small/medium/large variants - support for **HunyuanDiT 1.1** @@ -4475,7 +4477,7 @@ a completely different backend/engine and a change of focus, it is time to give Search or sort by path, name, size, width, height, mtime or any image metadata item, also with extended syntax like *width > 1000* *Settings*: optional additional user-defined folders, thumbnails in fixed or variable aspect-ratio - [HiDiffusion](https://github.com/megvii-research/HiDiffusion): - Generate high-resolution images using your standard models without duplicates/distorsions AND improved performance + Generate high-resolution images using your standard models without duplicates/distortions AND improved performance For example, *SD15* can now go up to *2024x2048* and *SDXL* up to *4k* natively Simply enable checkbox in advanced menu and set desired resolution Additional settings are available in *settings -> inference settings -> hidiffusion* @@ -4603,11 +4605,11 @@ a completely different backend/engine and a change of focus, it is time to give *note*: you can use other samplers as well with SDXL-Lightning models - Add *CMSI* sampler, optimized for consistency models - Add option *timestep spacing* to sampler settings and sampler section in main ui - Note: changing timestep spacing changes behavior of sampler and can help to make any sampler turbo/lightning compatibile + Note: changing timestep spacing changes behavior of sampler and can help to make any sampler turbo/lightning compatible - Add option *timesteps* to manually set timesteps instead of relying on steps+spacing - Additionally, presets from nVidias align-you-steps reasearch are provided + Additionally, presets from nVidias align-you-steps research are provided Result is that perfectly aligned steps can drastically reduce number of steps needed! - For example, **AYS** preset alows DPM++2M to run in ~10 steps with quality equallying ~30 steps! + For example, **AYS** preset allows DPM++2M to run in ~10 steps with quality equallying ~30 steps! - **IPEX**, thanks @Disty0 - Update to *IPEX 2.1.20* on Linux requires removing the venv folder to update properly @@ -4670,7 +4672,7 @@ New pipelines and features: - **Face-HiRes**: simple built-in detailer for face refinements - Even simpler outpaint: when resizing image, simply pick outpaint method and if image has different aspect ratio, blank areas will be outpainted! - UI aspect-ratio controls and other UI improvements -- User controllable invisibile and visible watermarking +- User controllable invisible and visible watermarking - Native composable LoRA What else? @@ -4705,7 +4707,7 @@ Further details: - context aware img2img method with image analysis and positive/negative prompt handling - enable via img2img -> scripts -> ledit - uses following params from standard img2img: cfg scale (recommended ~3), steps (recommended ~50), denoise strength (recommended ~0.7) - - can use postive and/or negative prompt to guide editing process + - can use positive and/or negative prompt to guide editing process - positive prompt: what to enhance, strength and threshold for auto-masking - negative prompt: what to remove, strength and threshold for auto-masking - *note*: not compatible with model offloading @@ -4713,7 +4715,7 @@ Further details: - independent upscale and hires options: run hires without upscale or upscale without hires or both - upscale can now run 0.1-8.0 scale and will also run if enabled at 1.0 to allow for upscalers that simply improve image quality - update ui section to reflect changes - - *note*: behavior using backend:original is unchanged for backwards compatibilty + - *note*: behavior using backend:original is unchanged for backwards compatibility - **Visual Query** visual query & answer in process tab - go to process -> visual query - ask your questions, e.g. "describe the image", "what is behind the subject", "what are predominant colors of the image?" @@ -4733,7 +4735,7 @@ Further details: - for svd 1.0, use frames=~14, for xt models use frames=~25 - **Composable LoRA**, thanks @AI-Casanova - control lora strength for each step - for example: `` means strength=0.1 for step at 0% and intepolate towards strength=0.9 for step at 100% + for example: `` means strength=0.1 for step at 0% and interpolate towards strength=0.9 for step at 100% - *note*: this is a very experimental feature and may not work as expected - **Control** - added *refiner/hires* workflows @@ -4758,7 +4760,7 @@ Further details: - set as default face restorer in settings -> postprocessing - disabled by default, to enable simply check *face restore* in your generate advanced settings - strength, steps and sampler are set using by hires section in refine menu - - strength can be overriden in settings -> postprocessing + - strength can be overridden in settings -> postprocessing - will use secondary prompt and secondary negative prompt if present in refine - **Watermarking** - SD.Next disables all known watermarks in models, but does allow user to set custom watermark @@ -4843,7 +4845,7 @@ This time release schedule was shorter as we wanted to get some of the fixes out ### Highlights 2024-02-22 -- **IP-Adapters** & **FaceID**: multi-adapter and multi-image suport +- **IP-Adapters** & **FaceID**: multi-adapter and multi-image support - New optimization engines: [DeepCache](https://github.com/horseee/DeepCache), [ZLUDA](https://github.com/vosen/ZLUDA) and **Dynamic Attention Slicing** - New built-in pipelines: [Differential diffusion](https://github.com/exx8/differential-diffusion) and [Regional prompting](https://github.com/huggingface/diffusers/blob/main/examples/community/README.md#regional-prompting-pipeline) - Big updates to: **Outpainting** (noised-edge-extend), **Clip-skip** (interpolate with non-integrer values!), **CFG end** (prevent overburn on high CFG scales), **Control** module masking functionality @@ -4864,7 +4866,7 @@ Further details: *note*: you cannot mix & match ip adapters that use different *CLiP* models, for example `Base` and `Base ViT-G` - add **adapter start/end** to settings, thanks @AI-Casanova having adapter start late can help with better control over composition and prompt adherence - having adapter end early can help with overal quality and performance + having adapter end early can help with overall quality and performance - unified interface in txt2img, img2img and control - enhanced xyz grid support - **FaceID** now also works with multiple input images! @@ -4885,7 +4887,7 @@ Further details: - [ZLUDA](https://github.com/vosen/ZLUDA) experimental support, thanks @lshqqytiger - ZLUDA is CUDA wrapper that can be used for GPUs without native support - best use case is *AMD GPUs on Windows*, see [wiki](https://github.com/vladmandic/automatic/wiki/ZLUDA) for details - - **Outpaint** control outpaint now uses new alghorithm: noised-edge-extend + - **Outpaint** control outpaint now uses new algorithm: noised-edge-extend new method allows for much larger outpaint areas in a single pass, even outpaint 512->1024 works well note that denoise strength should be increased for larger the outpaint areas, for example outpainting 512->1024 works well with denoise 0.75 outpaint can run in *img2img* mode (default) and *inpaint* mode where original image is masked (if inpaint masked only is selected) @@ -4897,7 +4899,7 @@ Further details: for example, when used with ip-adapters or controlnet, high cfg scale can overpower the guided image - **Control** - when performing inpainting, you can specify processing resolution using **size->mask** - - units now have extra option to re-use current preview image as processor input + - units now have extra option to reuse current preview image as processor input - **Cross-attention** refactored cross-attention methods, thanks @Disty0 - for backend:original, its unchanged: SDP, xFormers, Doggettxs, InvokeAI, Sub-quadratic, Split attention - for backend:diffuers, list is now: SDP, xFormers, Batch matrix-matrix, Split attention, Dynamic Attention BMM, Dynamic Attention SDP @@ -5022,7 +5024,7 @@ Further details: if you dont provide mask or mask is empty, you can instead use auto-mask to automatically generate mask this is especially useful if you want to use advanced masking on batch or video inputs and dont want to manually mask each image *note*: such auto-created mask is also subject to all other selected settings such as auto-segmentation, blur, erode and dilate - - optional **object removal** using LaMA model + - optional **object removal** using LAMA model remove selected objects from images with a single click works best when combined with auto-segmentation to remove smaller objects - masking can be combined with control processors in which case mask is applied before processor @@ -5057,7 +5059,7 @@ Further details: - support controlnets with non-default yaml config files - implement resize modes for override images - allow any selection of units - - dynamically install depenencies required by specific processors + - dynamically install dependencies required by specific processors - fix input image size - fix video color mode - fix correct image mode @@ -5101,7 +5103,7 @@ Further details: - support for create and load custom mixes will be added in the future - [Mixture Tiling](https://arxiv.org/abs/2302.02412) - uses multiple prompts to guide different parts of the grid during diffusion process - - can be used ot create complex scenes with multiple subjects + - can be used to create complex scenes with multiple subjects - simply select from scripts - [Self-attention guidance](https://github.com/SusungHong/Self-Attention-Guidance) - simply select scale in advanced menu @@ -5183,7 +5185,7 @@ Further details: - correct font scaling, thanks @nCoderGit - **hypertile** - enable vae tiling - - add autodetect optimial value + - add autodetect optimal value set tile size to 0 to use autodetected value - **cli** - `sdapi.py` allow manual api invoke @@ -5214,7 +5216,7 @@ Further details: - **IPEX**, thanks @disty0 - see [wiki](https://github.com/vladmandic/automatic/wiki/Intel-ARC) for details - rewrite ipex hijacks without CondFunc - improves compatibilty and performance + improves compatibility and performance fixes random memory leaks - out of the box support for Intel Data Center GPU Max Series - remove IPEX / Torch 2.0 specific hijacks @@ -5316,7 +5318,7 @@ To wrap up this amazing year, were releasing a new version of [SD.Next](https:// - Better onboarding experience (first install) with all model types available for single click download & load (networks -> reference) - Performance optimizations! - For comparisment of different processing options and compile backends, see [Wiki](https://github.com/vladmandic/automatic/wiki/Benchmark) + For comparison of different processing options and compile backends, see [Wiki](https://github.com/vladmandic/automatic/wiki/Benchmark) As a highlight, were reaching **~100 it/s** (no tricks, this is with full features enabled and end-to-end on a standard nVidia RTX4090) - New [custom pipelines](https://github.com/vladmandic/automatic/blob/dev/scripts/example.py) framework for quickly porting any new pipeline @@ -5416,7 +5418,7 @@ Plus some nifty new modules such as **FaceID** automatic face guidance using emb use if you have multiple complex loras that may be causing performance degradation as it fuses lora with model during load instead of interpreting lora on-the-fly - **CivitAI downloader** allow usage of access tokens for download of gated or private models - - **Extra networks** new *settting -> extra networks -> build info on first access* + - **Extra networks** new *setting -> extra networks -> build info on first access* indexes all networks on first access instead of server startup - **IPEX**, thanks @disty0 - update to **Torch 2.1** @@ -5450,7 +5452,7 @@ Plus some nifty new modules such as **FaceID** automatic face guidance using emb - **chaiNNer** fix `NaN` issues due to autocast - **Upscale** increase limit from 4x to 8x given the quality of some upscalers - **Networks** fix sort - - reduced default **CFG scale** from 6 to 4 to be more out-of-the-box compatibile with LCM/Turbo models + - reduced default **CFG scale** from 6 to 4 to be more out-of-the-box compatible with LCM/Turbo models - disable google fonts check on server startup - fix torchvision/basicsr compatibility - fix styles quick save @@ -5501,7 +5503,7 @@ Also new is support for **SDXL-Turbo** as well as new **Kandinsky 3** models and - model params count is at 11.9B (compared to SD-XL at 3.3B) and its trained on mixed resolutions from 256px to 1024px - use either model offload or sequential cpu offload to be able to use it - better autodetection of *inpaint* and *instruct* pipelines - - support long seconary prompt for refiner + - support long secondary prompt for refiner - **Video support** - applies to any model that supports video generation, e.g. AnimateDiff and StableVideoDiffusion - support for **animated-GIF**, **animated-PNG** and **MP4** @@ -6295,7 +6297,7 @@ Trying to unify settings for both original and diffusers backend without introdu Another big one, but now improvements to both **diffusers** and **original** backends as well plus ability to dynamically switch between them! -- swich backend between diffusers and original on-the-fly +- switch backend between diffusers and original on-the-fly - you can still use `--backend ` and now that only means in which mode app will start, but you can change it anytime in ui settings - for example, you can even do things like generate image using sd-xl, @@ -6332,7 +6334,7 @@ Service release with some fixes and enhancements: note that **sd-xl** img2img workflows are architecturaly different so it will take longer to implement - updated hints for settings - extra networks: - - fix corrupt display on refesh when new extra network type found + - fix corrupt display on refresh when new extra network type found - additional ui tweaks - generate thumbnails from previews only if preview resolution is above 1k - image viewer: @@ -6450,7 +6452,7 @@ Both some **new functionality** as well as **massive merges** from upstream if disabled, model will be loaded on first request, e.g. when you click generate useful when you want to start server to perform other tasks like upscaling which do not rely on model - updated `accelerate` and `xformers` -- huge nubmer of changes ported from **A1111** upstream +- huge number of changes ported from **A1111** upstream this was a massive merge, hopefully this does not cause any regressions and still a bit more pending... @@ -6510,7 +6512,7 @@ Some quality-of-life improvements while working on larger stuff in the backgroun but they are saved correctly. and cant beat raw quality of 32-bit `tiff` or `psd` :) - change in behavior: `xformers` will be uninstalled on startup if they are not active if you do have `xformers` selected as your desired cross-optimization method, then they will be used - reason is that a lot of libaries try to blindly import xformers even if they are not selected or not functional + reason is that a lot of libraries try to blindly import xformers even if they are not selected or not functional ## Update for 2023-05-30 @@ -6570,7 +6572,7 @@ Major internal work with perhaps not that much user-facing to show for it ;) - redo api authentication now api authentication will use same user/pwd (if specified) for ui and strictly enforce it using httpbasicauth new authentication is also fully supported in combination with ssl for both sync and async calls - if you want to use api programatically, see examples in `cli/sdapi.py` + if you want to use api programmatically, see examples in `cli/sdapi.py` - add dark/light theme mode toggle - redo some `clip-skip` functionality - better matching for vae vs model diff --git a/cli/api-progress.py b/cli/api-progress.py index e623299d9..21b368fbe 100755 --- a/cli/api-progress.py +++ b/cli/api-progress.py @@ -57,7 +57,7 @@ while True: sampling_step = state.get('sampling_step', 0) sampling_steps = state.get('sampling_steps', 0) if job_timestamp is None: - log.warning(f'sdnext montoring cannot get last job info: {status}') + log.warning(f'sdnext monitoring cannot get last job info: {status}') else: job_timestamp = datetime.datetime.strptime(job_timestamp, "%Y%m%d%H%M%S") if job_timestamp != '0' else datetime.datetime.now() elapsed = datetime.datetime.now() - job_timestamp diff --git a/cli/lcm-convert.py b/cli/lcm-convert.py index 9feeb98de..d0bf779ad 100755 --- a/cli/lcm-convert.py +++ b/cli/lcm-convert.py @@ -7,7 +7,7 @@ from diffusers import StableDiffusionPipeline, StableDiffusionXLPipeline, AutoPi parser = argparse.ArgumentParser("lcm_convert") parser.add_argument("--name", help="Name of the new LCM model", type=str) parser.add_argument("--model", help="A model to convert", type=str) -parser.add_argument("--lora-scale", default=1.0, help="Strenght of the LCM", type=float) +parser.add_argument("--lora-scale", default=1.0, help="Strength of the LCM", type=float) parser.add_argument("--huggingface", action="store_true", help="Use Hugging Face models instead of safetensors models") parser.add_argument("--upload", action="store_true", help="Upload the new LCM model to Hugging Face") parser.add_argument("--no-half", action="store_true", help="Convert the new LCM model to FP32") diff --git a/installer.py b/installer.py index 1e2a21681..51ea09b65 100644 --- a/installer.py +++ b/installer.py @@ -1058,8 +1058,8 @@ def run_extension_installer(folder): env = os.environ.copy() env['PYTHONPATH'] = os.path.abspath(".") if os.environ.get('PYTHONPATH', None) is not None: - seperator = ';' if sys.platform == 'win32' else ':' - env['PYTHONPATH'] += seperator + os.environ.get('PYTHONPATH', None) + separator = ';' if sys.platform == 'win32' else ':' + env['PYTHONPATH'] += separator + os.environ.get('PYTHONPATH', None) result, txt = run(sys.executable, path_installer, env=env, cwd=folder) debug(f'Extension installer: file="{path_installer}" {result.stdout}') if result.returncode != 0: @@ -1324,7 +1324,7 @@ def install_requirements(): ts('requirements', t_start) -# set environment variables controling the behavior of various libraries +# set environment variables controlling the behavior of various libraries def set_environment(): log.debug('Setting environment tuning') os.environ.setdefault('ACCELERATE', 'True') @@ -1878,7 +1878,7 @@ def ensure_base_requirements(): except ImportError: update_setuptools() - # used by installler itself so must be installed before requirements + # used by installer itself so must be installed before requirements install('rich==15.0.0', 'rich', quiet=True) install('psutil', 'psutil', quiet=True) install('requests==2.32.3', 'requests', quiet=True) diff --git a/modules/api/gpu.py b/modules/api/gpu.py index bdcffde81..de6daa1f8 100644 --- a/modules/api/gpu.py +++ b/modules/api/gpu.py @@ -38,7 +38,7 @@ def get_gpu_smi(): """ -Resut should always be: list[ResGPU] +Result should always be: list[ResGPU] class ResGPU(BaseModel): name: str = Field(title="GPU Name") data: dict = Field(title="Name/Value data") diff --git a/modules/api/models.py b/modules/api/models.py index 96fa7343f..b24a7991c 100644 --- a/modules/api/models.py +++ b/modules/api/models.py @@ -217,7 +217,7 @@ class ItemFace(BaseModel): mode: str = Field(title="Mode", default="FaceID", description="The mode to use (available values: FaceID, FaceSwap, PhotoMaker, InstantID).") source_images: list[str] = Field(title="Source Images", description="Source face images, must be base64 encoded containing the image's data.") ip_model: str = Field(title="IPAdapter Model", default="FaceID Base", description="The IPAdapter model to use.") - ip_override_sampler: bool = Field(title="IPAdapter Override Sampler", default=True, description="Should the sampler be overriden?") + ip_override_sampler: bool = Field(title="IPAdapter Override Sampler", default=True, description="Should the sampler be overridden?") ip_cache_model: bool = Field(title="IPAdapter Cache", default=True, description="Should the IPAdapter model be cached?") ip_strength: float = Field(title="IPAdapter Strength", default=1, ge=0, le=2, description="IPAdapter strength of the source images, must be between 0.0 and 2.0.") ip_structure: float = Field(title="IPAdapter Structure", default=1, ge=0, le=1, description="IPAdapter structure to use, must be between 0.0 and 1.0.") diff --git a/modules/api/process.py b/modules/api/process.py index ca9ba3346..9c3925a51 100644 --- a/modules/api/process.py +++ b/modules/api/process.py @@ -23,7 +23,7 @@ class ResPreprocess(BaseModel): class ReqMask(BaseModel): image: str = Field(title="Image", description="The base64 encoded image") type: str = Field(title="Mask type", description="Type of masking image to return") - mask: str | None = Field(title="Mask", description="If optional maks image is not provided auto-masking will be performed") + mask: str | None = Field(title="Mask", description="If optional mask image is not provided auto-masking will be performed") model: str | None = Field(title="Model", description="The model to use for preprocessing") params: dict | None = Field(default={}, title="Settings", description="Preprocessor settings") diff --git a/modules/attention.py b/modules/attention.py index a8d93e25d..a9062a713 100644 --- a/modules/attention.py +++ b/modules/attention.py @@ -197,7 +197,7 @@ def set_sage_attention(backend: str, device: torch.device): key = key.repeat_interleave(query.size(-3)//key.size(-3), -3) value = value.repeat_interleave(query.size(-3)//value.size(-3), -3) - # Call pre-selected sage attention implementation + # Call preselected sage attention implementation return sage_attn_impl(query, key, value, is_causal, scale) else: if enable_gqa: diff --git a/modules/ben2/ben2_model.py b/modules/ben2/ben2_model.py index 2eccfc8ce..c36f40b21 100644 --- a/modules/ben2/ben2_model.py +++ b/modules/ben2/ben2_model.py @@ -437,7 +437,7 @@ class SwinTransformer(nn.Module): https://arxiv.org/pdf/2103.14030 Args: pretrain_img_size (int): Input image size for training the pretrained model, - used in absolute postion embedding. Default 224. + used in absolute position embedding. Default 224. patch_size (int | tuple(int)): Patch size. Default: 4. in_chans (int): Number of input image channels. Default: 3. embed_dim (int): Number of linear projection output channels. Default: 96. diff --git a/modules/control/proc/depth_anything/util/transform.py b/modules/control/proc/depth_anything/util/transform.py index d542fefee..fd050d3de 100644 --- a/modules/control/proc/depth_anything/util/transform.py +++ b/modules/control/proc/depth_anything/util/transform.py @@ -131,7 +131,7 @@ class Resize(object): # fit height scale_width = scale_height elif self.__resize_method == "minimal": - # scale as least as possbile + # scale as least as possible if abs(1 - scale_width) < abs(1 - scale_height): # fit width scale_height = scale_width @@ -209,7 +209,7 @@ class Resize(object): class NormalizeImage(object): - """Normlize image by given mean and std. + """Normalize image by given mean and std. """ def __init__(self, mean, std): diff --git a/modules/control/proc/leres/leres/depthmap.py b/modules/control/proc/leres/leres/depthmap.py index d89ac7e7a..6b63b31ff 100644 --- a/modules/control/proc/leres/leres/depthmap.py +++ b/modules/control/proc/leres/leres/depthmap.py @@ -49,7 +49,7 @@ def estimateleres(img, model, w, h): return prediction def generatemask(size): - # Generates a Guassian mask + # Generates a Gaussian mask mask = np.zeros(size, dtype=np.float32) sigma = int(size[0]/16) k_size = int(2 * np.ceil(2 * int(size[0]/16)) + 1) @@ -395,7 +395,7 @@ def estimateboost(img, model, model_type, pix2pixmodel, max_res=512, depthmap_sc gc.collect() torch_gc() - # Generate mask used to smoothly blend the local pathc estimations to the base estimate. + # Generate mask used to smoothly blend the local patch estimations to the base estimate. # It is arbitrarily large to avoid artifacts during rescaling for each crop. mask_org = generatemask((3000, 3000)) mask = mask_org.copy() diff --git a/modules/control/proc/leres/pix2pix/models/base_model.py b/modules/control/proc/leres/pix2pix/models/base_model.py index 64af9aff6..fdffd19e6 100644 --- a/modules/control/proc/leres/pix2pix/models/base_model.py +++ b/modules/control/proc/leres/pix2pix/models/base_model.py @@ -136,7 +136,7 @@ class BaseModel(ABC): return visual_ret def get_current_losses(self): - """Return traning losses / errors. train.py will print out these errors on console, and save them to a file""" + """Return training losses / errors. train.py will print out these errors on console, and save them to a file""" errors_ret = OrderedDict() for name in self.loss_names: if isinstance(name, str): @@ -229,7 +229,7 @@ class BaseModel(ABC): print('-----------------------------------------------') def set_requires_grad(self, nets, requires_grad=False): - """Set requies_grad=Fasle for all the networks to avoid unnecessary computations + """Set requies_grad=False for all the networks to avoid unnecessary computations Parameters: nets (network list) -- a list of networks requires_grad (bool) -- whether the networks require gradients or not diff --git a/modules/control/proc/leres/pix2pix/models/networks.py b/modules/control/proc/leres/pix2pix/models/networks.py index 1f076f89f..2479f7f7a 100644 --- a/modules/control/proc/leres/pix2pix/models/networks.py +++ b/modules/control/proc/leres/pix2pix/models/networks.py @@ -255,7 +255,7 @@ class GANLoss(nn.Module): """Create label tensors with the same size as the input. Parameters: - prediction (tensor) - - tpyically the prediction from a discriminator + prediction (tensor) - - typically the prediction from a discriminator target_is_real (bool) - - if the ground truth label is for real images or fake images Returns: @@ -272,7 +272,7 @@ class GANLoss(nn.Module): """Calculate loss given Discriminator's output and grount truth labels. Parameters: - prediction (tensor) - - tpyically the prediction output from a discriminator + prediction (tensor) - - typically the prediction output from a discriminator target_is_real (bool) - - if the ground truth label is for real images or fake images Returns: diff --git a/modules/control/proc/leres/pix2pix/models/pix2pix4depth_model.py b/modules/control/proc/leres/pix2pix/models/pix2pix4depth_model.py index aac9ae83a..6fc3b393e 100644 --- a/modules/control/proc/leres/pix2pix/models/pix2pix4depth_model.py +++ b/modules/control/proc/leres/pix2pix/models/pix2pix4depth_model.py @@ -9,7 +9,7 @@ class Pix2Pix4DepthModel(BaseModel): The model training requires '--dataset_mode aligned' dataset. By default, it uses a '--netG unet256' U-Net generator, a '--netD basic' discriminator (PatchGAN), - and a '--gan_mode' vanilla GAN loss (the cross-entropy objective used in the orignal GAN paper). + and a '--gan_mode' vanilla GAN loss (the cross-entropy objective used in the original GAN paper). pix2pix paper: https://arxiv.org/pdf/1611.07004.pdf """ @@ -152,4 +152,4 @@ class Pix2Pix4DepthModel(BaseModel): self.set_requires_grad(self.netD, False) # D requires no gradients when optimizing G self.optimizer_G.zero_grad() # set G's gradients to zero self.backward_G() # calculate graidents for G - self.optimizer_G.step() # udpate G's weights + self.optimizer_G.step() # update G's weights diff --git a/modules/control/proc/leres/pix2pix/options/base_options.py b/modules/control/proc/leres/pix2pix/options/base_options.py index 2a3a25dd4..2ff2c7822 100644 --- a/modules/control/proc/leres/pix2pix/options/base_options.py +++ b/modules/control/proc/leres/pix2pix/options/base_options.py @@ -14,7 +14,7 @@ class BaseOptions(): """ def __init__(self): - """Reset the class; indicates the class hasn't been initailized""" + """Reset the class; indicates the class hasn't been initialized""" self.initialized = False def initialize(self, parser): diff --git a/modules/control/proc/midas/midas/transforms.py b/modules/control/proc/midas/midas/transforms.py index 57f3cb371..d24c6b335 100644 --- a/modules/control/proc/midas/midas/transforms.py +++ b/modules/control/proc/midas/midas/transforms.py @@ -125,7 +125,7 @@ class Resize(object): # fit height scale_width = scale_height elif self.__resize_method == "minimal": - # scale as least as possbile + # scale as least as possible if abs(1 - scale_width) < abs(1 - scale_height): # fit width scale_height = scale_width @@ -195,7 +195,7 @@ class Resize(object): class NormalizeImage(object): - """Normlize image by given mean and std. + """Normalize image by given mean and std. """ def __init__(self, mean, std): diff --git a/modules/control/proc/openpose/body.py b/modules/control/proc/openpose/body.py index 01a23f3d8..c81b49c85 100644 --- a/modules/control/proc/openpose/body.py +++ b/modules/control/proc/openpose/body.py @@ -109,7 +109,7 @@ class Body(object): limbSeq = [[2, 3], [2, 6], [3, 4], [4, 5], [6, 7], [7, 8], [2, 9], [9, 10], \ [10, 11], [2, 12], [12, 13], [13, 14], [2, 1], [1, 15], [15, 17], \ [1, 16], [16, 18], [3, 17], [6, 18]] - # the middle joints heatmap correpondence + # the middle joints heatmap correspondence mapIdx = [[31, 32], [39, 40], [33, 34], [35, 36], [41, 42], [43, 44], [19, 20], [21, 22], \ [23, 24], [25, 26], [27, 28], [29, 30], [47, 48], [49, 50], [53, 54], [51, 52], \ [55, 56], [37, 38], [45, 46]] diff --git a/modules/control/proc/segment_anything/modeling/tiny_vit_sam.py b/modules/control/proc/segment_anything/modeling/tiny_vit_sam.py index 165bd11bb..fe14a24bd 100644 --- a/modules/control/proc/segment_anything/modeling/tiny_vit_sam.py +++ b/modules/control/proc/segment_anything/modeling/tiny_vit_sam.py @@ -285,7 +285,7 @@ class TinyViTBlock(nn.Module): Args: dim (int): Number of input channels. - input_resolution (tuple[int, int]): Input resulotion. + input_resolution (tuple[int, int]): Input resolution. num_heads (int): Number of attention heads. window_size (int): Window size. mlp_ratio (float): Ratio of mlp hidden dim to embedding dim. diff --git a/modules/control/proc/zoe/zoedepth/models/base_models/midas.py b/modules/control/proc/zoe/zoedepth/models/base_models/midas.py index 683bd0329..45c94995a 100644 --- a/modules/control/proc/zoe/zoedepth/models/base_models/midas.py +++ b/modules/control/proc/zoe/zoedepth/models/base_models/midas.py @@ -134,7 +134,7 @@ class Resize(object): # fit height scale_width = scale_height elif self.__resize_method == "minimal": - # scale as least as possbile + # scale as least as possible if abs(1 - scale_width) < abs(1 - scale_height): # fit width scale_height = scale_width diff --git a/modules/control/proc/zoe/zoedepth/models/base_models/midas_repo/midas/transforms.py b/modules/control/proc/zoe/zoedepth/models/base_models/midas_repo/midas/transforms.py index 350cbc116..4adb23fbe 100644 --- a/modules/control/proc/zoe/zoedepth/models/base_models/midas_repo/midas/transforms.py +++ b/modules/control/proc/zoe/zoedepth/models/base_models/midas_repo/midas/transforms.py @@ -125,7 +125,7 @@ class Resize(object): # fit height scale_width = scale_height elif self.__resize_method == "minimal": - # scale as least as possbile + # scale as least as possible if abs(1 - scale_width) < abs(1 - scale_height): # fit width scale_height = scale_width @@ -195,7 +195,7 @@ class Resize(object): class NormalizeImage(object): - """Normlize image by given mean and std. + """Normalize image by given mean and std. """ def __init__(self, mean, std): diff --git a/modules/control/proc/zoe/zoedepth/models/layers/localbins_layers.py b/modules/control/proc/zoe/zoedepth/models/layers/localbins_layers.py index 9af4dc463..209cc40b7 100644 --- a/modules/control/proc/zoe/zoedepth/models/layers/localbins_layers.py +++ b/modules/control/proc/zoe/zoedepth/models/layers/localbins_layers.py @@ -153,7 +153,7 @@ class LinearSplitter(nn.Module): b_prev = nn.functional.interpolate(b_prev, (h,w), mode='bilinear', align_corners=True) - b_prev = b_prev / b_prev.sum(dim=1, keepdim=True) # renormalize for gurantees + b_prev = b_prev / b_prev.sum(dim=1, keepdim=True) # renormalize for guarantees # print(b_prev.shape, S_normed.shape) # if is_for_query:(1).expand(-1, b_prev.size(0)//n, -1, -1, -1, -1).flatten(0,1) b = b_prev.unsqueeze(2) * S_normed diff --git a/modules/control/proc/zoe/zoedepth/models/zoedepth_nk/zoedepth_nk_v1.py b/modules/control/proc/zoe/zoedepth/models/zoedepth_nk/zoedepth_nk_v1.py index 91e3ca72a..2c295013e 100644 --- a/modules/control/proc/zoe/zoedepth/models/zoedepth_nk/zoedepth_nk_v1.py +++ b/modules/control/proc/zoe/zoedepth/models/zoedepth_nk/zoedepth_nk_v1.py @@ -63,7 +63,7 @@ class ZoeDepthNK(DepthModel): min_temp (int, optional): Lower bound for temperature of output probability distribution. Defaults to 5. max_temp (int, optional): Upper bound for temperature of output probability distribution. Defaults to 50. - memory_efficient (bool, optional): Whether to use memory efficient version of attractor layers. Memory efficient version is slower but is recommended incase of multiple metric heads in order save GPU memory. Defaults to False. + memory_efficient (bool, optional): Whether to use memory efficient version of attractor layers. Memory efficient version is slower but is recommended in case of multiple metric heads in order save GPU memory. Defaults to False. train_midas (bool, optional): Whether to train "core", the base midas model. Defaults to True. is_midas_pretrained (bool, optional): Is "core" pretrained? Defaults to True. diff --git a/modules/control/run.py b/modules/control/run.py index 22029b541..fa021b92e 100644 --- a/modules/control/run.py +++ b/modules/control/run.py @@ -73,7 +73,7 @@ def set_pipe(p, has_models, unit_type, selected_models, active_model, active_str return pipe if has_models: p.ops.append('control') - p.extra_generation_params["Control type"] = unit_type # overriden later with pretty-print + p.extra_generation_params["Control type"] = unit_type # overridden later with pretty-print p.extra_generation_params["Control model"] = ';'.join([(m.model_id or '') for m in active_model if m.model is not None]) p.extra_generation_params["Control conditioning"] = control_conditioning if isinstance(control_conditioning, list) else [control_conditioning] p.extra_generation_params['Control start'] = control_guidance_start if isinstance(control_guidance_start, list) else [control_guidance_start] diff --git a/modules/control/units/xs_model.py b/modules/control/units/xs_model.py index f21803d87..7d069590c 100644 --- a/modules/control/units/xs_model.py +++ b/modules/control/units/xs_model.py @@ -345,7 +345,7 @@ class ControlNetXSModel(ModelMixin, ConfigMixin): conditioning_channels=conditioning_channels, ) - # In the mininal implementation setting, we only need the control model up to the mid block + # In the minimal implementation setting, we only need the control model up to the mid block del self.control_model.up_blocks del self.control_model.conv_norm_out del self.control_model.conv_out @@ -377,7 +377,7 @@ class ControlNetXSModel(ModelMixin, ConfigMixin): controlnet_conditioning_channel_order (`str`, defaults to `"rgb"`): The channel order of conditional image. Will convert to `rgb` if it's `bgr`. learn_embedding (`bool`, defaults to `False`): - Wether to use time embedding of the control model. If yes, the time embedding is a linear interpolation + Whether to use time embedding of the control model. If yes, the time embedding is a linear interpolation of the time embeddings of the control and base model with interpolation parameter `time_embedding_mix**3`. time_embedding_mix (`float`, defaults to 1.0): diff --git a/modules/devices.py b/modules/devices.py index 76ee3ef4f..438c12028 100644 --- a/modules/devices.py +++ b/modules/devices.py @@ -337,7 +337,7 @@ def test_fp16(): return fp16_ok elif backend == 'rocm': # gfx1102 (RX 7600, 7500, 7650 and 7700S) causes segfaults with fp16 - # agent can be overriden to gfx1100 to get gfx1102 working with ROCm so check the gpu name as well + # agent can be overridden to gfx1100 to get gfx1102 working with ROCm so check the gpu name as well agent = get_hip_agent() agent_name = getattr(torch.cuda.get_device_properties(device), "name", "AMD Radeon RX 0000") if agent.gfx_version == 0x1102 or (agent.gfx_version == 0x1100 and any(i in agent_name for i in ("7600", "7500", "7650", "7700S"))): diff --git a/modules/extra_networks.py b/modules/extra_networks.py index b400e6050..89acf5a4e 100644 --- a/modules/extra_networks.py +++ b/modules/extra_networks.py @@ -62,7 +62,7 @@ class ExtraNetwork: Called by processing on every run. Whatever the extra network is meant to do should be activated here. Passes arguments related to this extra network in params_list. User passes arguments by specifying this in his prompt: Where name matches the name of this ExtraNetwork object, and arg1:arg2:arg3 are any natural number of text arguments separated by colon. - Even if the user does not mention this ExtraNetwork in his prompt, the call will stil be made, with empty params_list - in this case, all effects of this extra networks should be disabled. + Even if the user does not mention this ExtraNetwork in his prompt, the call will still be made, with empty params_list - in this case, all effects of this extra networks should be disabled. Can be called multiple times before deactivate() - each new call should override the previous call completely. For example, if this ExtraNetwork's name is 'hypernet' and user's prompt is: > "1girl, " diff --git a/modules/extras.py b/modules/extras.py index 24df8f9d0..de00e8cd4 100644 --- a/modules/extras.py +++ b/modules/extras.py @@ -173,7 +173,7 @@ def run_modelmerger(id_task, **kwargs): # pylint: disable=unused-argument _, extension = os.path.splitext(output_modelname) if os.path.exists(output_modelname) and not kwargs.get("overwrite", False): - return [*[gr.Dropdown.update(choices=sd_models.checkpoint_titles()) for _ in range(4)], f"Model alredy exists: {output_modelname}"] + return [*[gr.Dropdown.update(choices=sd_models.checkpoint_titles()) for _ in range(4)], f"Model already exists: {output_modelname}"] if extension.lower() == ".safetensors": safetensors.torch.save_file(theta_0, output_modelname, metadata=metadata) else: diff --git a/modules/face/instantid_model.py b/modules/face/instantid_model.py index be17b709a..3ce37ed0b 100644 --- a/modules/face/instantid_model.py +++ b/modules/face/instantid_model.py @@ -704,7 +704,7 @@ class StableDiffusionXLInstantIDPipeline(StableDiffusionXLControlNetPipeline): callback_on_step_end_tensor_inputs (`List`, *optional*): The list of tensor inputs for the `callback_on_step_end` function. The tensors specified in the list will be passed as `callback_kwargs` argument. You will only be able to include variables listed in the - `._callback_tensor_inputs` attribute of your pipeine class. + `._callback_tensor_inputs` attribute of your pipeline class. Examples: @@ -990,7 +990,7 @@ class StableDiffusionXLInstantIDPipeline(StableDiffusionXLControlNetPipeline): ) if guess_mode and self.do_classifier_free_guidance: - # Infered ControlNet only for the conditional batch. + # Inferred ControlNet only for the conditional batch. # To apply the output of ControlNet to both the unconditional and conditional batches, # add 0 to the unconditional batch to keep it unchanged. down_block_res_samples = [torch.cat([torch.zeros_like(d), d]) for d in down_block_res_samples] diff --git a/modules/files_cache.py b/modules/files_cache.py index b7b5a28f7..9c0923d43 100644 --- a/modules/files_cache.py +++ b/modules/files_cache.py @@ -64,7 +64,7 @@ class Directory(Directory): # pylint: disable=E0102 return self def _update(self, source:Directory) -> None: - assert not source.path or source.path == self.path, f'When updating a directory, the paths must match. Attemped to update Directory `{self.path}` with `{source.path}`' + assert not source.path or source.path == self.path, f'When updating a directory, the paths must match. Attempted to update Directory `{self.path}` with `{source.path}`' for dead_path in self.directories: if dead_path not in source.directories: delete_cached_directory(dead_path) diff --git a/modules/flash_attn_triton_amd/fwd_prefill.py b/modules/flash_attn_triton_amd/fwd_prefill.py index 074df4132..d31c5ccb4 100644 --- a/modules/flash_attn_triton_amd/fwd_prefill.py +++ b/modules/flash_attn_triton_amd/fwd_prefill.py @@ -550,7 +550,7 @@ def attention_prefill_forward_triton_impl( dropout_mask = None scores_strides = (0, 0, 0, 0) - # stores LSE the log of the normalization constant / sum of expoential score(unnormalzied probablities) + # stores LSE the log of the normalization constant / sum of exponential score(unnormalzied probabilities) if is_varlen: softmax_lse = torch.zeros((q.shape[0], nheads_q), device=q.device, dtype=torch.float32) stride_lse_m, stride_lse_h = softmax_lse.stride() diff --git a/modules/ggml/__init__.py b/modules/ggml/__init__.py index c36c5a710..e85719dfd 100644 --- a/modules/ggml/__init__.py +++ b/modules/ggml/__init__.py @@ -17,7 +17,7 @@ def install_gguf(): scripts_dir = os.path.join(os.path.dirname(gguf.__file__), '..', 'scripts') if os.path.exists(scripts_dir): os.rename(scripts_dir, scripts_dir + str(time.time())) - # monkey patch transformers/diffusers so they detect newly installed gguf pacakge correctly + # monkey patch transformers/diffusers so they detect newly installed gguf package correctly ver = importlib.metadata.version('gguf') transformers.utils.import_utils._is_gguf_available = True # pylint: disable=protected-access transformers.utils.import_utils._gguf_version = ver # pylint: disable=protected-access diff --git a/modules/hidiffusion/hidiffusion.py b/modules/hidiffusion/hidiffusion.py index 73860e2a1..694888189 100644 --- a/modules/hidiffusion/hidiffusion.py +++ b/modules/hidiffusion/hidiffusion.py @@ -277,7 +277,7 @@ def make_diffusers_cross_attn_down_block(block_class: Type[torch.nn.Module]) -> T1_ratio = 0 T1_start = 0 T1_end = 0 - T1 = 0 # to avoid confict with sdxl-turbo + T1 = 0 # to avoid conflict with sdxl-turbo max_timestep = current_steps def forward( @@ -323,7 +323,7 @@ def make_diffusers_cross_attn_down_block(block_class: Type[torch.nn.Module]) -> if self.aggressive_raunet: self.T1_start = int(aggressive_step/50 * self.max_timestep) self.T1_end = int(self.max_timestep * self.T1_ratio) - self.T1 = 0 # to avoid confict with sdxl-turbo + self.T1 = 0 # to avoid conflict with sdxl-turbo else: self.T1 = int(self.max_timestep * self.T1_ratio) @@ -410,7 +410,7 @@ def make_diffusers_cross_attn_up_block(block_class: Type[torch.nn.Module]) -> Ty T1_ratio = 0 T1_start = 0 T1_end = 0 - T1 = 0 # to avoid confict with sdxl-turbo + T1 = 0 # to avoid conflict with sdxl-turbo max_timestep = 50 def forward( @@ -463,7 +463,7 @@ def make_diffusers_cross_attn_up_block(block_class: Type[torch.nn.Module]) -> Ty if self.aggressive_raunet: self.T1_start = int(aggressive_step/50 * self.max_timestep) self.T1_end = int(self.max_timestep * self.T1_ratio) - self.T1 = 0 # to avoid confict with sdxl-turbo + self.T1 = 0 # to avoid conflict with sdxl-turbo else: self.T1 = int(self.max_timestep * self.T1_ratio) diff --git a/modules/hidiffusion/hidiffusion_controlnet.py b/modules/hidiffusion/hidiffusion_controlnet.py index ef7ce0457..d7c30fc39 100644 --- a/modules/hidiffusion/hidiffusion_controlnet.py +++ b/modules/hidiffusion/hidiffusion_controlnet.py @@ -709,7 +709,7 @@ def make_diffusers_sdxl_contrtolnet_ppl(block_class): ) if guess_mode and self.do_classifier_free_guidance: - # Infered ControlNet only for the conditional batch. + # Inferred ControlNet only for the conditional batch. # To apply the output of ControlNet to both the unconditional and conditional batches, # add 0 to the unconditional batch to keep it unchanged. down_block_res_samples = [torch.cat([torch.zeros_like(d), d]) for d in down_block_res_samples] diff --git a/modules/image/grid.py b/modules/image/grid.py index ef6095f4d..455d1c8d1 100644 --- a/modules/image/grid.py +++ b/modules/image/grid.py @@ -32,7 +32,7 @@ def check_grid_size(imgs: list[Image.Image] | list[list[Image.Image]] | None): mp = round(mp / 1000000) ok = mp <= shared.opts.img_max_size_mp if not ok: - log.warning(f'Maximum image size exceded: size={mp} maximum={shared.opts.img_max_size_mp} MPixels') + log.warning(f'Maximum image size exceeded: size={mp} maximum={shared.opts.img_max_size_mp} MPixels') return ok diff --git a/modules/lora/lora_convert.py b/modules/lora/lora_convert.py index 3a0ec7222..8af280f98 100644 --- a/modules/lora/lora_convert.py +++ b/modules/lora/lora_convert.py @@ -477,7 +477,7 @@ def _convert_kohya_sd3_lora_to_diffusers(state_dict): def assign_network_names_to_compvis_modules(sd_model): if sd_model is None: return - sd_model = getattr(shared.sd_model, "pipe", shared.sd_model) # wrapped model compatiblility + sd_model = getattr(shared.sd_model, "pipe", shared.sd_model) # wrapped model compatibility network_layer_mapping = {} if hasattr(sd_model, 'text_encoder') and sd_model.text_encoder is not None: for name, module in sd_model.text_encoder.named_modules(): diff --git a/modules/lora/lora_extract.py b/modules/lora/lora_extract.py index 19a55d209..1eb8a69bd 100644 --- a/modules/lora/lora_extract.py +++ b/modules/lora/lora_extract.py @@ -191,7 +191,7 @@ def make_lora(fn, maxrank, auto_rank, rank_ratio, modules, overwrite): submodel = getattr(shared.sd_model, sub, None) if submodel is not None: modules = submodel.named_modules() - task = progress.add_task(description=f"{sub} exctract", total=len(list(modules))) + task = progress.add_task(description=f"{sub} extract", total=len(list(modules))) for _name, module in submodel.named_modules(): progress.update(task, advance=1) if not hasattr(module, "svdhandler"): diff --git a/modules/lora/lyco_helpers.py b/modules/lora/lyco_helpers.py index ac4f2419f..bc4610f29 100644 --- a/modules/lora/lyco_helpers.py +++ b/modules/lora/lyco_helpers.py @@ -28,9 +28,9 @@ def factorization(dimension: int, factor:int=-1) -> tuple[int, int]: second value is higher or equal than first value. In LoRA with Kroneckor Product, first value is a value for weight scale. - secon value is a value for weight. + second value is a value for weight. - Becuase of non-commutative property, A⊗B ≠ B⊗A. Meaning of two matrices is slightly different. + Because of non-commutative property, A⊗B ≠ B⊗A. Meaning of two matrices is slightly different. examples factor diff --git a/modules/merging/merge.py b/modules/merging/merge.py index 58db36a1a..5ab33fe8f 100644 --- a/modules/merging/merge.py +++ b/modules/merging/merge.py @@ -20,7 +20,7 @@ from modules.merging.merge_PermSpec_SDXL import sdxl_permutation_spec ########################################################## # Files in modules.merging are heavily modified # versions of sd-meh by @s1dxl used with his blessing -# orginal code can be found @ https://github.com/s1dlx/meh +# original code can be found @ https://github.com/s1dlx/meh ########################################################## MAX_TOKENS = 77 diff --git a/modules/merging/merge_methods.py b/modules/merging/merge_methods.py index 256baeb05..5117579a9 100644 --- a/modules/merging/merge_methods.py +++ b/modules/merging/merge_methods.py @@ -112,7 +112,7 @@ def euclidean_add_difference(a: Tensor, b: Tensor, c: Tensor, alpha: float, **kw def multiply_difference(a: Tensor, b: Tensor, c: Tensor, alpha: float, beta: float, **kwargs) -> Tensor: # pylint: disable=unused-argument """ - Similar to Add Difference but with geometric mean instead of arithmatic mean + Similar to Add Difference but with geometric mean instead of arithmetic mean """ diff_a = torch.pow(torch.abs(a.float() - c), (1 - alpha)) diff_b = torch.pow(torch.abs(b.float() - c), alpha) diff --git a/modules/postprocess/icbi.py b/modules/postprocess/icbi.py index e65706069..43b1cefb7 100644 --- a/modules/postprocess/icbi.py +++ b/modules/postprocess/icbi.py @@ -17,7 +17,7 @@ def icbi(IM,ZK = 1,SZ = 8,PF = 1,ST = 20,TM = 100,TC = 50,SC = 1,TS = 100,AL = 1 :param PF: Potential to be minimized (default:1) :param ST: Maximum number of iterations (default:20) :param TM: Maximum edge step (default:100) - :param TC: Edge continuity threshold (deafult:50). + :param TC: Edge continuity threshold (default:50). :param SC: Stopping criterion: 1 = change under threshold, 0 = ST iterations (default:1). :param TS: Threshold on image change for stopping iterations (default:100). :param AL: Weight for Curvature Continuity energy (default:1.0). diff --git a/modules/postprocess/swinir_model_arch_v2.py b/modules/postprocess/swinir_model_arch_v2.py index 00577c8ba..0c4b5c895 100644 --- a/modules/postprocess/swinir_model_arch_v2.py +++ b/modules/postprocess/swinir_model_arch_v2.py @@ -193,7 +193,7 @@ class SwinTransformerBlock(nn.Module): r""" Swin Transformer Block. Args: dim (int): Number of input channels. - input_resolution (tuple[int]): Input resulotion. + input_resolution (tuple[int]): Input resolution. num_heads (int): Number of attention heads. window_size (int): Window size. shift_size (int): Shift size for SW-MSA. diff --git a/modules/postprocess/yolo.py b/modules/postprocess/yolo.py index b3cbe7db0..eabca9394 100644 --- a/modules/postprocess/yolo.py +++ b/modules/postprocess/yolo.py @@ -436,7 +436,7 @@ class YoloRestorer(Detailer): pc.init_images = [image] pc.image_mask = [item.mask] pc.overlay_images = [] - # explictly disable for detailer pass + # explicitly disable for detailer pass pc.enable_hr = False pc.do_not_save_samples = True pc.do_not_save_grid = True diff --git a/modules/processing_diffusers.py b/modules/processing_diffusers.py index 4fcc4460f..914200c23 100644 --- a/modules/processing_diffusers.py +++ b/modules/processing_diffusers.py @@ -297,7 +297,7 @@ def process_hires(p: processing.StableDiffusionProcessing, output): output.images = processing_vae.vae_decode(latents=output.images, model=shared.sd_model, vae_type=p.vae_type, output_type='pil', width=p.width, height=p.height) if p.is_control and hasattr(p, 'task_args') and p.task_args.get('image', None) is not None: if hasattr(shared.sd_model, "vae") and output.images is not None and len(output.images) > 0: - output.images = processing_vae.vae_decode(latents=output.images, model=shared.sd_model, vae_type=p.vae_type, output_type='pil', width=p.hr_upscale_to_x, height=p.hr_upscale_to_y) # controlnet cannnot deal with latent input + output.images = processing_vae.vae_decode(latents=output.images, model=shared.sd_model, vae_type=p.vae_type, output_type='pil', width=p.hr_upscale_to_x, height=p.hr_upscale_to_y) # controlnet cannot deal with latent input update_sampler(p, shared.sd_model, second_pass=True) orig_denoise = p.denoising_strength p.denoising_strength = strength diff --git a/modules/prompt_parser.py b/modules/prompt_parser.py index 26259d7b1..308f28741 100644 --- a/modules/prompt_parser.py +++ b/modules/prompt_parser.py @@ -270,7 +270,7 @@ def reconstruct_multicond_batch(c: MulticondLearnedConditioning, current_step): conds_for_batch.append((len(tensors), composable_prompt.weight)) tensors.append(composable_prompt.schedules[target_index].cond) conds_list.append(conds_for_batch) - # if prompts have wildly different lengths above the limit we'll get tensors fo different shapes and won't be able to torch.stack them. So this fixes that. + # if prompts have wildly different lengths above the limit we'll get tensors of different shapes and won't be able to torch.stack them. So this fixes that. token_count = max([x.shape[0] for x in tensors]) for i in range(len(tensors)): if tensors[i].shape[0] != token_count: diff --git a/modules/prompt_parser_xhinker.py b/modules/prompt_parser_xhinker.py index cce59d262..344f0778c 100644 --- a/modules/prompt_parser_xhinker.py +++ b/modules/prompt_parser_xhinker.py @@ -41,7 +41,7 @@ def get_prompts_tokens_with_weights(clip_tokenizer: CLIPTokenizer, prompt: str | text_tokens (list) A list contains token ids text_weight (list) - A list contains the correspodent weight of token ids + A list contains the correspondent weight of token ids Example: import torch diff --git a/modules/rembg/ben2_model.py b/modules/rembg/ben2_model.py index fe38c571e..4b9649baf 100644 --- a/modules/rembg/ben2_model.py +++ b/modules/rembg/ben2_model.py @@ -437,7 +437,7 @@ class SwinTransformer(nn.Module): https://arxiv.org/pdf/2103.14030 Args: pretrain_img_size (int): Input image size for training the pretrained model, - used in absolute postion embedding. Default 224. + used in absolute position embedding. Default 224. patch_size (int | tuple(int)): Patch size. Default: 4. in_chans (int): Number of input image channels. Default: 3. embed_dim (int): Number of linear projection output channels. Default: 96. diff --git a/modules/rife/ssim.py b/modules/rife/ssim.py index 8233ec8f3..fe0a39c68 100644 --- a/modules/rife/ssim.py +++ b/modules/rife/ssim.py @@ -139,7 +139,7 @@ def msssim(img1, img2, window_size=11, size_average=True, val_range=None, normal return output -# Classes to re-use window +# Classes to reuse window class SSIM(torch.nn.Module): def __init__(self, window_size=11, size_average=True, val_range=None): super().__init__() diff --git a/modules/schedulers/scheduler_dc.py b/modules/schedulers/scheduler_dc.py index 4a352777a..66a4458d4 100644 --- a/modules/schedulers/scheduler_dc.py +++ b/modules/schedulers/scheduler_dc.py @@ -225,7 +225,7 @@ class DCSolverMultistepScheduler(SchedulerMixin, ConfigMixin): @property def step_index(self): """ - The index counter for current timestep. It will increae 1 after each scheduler step. + The index counter for current timestep. It will increase 1 after each scheduler step. """ return self._step_index @@ -400,7 +400,7 @@ class DCSolverMultistepScheduler(SchedulerMixin, ConfigMixin): if len(args) > 1: sample = args[1] else: - raise ValueError("missing `sample` as a required keyward argument") + raise ValueError("missing `sample` as a required keyword argument") if timestep is not None: deprecate( "timesteps", @@ -474,12 +474,12 @@ class DCSolverMultistepScheduler(SchedulerMixin, ConfigMixin): if len(args) > 1: sample = args[1] else: - raise ValueError(" missing `sample` as a required keyward argument") + raise ValueError(" missing `sample` as a required keyword argument") if order is None: if len(args) > 2: order = args[2] else: - raise ValueError(" missing `order` as a required keyward argument") + raise ValueError(" missing `order` as a required keyword argument") if prev_timestep is not None: deprecate( "prev_timestep", @@ -606,17 +606,17 @@ class DCSolverMultistepScheduler(SchedulerMixin, ConfigMixin): if len(args) > 1: last_sample = args[1] else: - raise ValueError(" missing`last_sample` as a required keyward argument") + raise ValueError(" missing`last_sample` as a required keyword argument") if this_sample is None: if len(args) > 2: this_sample = args[2] else: - raise ValueError(" missing`this_sample` as a required keyward argument") + raise ValueError(" missing`this_sample` as a required keyword argument") if order is None: if len(args) > 3: order = args[3] else: - raise ValueError(" missing`order` as a required keyward argument") + raise ValueError(" missing`order` as a required keyword argument") if this_timestep is not None: deprecate( "this_timestep", diff --git a/modules/schedulers/scheduler_tdd.py b/modules/schedulers/scheduler_tdd.py index f7939f012..24ef2024a 100644 --- a/modules/schedulers/scheduler_tdd.py +++ b/modules/schedulers/scheduler_tdd.py @@ -81,7 +81,7 @@ class TDDScheduler(DPMSolverSinglestepScheduler): if algorithm_type != "dpmsolver++" and final_sigmas_type == "zero": raise ValueError( - f"`final_sigmas_type` {final_sigmas_type} is not supported for `algorithm_type` {algorithm_type}. Please chooose `sigma_min` instead." + f"`final_sigmas_type` {final_sigmas_type} is not supported for `algorithm_type` {algorithm_type}. Please choose `sigma_min` instead." ) # setable values @@ -288,7 +288,7 @@ class TDDScheduler(DPMSolverSinglestepScheduler): if len(args) > 2: sample = args[2] else: - raise ValueError(" missing `sample` as a required keyward argument") + raise ValueError(" missing `sample` as a required keyword argument") if timestep is not None: deprecate( "timesteps", @@ -327,7 +327,7 @@ class TDDScheduler(DPMSolverSinglestepScheduler): if len(args) > 2: sample = args[2] else: - raise ValueError(" missing `sample` as a required keyward argument") + raise ValueError(" missing `sample` as a required keyword argument") if timestep_list is not None: deprecate( "timestep_list", @@ -404,12 +404,12 @@ class TDDScheduler(DPMSolverSinglestepScheduler): if len(args) > 2: sample = args[2] else: - raise ValueError(" missing`sample` as a required keyward argument") + raise ValueError(" missing`sample` as a required keyword argument") if order is None: if len(args) > 3: order = args[3] else: - raise ValueError(" missing `order` as a required keyward argument") + raise ValueError(" missing `order` as a required keyword argument") if timestep_list is not None: deprecate( "timestep_list", @@ -465,7 +465,7 @@ class TDDScheduler(DPMSolverSinglestepScheduler): if len(args) > 1: sample = args[1] else: - raise ValueError("missing `sample` as a required keyward argument") + raise ValueError("missing `sample` as a required keyword argument") if timestep is not None: deprecate( "timesteps", diff --git a/modules/schedulers/scheduler_unipc_flowmatch.py b/modules/schedulers/scheduler_unipc_flowmatch.py index f94c4cab2..1da8dc49e 100644 --- a/modules/schedulers/scheduler_unipc_flowmatch.py +++ b/modules/schedulers/scheduler_unipc_flowmatch.py @@ -306,7 +306,7 @@ class FlowUniPCMultistepScheduler(SchedulerMixin, ConfigMixin): sample = args[1] else: raise ValueError( - "missing `sample` as a required keyward argument") + "missing `sample` as a required keyword argument") if timestep is not None: deprecate( "timesteps", @@ -381,13 +381,13 @@ class FlowUniPCMultistepScheduler(SchedulerMixin, ConfigMixin): sample = args[1] else: raise ValueError( - " missing `sample` as a required keyward argument") + " missing `sample` as a required keyword argument") if order is None: if len(args) > 2: order = args[2] else: raise ValueError( - " missing `order` as a required keyward argument") + " missing `order` as a required keyword argument") if prev_timestep is not None: deprecate( "prev_timestep", @@ -520,19 +520,19 @@ class FlowUniPCMultistepScheduler(SchedulerMixin, ConfigMixin): last_sample = args[1] else: raise ValueError( - " missing`last_sample` as a required keyward argument") + " missing`last_sample` as a required keyword argument") if this_sample is None: if len(args) > 2: this_sample = args[2] else: raise ValueError( - " missing`this_sample` as a required keyward argument") + " missing`this_sample` as a required keyword argument") if order is None: if len(args) > 3: order = args[3] else: raise ValueError( - " missing`order` as a required keyward argument") + " missing`order` as a required keyword argument") if this_timestep is not None: deprecate( "this_timestep", diff --git a/modules/sd_checkpoint.py b/modules/sd_checkpoint.py index 00f94f3b3..2f90f0d8c 100644 --- a/modules/sd_checkpoint.py +++ b/modules/sd_checkpoint.py @@ -214,13 +214,13 @@ def get_closest_checkpoint_match(s: str) -> CheckpointInfo | None: # direct hf url if s.startswith('https://huggingface.co/'): model_name = s.replace('https://huggingface.co/', '') - checkpoint_info = CheckpointInfo(model_name) # create a virutal model info + checkpoint_info = CheckpointInfo(model_name) # create a virtual model info checkpoint_info.type = 'huggingface' log.debug(f'Seach model: name="{s}" matched="{checkpoint_info.path}" type=huggingface') return checkpoint_info if s.startswith('huggingface/'): model_name = s.replace('huggingface/', '') - checkpoint_info = CheckpointInfo(model_name) # create a virutal model info + checkpoint_info = CheckpointInfo(model_name) # create a virtual model info checkpoint_info.type = 'huggingface' return checkpoint_info diff --git a/modules/sd_offload.py b/modules/sd_offload.py index 80ca7fe58..3dd931b1c 100644 --- a/modules/sd_offload.py +++ b/modules/sd_offload.py @@ -458,7 +458,7 @@ def apply_balanced_offload_to_module(module, op="apply", force:bool=False): module.balanced_offload_max_memory = max_memory module.offload_post = shared.sd_model_type in offload_post and module_name.startswith("text_encoder") if shared.opts.layerwise_quantization or getattr(module, 'quantization_method', None) == 'LayerWise': - model_quant.apply_layerwise(module, quiet=True) # need to reapply since hooks were removed/readded + model_quant.apply_layerwise(module, quiet=True) # need to reapply since hooks were removed/re-added devices.torch_gc(fast=True, force=True, reason='offload') diff --git a/modules/sdnq/common.py b/modules/sdnq/common.py index 04fc6ee4d..ff9515ce3 100644 --- a/modules/sdnq/common.py +++ b/modules/sdnq/common.py @@ -141,7 +141,7 @@ dtype_dict = { "float3_e2m0fn": {"min": -4.0, "max": 4.0, "num_bits": 3, "sign": 1, "exponent": 2, "mantissa": 0, "min_normal": 1.0, "target_dtype": "fp3", "torch_dtype": torch.float32, "storage_dtype": torch.uint8, "is_unsigned": False, "is_integer": False, "is_packed": True}, # "float2_e1m0fn": {"min": -2.0, "max": 2.0, "num_bits": 2, "sign": 1, "exponent": 1, "mantissa": 0, "min_normal": 2.0, "target_dtype": "fp2", "torch_dtype": torch.float32, "storage_dtype": torch.uint8, "is_unsigned": False, "is_integer": False, "is_packed": True}, - ### Custom Usigned Floats + ### Custom Unsigned Floats "float16_e1m15fnu": {"min": 0, "max": 3.99993896484375, "num_bits": 16, "sign": 0, "exponent": 1, "mantissa": 15, "min_normal": 1.000030517578125, "target_dtype": "fp16", "torch_dtype": torch.float32, "storage_dtype": torch.uint16, "is_unsigned": True, "is_integer": False, "is_packed": True}, "float16_e2m14fnu": {"min": 0, "max": 7.999755859375, "num_bits": 16, "sign": 0, "exponent": 2, "mantissa": 14, "min_normal": 0.500030517578125, "target_dtype": "fp16", "torch_dtype": torch.float32, "storage_dtype": torch.uint16, "is_unsigned": True, "is_integer": False, "is_packed": True}, "float16_e3m13fnu": {"min": 0, "max": 31.998046875, "num_bits": 16, "sign": 0, "exponent": 3, "mantissa": 13, "min_normal": 0.1250152587890625, "target_dtype": "fp16", "torch_dtype": torch.float32, "storage_dtype": torch.uint16, "is_unsigned": True, "is_integer": False, "is_packed": True}, diff --git a/modules/sdnq/file_loader.py b/modules/sdnq/file_loader.py index dc9317130..d5fe53574 100644 --- a/modules/sdnq/file_loader.py +++ b/modules/sdnq/file_loader.py @@ -46,7 +46,7 @@ def load_streamer(files: list[str], state_dict: dict | None = None, key_mapping: def load_files(files: list[str], state_dict: dict | None = None, key_mapping: dict | None = None, device: torch.device = "cpu", method: str | None = None) -> dict: - # note: files is list-of-files within a module for chunked loading, not accross model + # note: files is list-of-files within a module for chunked loading, not across model if isinstance(files, str): files = [files] if method is None: diff --git a/modules/sdnq/quantizer.py b/modules/sdnq/quantizer.py index 2b84e788d..fc223c39a 100644 --- a/modules/sdnq/quantizer.py +++ b/modules/sdnq/quantizer.py @@ -541,13 +541,13 @@ class SDNQQuantizer(DiffusersQuantizer, HfQuantizer): def check_quantized_param(self, *args, **kwargs) -> bool: """ - needed for transformers compatibilty, returns self.check_if_quantized_param + needed for transformers compatibility, returns self.check_if_quantized_param """ return self.check_if_quantized_param(*args, **kwargs) def param_needs_quantization(self, model, param_name: str, *args, **kwargs) -> bool: """ - needed for transformers compatibilty, returns self.check_if_quantized_param + needed for transformers compatibility, returns self.check_if_quantized_param """ return self.check_if_quantized_param(model, None, param_name, *args, **kwargs) @@ -685,7 +685,7 @@ class SDNQQuantizer(DiffusersQuantizer, HfQuantizer): def get_cuda_warm_up_factor(self): """ - needed for transformers compatibilty, returns self.get_accelerator_warm_up_factor + needed for transformers compatibility, returns self.get_accelerator_warm_up_factor """ return self.get_accelerator_warm_up_factor() diff --git a/modules/seedvr/rotary_embedding.py b/modules/seedvr/rotary_embedding.py index 021ae9e52..0e33d3ffa 100644 --- a/modules/seedvr/rotary_embedding.py +++ b/modules/seedvr/rotary_embedding.py @@ -15,9 +15,9 @@ def exists(val): def default(val, d): return val if exists(val) else d -# broadcat, as tortoise-tts was using it +# broadcast, as tortoise-tts was using it -def broadcat(tensors, dim = -1): +def broadcast(tensors, dim = -1): broadcasted_tensors = broadcast_tensors(*tensors) return torch.cat(broadcasted_tensors, dim = dim) diff --git a/modules/seedvr/src/common/diffusion/samplers/base.py b/modules/seedvr/src/common/diffusion/samplers/base.py index 8e65f1989..7d476a093 100644 --- a/modules/seedvr/src/common/diffusion/samplers/base.py +++ b/modules/seedvr/src/common/diffusion/samplers/base.py @@ -63,7 +63,7 @@ class Sampler(ABC): f: Callable[[SamplerModelArgs], torch.Tensor], ) -> torch.Tensor: """ - Generate a new sample given the the intial sample x and score function f. + Generate a new sample given the the initial sample x and score function f. """ def get_next_timestep( diff --git a/modules/seedvr/src/common/distributed/ops.py b/modules/seedvr/src/common/distributed/ops.py index 1cbade014..593a5d427 100644 --- a/modules/seedvr/src/common/distributed/ops.py +++ b/modules/seedvr/src/common/distributed/ops.py @@ -193,10 +193,10 @@ def gather_seq_scatter_heads_qkv( restore_shape: bool = True, ): """ - A func to sync splited qkv tensor + A func to sync split qkv tensor qkv_tensor: the tensor we want to do alltoall with. The last dim must be the projection_idx, which we will split into 3 part. After - spliting, the gather idx will be projecttion_idx + 1 + splitting, the gather idx will be projecttion_idx + 1 seq_dim: gather_dim for all2all comm restore_shape: if True, output will has the same shape length as input """ diff --git a/modules/taesd/hybrid_small.py b/modules/taesd/hybrid_small.py index 964541d2c..3410a9cbc 100644 --- a/modules/taesd/hybrid_small.py +++ b/modules/taesd/hybrid_small.py @@ -62,7 +62,7 @@ class AutoencoderSmall(ModelMixin, ConfigMixin, FromOriginalModelMixin): Synthesis with Latent Diffusion Models](https://arxiv.org/abs/2112.10752) paper. force_upcast (`bool`, *optional*, default to `True`): If enabled it will force the VAE to run in float32 for high image resolution pipelines, such as SD-XL. VAE - can be fine-tuned / trained to a lower range without loosing too much precision in which case + can be fine-tuned / trained to a lower range without losing too much precision in which case `force_upcast` can be set to `False` - see: https://huggingface.co/madebyollin/sdxl-vae-fp16-fix """ diff --git a/modules/textual_inversion.py b/modules/textual_inversion.py index de2d22278..de7283810 100644 --- a/modules/textual_inversion.py +++ b/modules/textual_inversion.py @@ -98,7 +98,7 @@ def get_text_encoders(): def deref_tokenizers(tokens, tokenizers): """ - Bundled embeddings may have the same name as a seperately loaded embedding, or there may be multiple LoRA with + Bundled embeddings may have the same name as a separately loaded embedding, or there may be multiple LoRA with differing numbers of vectors. By editing the AddedToken objects, and deleting the dict keys pointing to them, we can ensure that a smaller embedding will not get tokenized as itself, plus the remaining vectors of the previous. """ @@ -212,7 +212,7 @@ class DirWithTextualInversionEmbeddings: def convert_embedding(tensor, text_encoder, text_encoder_2): """ Given a tensor of shape (b, embed_dim) and two text encoders whose tokenizers match, return a tensor with - approximately mathcing meaning, or padding if the input tensor is dissimilar to any frozen text embed + approximately matching meaning, or padding if the input tensor is dissimilar to any frozen text embed """ with torch.no_grad(): vectors = [] @@ -256,7 +256,7 @@ class EmbeddingDatabase: def load_diffusers_embedding(self, filename: str | list[str] | None = None, data: dict | None = None): """ - File names take precidence over bundled embeddings passed as a dict. + File names take precedence over bundled embeddings passed as a dict. Bundled embeddings are automatically set to overwrite previous embeddings. """ with limit_errors("load_diffusers_embedding") as elimit: diff --git a/modules/todo/todo_merge.py b/modules/todo/todo_merge.py index bc03b96c7..158bc36b1 100644 --- a/modules/todo/todo_merge.py +++ b/modules/todo/todo_merge.py @@ -245,7 +245,7 @@ def bipartite_soft_matching_random2d(metric: torch.Tensor, class TokenMergeAttentionProcessor: def __init__(self): - # priortize torch2's flash attention, if not fall back to xformers then regular attention + # prioritize torch2's flash attention, if not fall back to xformers then regular attention if torch2_is_available: self.attn_method = "torch2" elif xformers_is_available: diff --git a/modules/ui_components.py b/modules/ui_components.py index 0b4ad86ed..a839376f6 100644 --- a/modules/ui_components.py +++ b/modules/ui_components.py @@ -91,7 +91,7 @@ class InputAccordion(gr.Checkbox): # unused return "checkbox" -class ResizeHandleRow(gr.Row): # unusued +class ResizeHandleRow(gr.Row): # unused def __init__(self, **kwargs): super().__init__(**kwargs) self.elem_classes.append("resize-handle-row") diff --git a/modules/ui_extensions.py b/modules/ui_extensions.py index 0b6ac3e97..826f43ac1 100644 --- a/modules/ui_extensions.py +++ b/modules/ui_extensions.py @@ -474,7 +474,7 @@ def create_ui(): list_extensions() gr.HTML('''

Extension list

- - Refesh extension list to download latest list with status
+ - Refresh extension list to download latest list with status
- Check status of an extension by looking at status icon before installing it
- After any operation such as install/uninstall or enable/disable, please restart the server
''') diff --git a/package.json b/package.json index f1613de03..d03eaad1b 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "pylint": ". venv/bin/activate && pylint *.py modules/ pipelines/ scripts/ extensions-builtin/ | grep -v '^*'", "pyright": ". venv/bin/activate && pyright --threads 4", "ty": ". venv/bin/activate && ty check --force-exclude", + "codespell": ". venv/bin/activate && codespell", "compile": ". venv/bin/activate && python test/test-compile.py" }, "devDependencies": { diff --git a/pipelines/bria/bria_pipeline.py b/pipelines/bria/bria_pipeline.py index 0c4d160d7..9d5cd324d 100644 --- a/pipelines/bria/bria_pipeline.py +++ b/pipelines/bria/bria_pipeline.py @@ -100,7 +100,7 @@ class BriaPipeline(FluxPipeline): self.image_processor = VaeImageProcessor(vae_scale_factor=self.vae_scale_factor) self.default_sample_size = 64 # due to patchify=> 128,128 => res of 1k,1k - # T5 is senstive to precision so we use the precision used for precompute and cast as needed + # T5 is sensitive to precision so we use the precision used for precompute and cast as needed for block in self.text_encoder.encoder.block: block.layer[-1].DenseReluDense.wo.to(dtype=torch.float32) @@ -384,7 +384,7 @@ class BriaPipeline(FluxPipeline): # 5. Prepare latent variables - num_channels_latents = self.transformer.config.in_channels // 4 # due to patch=2, we devide by 4 + num_channels_latents = self.transformer.config.in_channels // 4 # due to patch=2, we divide by 4 latents, latent_image_ids = self.prepare_latents( batch_size * num_images_per_prompt, num_channels_latents, @@ -427,7 +427,7 @@ class BriaPipeline(FluxPipeline): num_warmup_steps = max(len(timesteps) - num_inference_steps * self.scheduler.order, 0) self._num_timesteps = len(timesteps) - # Supprot different diffusers versions + # Support different diffusers versions if diffusers.__version__>='0.32.0': latent_image_ids=latent_image_ids[0] text_ids=text_ids[0] @@ -566,7 +566,7 @@ class BriaPipeline(FluxPipeline): def to(self, *args, **kwargs): DiffusionPipeline.to(self, *args, **kwargs) - # T5 is senstive to precision so we use the precision used for precompute and cast as needed + # T5 is sensitive to precision so we use the precision used for precompute and cast as needed for block in self.text_encoder.encoder.block: block.layer[-1].DenseReluDense.wo.to(dtype=torch.float32) diff --git a/pipelines/bria/bria_utils.py b/pipelines/bria/bria_utils.py index 5aed654c2..2047ba838 100644 --- a/pipelines/bria/bria_utils.py +++ b/pipelines/bria/bria_utils.py @@ -439,5 +439,5 @@ def get_lr_scheduler( num_warmup_steps=num_warmup_steps, num_training_steps=num_training_steps) - # Usign custom warmup+cnstant+decay scheduler + # Using custom warmup+cnstant+decay scheduler return get_cosine_schedule_with_warmup_and_decay(optimizer=optimizer, num_warmup_steps=num_warmup_steps, num_training_steps=num_training_steps, constant_steps=constant_steps) diff --git a/pipelines/hidream/qwen3_vl_transformers.py b/pipelines/hidream/qwen3_vl_transformers.py index 1abd7557f..a74d5ec68 100644 --- a/pipelines/hidream/qwen3_vl_transformers.py +++ b/pipelines/hidream/qwen3_vl_transformers.py @@ -1083,7 +1083,7 @@ class Qwen3VLModel(Qwen3VLPreTrainedModel): ) -> tuple[torch.Tensor, torch.Tensor]: """Different from the original implementation, Qwen3VL use timestamps rather than absolute time position ids.""" - # Since we use timestamps to seperate videos, like , the video_grid_thw should also be split + # Since we use timestamps to separate videos, like , the video_grid_thw should also be split if video_grid_thw is not None: video_grid_thw = torch.repeat_interleave(video_grid_thw, video_grid_thw[:, 0], dim=0) video_grid_thw[:, 0] = 1 diff --git a/pipelines/hidream/scheduler_flowunipc.py b/pipelines/hidream/scheduler_flowunipc.py index b2542517b..4ec4f8e3f 100644 --- a/pipelines/hidream/scheduler_flowunipc.py +++ b/pipelines/hidream/scheduler_flowunipc.py @@ -300,7 +300,7 @@ class FlowUniPCMultistepScheduler(SchedulerMixin, ConfigMixin): sample = args[1] else: raise ValueError( - "missing `sample` as a required keyward argument") + "missing `sample` as a required keyword argument") sigma = self.sigmas[self.step_index] _alpha_t, sigma_t = self._sigma_to_alpha_sigma_t(sigma) @@ -369,13 +369,13 @@ class FlowUniPCMultistepScheduler(SchedulerMixin, ConfigMixin): sample = args[1] else: raise ValueError( - " missing `sample` as a required keyward argument") + " missing `sample` as a required keyword argument") if order is None: if len(args) > 2: order = args[2] else: raise ValueError( - " missing `order` as a required keyward argument") + " missing `order` as a required keyword argument") model_output_list = self.model_outputs s0 = self.timestep_list[-1] @@ -502,19 +502,19 @@ class FlowUniPCMultistepScheduler(SchedulerMixin, ConfigMixin): last_sample = args[1] else: raise ValueError( - " missing`last_sample` as a required keyward argument") + " missing`last_sample` as a required keyword argument") if this_sample is None: if len(args) > 2: this_sample = args[2] else: raise ValueError( - " missing`this_sample` as a required keyward argument") + " missing`this_sample` as a required keyword argument") if order is None: if len(args) > 3: order = args[3] else: raise ValueError( - " missing`order` as a required keyward argument") + " missing`order` as a required keyword argument") model_output_list = self.model_outputs diff --git a/pipelines/meissonic/pipeline.py b/pipelines/meissonic/pipeline.py index 34b894081..9aca6ae75 100644 --- a/pipelines/meissonic/pipeline.py +++ b/pipelines/meissonic/pipeline.py @@ -136,7 +136,7 @@ class MeissonicPipeline(DiffusionPipeline): generation deterministic. latents (`torch.IntTensor`, *optional*): Pre-generated tokens representing latent vectors in `self.vqvae`, to be used as inputs for image - gneration. If not provided, the starting latents will be completely masked. + generation. If not provided, the starting latents will be completely masked. prompt_embeds (`torch.Tensor`, *optional*): Pre-generated text embeddings. Can be used to easily tweak text inputs (prompt weighting). If not provided, text embeddings are generated from the `prompt` input argument. A single vector from the diff --git a/pipelines/ultraflux/autoencoder_kl.py b/pipelines/ultraflux/autoencoder_kl.py index 5a47ba970..29b154d70 100644 --- a/pipelines/ultraflux/autoencoder_kl.py +++ b/pipelines/ultraflux/autoencoder_kl.py @@ -49,7 +49,7 @@ class AutoencoderUltraFluxKL(ModelMixin, ConfigMixin, FromOriginalModelMixin): Synthesis with Latent Diffusion Models](https://arxiv.org/abs/2112.10752) paper. force_upcast (`bool`, *optional*, default to `True`): If enabled it will force the VAE to run in float32 for high image resolution pipelines, such as SD-XL. VAE - can be fine-tuned / trained to a lower range without loosing too much precision in which case + can be fine-tuned / trained to a lower range without losing too much precision in which case `force_upcast` can be set to `False` - see: https://huggingface.co/madebyollin/sdxl-vae-fp16-fix stride (int, *optional*, defaults to 1): stride for VAE. """ diff --git a/pipelines/ultraflux/pipeline_flux.py b/pipelines/ultraflux/pipeline_flux.py index ff630f136..1c86afc43 100644 --- a/pipelines/ultraflux/pipeline_flux.py +++ b/pipelines/ultraflux/pipeline_flux.py @@ -684,7 +684,7 @@ class UltraFluxPipeline(DiffusionPipeline, FluxLoraLoaderMixin): noise_pred = self.transformer( hidden_states=latents, - # YiYi notes: divide it by 1000 for now because we scale it by 1000 in the transforme rmodel (we should not keep it but I want to keep the inputs same for the model for testing) + # YiYi notes: divide it by 1000 for now because we scale it by 1000 in the transformer model (we should not keep it but I want to keep the inputs same for the model for testing) timestep=timestep / 1000, guidance=guidance, pooled_projections=pooled_prompt_embeds, diff --git a/pipelines/vibe/vibe_sana_editing.py b/pipelines/vibe/vibe_sana_editing.py index 4f013a3dc..0842ca439 100644 --- a/pipelines/vibe/vibe_sana_editing.py +++ b/pipelines/vibe/vibe_sana_editing.py @@ -43,7 +43,7 @@ class SanaLinearAttnProcessor2_0: ) -> torch.Tensor: """Execute the forward pass of the SanaLinearAttnProcessor2_0. - We need that redifinition because default implementation do not take into account the attention mask. + We need that redefinition because default implementation do not take into account the attention mask. Args: attn (Attention): The attention object. diff --git a/pipelines/xomni/modeling_vit.py b/pipelines/xomni/modeling_vit.py index dfd8a1da1..50250eb11 100644 --- a/pipelines/xomni/modeling_vit.py +++ b/pipelines/xomni/modeling_vit.py @@ -62,7 +62,7 @@ def _no_grad_trunc_normal_(tensor, mean, std, a, b): def trunc_normal_(tensor, mean=0.0, std=1.0, a=-2.0, b=2.0): # type: (torch.Tensor, float, float, float, float) -> torch.Tensor r"""The original timm.models.layers.weight_init.trunc_normal_ can not handle bfloat16 yet, here we first - convert the tensor to float32, apply the trunc_normal_() in float32, and then convert it back to its orignal dtype. + convert the tensor to float32, apply the trunc_normal_() in float32, and then convert it back to its original dtype. Fills the input Tensor with values drawn from a truncated normal distribution. The values are effectively drawn from the normal distribution :math:`\mathcal{N}(\text{mean}, \text{std}^2)` with values outside :math:`[a, b]` redrawn until they are within @@ -289,7 +289,7 @@ class VisionTransformer(nn.Module): img_size: Input image size. patch_size: Patch size. in_chans: Number of image input channels. - num_classes: Mumber of classes for classification head. + num_classes: Number of classes for classification head. global_pool: Type of global pooling for final sequence (default: 'token'). embed_dim: Transformer embedding dimension. depth: Depth of transformer. diff --git a/pyproject.toml b/pyproject.toml index 4e52a6506..d108f0dbb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -438,3 +438,10 @@ missing-argument = "ignore" unknown-argument = "ignore" invalid-attribute-access = "ignore" call-top-callable = "ignore" + +[tool.codespell] +skip = "./venv, ./.git, __pycache__, ./tmp, ./extensions-builtin, ./configs, ./models, ./outputs, *.txt, *.json, *.yaml, *.map, *.mjs, *.log" +ignore-words-list = [ + "te", "nd", "TE", "padd", "inpt", "thw", "thre", "tipe", "ACI", "Foto", "CNA", "LAMA", "lama", "LaMa", "SOM", "trU", "PatchIn", "AllTime", + "youre", "thats", "dont", "whats", "havent", "isnt", "doesnt", "cant", "theres", "receipe", "splitted", "spacial", "patchs", +] diff --git a/scripts/consistory/consistory_pipeline.py b/scripts/consistory/consistory_pipeline.py index a80bd5595..3c569c5e0 100644 --- a/scripts/consistory/consistory_pipeline.py +++ b/scripts/consistory/consistory_pipeline.py @@ -214,7 +214,7 @@ class ConsistoryExtendAttnSDXLPipeline( callback_on_step_end_tensor_inputs (`List`, *optional*): The list of tensor inputs for the `callback_on_step_end` function. The tensors specified in the list will be passed as `callback_kwargs` argument. You will only be able to include variables listed in the - `._callback_tensor_inputs` attribute of your pipeine class. + `._callback_tensor_inputs` attribute of your pipeline class. Examples: diff --git a/scripts/consistory/consistory_unet_sdxl.py b/scripts/consistory/consistory_unet_sdxl.py index a6694f276..22275a325 100644 --- a/scripts/consistory/consistory_unet_sdxl.py +++ b/scripts/consistory/consistory_unet_sdxl.py @@ -857,7 +857,7 @@ class ConsistorySDXLUNet2DConditionModel(ModelMixin, ConfigMixin, UNet2DConditio cross_attention_kwargs (`dict`, *optional*): A kwargs dictionary that if specified is passed along to the [`AttnProcessor`]. added_cond_kwargs: (`dict`, *optional*): - A kwargs dictionary containin additional embeddings that if specified are added to the embeddings that + A kwargs dictionary containing additional embeddings that if specified are added to the embeddings that are passed along to the UNet blocks. down_block_additional_residuals (`tuple` of `torch.Tensor`, *optional*): additional residuals to be added to UNet long skip connections from down blocks to up blocks for diff --git a/scripts/demofusion.py b/scripts/demofusion.py index 4f1c47925..4441c9fee 100644 --- a/scripts/demofusion.py +++ b/scripts/demofusion.py @@ -1157,7 +1157,7 @@ class DemoFusionSDXLPipeline(DiffusionPipeline, FromSingleFileMixin, LoraLoaderM output = ImagePipelineOutput(images=output_images) return output - # Overrride to properly handle the loading and unloading of the additional text encoder. + # Override to properly handle the loading and unloading of the additional text encoder. def load_lora_weights(self, pretrained_model_name_or_path_or_dict: Union[str, Dict[str, torch.Tensor]], **kwargs): # pylint: disable=arguments-differ # We could have accessed the unet config from `lora_state_dict()` too. We pass # it here explicitly to be able to tell that it's coming from an SDXL diff --git a/scripts/differential_diffusion.py b/scripts/differential_diffusion.py index 0ca8fc463..2843bf62f 100644 --- a/scripts/differential_diffusion.py +++ b/scripts/differential_diffusion.py @@ -940,7 +940,7 @@ class StableDiffusionXLDiffImg2ImgPipeline(DiffusionPipeline, FromSingleFileMixi num_inference_steps = len(list(filter(lambda ts: ts >= discrete_timestep_cutoff, timesteps))) timesteps = timesteps[:num_inference_steps] - # prepartions for diff diff + # preparations for diff diff original_with_noise = self.prepare_latents( original_image, timesteps, batch_size, num_images_per_prompt, prompt_embeds.dtype, device, generator ) @@ -1764,7 +1764,7 @@ class StableDiffusionDiffImg2ImgPipeline(DiffusionPipeline): # 8. Denoising loop num_warmup_steps = len(timesteps) - num_inference_steps * self.scheduler.order - # prepartions + # preparations original_with_noise = self.prepare_latents( image, timesteps, batch_size, num_images_per_prompt, prompt_embeds.dtype, device, generator ) diff --git a/scripts/example.py b/scripts/example.py index dafcd578f..98bbc62fb 100644 --- a/scripts/example.py +++ b/scripts/example.py @@ -118,7 +118,7 @@ class Script(scripts_manager.Script): for i in range(len(args)): p.task_args[params[i]] = args[i] - # you can also re-use existing params from `p` object if pipeline wants them, but under a different name + # you can also reuse existing params from `p` object if pipeline wants them, but under a different name # for example, if pipeline expects 'image' param, but you want to use 'init_images' instead which is what img2img tab uses # p.task_args['image'] = p.init_images[0] diff --git a/scripts/freescale/freescale_pipeline.py b/scripts/freescale/freescale_pipeline.py index 96748ad38..844e4b825 100644 --- a/scripts/freescale/freescale_pipeline.py +++ b/scripts/freescale/freescale_pipeline.py @@ -1118,7 +1118,7 @@ class StableDiffusionXLFreeScale(DiffusionPipeline, FromSingleFileMixin, LoraLoa """ return StableDiffusionXLPipelineOutput(images=results_list) - # Overrride to properly handle the loading and unloading of the additional text encoder. + # Override to properly handle the loading and unloading of the additional text encoder. def load_lora_weights(self, pretrained_model_name_or_path_or_dict: Union[str, Dict[str, torch.Tensor]], **kwargs): # We could have accessed the unet config from `lora_state_dict()` too. We pass # it here explicitly to be able to tell that it's coming from an SDXL diff --git a/scripts/freescale/freescale_pipeline_img2img.py b/scripts/freescale/freescale_pipeline_img2img.py index 447fa054a..c86d53856 100644 --- a/scripts/freescale/freescale_pipeline_img2img.py +++ b/scripts/freescale/freescale_pipeline_img2img.py @@ -1174,7 +1174,7 @@ class StableDiffusionXLFreeScaleImg2Img(DiffusionPipeline, FromSingleFileMixin, """ return StableDiffusionXLPipelineOutput(images=results_list) - # Overrride to properly handle the loading and unloading of the additional text encoder. + # Override to properly handle the loading and unloading of the additional text encoder. def load_lora_weights(self, pretrained_model_name_or_path_or_dict: Union[str, Dict[str, torch.Tensor]], **kwargs): # We could have accessed the unet config from `lora_state_dict()` too. We pass # it here explicitly to be able to tell that it's coming from an SDXL diff --git a/scripts/instantir/ip_adapter/attention_processor.py b/scripts/instantir/ip_adapter/attention_processor.py index 2b1a629a4..17f3f3365 100644 --- a/scripts/instantir/ip_adapter/attention_processor.py +++ b/scripts/instantir/ip_adapter/attention_processor.py @@ -459,7 +459,7 @@ class split_AttnProcessor2_0(torch.nn.Module): hidden_states_0 = hidden_states_0.view(batch_size, channel, height * width).transpose(1, 2) hidden_states_1 = hidden_states_1.view(batch_size, channel, height * width).transpose(1, 2) else: - # directly split sqeuence according to concat dim. + # directly split sequence according to concat dim. single_dim = original_shape[2] if cat_dim==-2 or cat_dim==2 else original_shape[1] hidden_states_0 = hidden_states[:, :single_dim*single_dim,:] hidden_states_1 = hidden_states[:, single_dim*(single_dim+1):,:] @@ -593,7 +593,7 @@ class sep_split_AttnProcessor2_0(torch.nn.Module): hidden_states_0 = hidden_states_0.view(batch_size, channel, height * width).transpose(1, 2) hidden_states_1 = hidden_states_1.view(batch_size, channel, height * width).transpose(1, 2) else: - # directly split sqeuence according to concat dim. + # directly split sequence according to concat dim. single_dim = original_shape[2] if cat_dim==-2 or cat_dim==2 else original_shape[1] hidden_states_0 = hidden_states[:, :single_dim*single_dim,:] hidden_states_1 = hidden_states[:, single_dim*(single_dim+1):,:] diff --git a/scripts/instantir/ip_adapter/utils.py b/scripts/instantir/ip_adapter/utils.py index ed3411eeb..e6bbba32a 100644 --- a/scripts/instantir/ip_adapter/utils.py +++ b/scripts/instantir/ip_adapter/utils.py @@ -65,7 +65,7 @@ def init_adapter_in_unet( image_projection_layers.append(image_proj_model) unet.encoder_hid_proj = MultiIPAdapterImageProjection(image_projection_layers) - # Adjust unet config to handle addtional ip hidden states. + # Adjust unet config to handle additional ip hidden states. unet.config.encoder_hid_dim_type = "ip_image_proj" unet.to(dtype=dtype, device=device) @@ -155,7 +155,7 @@ def load_adapter_to_pipe( image_projection_layers.append(image_proj_model) unet.encoder_hid_proj = MultiIPAdapterImageProjection(image_projection_layers) - # Adjust unet config to handle addtional ip hidden states. + # Adjust unet config to handle additional ip hidden states. unet.config.encoder_hid_dim_type = "ip_image_proj" unet.to(dtype=pipe.dtype, device=pipe.device) diff --git a/scripts/instantir/sdxl_instantir.py b/scripts/instantir/sdxl_instantir.py index 20beeb97c..39d9c7488 100644 --- a/scripts/instantir/sdxl_instantir.py +++ b/scripts/instantir/sdxl_instantir.py @@ -932,7 +932,7 @@ class InstantIRPipeline( noise = torch.randn(latents.shape, generator=generator[0] if isinstance(generator, list) else generator, device=self.vae.device, dtype=self.vae.dtype, layout=torch.strided) bsz = latents.shape[0] timestep = torch.tensor([timestep]*bsz, device=self.vae.device) - # Note that the latents will be scaled aleady by scheduler.add_noise + # Note that the latents will be scaled already by scheduler.add_noise latents = self.scheduler.add_noise(latents, noise, timestep) return latents diff --git a/scripts/lbm/base/base_model.py b/scripts/lbm/base/base_model.py index 5f6778fe3..ac93f5d0c 100644 --- a/scripts/lbm/base/base_model.py +++ b/scripts/lbm/base/base_model.py @@ -16,7 +16,7 @@ class BaseModel(nn.Module): """Called when the training starts Args: - device (Optional[torch.device], optional): The device to use. Usefull to set + device (Optional[torch.device], optional): The device to use. Useful to set relevant parameters on the model and embedder to the right device only once at the start of the training. Defaults to None. """ diff --git a/scripts/lbm/config.py b/scripts/lbm/config.py index c9321db24..24e7917c0 100644 --- a/scripts/lbm/config.py +++ b/scripts/lbm/config.py @@ -21,10 +21,10 @@ class BaseConfig: @classmethod def from_dict(cls, config_dict: Dict[str, Any]) -> "BaseConfig": - """Creates a BaseConfig instance from a dictionnary + """Creates a BaseConfig instance from a dictionary Args: - config_dict (dict): The Python dictionnary containing all the parameters + config_dict (dict): The Python dictionary containing all the parameters Returns: :class:`BaseConfig`: The created instance @@ -78,10 +78,10 @@ class BaseConfig: return cls.from_dict(config_dict) def to_dict(self) -> dict: - """Transforms object into a Python dictionnary + """Transforms object into a Python dictionary Returns: - (dict): The dictionnary containing all the parameters""" + (dict): The dictionary containing all the parameters""" return asdict(self) def to_json_string(self): diff --git a/scripts/lbm/tiler.py b/scripts/lbm/tiler.py index d32f82dd8..0621717fd 100644 --- a/scripts/lbm/tiler.py +++ b/scripts/lbm/tiler.py @@ -84,7 +84,7 @@ class Tiler: def merge_tiles( self, tiles: List[List[torch.Tensor]], tiling_method: str = "gaussian" ) -> torch.Tensor: - """Merge tiles by averaging the overlaping regions + """Merge tiles by averaging the overlapping regions Args: tiles (Dict[str, Tile]): dictionary of processed tiles tiling_method (str): tiling method. Can be "average", "gaussian" or "linear" @@ -103,7 +103,7 @@ class Tiler: ) def _average_merge_tiles(self, tiles: List[List[torch.Tensor]]) -> torch.Tensor: - """Merge tiles by averaging the overlaping regions + """Merge tiles by averaging the overlapping regions Args: tiles (Dict[str, Tile]): dictionary of processed tiles Returns: @@ -149,7 +149,7 @@ class Tiler: ] += 1 # outputs is summed up with this multiplicity - # so we need to divide by the weights wich is either 1, 2 or 4 depending on the region + # so we need to divide by the weights which is either 1, 2 or 4 depending on the region output = output / weights return output @@ -204,7 +204,7 @@ class Tiler: ) def _gaussian_merge_tiles(self, tiles: List[List[torch.Tensor]]) -> torch.Tensor: - """Merge tiles by averaging the overlaping regions + """Merge tiles by averaging the overlapping regions Args: List[List[torch.Tensor]]: List of processed tiles Returns: @@ -278,7 +278,7 @@ class Tiler: return b def _linear_merge_tiles(self, tiles: List[List[torch.Tensor]]) -> torch.Tensor: - """Merge tiles by blending the overlaping regions + """Merge tiles by blending the overlapping regions Args: tiles (List[List[torch.Tensor]]): List of processed tiles Returns: diff --git a/scripts/lbm/unets/unet.py b/scripts/lbm/unets/unet.py index 8fddb5332..0c32929d2 100644 --- a/scripts/lbm/unets/unet.py +++ b/scripts/lbm/unets/unet.py @@ -111,7 +111,7 @@ class DiffusersUNet2DCondWrapper(UNet2DConditionModel): down_intrablock_additional_residuals_clone = None # Check diffusers.models.embeddings.py > MultiIPAdapterImageProjectionLayer > forward() for implementation - # Exepected format : List[torch.Tensor] of shape (batch_size, num_image_embeds, embed_dim) + # Expected format : List[torch.Tensor] of shape (batch_size, num_image_embeds, embed_dim) # with length = number of ip_adapters loaded in the ip_adapter_wrapper if ip_adapter_cond_embedding is not None: added_cond_kwargs = { diff --git a/scripts/mulan.py b/scripts/mulan.py index baf7bf923..28a674b90 100644 --- a/scripts/mulan.py +++ b/scripts/mulan.py @@ -3,7 +3,7 @@ # https://huggingface.co/OpenGVLab/InternVL-14B-224px """ -- [MuLan](https://github.com/mulanai/MuLan) Multi-langunage prompts - wirte your prompts in ~110 auto-detected languages! +- [MuLan](https://github.com/mulanai/MuLan) Multi-langunage prompts - write your prompts in ~110 auto-detected languages! Compatible with SD15 and SDXL Enable in scripts -> MuLan and set encoder to `InternVL-14B-224px` encoder (that is currently only supported encoder, but others will be added) diff --git a/scripts/nudenet_ext.py b/scripts/nudenet_ext.py index 915776e30..d8c83f999 100644 --- a/scripts/nudenet_ext.py +++ b/scripts/nudenet_ext.py @@ -61,7 +61,7 @@ def process( policy=False, banned=False, metadata=True, - copy=False, # pylint: disable=unused-argument # compatability + copy=False, # pylint: disable=unused-argument # compatibility score=0.2, blocks=3, censor=[], diff --git a/scripts/pixelsmith/autoencoder_kl.py b/scripts/pixelsmith/autoencoder_kl.py index 90c2f9462..e4f923ef3 100644 --- a/scripts/pixelsmith/autoencoder_kl.py +++ b/scripts/pixelsmith/autoencoder_kl.py @@ -48,7 +48,7 @@ class PixelSmithVAE(ModelMixin, ConfigMixin, FromOriginalModelMixin): Synthesis with Latent Diffusion Models](https://arxiv.org/abs/2112.10752) paper. force_upcast (`bool`, *optional*, default to `True`): If enabled it will force the VAE to run in float32 for high image resolution pipelines, such as SD-XL. VAE - can be fine-tuned / trained to a lower range without loosing too much precision in which case + can be fine-tuned / trained to a lower range without losing too much precision in which case `force_upcast` can be set to `False` - see: https://huggingface.co/madebyollin/sdxl-vae-fp16-fix """ diff --git a/scripts/pulid/eva_clip/eva_vit_model.py b/scripts/pulid/eva_clip/eva_vit_model.py index 61fe1cfe7..fcf3e3216 100644 --- a/scripts/pulid/eva_clip/eva_vit_model.py +++ b/scripts/pulid/eva_clip/eva_vit_model.py @@ -71,7 +71,7 @@ class Mlp(nn.Module): x = self.fc1(x) x = self.act(x) # x = self.drop(x) - # commit this for the orignal BERT implement + # commit this for the original BERT implement x = self.ffn_ln(x) x = self.fc2(x) diff --git a/scripts/pulid/eva_clip/rope.py b/scripts/pulid/eva_clip/rope.py index 6fc6cec2f..f4b834ba3 100644 --- a/scripts/pulid/eva_clip/rope.py +++ b/scripts/pulid/eva_clip/rope.py @@ -4,7 +4,7 @@ from torch import nn from einops import rearrange, repeat import logging -def broadcat(tensors, dim = -1): +def broadcast(tensors, dim = -1): num_tensors = len(tensors) shape_lens = set(map(lambda t: len(t.shape), tensors)) assert len(shape_lens) == 1, 'tensors must all have the same number of dimensions' @@ -60,7 +60,7 @@ class VisionRotaryEmbedding(nn.Module): freqs_w = torch.einsum('..., f -> ... f', t, freqs) freqs_w = repeat(freqs_w, '... n -> ... (n r)', r = 2) - freqs = broadcat((freqs_h[:, None, :], freqs_w[None, :, :]), dim = -1) + freqs = broadcast((freqs_h[:, None, :], freqs_w[None, :, :]), dim = -1) self.register_buffer("freqs_cos", freqs.cos()) self.register_buffer("freqs_sin", freqs.sin()) @@ -106,7 +106,7 @@ class VisionRotaryEmbeddingFast(nn.Module): freqs = torch.einsum('..., f -> ... f', t, freqs) freqs = repeat(freqs, '... n -> ... (n r)', r = 2) - freqs = broadcat((freqs[:, None, :], freqs[None, :, :]), dim = -1) + freqs = broadcast((freqs[:, None, :], freqs[None, :, :]), dim = -1) freqs_cos = freqs.cos().view(-1, freqs.shape[-1]) freqs_sin = freqs.sin().view(-1, freqs.shape[-1]) diff --git a/scripts/pulid/eva_clip/tokenizer.py b/scripts/pulid/eva_clip/tokenizer.py index 45fa860a9..c66d2cf57 100644 --- a/scripts/pulid/eva_clip/tokenizer.py +++ b/scripts/pulid/eva_clip/tokenizer.py @@ -27,7 +27,7 @@ def bytes_to_unicode(): The reversible bpe codes work on unicode strings. This means you need a large # of unicode characters in your vocab if you want to avoid UNKs. When you're at something like a 10B token dataset you end up needing around 5K for decent coverage. - This is a signficant percentage of your normal, say, 32K bpe vocab. + This is a significant percentage of your normal, say, 32K bpe vocab. To avoid that, we want lookup tables between utf-8 bytes and unicode strings. And avoids mapping to whitespace/control characters the bpe code barfs on. """ diff --git a/scripts/pulid/pulid_sdxl.py b/scripts/pulid/pulid_sdxl.py index b239aab3e..dbfce63d4 100644 --- a/scripts/pulid/pulid_sdxl.py +++ b/scripts/pulid/pulid_sdxl.py @@ -229,7 +229,7 @@ class StableDiffusionXLPuLIDPipeline: if len(self.face_helper.cropped_faces) == 0: raise RuntimeError('facexlib align face fail') align_face = self.face_helper.cropped_faces[0] - # incase insightface didn't detect face + # in case insightface didn't detect face if id_ante_embedding is None: id_ante_embedding = self.handler_ante.get_feat(align_face) diff --git a/scripts/softfill.py b/scripts/softfill.py index ba5a9bc81..35b2348e9 100644 --- a/scripts/softfill.py +++ b/scripts/softfill.py @@ -6,7 +6,7 @@ code from: https://github.com/zacheryvaughn/softfill-pipelines/blob/main/pipelin sdnext implementation follows after pipeline-end """ -pnoise2 = None # dynamically instlled and imported module +pnoise2 = None # dynamically installed and imported module ### pipeline start diff --git a/scripts/xyz/xyz_grid_classes.py b/scripts/xyz/xyz_grid_classes.py index 4a5e8f2f4..3ad480c05 100644 --- a/scripts/xyz/xyz_grid_classes.py +++ b/scripts/xyz/xyz_grid_classes.py @@ -144,7 +144,7 @@ class SharedSettingsStackHelper(): shared.opts.data["disable_apply_params"] = '' def __exit__(self, exc_type, exc_value, tb): - # Restore overriden settings after plot generation + # Restore overridden settings after plot generation shared.opts.data["disable_apply_metadata"] = self.disable_apply_metadata shared.opts.data["disable_apply_params"] = self.disable_apply_params shared.opts.data["extra_networks_default_multiplier"] = self.extra_networks_default_multiplier @@ -278,7 +278,7 @@ axis_options = [ AxisOption("[Control] End", float, apply_control('control_end')), AxisOption("[HiDiffusion] T1", float, apply_override('hidiffusion_t1')), AxisOption("[HiDiffusion] T2", float, apply_override('hidiffusion_t2')), - AxisOption("[HiDiffusion] Agression step", float, apply_field('hidiffusion_steps')), + AxisOption("[HiDiffusion] Aggression step", float, apply_field('hidiffusion_steps')), AxisOption("[PAG] Attention scale", float, apply_field('cfg_true')), AxisOption("[PAG] Adaptive scaling", float, apply_field('cfg_adaptive')), AxisOption("[PAG] Applied layers", str, apply_setting('pag_apply_layers')), diff --git a/test/test-flux2-native-adapters.py b/test/test-flux2-native-adapters.py index 196a95763..76dc93c3a 100644 --- a/test/test-flux2-native-adapters.py +++ b/test/test-flux2-native-adapters.py @@ -416,7 +416,7 @@ def sd_oft_kohya_qkv_skipped(): def sd_boft_butterfly(): - """BOFT (butterfly-OFT) — re-uses ``oft_blocks`` key with 4-D shape. + """BOFT (butterfly-OFT) — reuses ``oft_blocks`` key with 4-D shape. Mirrors the LyCORIS upstream save layout (boft.py weight_list: ``oft_blocks, rescale, alpha``; tensor shape per __init__: diff --git a/ui/editAttention.ts b/ui/editAttention.ts index cb043f7fa..5eeee09fe 100644 --- a/ui/editAttention.ts +++ b/ui/editAttention.ts @@ -48,7 +48,7 @@ export function keyupEditAttention(event: KeyboardEvent): void { function selectCurrentWord(): boolean { if (selectionStart !== selectionEnd) return false; const delimiters = `${window.opts.keyedit_delimiters} \r\n\t`; - // seek backward until to find beggining + // seek backward until to find beginning while (!delimiters.includes(text[selectionStart - 1]) && selectionStart > 0) selectionStart--; // seek forward to find end while (!delimiters.includes(text[selectionEnd]) && selectionEnd < text.length) selectionEnd++; diff --git a/ui/js/iframeResizer.js b/ui/js/iframeResizer.js index 4ea1d309a..ffb202d9c 100644 --- a/ui/js/iframeResizer.js +++ b/ui/js/iframeResizer.js @@ -1184,7 +1184,7 @@ : remoteHost } - function depricate(key) { + function deprecate(key) { var splitName = key.split('Callback') if (splitName.length === 2) { @@ -1213,7 +1213,7 @@ iframe.src && iframe.src.split('/').slice(0, 3).join('/') checkOptions(options) - Object.keys(options).forEach(depricate, options) + Object.keys(options).forEach(deprecate, options) copyOptions(options) if (settings[iframeId]) { @@ -1242,7 +1242,7 @@ } } - function debouce(fn, time) { + function debounce(fn, time) { if (null === timer) { timer = setTimeout(function () { timer = null @@ -1302,7 +1302,7 @@ 'window', 'Mutation observed: ' + mutations[0].target + ' ' + mutations[0].type ) - debouce(checkIFrames, 16) + debounce(checkIFrames, 16) } function createMutationObserver() { @@ -1332,7 +1332,7 @@ } log('window', 'Trigger event: ' + event) - debouce(resize, 16) + debounce(resize, 16) } // Not testable in PhantomJS @@ -1344,7 +1344,7 @@ if ('hidden' !== document.visibilityState) { log('document', 'Trigger event: Visibility change') - debouce(resize, 16) + debounce(resize, 16) } } diff --git a/ui/js/sha256.ts b/ui/js/sha256.ts index 075b74627..1ac4f51db 100644 --- a/ui/js/sha256.ts +++ b/ui/js/sha256.ts @@ -105,7 +105,7 @@ const Hash = /** @class */ (function () { this.reset(); } // Resets hash state making it possible - // to re-use this instance to hash other data. + // to reuse this instance to hash other data. Hash.prototype.reset = function () { this.state[0] = 0x6a09e667; this.state[1] = 0xbb67ae85; diff --git a/ui/startup.ts b/ui/startup.ts index dfc53d1f4..4095a99da 100644 --- a/ui/startup.ts +++ b/ui/startup.ts @@ -92,7 +92,7 @@ async function initStartup() { executeCallbacks(uiReadyCallbacks); - // optinally wait for modern ui + // optionally wait for modern ui if (window.waitForUiReady) await window.waitForUiReady(); // post startup tasks that may take longer but are not critical diff --git a/wiki b/wiki index 2f47d4cc3..73d602162 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit 2f47d4cc386f60c87ecec9ac9de13681bbbf8911 +Subproject commit 73d602162ee920d2b146653a319a0adb7fb45f10