Skip to content

milesand/sd-webui-forge-classic

 
 

Repository files navigation

Stable Diffusion WebUI Forge - Classic

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)


"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.

Installation

(Unscientific) Comparisons
Forge Classic Forge previous Forge main reForge main
1 Size 4.3 MB 6.8 MB 2 18.5 MB 7.8 MB
3 Startup 4.5s 4 9.5s 5.2s 5.7s

1: using the Download ZIP button on GitHub
2: the large size is from backend/huggingface
3: using only --xformers flag; disable all extra extensions; does not include import torch time
4: the long time is from requirement conflicts


Features [Apr. 15]

Most base features of the original Automatic1111 Webui should still function

New Features

  • Support v-pred SDXL checkpoints (eg. NoobAI)
  • Support uv package manager
    • requires uv
    • drastically speed up installation
    • see Commandline
  • Support SageAttention
  • Support fast cublas operation (CublasLinear)
    • requires manually installing the cublas_ops package
    • ~25% speed up
    • enable in Settings
  • Support fast fp8 operation (torch._scaled_mm)
    • requires RTX 40 +
    • ~10% speed up; reduce quality
    • enable in Settings

Note

The cublas operation requires fp16 precision, thus is not compatible with fp8 operation

  • Implement RescaleCFG
    • reduce burnt colors; mainly for v-pred checkpoints
  • Implement MaHiRo
    • alternative CFG calculation; [graph]
  • Implement diskcache
    • (backported from Automatic1111 Webui upstream)
  • Implement skip_early_cond
    • (backported from Automatic1111 Webui upstream)
  • Update spandrel
    • support most modern Upscaler architecture
  • Add pillow-heif package
    • support .avif and .heif formats
  • Automatic row split for X/Y/Z Plot
  • Add an option to disable Refiner
  • Add an option to disable ExtraNetworks Tree View
  • Support Union / ProMax ControlNet
    • I just made them always show up in the dropdown

Removed Features

  • 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
  • The test scripts
  • Photopea and openpose_editor (ControlNet)
  • Unix .sh launch scripts
    • You can still use this WebUI by copying a launch script from another working WebUI; I just don't want to maintain them...

Optimizations

  • [Freedom] Natively integrate the SD1 and SDXL logics
    • no longer git clone any repository on fresh install
    • no more random hacks and monkey patches
  • Fix memory leak when switching checkpoints
  • Clean up the ldm_patched (ie. comfy) folder
  • Remove unused cmd_args
  • Remove unused shared_options
  • Remove unused args_parser
  • Remove legacy codes
  • Remove duplicated upscaler codes
    • put every upscaler inside the ESRGAN folder
  • Improve color correction
  • Improve code logics
  • Improve hash caching
  • Improve error logs
    • no longer prints TypeError: 'NoneType' object is not iterable
  • Improve setting descriptions
  • Check for Extension updates in parallel
  • Moved embeddings folder into models folder
  • ControlNet Rewrite
    • change Units to gr.Tab
    • remove multi-inputs, as they are "misleading"
    • change visible toggle to interactive toggle; now the UI will no longer jump around
    • improved Presets application
  • Run text encoder on CPU by default
  • Fix pydantic Errors
  • Fix Soft Inpainting
  • Lint & Format most of the Python and JavaScript codes
  • Update to Pillow 11
    • faster image processing
  • Update to latest PyTorch
    • currently 2.6.0+cu126
  • No longer install open-clip twice
  • Update certain 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

  • --no-download-sd-model: Do not download a default checkpoint
    • can be removed after you download some checkpoints of your choice
  • --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

by. Classic

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

  • --sage: Install the sageattention package to speed up generation
    • requires RTX 30 +
    • requires manually installing triton
    • only affects SDXL

Tip

--xformers is still recommended even if you already have --sage, as sageattention does not speed up VAE while xformers does

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


Installation

  1. Install git

  2. Clone the Repo

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

Recommended Method
  • Install uv
  • Set up venv
    cd sd-webui-forge-classic
    uv venv venv --python 3.11
  • Add the --uv flag (see Commandline)
Standard Method
  1. (Optional) Configure Commandline

Note

For RTX 50s user, refer to #8 to install PyTorch first

  1. Launch the WebUI via webui-user.bat
  • During the first launch, it will automatically install all the requirements
  • Once installation is finished, the WebUI will start in a browser automatically

GitHub Related

  • Issues about removed features will simply be ignored; Issues regarding installation will also 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 reForge instead

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

About

The "classic" version of the Forge WebUI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 93.3%
  • JavaScript 2.4%
  • Cuda 2.2%
  • C++ 1.2%
  • CSS 0.6%
  • HTML 0.1%
  • Other 0.2%