| # Safe Diffusion Guidance (SDG) | |
| Custom Diffusers pipeline that applies a mid-UNet safety classifier as guidance during denoising. | |
| - Plug-and-play: works with any Stable Diffusion checkpoint (e.g., SD 1.5). | |
| - No retraining needed; classifier runs on mid-UNet features. | |
| - Tunable: `safety_scale`, `mid_fraction`, `safe_class_index`. | |
| ## Install | |
| ```bash | |
| python -m venv .venv && source .venv/bin/activate | |
| pip install -r requirements.txt | |