What it is
Stable Diffusion web UI is a browser interface for Stable Diffusion, implemented with the Gradio library. It offers original txt2img and img2img modes along with outpainting, inpainting, prompt matrix, upscaling and many other generation tools. It also includes training for embeddings and hypernetworks, a checkpoint merger, an API and support for community custom scripts.
Who it's for
- Users who want a browser-based interface for generating images with Stable Diffusion
- Users who want to train embeddings or hypernetworks and preprocess training images
- Developers who want to extend the UI with custom scripts or extensions, or use its API
- Users with low-VRAM GPUs (4GB supported, with reports of 2GB working)
Requirements
Requirements
- Python and git must be installed (the one-click script does not install them)
- Python 3.10.6 for Windows automatic installation (newer Python versions do not support torch)
- On very new Linux systems, python3.11 or python3.10
- Linux dependency packages such as wget, git, python3 and python3-venv (Debian-based)
- NVidia GPUs are recommended; AMD, Intel and Ascend NPUs are covered by separate instructions
Setup
Windows release package (NVidia GPUs)
Download
sd.webui.zipfrom the v1.0.0-pre release and extract its contents. Then runupdate.bat, followed byrun.bat.Automatic installation on Windows
Install Python 3.10.6 (checking "Add Python to PATH") and git. Clone the repository, then run
webui-user.batfrom Windows Explorer as a normal, non-administrator user.bashgit clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.gitLinux: install dependencies (Debian-based example)
Install the dependencies for your distribution. The README also gives Red Hat, openSUSE and Arch variants.
bashsudo apt install wget git python3 python3-venv libgl1 libglib2.0-0Linux: get and run the webui
Download
webui.shinto the directory where you want to install, or clone the repo instead. Then runwebui.shand checkwebui-user.shfor options.bashwget -q https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui/master/webui.sh # or git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
Examples
Attention emphasis syntax
Prompta man in a ((tuxedo))
a man in a (tuxedo:1.21)Expected output: Two syntaxes for making the model pay more attention to part of the prompt. Selecting text and pressing Ctrl+Up or Ctrl+Down adjusts attention automatically.
Composable Diffusion with weights
Prompta cat :1.2 AND a dog AND a penguin :2.2Expected output: Uppercase AND separates multiple prompts used at once, and weights can be attached to each.
Pin Python 3.11 on Linux
bashexport python_cmd="python3.11"
# or in webui-user.sh
python_cmd="python3.11"What it does: On very new systems, set this variable in the launch script or in webui-user.sh so the correct Python version is used.
Pros & cons
Pros
- Pro:Large built-in feature set: inpainting, outpainting, upscalers, face restoration, checkpoint merger, X/Y/Z plots and more
- Pro:Training tab supports embeddings and hypernetworks, and embeddings can be trained on 8GB (reports of 6GB working)
- Pro:Low-VRAM support (4GB, with reports of 2GB working) and an optional xformers speed-up
- Pro:Generation parameters are saved in each image and can be restored via the PNG info tab, plus an API and community custom scripts
Cons
- Con:Python and git must be installed separately even with the one-click script
- Con:Windows setup requires Python 3.10.6, since newer Python versions do not support torch
- Con:Detailed documentation lives in the wiki rather than the README, and Intel and Ascend instructions are on external wiki pages
Images
