AUTOMATIC1111/stable-diffusion-webui
Stable Diffusion web UI
A browser-based interface for running Stable Diffusion image-generation models locally. The application is built around the Gradio framework, with a FastAPI HTTP API on the side and a large extension/script ecosystem layered on top.
What this project is
stable-diffusion-webui (often called "AUTOMATIC1111" or "A1111" after its original author) is the most widely deployed open-source frontend for Stable Diffusion. It bundles:
- A txt2img and img2img workflow with prompt parsing, attention syntax, X/Y/Z grids, and infinite-token prompts.
- An extras/post-processing pipeline (face restoration, upscaling, image-to-image alternatives).
- A training tab for textual inversion embeddings and hypernetworks.
- A built-in Lora extension and an extensions tab that downloads, installs and updates third-party plugins from a registry index.
- A REST API at
/sdapi/v1/*that mirrors most UI features and is documented automatically via OpenAPI.
The code lives almost entirely in modules/ and extensions-builtin/; the rest of the repository is launch wrappers (launch.py, webui.sh, webui.bat), Gradio JavaScript glue (javascript/), CSS, and YAML configs for the underlying ldm/Stable Diffusion model.
What this wiki covers
This wiki is generated from the source tree at commit 82a973c0. It is a codebase wiki — it explains how the program is structured, where the main extension points are, and what each module does. End-user documentation (model recommendations, prompt tutorials, command-line tricks) lives on the GitHub wiki.
| You want to… | Start here |
|---|---|
| Understand the overall architecture | overview/architecture.md |
| Run the project locally | overview/getting-started.md |
| Look up a project-specific term | overview/glossary.md |
| See how the codebase has evolved | ../lore.md |
| Read the source-tree statistics | ../by-the-numbers.md |
| Modify a subsystem | the systems/ section |
| Implement a new feature for users | the features/ section |
| Write an extension or script | systems/scripts-and-extensions.md and systems/script-callbacks.md |
| Drive the API | api/index.md |
Quick orientation
launch.py # bootstraps the venv, installs deps, calls webui.py
webui.py # api_only() and webui() entry points
modules/ # ~120 Python modules — the bulk of the application
modules/api/ # FastAPI routes and Pydantic models
modules/processing.py # the txt2img / img2img generation pipeline
modules/sd_models.py # checkpoint loading and switching
modules/scripts.py # the script and extension registry
modules/ui.py # top-level Gradio UI assembly
extensions-builtin/ # Lora, LDSR, SwinIR, ScuNET, hypertile, etc.
javascript/ # browser-side helpers loaded into the Gradio pageThe application is single-process. Generation requests are serialised by a global queue_lock defined in modules/call_queue.py, so only one image is being produced on the GPU at a time even though the API and the UI both feed into the same process.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.
Next
Architecture