AUTOMATIC1111/stable-diffusion-webui
By the numbers
A quantitative snapshot of the codebase. Data collected on 2026-04-30 from the master branch at commit 82a973c0.
Size
xychart-beta horizontal
title "Lines of source code by language"
x-axis ["Python", "JavaScript", "CSS"]
y-axis "Lines" 0 --> 50000
bar [43654, 5068, 1732]| Language | Files | Lines |
|---|---|---|
| Python | 213 | ~43,654 |
| JavaScript | 30 | ~5,068 |
| CSS | 1 (style.css) |
~1,732 |
Counts exclude the gitignored extensions/ directory and vendored model code under repositories/. The extensions-builtin/ tree is included.
The largest single Python files are concentrated in the generation pipeline and the UI:
| Lines | File |
|---|---|
| 1,792 | modules/processing.py |
| 1,235 | modules/ui.py |
| 1,040 | modules/scripts.py |
| 1,034 | modules/sd_models.py |
| 929 | modules/api/api.py |
| 877 | modules/images.py |
| 838 | modules/ui_extra_networks.py |
| 701 | modules/ui_extensions.py |
| 678 | modules/deepbooru_model.py (model architecture, generated from upstream) |
| 677 | modules/sd_hijack_optimizations.py |
JavaScript is dominated by javascript/extraNetworks.js (970 lines) and 436 lines).javascript/ui.js (
There is one CSS file (style.css, 43 KB) — there is no preprocessor or component-scoped styling.
Activity
Total commits in the repository: 7,689 (across 7,916 commit SHAs counting tag refs).
xychart-beta horizontal
title "Commits per month, last 12 months of activity"
x-axis ["2023-08", "2023-09", "2023-10", "2023-11", "2023-12", "2024-01", "2024-02", "2024-03", "2024-04", "2024-05", "2024-06", "2024-07"]
y-axis "Commits" 0 --> 700
bar [634, 119, 101, 168, 237, 215, 137, 244, 116, 55, 130, 95]The repository's most recent commit on master is 2024-07-27 (tag v1.10.1). Activity peaks correspond to release windows: August 2023 (v1.6), December 2023 (v1.7), February–March 2024 (v1.8), April 2024 (v1.9), July 2024 (v1.10). Earlier in the project's life, October 2022 (1,328 commits) was the highest-volume month.
The repository has had 653 unique authors. Top contributors by raw commit count (across the entire history):
| Commits | Author |
|---|---|
| 2,255 | AUTOMATIC1111 |
| 1,331 | AUTOMATIC (older alias) |
| 314 | w-e-w |
| 168 | DepFA |
| 155 | Aarni Koskela |
| 132 | catboxanon |
| 121 | Kohaku-Blueleaf |
| 91 | missionfloyd |
| 83 | brkirch |
| 82 | C43H66N12O12S2 |
(Two of the top entries are the same person under different commit-author strings.)
Bot-attributed commits
A grep over commit messages and Co-authored-by: trailers for [bot], dependabot, github-actions, copilot, etc. matches 0 commits. The repository does not currently use any automation that leaves bot signatures in git history. Inline AI tools (Copilot, IDE integrations) leave no trace and are not counted here.
Complexity
Average and median Python file size:
| Metric | Value |
|---|---|
Mean lines per .py file |
~205 |
Median lines per .py file |
~80 |
| Files over 500 lines | 16 |
| Files over 1,000 lines | 5 |
The five files over 1,000 lines (listed above) are reasonable candidates for extraction; in particular modules/processing.py hosts both StableDiffusionProcessing and the entire process_images_inner pipeline, and modules/ui.py builds every Gradio tab in one module.
The codebase's "deepest" import chains pass through shared.py → cmd_args / shared_options / shared_state. Most modules import shared directly, so it is effectively a service locator.
Tests and configuration
| Metric | Value |
|---|---|
Test files (test/test_*.py) |
5 |
| Lines of test code | ~280 |
| Test-to-code ratio (Python only) | ~0.6% |
| Pinned Python dependencies | 33 (in requirements_versions.txt) |
| Floating Python dependencies | 33 (in requirements.txt) |
| Stable Diffusion model YAML configs | 7 (in configs/) |
| Built-in extensions | 12 (under extensions-builtin/) |
| Built-in scripts | 12 (under scripts/) |
| Localisation files | shipped via extensions; the bundled localizations/ is empty |
| Command-line flags (cmd_args) | ~130 |
| User-visible options (shared_options) | ~400 |
The tests target the API, not the UI; they hit /sdapi/v1/txt2img, /img2img, and /extra-single-image against a CPU-only test server. Coverage is functional rather than exhaustive.
Subsystem totals
| Area | Files | Approx LoC |
|---|---|---|
modules/ (top level) |
~120 | ~31,500 |
modules/api/ |
2 | ~1,460 |
modules/textual_inversion/ |
7 | ~1,930 |
modules/hypernetworks/ |
2 | ~1,500 |
modules/processing_scripts/ |
4 | ~310 |
modules/models/ |
(sd3, diffusion submodules) | ~600 |
extensions-builtin/Lora/ |
16 | ~2,600 |
extensions-builtin/ other |
11 | ~5,800 |
scripts/ (one-shot scripts) |
12 | ~3,400 |
javascript/ |
30 | ~5,068 |
test/ |
5 | ~280 |
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.
Previous
Glossary
Next
Lore