AUTOMATIC1111/stable-diffusion-webui
Systems
This section walks the architectural building blocks of the application. Each page describes a single subsystem in modules/ (or, in the case of Lora, a single built-in extension) and how to extend or modify it.
The grouping mirrors how the code actually behaves at runtime, not the directory layout — there is no modules/processing/ package, but "the processing pipeline" is a clear conceptual unit spanning modules/processing.py, modules/sd_samplers*.py, and parts of modules/scripts.py.
| System | Owns | Page |
|---|---|---|
| UI | Gradio Blocks construction; the txt2img/img2img/Extras/Settings tabs | ui.md |
| Processing pipeline | The process_images loop, StableDiffusionProcessing dataclasses |
processing.md |
| Models | Checkpoint discovery, loading, switching, hashing, VAE | models.md |
| Samplers and schedulers | Wrappers around k-diffusion / LCM / timestep samplers; sigma schedules | samplers-and-schedulers.md |
| SD hijack | Monkey-patches on the ldm package for prompt syntax and attention |
sd-hijack.md |
| Scripts and extensions | The plugin system (alwayson, txt2img-only, img2img-only) | scripts-and-extensions.md |
| Script callbacks | The 30+ named hooks that scripts and extensions subscribe to | script-callbacks.md |
| Extra networks | Lora/embedding/hypernetwork browser and prompt syntax | extra-networks.md |
| Postprocessing | Upscalers, face restoration, the Extras tab | postprocessing.md |
Active contributors across these systems (top-of-history): AUTOMATIC1111, w-e-w, Aarni Koskela, Kohaku-Blueleaf, catboxanon, light-and-ray, missionfloyd, brkirch.
How they fit together
graph TD
UI[ui.py / ui_*.py] -->|StableDiffusionProcessing| Processing
API[modules/api/api.py] -->|StableDiffusionProcessing| Processing
Processing -->|loads| Models
Processing -->|create_sampler| Samplers
Processing -->|run| Scripts
Models -->|hijack| SDHijack[sd_hijack.py]
SDHijack --> Samplers
Scripts -->|on_*| ScriptCallbacks
Scripts -->|extra_network_data| ExtraNetworks
ExtraNetworks -->|patch UNet| Models
Processing -->|after sampling| Postprocessing
Postprocessing -->|saves| Images[images.py]The most central files in the repository are modules/shared.py (process-wide globals), modules/processing.py (the pipeline), modules/scripts.py (the script runtime), and modules/script_callbacks.py (the extension API). Almost every other module imports at least one of those.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.
Previous
Tooling
Next
UI