table Diffusion WebUI Forge
Go to file
2025-09-03 17:17:58 +08:00
backend lint 2025-09-03 15:54:56 +08:00
extensions ext 2025-08-04 16:58:41 +08:00
extensions-builtin lint 2025-08-04 14:59:13 +08:00
html update README 2025-08-06 21:03:24 +08:00
javascript player 2025-09-01 15:22:22 +08:00
localizations Remove old localizations from the main repo. 2022-11-08 10:01:27 +03:00
models mdl 2025-07-28 14:33:14 +08:00
modules lint 2025-09-03 17:17:58 +08:00
modules_forge nunchaku 2025-09-03 15:23:21 +08:00
scripts refresh 2025-08-06 10:14:13 +08:00
.gitignore yeet 2025-07-26 14:31:21 +08:00
download_configs.py configs 2025-09-01 15:19:22 +08:00
launch.py references 2025-08-06 18:22:23 +08:00
LICENSE yeet 2025-07-26 14:31:21 +08:00
pyproject.toml clean 2025-07-28 10:21:55 +08:00
README.md update README 2025-09-03 16:59:11 +08:00
requirements.txt nunchaku - flux 2025-08-01 12:49:34 +08:00
script.js js 2025-08-04 15:04:15 +08:00
style.css styles 2025-08-13 18:10:57 +08:00
webui-user.bat donacdum 2025-08-06 12:19:44 +08:00
webui.bat installation 2025-07-26 14:52:42 +08:00
webui.py imports 2025-07-28 11:47:30 +08:00

Stable Diffusion WebUI Forge - Neo

[ Classic | Neo ]

UI

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)


"Neo" mainly serves as an continuation for the "latest" version of Forge, which was built on Gradio 4.40.0 before lllyasviel became too busy... Additionally, this fork is focused on optimization and usability, with the main goal of being the lightest WebUI without any bloatwares.

Tip

How to Install


Features [Sep. 03]

Most base features of the original Automatic1111 Webui should still function

New Features

  • Support Wan 2.2
    • txt2img, img2img, txt2vid, img2vid
  • Support Nunchaku (SVDQ) Models
    • dev, krea, kontext, t5
  • Support Flux Kontext
    • img2img, inpaint

Note

Since the state_dict between Flux-Dev, Flux-Krea, and Flux-Kontext are exactly the same, to be properly detected as a Kontext model, the model needs to include "kontext" in its path, either the file or folder name.

  • Support Chroma
  • Rewrite Preset System
    • now actually remember the checkpoint/modules selections for each preset
  • Support uv package manager
    • requires manually installing uv
    • drastically speed up installation
    • see Commandline
  • Support SageAttention, FlashAttention, and fast fp16_accumulation
  • Implement RescaleCFG
    • reduce burnt colors; mainly for v-pred checkpoints
    • enable in Settings/UI Alternatives
  • Implement MaHiRo
    • alternative CFG calculation; improve prompt adherence
    • enable in Settings/UI Alternatives
  • Support loading upscalers in half precision
    • speed up; reduce quality
    • enable in Settings/Upscaling
  • Support running tile composition on GPU
    • enable in Settings/Upscaling
  • Update spandrel
    • support new Upscaler architectures
  • Add pillow-heif package
    • support .avif and .heif images

TODO

  • Improve Memory Management during Generation
    • currently, even when using the same models you could run in ComfyUI, you might still get Out of Memory error...
  • Support Qwen-Image

Removed Features

  • SD2
  • SD3
  • Forge Spaces
  • Hypernetworks
  • CLIP Interrogator
  • Deepbooru Interrogator
  • Textual Inversion Training
  • Most built-in Extensions
  • Some built-in Scripts
  • Some Samplers
  • Sampler in RadioGroup
  • Unix .sh launch scripts
    • You can still use this WebUI by simply copying a launch script from other working WebUI

Optimizations

  • No longer git clone any repository on fresh install
  • 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 ESRGAN folder
  • Optimize upscaler logics
  • Optimize certain operations in Spandrel
  • Improve color correction
  • Revamp settings
    • improve formatting
    • update descriptions
  • Check for Extension updates in parallel
  • Move embeddings folder into models folder
  • Disable Refiner by default
    • enable again in Settings/UI Alternatives
  • Lint & Format
  • Update Pillow
    • faster image processing
  • Update protobuf
    • faster insightface loading
  • Update to latest PyTorch
    • torch==2.8.0+cu128
    • xformers==0.0.32

