[ Classic | Neo ]
Stable Diffusion WebUI Forge is a platform on top of the original Stable Diffusion WebUI by AUTOMATIC1111, to make development easier, optimize resource management, speed up inference, and study experimental features.
The name "Forge" is inspired by "Minecraft Forge". This project aims to become the Forge of Stable Diffusion WebUI.
- lllyasviel
(paraphrased)
"Classic" mainly serves as an archive for the "previous" version of Forge, which was built on Gradio 3.41.2 before the major changes (see the original announcement) were introduced. Additionally, this fork is focused exclusively on SD1 and SDXL checkpoints, having various optimizations implemented, with the main goal of being the lightest WebUI without any bloatwares.
Most base features of the original Automatic1111 Webui should still function
- Support uv package manager
- requires manually installing uv
- drastically speed up installation
- see Commandline
- Support SageAttention, FlashAttention, and fast
fp16_accumulation- see Commandline
- Support fast
fp8operation (torch._scaled_mm)- requires RTX 40 +
- requires UNet Weights in fp8 option
- ~10% speed up; reduce quality
- enable in Settings/Optimizations
Note
The fp16_accumulation requires fp16 precision, thus is not compatible with the fast fp8 operation
- Persistent LoRA Patching
- speed up LoRA loading in subsequent generations
- see Commandline
- Patch LoRA in-place
- reduce VRAM usage when loading LoRA
- enable in Settings/Extra Networks
- Implement new Samplers
- (ported from reForge Webui)
- Implement Scheduler dropdown
- (backported from Automatic1111 Webui upstream)
- enable in Settings/UI Alternatives
- Add
CFGslider to theHires. fixsection - Implement RescaleCFG
- reduce burnt colors; mainly for
v-predcheckpoints - enable in Settings/UI Alternatives
- reduce burnt colors; mainly for
- Implement MaHiRo
- alternative CFG calculation; improve prompt adherence
- enable in Settings/UI Alternatives
- Implement Epsilon Scaling
- enable in Settings/Stable Diffusion
- Implement full precision calculation for
Mask blurblending- enable in Settings/img2img
- Support loading upscalers in
halfprecision- speed up; reduce quality
- enable in Settings/Upscaling
- Support running tile composition on GPU
- enable in Settings/Upscaling
- Allow
newlinein LoRA metadata- (backported from Automatic1111 Webui upstream)
- Implement sending parameters from generation result rather than from UI
- e.g. send the prompts instead of
Wildcardsyntax - enable in Settings/Infotext
- e.g. send the prompts instead of
- Implement tiling optimization for VAE
- reduce memory usage; reduce speed
- enable in Settings/VAE
- Implement
diskcachefor hashes- (backported from Automatic1111 Webui upstream)
- Implement
skip_early_cond- (backported from Automatic1111 Webui upstream)
- enable in Settings/Optimizations
- Allow inserting the upscaled image to the Gallery instead of overriding the input image
- (backported from upstream PR)
- Support
v-predSDXL checkpoints (e.g. NoobAI) - Support new LoRA architectures
- Update
spandrel- support new Upscaler architectures
- Add support for
.avif,.heif, and.jxlimage formats - Automatically determine the optimal row count for
X/Y/Z Plot - Support new LoRA architectures
-
DepthAnything v2Preprocessor - Support NoobAI Inpaint ControlNet
- Support Union / ProMax ControlNet
- they simply always show up in the dropdown
- SD2
- Alt-Diffusion
- Instruct-Pix2Pix
- Hypernetworks
- SVD
- Z123
- CLIP Interrogator
- Deepbooru Interrogator
- Textual Inversion Training
- Checkpoint Merging
- LDSR
- Most built-in Extensions
- Some built-in Scripts
- Some Samplers
- Sampler in RadioGroup
-
testscripts - Some Preprocessors (ControlNet)
-
Photopeaandopenpose_editor(ControlNet) - Unix
.shlaunch scripts- You can still use this WebUI by simply copying a launch script from other working WebUI
- [Freedom] Natively integrate the
SD1andSDXLlogics- no longer
gitcloneany repository on fresh install - no more random hacks and monkey patches
- no longer
- Fix
canvas-zoom-and-panbuilt-in extension- no more infinite-resizing bug when using
Send tobuttons
- no more infinite-resizing bug when using
- Fix RAM and VRAM leak when switching checkpoints
- Clean up the
ldm_patched(i.e.comfy) folder - Remove unused
cmd_args - Remove unused
args_parser - Remove unused
shared_options - Remove legacy codes
- Fix some typos
- Remove redundant upscaler codes
- put every upscaler inside the
ESRGANfolder
- put every upscaler inside the
- Optimize upscaler logics
- Optimize certain operations in
Spandrel - Optimize the creation of Extra Networks pages
- (backported from Automatic1111 Webui upstream)
- Improve color correction
- Improve hash caching
- Improve error logs
- no longer print
TypeError: 'NoneType' object is not iterable
- no longer print
- Improve implementation for
Comments - Update the implementation for
uni_pcsampler - Revamp settings
- improve formatting
- update descriptions
- Check for Extension updates in parallel
- Move
embeddingsfolder intomodelsfolder - ControlNet Rewrite
- change Units to
gr.Tab - remove multi-inputs, as they are "misleading"
- change
visibletoggle tointeractivetoggle; now the UI will no longer jump around - improve
Presetsapplication - fix
Inpaint not maskedmode
- change Units to
- Disable Refiner by default
- enable again in Settings/UI Alternatives
- Disable Tree View by default
- enable again in Settings/Extra Networks
- Hide Sampler Parameters by default
- enable again by adding --adv-samplers flag
- Hide some X/Y/Z Plot options by default
- enable again by adding --adv-xyz flag
- Run
text encoderon CPU by default - Fix
pydanticErrors - Fix
Soft Inpainting - Fix
Controllllite - Fix
MultiDiffusion - Fix
SD Upscale - Lint & Format
- Update
Pillow- faster image processing
- Update
protobuf- faster
insightfaceloading
- faster
- Update to latest PyTorch
torch==2.9.1+cu130xformers==0.0.33
Note
If your GPU does not support the latest PyTorch, manually install older version of PyTorch
- No longer install
open-cliptwice - Update some packages to newer versions
- Update recommended Python to
3.11.9 - many more... ™️
These flags can be added after the
set COMMANDLINE_ARGS=line in thewebui-user.bat(separate each flag with space)
--no-download-sd-model: Do not download a default checkpoint- can be removed after you download some checkpoints of your choice
--xformers: Install thexformerspackage to speed up generation--port: Specify a server port to use- defaults to
7860
- defaults to
--api: Enable API access
- Once you have successfully launched the WebUI, you can add the following flags to bypass some validation steps in order to improve the Startup time
--skip-prepare-environment--skip-install--skip-python-version-check--skip-torch-cuda-test--skip-version-check
Important
Remove them if you are installing an Extension, as those also block Extension from installing requirements
- For RTX 30 and above, you can add the following flags to slightly increase the performance; but in rare occurrences, they may cause
OutOfMemoryerrors or even crash the WebUI; and in certain configurations, they may even lower the speed instead--cuda-malloc--cuda-stream--pin-shared-memory
--uv: Replace thepython -m pipcalls withuv pipto massively speed up package installation- requires uv to be installed first (see Installation)
--uv-symlink: Same as above; but additionally pass--link-mode symlinkto the commands- significantly reduces installation size (
~7 GBto~100 MB)
- significantly reduces installation size (
Important
Using symlink means it will directly access the packages from the cache folders; refrain from clearing the cache when setting this option
--model-ref: Points to a centralmodelsfolder that contains all your models- said folder should contain subfolders like
Stable-diffusion,Lora,VAE,ESRGAN, etc.
- said folder should contain subfolders like
Important
This simply replaces the models folder, rather than adding on top of it
-
--persistent-patches: Enable the persistent LoRA patching- no longer apply LoRA every single generation, if the weight is unchanged
- save around 1 second per generation when using LoRA
-
--sage: Install thesageattentionpackage to speed up generation- will also attempt to install
tritonautomatically
- will also attempt to install
-
--flash: Install theflash_attnpackage to speed up generation -
--onnxruntime-gpu: Install theonnxruntimewith the latest GPU support -
--fast-fp16: Enable theallow_fp16_accumulationoption
with SageAttention 2
--sage2-function: Select the function used by SageAttention 2- options:
auto(default)fp16_tritonfp16_cudafp8_cuda
- options:
If you are getting
NaNerrors, try play around with them
-
Install git
-
Clone the Repo
git clone https://github.com/Haoming02/sd-webui-forge-classic
-
Setup Python
Recommended Method
- Install uv
- Set up venv
cd sd-webui-forge-classic uv venv venv --python 3.11 --seed - Add the
--uvflag towebui-user.bat
Deprecated Method
- Install Python 3.11.9
- Remember to enable
Add Python to PATH
- Remember to enable
- (Optional) Configure Commandline
- Launch the WebUI via
webui-user.bat - During the first launch, it will automatically install all the requirements
- Once the installation is finished, the WebUI will start in a browser automatically
Important
The --xformers, --flash, and --sage args are only responsible for installing the packages, not whether its respective attention is used (this also means you can remove them once the packages are successfully installed)
Forge Classic tries to import the packages and automatically choose the first available attention function in the following order:
SageAttentionFlashAttentionxformersPyTorchBasic
Tip
To skip a specific attention, add the respective disable arg such as --disable-sage
Note
The VAE only checks for xformers, so --xformers is still recommended even if you already have --sage
In my experience, the speed of each attention function for SDXL is ranked in the following order:
SageAttention≥FlashAttention>xformers>PyTorch>>Basic
Important
When using SageAttention 2, both positive prompts and negative prompts are required; omitting negative prompts may cause NaN issues
Tip
Check out the Wiki~
- Issues about removed features will simply be ignored
- Issues regarding installation will be ignored if it's obviously user-error
- Feature Request not related to performance or optimization will simply be ignored
- For cutting edge features, check out the Neo branch instead
- Non-Windows platforms will not be officially supported, as I cannot verify nor maintain them
Special thanks to AUTOMATIC1111, lllyasviel, and comfyanonymous, kijai,
along with the rest of the contributors,
for their invaluable efforts in the open-source image generation community
