Skip to content

Haoming02/sd-webui-forge-classic

 
 

Repository files navigation

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.


Features [Feb.]

Most base features of the original Automatic1111 Webui should still function

New Features

  • Support Flux.2-Klein
    • 4B, 9B
    • txt2img, img2img, inpaint
  • Support Z-Image
    • z-image, z-image-turbo
  • Support Wan 2.2
    • txt2img, img2img, txt2vid, img2vid
    • use Refiner to achieve High Noise / Low Noise switching
      • enable Refiner in Settings/Refiner

Important

To export a video, you need to have FFmpeg installed

Note

Since the layers between Qwen-Image and Qwen-Image-Edit are exactly the same, to be properly detected as an Edit model, the model needs to include "qwen" and "edit" in its path, either the file name or folder name.

Note

Since the layers 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 name or folder name.

  • Support Multi-Image Inputs for Qwen-Image-Edit and Flux-Kontext
  • Support Nunchaku (SVDQ) Models
    • flux-dev, flux-krea, flux-kontext, qwen-image, qwen-image-edit, z-image-turbo
    • support LoRA for Flux and Qwen
    • see Commandline
  • Support Lumina-Image-2.0
    • Neta-Lumina, NetaYume-Lumina
  • Support Chroma1-HD

Tip

Check out Download Models for where to get each model and the accompanying modules

Tip

Check out Inference References for how to use each model and the recommended parameters


  • Rewrite Preset System
    • now actually remembers the checkpoint/module selection and parameters for each preset
  • Support uv package manager
    • requires manually installing uv
    • drastically speed up installation
    • see Commandline
  • Support SageAttention, FlashAttention, fp16_accumulation, torch._scaled_mm
  • Implement Triton Kernel for matmul in torch.int8
    • speed up bf16 models
    • enable by selecting int8 in the Diffusion in Low Bits
  • Implement Seed Variance Enhancer
    • improve seed-to-seed variance for distilled models
  • 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
  • Implement Epsilon Scaling
    • enable in Settings/Stable Diffusion
  • 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 support for .avif, .heif, and .jxl image formats

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

  • [Comfy] Rewrite the Backend (memory_management.py, ModelPatcher, attention.py, etc.)
  • No longer git clone any repository on fresh install
  • Fix memory leak when switching checkpoints
  • Speed up launch time
  • Improve timer logs
  • Remove unused cmd_args
  • Remove unused args_parser
  • Remove unused shared_options
  • Remove legacy codes
  • Fix some typos
  • Fix automatic Tiled VAE fallback
  • Pad conditioning for SDXL
  • Remove redundant upscaler codes
    • put every upscaler inside the ESRGAN folder
  • Improve ForgeCanvas
    • brush adjustments
    • customization
    • deobfuscate
    • eraser
    • hotkeys
  • Optimize upscaler logics
  • Optimize certain operations in Spandrel
  • Improve memory management
  • Improve color correction
  • Update the implementation for uni_pc and LCM samplers
  • Update the implementation of LoRAs
  • Revamp settings
    • improve formatting
    • update descriptions
  • Check for Extension updates in parallel
  • Move embeddings folder into models folder
  • ControlNet Rewrite
    • change Units to gr.Tab
    • remove multi-inputs, as they are "misleading"
  • Disable Refiner by default
    • enable again in Settings/Refiner
  • No longer install bitsandbytes by default
  • Lint & Format
  • Update Pillow
    • faster image processing
  • Update protobuf
    • faster insightface loading
  • Update to latest PyTorch
    • torch==2.10.0+cu130

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.13.12
  • many more... ™️

Commandline

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

Tip

Use python launch.py --help to see all available flags

  • --xformers: Install the xformers package to speed up generation
  • --port: Specify a server port to use
    • defaults to 7860
  • --api: Enable API access

by. Neo

  • Add the following flags to slightly improve the model loading; in certain situations, they may cause OutOfMemory errors instead...

    • --cuda-malloc
    • --cuda-stream
    • --pin-shared-memory
  • --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

  • --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

  • --forge-ref-a1111-home: Point to an Automatic1111 installation to load its models folders

    • i.e. Stable-diffusion, text_encoder
  • --forge-ref-comfy-home: Point to a ComfyUI installation to load its models folders

    • i.e. diffusion_models, clip

  • --sage: Install the sageattention package to speed up generation
    • will also attempt to install triton automatically
  • --flash: Install the flash_attn package to speed up generation
  • --nunchaku: Install the nunchaku package to inference SVDQ models
  • --bnb: Install the bitsandbytes package to do low-bits (nf4) inference
  • --onnxruntime-gpu: Install the onnxruntime with the latest GPU support

  • --fast-fp8: Use the torch._scaled_mm function when the model type is float8_e4m3fn
  • --fast-fp16: Enable the allow_fp16_accumulation option
  • --autotune: Enable the torch.backends.cudnn.benchmark option
    • this is slower in my experience...

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.13 --seed
  • Add the --uv flag to webui-user.bat

Deprecated 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

Tip

Check out Extra Installations for how to install git, uv, and FFmpeg


Attention Functions

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)

Caution

Do not just blindly install all of them
Nowadays the native PyTorch scaled_dot_product_attention is usually as fast, and also more stable

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

Note

To skip a specific attention, add the respective disable arg such as --disable-sage


Issues & Requests

  • Issues about removed features will simply be ignored
  • Issues regarding installation will be ignored if it's obviously user-error
  • Issues caused by StabilityMatrix will also be ignored
    • only open an Issue if you can reproduce it on a clean install following the official Installation guide
  • Linux, macOS, AMD, Intel will not be officially supported, as I cannot verify nor maintain them...

Tip

Check out the Wiki~


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


Buy me a Coffee~ ☕

About

The good ol' Forge WebUI, now updated with new features~

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Languages

  • Python 93.7%
  • JavaScript 2.2%
  • Cuda 2.0%
  • C++ 1.1%
  • CSS 0.7%
  • HTML 0.2%
  • Other 0.1%