Note

If your GPU does not support the latest PyTorch, manually install older version of PyTorch

  • No longer install open-clip twice
  • Update some packages to newer versions
  • Update recommended Python to 3.11.9
  • many more... ™️

Commandline

These flags can be added after the set COMMANDLINE_ARGS= line in the webui-user.bat (separate each flag with space)

A1111 built-in

  • --xformers: Install the xformers package to speed up generation
  • --port: Specify a server port to use
    • defaults to 7860
  • --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

by. Forge

  • For RTX 30 and above, you can add the following flags to slightly increase the performance; but in rare occurrences, they may cause OutOfMemory errors or even crash the WebUI; and in certain configurations, they may even lower the speed instead

    • --cuda-malloc
    • --cuda-stream
    • --pin-shared-memory
  • --forge-ref-a1111-home: Point to an Automatic1111 installation to load its models folders

    • i.e. Stable-diffusion, text_encoder

by. Neo

  • --uv: Replace the python -m pip calls with uv pip to massively speed up package installation
  • --uv-symlink: Same as above; but additionally pass --link-mode symlink to the commands
    • significantly reduces installation size (~7 GB to ~100 MB)

Important

Using symlink means it will directly access the packages from the cache folders; refrain from clearing the cache when setting this option

  • --forge-ref-comfy-home: Point to an ComfyUI installation to load its models folders

    • i.e. diffusion_models, clip
  • --model-ref: Points to a central models folder that contains all your models

    • said folder should contain subfolders like Stable-diffusion, Lora, VAE, ESRGAN, etc.

Important

This simply replaces the models folder, rather than adding on top of it

  • --sage: Install the sageattention package to speed up generation
    • will also attempt to install triton automatically

Note

For RTX 50 users, you may need to manually install sageattention 2 instead

  • --flash: Install the flash_attn package to speed up generation
  • --fast-fp16: Enable the allow_fp16_accumulation option
    • requires PyTorch 2.7.0 +

Installation

  1. Install git

  2. Clone the Repo

    git clone https://github.com/Haoming02/sd-webui-forge-classic sd-webui-forge-neo --branch neo
    
  3. Setup Python

Recommended Method
  • Install uv
  • Set up venv
    cd sd-webui-forge-neo
    uv venv venv --python 3.11 --seed
    
  • Add the --uv flag to webui-user.bat
Standard Method
  1. (Optional) Configure Commandline
  2. Launch the WebUI via webui-user.bat
  3. During the first launch, it will automatically install all the requirements
  4. Once the installation is finished, the WebUI will start in a browser automatically

Install sageattention 2

Expand
  1. Ensure the WebUI can properly launch already, by following the installation steps first

  2. Open the console in the WebUI directory

    cd sd-webui-forge-neo
    
  3. Start the virtual environment

    venv\scripts\activate
    
  4. Create a new folder

    mkdir repo
    cd repo
    
  5. Clone the repo

    git clone https://github.com/thu-ml/SageAttention
    cd SageAttention
    
  6. Install the library

    pip install -e . --no-build-isolation
    
    • If you installed uv, use uv pip install instead
    • The installation takes a few minutes

Install older PyTorch

Expand
  1. Navigate to the WebUI directory
  2. Edit the webui-user.bat file
  3. Add a new line to specify an older version:
set TORCH_COMMAND=pip install torch==2.1.2 torchvision==0.16.2 --extra-index-url https://download.pytorch.org/whl/cu121

Attention

Important

The --xformers 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 Neo tries to import the packages and automatically choose the first available attention function in the following order:

  1. SageAttention
  2. FlashAttention
  3. xformers
  4. PyTorch
  5. Basic

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:

  • SageAttentionFlashAttention > xformers > PyTorch >> Basic

Note

SageAttention is based on quantization, so its quality might be slightly worse than others

Important

When using SageAttention 2, both positive prompts and negative prompts are required; omitting negative prompts can cause NaN issues


Issues & Requests

  • Issues about removed features will simply be ignored
  • Issues regarding installation will be ignored if it's obviously user-error
  • Non-Windows platforms will not be supported, as I cannot verify nor maintain them

Special thanks to AUTOMATIC1111, lllyasviel, and comfyanonymous, kijai, city96,
along with the rest of the contributors,
for their invaluable efforts in the open-source image generation community