Code
How automatic1111/stable-diffusion-webui is laid out, and where to start for common changes.
There is no import map for this report yet.
Where to start reading
- Repository root
- Repository root
- Likely public API
- Suggested starting pointAI
- Suggested starting pointAI
- Suggested starting pointAI
- Suggested starting pointAI
- Suggested starting pointAI
Find files for a task
AIAdd a LoRA-style Parameter Adapter
- Subclass the base network in extensions-builtin/Lora/network.py to define parameter structure
- Implement weight forward hooks and apply_to() method to integrate with UNet/CLIP modules
- Add loading logic in extra_networks_lora.py to detect and bind .safetensors files from models/ directory
- Register in the extensions framework so API and UI discover the new parameter type
Add a New Upscaler Post-processor
- Create extension directory under extensions-builtin/ with preload.py for model initialization
- Implement model loading and inference in a module mirroring the SwinIR or LDSR pattern
- Wire the upscaler into the processing pipeline via modules/processing_scripts/
- Expose via REST API in modules/api/models.py if user-selectable
Add a REST API Endpoint
- Define Pydantic request/response schemas in modules/api/models.py
- Create handler function in modules/api/api.py and register with Gradio Interface
- Use modules/call_queue.py to queue long-running operations and prevent blocking
Add Custom Textual Inversion Optimization
- Create optimization schedule in modules/textual_inversion/learn_schedule.py
- Implement embedding training loop in modules/textual_inversion/textual_inversion.py
- Add dataset utilities in modules/textual_inversion/dataset.py for image sampling
- Wire into UI via modules/textual_inversion/ui.py with progress callbacks
Change the public API
Add or update tests
Change build or automation
RepoPilot lists up to 500 files, so a file missing here may still exist.
- Files marked “likely” are guessed from their names.