stable-diffusion

Generate images from text prompts using Stable Diffusion and HuggingFace Diffusers pipelines.

Updated Sep 10, 2026
One-click install
npx skills add https://github.com/loteiron/ZeusAgent --skill stable-diffusion-loteiron
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: stable-diffusion
Source: https://github.com/loteiron/ZeusAgent/tree/main/optional-skills/mlops/stable-diffusion
Command: npx skills add https://github.com/loteiron/ZeusAgent --skill stable-diffusion-loteiron

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires diffusers, transformers, accelerate, torch, and includes references (resource) components.

What problem does it solve? Running text-to-image generation, inpainting, and image-to-image translation locally requires correctly configuring Diffusers pipelines, schedulers, and memory optimizations, which involves many interdependent choices that are easy to get wrong. ## Core Features & Use Cases - Text-to-Image Generation: Create images from natural language prompts using SD 1.5, SDXL, SD 3.0, or Flux models with tunable guidance scale, steps, and seeds. - Image-to-Image and Inpainting: Transform existing images with text guidance or fill masked regions with context-aware content. - ControlNet and LoRA Support: Add spatial conditioning (edges, poses, depth) and load fine-tuned style adapters for controlled generation. - Memory Optimization: Apply CPU offloading, attention slicing, VAE tiling, and xFormers to run large models on limited GPU memory. - Use Case: A developer building an image generation API can load an SDXL pipeline with a DPM-Solver scheduler, enable model CPU offload, and generate reproducible 1024x1024 images with seeded generators. ## Quick Start Use the stable-diffusion skill to generate a 1024x1024 image of a futuristic city with cinematic lighting using the SDXL pipeline.

Frequently Asked Questions about stable-diffusion

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate images with Stable Diffusion in Python?▼

Load a DiffusionPipeline from a pretrained model such as stable-diffusion-v1-5 with torch.float16, move it to CUDA, and call it with a prompt, num_inference_steps, and guidance_scale. The returned images list contains PIL images you can save directly.

What is the difference between SD 1.5 and SDXL?▼

SDXL generates higher quality 1024x1024 images using a larger model and optional refiner stage, while SD 1.5 produces 512x512 images with lower memory requirements. SDXL typically needs more VRAM and benefits from CPU offloading.

How do I fix CUDA out of memory errors in Diffusers?▼

Enable model CPU offloading with pipe.enable_model_cpu_offload(), add attention slicing and VAE slicing, and load the pipeline in float16 precision. You can also reduce image dimensions or batch size to lower memory usage.

Does Stable Diffusion support inpainting masked regions?▼

Yes, use AutoPipelineForInpainting with a model like runwayml/stable-diffusion-inpainting, passing the original image and a mask where white pixels mark the region to fill. The prompt describes the content to generate inside the masked area.

How do I use ControlNet for pose or edge conditioning?▼

Load a ControlNetModel such as control_v11p_sd15_canny and pass it to StableDiffusionControlNetPipeline alongside the base model. Provide a preprocessed control image (canny edges, poses, or depth maps) as the image argument during generation.

Why are my generated images black or noisy?▼

Black images often come from the safety checker or dtype mismatches between the pipeline and VAE; try disabling the safety checker or keeping the VAE in float32. Noisy outputs usually mean too few inference steps or a misconfigured scheduler.