stable-diffusion-image-generation

Generate images from text prompts using Stable Diffusion models via HuggingFace Diffusers.

1|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/Clay-HHK/claude-skills --skill stable-diffusion-image-generation-clay-hhk
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: stable-diffusion-image-generation
Source: https://github.com/Clay-HHK/claude-skills/tree/main/stable-diffusion
Command: npx skills add https://github.com/Clay-HHK/claude-skills --skill stable-diffusion-image-generation-clay-hhk

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Setting up text-to-image generation with Stable Diffusion involves choosing the right pipeline, scheduler, model variant, and memory optimizations, which is error-prone without a structured reference. ## Core Features & Use Cases - Text-to-Image Generation: Generate images with SD 1.5, SDXL, SD 3.0, and Flux pipelines, with control over steps, guidance scale, seeds, and negative prompts. - Image Transformation: Perform image-to-image translation, inpainting, and ControlNet-conditioned generation (canny edges, poses, depth). - LoRA & Memory Optimization: Load and fuse LoRA adapters, enable CPU offloading, attention slicing, and xFormers for constrained GPUs. - Use Case: Generate a batch of 1024x1024 product concept images with SDXL using a DPM solver scheduler, a fixed seed for reproducibility, and CPU offloading to fit on a single GPU. ## Quick Start Generate an image from the prompt 'a serene mountain landscape at sunset' using the Stable Diffusion pipeline with 50 inference steps and save it as output.png.

Frequently Asked Questions about stable-diffusion-image-generation

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, move it to CUDA with float16 precision, and call it with a text prompt, num_inference_steps, and guidance_scale. The returned images list contains PIL images you can save directly.

Which scheduler should I use for Stable Diffusion generation?▼

DPMSolverMultistepScheduler gives high quality in 15-25 steps and is a strong default. LCMScheduler enables 4-8 step generation for speed, while EulerDiscreteScheduler is a reliable general-purpose choice at 20-50 steps.

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

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

Can I use LoRA weights with Stable Diffusion pipelines?▼

Yes, call pipe.load_lora_weights() with the LoRA path and weight name, then optionally fuse with pipe.fuse_lora(lora_scale=0.8). Multiple LoRAs can be combined using named adapters and pipe.set_adapters() with per-adapter weights.

Why are my Stable Diffusion outputs black or noisy?▼

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

What is the difference between SD 1.5, SDXL, and Flux pipelines?▼

SD 1.5 generates 512x512 images with lower memory needs, SDXL produces higher-quality 1024x1024 images with a larger model, and Flux uses a transformer-based architecture via FluxPipeline. Each has a dedicated pipeline class in Diffusers.