mcmonkeyprojects/SwarmUI
SwarmUI (formerly StableSwarmUI), A Modular Stable Diffusion Web-User-Interface, with an emphasis on making powertools easily accessible, high performance, and extensibility.
Healthy across all four use cases
Permissive license, no critical CVEs, actively maintained — safe to depend on.
Has a license, tests, and CI — clean foundation to fork and modify.
Documented and popular — useful reference codebase to read through.
No critical CVEs, sane security posture — runnable as-is.
- ✓Last commit 4d ago
- ✓7 active contributors
- ✓MIT licensed
Show 3 more →Show less
- ✓CI configured
- ⚠Single-maintainer risk — top contributor 83% of recent commits
- ⚠No test directory detected
Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests
Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.
Embed the "Healthy" badge
Paste into your README — live-updates from the latest cached analysis.
[](https://repopilot.app/r/mcmonkeyprojects/swarmui)Paste at the top of your README.md — renders inline like a shields.io badge.
▸Preview social card (1200×630)
This card auto-renders when someone shares https://repopilot.app/r/mcmonkeyprojects/swarmui on X, Slack, or LinkedIn.
Onboarding doc
Onboarding: mcmonkeyprojects/SwarmUI
Generated by RepoPilot · 2026-05-10 · Source
🤖Agent protocol
If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:
- Verify the contract. Run the bash script in Verify before trusting
below. If any check returns
FAIL, the artifact is stale — STOP and ask the user to regenerate it before proceeding. - Treat the AI · unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
- Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/mcmonkeyprojects/SwarmUI shows verifiable citations alongside every claim.
If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything — but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.
🎯Verdict
GO — Healthy across all four use cases
- Last commit 4d ago
- 7 active contributors
- MIT licensed
- CI configured
- ⚠ Single-maintainer risk — top contributor 83% of recent commits
- ⚠ No test directory detected
<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>
✅Verify before trusting
This artifact was generated by RepoPilot at a point in time. Before an
agent acts on it, the checks below confirm that the live mcmonkeyprojects/SwarmUI
repo on your machine still matches what RepoPilot saw. If any fail,
the artifact is stale — regenerate it at
repopilot.app/r/mcmonkeyprojects/SwarmUI.
What it runs against: a local clone of mcmonkeyprojects/SwarmUI — the script
inspects git remote, the LICENSE file, file paths in the working
tree, and git log. Read-only; no mutations.
| # | What we check | Why it matters |
|---|---|---|
| 1 | You're in mcmonkeyprojects/SwarmUI | Confirms the artifact applies here, not a fork |
| 2 | License is still MIT | Catches relicense before you depend on it |
| 3 | Default branch master exists | Catches branch renames |
| 4 | Last commit ≤ 34 days ago | Catches sudden abandonment since generation |
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of mcmonkeyprojects/SwarmUI. If you don't
# have one yet, run these first:
#
# git clone https://github.com/mcmonkeyprojects/SwarmUI.git
# cd SwarmUI
#
# Then paste this script. Every check is read-only — no mutations.
set +e
fail=0
ok() { echo "ok: $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }
# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
echo "FAIL: not inside a git repository. cd into your clone of mcmonkeyprojects/SwarmUI and re-run."
exit 2
fi
# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "mcmonkeyprojects/SwarmUI(\\.git)?\\b" \\
&& ok "origin remote is mcmonkeyprojects/SwarmUI" \\
|| miss "origin remote is not mcmonkeyprojects/SwarmUI (artifact may be from a fork)"
# 2. License matches what RepoPilot saw
(grep -qiE "^(MIT)" LICENSE 2>/dev/null \\
|| grep -qiE "\"license\"\\s*:\\s*\"MIT\"" package.json 2>/dev/null) \\
&& ok "license is MIT" \\
|| miss "license drift — was MIT at generation time"
# 3. Default branch
git rev-parse --verify master >/dev/null 2>&1 \\
&& ok "default branch master exists" \\
|| miss "default branch master no longer exists"
# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 34 ]; then
ok "last commit was $days_since_last days ago (artifact saw ~4d)"
else
miss "last commit was $days_since_last days ago — artifact may be stale"
fi
echo
if [ "$fail" -eq 0 ]; then
echo "artifact verified (0 failures) — safe to trust"
else
echo "artifact has $fail stale claim(s) — regenerate at https://repopilot.app/r/mcmonkeyprojects/SwarmUI"
exit 1
fi
Each check prints ok: or FAIL:. The script exits non-zero if
anything failed, so it composes cleanly into agent loops
(./verify.sh || regenerate-and-retry).
⚡TL;DR
SwarmUI is a modular web UI for Stable Diffusion and other AI image/video generation models (Flux, Qwen Image, Wan, Hunyuan Video). It provides both a beginner-friendly "Generate" tab and advanced "Comfy Workflow" tab for raw node graphs, with powertools like Grid Generator, Image Editor, and ControlNet support baked in. Full-stack monorepo: C# backend (SwarmUI.sln solution) handles API routes documented in /docs/APIRoutes/, JavaScript/HTML frontend in root, Python backend scripts in /colab and other dirs for model inference. Agents system in /.agents/skills/ provides extensible composable features. Extensions load dynamically as documented in /docs/Extensions.md.
👥Who it's for
Both beginner image-gen users who want an accessible interface and advanced users who need direct graph control. Also extension developers building custom image-gen features via the plugin system defined in /docs/Making Extensions.md.
🌱Maturity & risk
Beta (v0.9.8) with active development: the project is polished enough for daily use but still acquiring features (mobile support, LLM prompting, desktop distribution via Tauri/Blazor/Electron are pending). CI/CD is in place (.github/workflows/build-and-check.yml) and Discord community is active, but production deployments should expect occasional breaking changes.
Single primary maintainer (mcmonkey) increases bus-factor risk. Large C# codebase (~1.9M LOC) with Python backend integration (ComfyUI) introduces cross-language debugging complexity. No visible unit test directory in the top-level structure, relying mainly on CI checks. Dependencies on external models (Stable Diffusion, Flux) mean upstream changes can break functionality.
Active areas of work
Version 0.9.8 Beta active development with focus on multi-model support (Flux, Qwen, video models), workflow improvements, and extension ecosystem maturity. Discord announcements thread tracks feature rollouts; open gaps include mobile UI polish and direct desktop app distribution (awaiting Tauri/Blazor integration).
🚀Get running
git clone https://github.com/mcmonkeyprojects/SwarmUI.git
cd SwarmUI
dotnet build SwarmUI.sln
dotnet run --project ./SwarmUI
Then access the web UI at http://localhost:7800 (typical default). See /docs/Command Line Arguments.md for configuration flags.
Daily commands:
After dotnet build: dotnet run --project ./SwarmUI starts the server. The web UI loads at http://localhost:7800. For GPU acceleration: configure model paths in settings and point to local Stable Diffusion / ComfyUI backends (see /docs/Advanced Usage.md). Docker support available (/.dockerignore and /docs/Docker.md).
🗺️Map of the codebase
- SwarmUI.sln: Main .NET solution file; compile entry point for the entire backend
- docs/APIRoutes/: Documents all REST endpoints (T2IAPI, BackendAPI, AdminAPI, ComfyUIWebAPI); essential for backend API design and client integration
- [docs/Making Extensions.md](https://github.com/mcmonkeyprojects/SwarmUI/blob/master/docs/Making Extensions.md): Defines the extension architecture and how plugins register features; critical for understanding modularity
- .agents/skills/image-editor-tools/SKILL.md: Real example of a composable agent/skill; reference implementation for extension developers
- docs/Features/Comfy-Workflows.md: Explains the node-graph workflow engine integration; core differentiator from simpler UIs
- [docs/Command Line Arguments.md](https://github.com/mcmonkeyprojects/SwarmUI/blob/master/docs/Command Line Arguments.md): Configuration surface for deployment; required reading for operations and custom setups
🛠️How to make changes
Backend API routes: edit C# files under the project structure matching /docs/APIRoutes/ docs (AdminAPI, BackendAPI, T2IAPI, etc.). Frontend UI: modify JavaScript/HTML in root directory (no bundler apparent, direct script tags). New features as extensions: follow /docs/Making Extensions.md and copy pattern from /.agents/skills/image-editor-tools/SKILL.md. Model support: extend Python backend scripts and update /docs/Model Support.md and /docs/Obscure Model Support.md.
🪤Traps & gotchas
- Backend discovery: model paths and ComfyUI integration require explicit configuration; naive
dotnet runwon't have GPU models available without setup (see /docs/Advanced Usage.md). 2) Frontend hot-reload absent: JavaScript changes require browser refresh; no dev server with live reload visible. 3) Python dependency chain: /colab scripts depend on rembg, dill, ultralytics (from Dependencies snippet); missing these breaks certain features silently. 4) Port hardcoding: default localhost:7800 may conflict; check /docs/Command Line Arguments.md for override syntax. 5) API versioning not explicit: docs don't show version headers; breaking changes possible across releases.
💡Concepts to learn
- Node-Graph Workflows (DAG evaluation) — The Comfy Workflow tab exposes users to directed acyclic graph (DAG) composition of image gen steps; understanding node execution order, caching, and dependency resolution is essential for power users and extension developers
- Stable Diffusion latent-space encoding/decoding — Image prompting, ControlNet, and other advanced features operate on VAE-encoded latents, not raw pixels; understanding this is crucial for debugging model outputs and extending image processing pipelines
- ControlNet conditional image guidance — SwarmUI's ControlNet support (docs/Features/ControlNet.md) adds auxiliary images (edge maps, pose, depth) as conditioning; core to structured generation and explains the image-editor integration
- Async WebSocket real-time updates — Webhooks and progress streaming rely on bidirectional WebSocket channels; necessary for understanding live generation feedback and batch monitoring without polling
- Model quantization and precision (fp16/fp32/int8) — Advanced Usage and Model Support docs hint at precision trade-offs; understanding float16 vs float32 vs int8 is vital for GPU memory optimization and performance tuning
- RESTful API versioning and deprecation — SwarmUI exposes multiple API surfaces (T2IAPI, BackendAPI, AdminAPI, ComfyUIWebAPI); maintaining backward compatibility across features requires clear versioning strategy (currently implicit)
- Modular plugin / extension architecture — The /.agents/skills/ system and /docs/Making Extensions.md define SwarmUI's extensibility model; understanding capability discovery, registration, and dependency injection is key to building or modifying features without forking
🔗Related repos
AUTOMATIC1111/stable-diffusion-webui— Direct predecessor and competitor; the original Stable Diffusion WebUI that SwarmUI improves upon with better UI/UX and modularitycomfyanonymous/ComfyUI— Node-graph backend that SwarmUI wraps; ComfyUI integration is core to the Workflow tab and advanced featureslllyasviel/ControlNet— ControlNet model implementation; SwarmUI's ControlNet support (docs/Features/ControlNet.md) depends on thisinvoke-ai/InvokeAI— Alternative AI image gen WebUI with similar goals; shows different architectural choices (Python FastAPI vs C# .NET) for the same problem spacemcmonkeyprojects/StableSwarmUI— Original repository name before the rename to SwarmUI; migration history and issues tracker may still reference this
🪄PR ideas
To work on one of these in Claude Code or Cursor, paste:
Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.
Add comprehensive API endpoint tests for T2I and ModelsAPI routes
The repo has extensive API documentation in docs/APIRoutes/ (T2IAPI.md, ModelsAPI.md, BackendAPI.md) but no visible test suite for these endpoints. Given SwarmUI's complexity with multiple backend types (Stable Diffusion, Flux, Qwen, Wan, Hunyuan) and the critical nature of the T2I (Text-to-Image) generation pipeline, adding integration tests would catch regressions early and provide confidence for contributors modifying API behavior.
- [ ] Review docs/APIRoutes/T2IAPI.md and docs/APIRoutes/ModelsAPI.md to identify critical endpoints
- [ ] Create a test suite (e.g., tests/api/t2i-api.test.ts or similar) covering core generation flows
- [ ] Add tests for model loading, parameter validation, and error handling across different backend types
- [ ] Integrate into .github/workflows/build-and-check.yml to run on PRs
- [ ] Document test setup in CONTRIBUTING.md if not already present
Complete missing feature documentation for Image Prompting and ControlNet in docs/Features/
The docs/Features/ directory shows README.md, Prompt Syntax.md, and ControlNet.md exist, but docs/Features/ImagePrompting.md is listed in the file structure yet appears incomplete based on the README snippet mentioning 'Image Prompting' as a core feature. Additionally, given the complexity of ControlNet integration with multiple model types, adding usage examples and troubleshooting for ControlNet (especially with Flux/Qwen/other non-SD models) would significantly help users.
- [ ] Review the actual content of docs/Features/ImagePrompting.md and docs/Features/ControlNet.md
- [ ] Add concrete examples for Image Prompting workflows (how to load images, expected input formats, performance tips)
- [ ] Expand ControlNet.md with model-specific examples (SD vs. Flux vs. Z-Image ControlNet differences)
- [ ] Add a troubleshooting section for common ControlNet issues (model mismatch, performance, format errors)
- [ ] Link these docs from docs/Features/README.md and docs/Advanced Usage.md
Add extension integration tests and a testing template for docs/Making Extensions.md
The repo emphasizes extensibility as a core value and has docs/Making Extensions.md, but there's no visible test suite or testing guidelines for extensions. With the .agents/skills directory structure showing skill modules (image-editor-tools), contributors need clarity on how to test custom extensions before submission. Adding a test template and extension validation workflow would reduce broken PRs.
- [ ] Review docs/Making Extensions.md to identify the extension API contract
- [ ] Create a template extension test file (e.g., tests/extensions/extension-template.test.ts) with common test patterns
- [ ] Document extension testing best practices in docs/Making Extensions.md (loading, mocking backends, API calls)
- [ ] Add a GitHub Actions workflow step to .github/workflows/build-and-check.yml that validates extension structure
- [ ] Include sample extension tests in .agents/skills/image-editor-tools/ as a reference implementation
🌿Good first issues
- Add unit tests for C# API route handlers in /docs/APIRoutes/ (T2IAPI, ModelsAPI, UtilAPI); currently no visible test directory, making refactoring risky. Create a /tests/ folder with xUnit or NUnit stubs.: Medium: Improves code confidence and CI validation; blocks robust releases.
- Document the WebSocket flow for real-time generation progress (hinted in /docs/Features/Webhooks.md but not detailed); add concrete examples to /docs/API.md showing subscription, message format, and error handling.: Small: Frontend developers building progress bars and live feedback need this; currently guessing from code.
- Expand /docs/Model Support.md with a troubleshooting section: what happens if a model fails to load, how to check logs, how to fall back to CPU. Add shell command examples.: Small: Reduces support burden; users hit model loading errors frequently based on Discord activity.
⭐Top contributors
Click to expand
Top contributors
- @mcmonkey4eva — 83 commits
- @jtreminio — 9 commits
- @GlenCarpenter — 3 commits
- @kalebbroo — 2 commits
- @mrblomblo — 1 commits
📝Recent commits
Click to expand
Recent commits
4941ba6— probably sufficient detection for sd-scripts anima loras (mcmonkey4eva)1ea2ae5— Add AltTriggerPhraseBtn to extension list (#1365) (mrblomblo)b4f30a9— Allow using video for ControlNet for target type image (#1362) (jtreminio)f856bbf— Set DWPreprocessor.bbox_detector = yolox_l.torchscript.pt (#1363) (jtreminio)c9a10cd— preview metadata should have ExtraData (mcmonkey4eva)651b14a— boomerang doesn't need a double-toggle (mcmonkey4eva)bed806a— fix interp bug (mcmonkey4eva)c53552f— bash is the work of satan (mcmonkey4eva)47ece37— Update Negpip extension (#1350) (khanghy1000)8d97bb7— possibly shut up the nuget source message (mcmonkey4eva)
🔒Security observations
- High · Insecure Dependency: rembg —
Dependencies/Package file - rembg. rembg is a computer vision library that downloads pre-trained models from the internet at runtime. This poses risks of man-in-the-middle attacks, model tampering, and supply chain attacks. The library may not validate model integrity or use secure channels. Fix: Implement model pinning with hash verification, use private model registries, enforce HTTPS for all model downloads, and consider pre-downloading models during build time rather than runtime. - High · Insecure Dependency: dill —
Dependencies/Package file - dill. dill is a Python serialization library that can deserialize arbitrary Python objects. Deserializing untrusted data with dill can lead to arbitrary code execution. This is especially dangerous if user-provided data is deserialized. Fix: Avoid deserializing untrusted data with dill. If deserialization is necessary, use pickle with restricted protocols or validate data with schema validation before deserialization. Consider alternative serialization formats like JSON or MessagePack. - High · Insecure Dependency: ultralytics —
Dependencies/Package file - ultralytics. ultralytics (YOLOv8) downloads models from remote sources at runtime without apparent verification. This creates supply chain attack vectors and potential code execution risks during model loading. Fix: Implement model integrity verification using cryptographic signatures, pre-download and cache models in the container/deployment, use private model registries, and enforce network policies restricting model download sources. - Medium · Missing Dependency Pinning —
Dependencies/Package file. The provided dependency list shows package names without version constraints. This allows automatic installation of vulnerable versions during deployment, increasing exposure to known CVEs. Fix: Pin all dependencies to specific versions (e.g., 'rembg==0.0.56') and use hash-based locking. Implement dependency scanning in CI/CD pipeline using tools like safety, pip-audit, or Dependabot. - Medium · Potential Code Execution via ComfyUI Integration —
docs/Features/Comfy-Workflows.md, docs/Making Extensions.md, ComfyUI integration components. The file structure indicates ComfyUI workflow support and custom extensions (docs/Features/Comfy-Workflows.md, Making Extensions.md). ComfyUI workflows can execute arbitrary Python code if user-provided workflows are not properly validated. Fix: Implement strict workflow validation, use AST parsing to detect malicious code patterns, sandbox workflow execution, enforce allowlists for permitted node types, and validate all user-uploaded workflows before execution. - Medium · Potential API Injection in Model Support —
docs/APIRoutes/ModelsAPI.md, docs/Model Support.md, docs/Obscure Model Support.md. Support for multiple model formats and sources (Stable Diffusion, Flux, Qwen, etc.) with dynamic loading suggests potential injection vectors if model paths or URLs are constructed from user input without sanitization. Fix: Validate and sanitize all model identifiers and paths, use allowlists for model sources, implement URL validation with protocol whitelisting, and avoid path traversal vulnerabilities through strict input validation. - Medium · Missing Security Headers Documentation —
docs/APIRoutes/ folder, API implementation. No evidence of security header configuration (CORS, CSP, X-Frame-Options, etc.) in the provided documentation snippets, particularly important for a web UI handling image generation. Fix: Implement security headers: Content-Security-Policy, X-Content-Type-Options: nosniff, X-Frame-Options: DENY, Strict-Transport-Security, and appropriate CORS policies. Document security configuration in API documentation. - Medium · Insufficient Input Validation in Webhook Support —
docs/Features/Webhooks.md. Webhooks feature (docs/Features/Webhooks.md) suggests callbacks to user-specified endpoints. This creates SSRF and data exfiltration risks if webhook URLs and payloads aren't properly validated. Fix: Implement webhook URL validation (block private IPs, validate hostnames), rate limit webhook calls, sign webhook payloads, implement timeout controls, maintain webhook audit logs, and use allowlists for webhook destinations.
LLM-derived; treat as a starting point, not a security audit.
👉Where to read next
- Open issues — current backlog
- Recent PRs — what's actively shipping
- Source on GitHub
Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.