stable-diffusion-image-generation

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

5|2|Updated Aug 10, 2026
One-click install
npx skills add https://github.com/MedTiLab/Auto-meta-analysis --skill stable-diffusion-image-generation-medtilab
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: stable-diffusion-image-generation
Source: https://github.com/MedTiLab/Auto-meta-analysis/tree/main/skills/multimodal/stable-diffusion
Command: npx skills add https://github.com/MedTiLab/Auto-meta-analysis --skill stable-diffusion-image-generation-medtilab

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Running Stable Diffusion locally involves many moving parts—pipelines, schedulers, ControlNets, LoRA adapters, and GPU memory constraints—and misconfiguring any of them leads to black images, out-of-memory errors, or poor quality output. This Skill provides tested code patterns and troubleshooting guidance for the full image generation workflow. ## Core Features & Use Cases - Text-to-Image & Image-to-Image: Generate images from prompts with SD 1.5, SDXL, SD 3.0, or Flux, and transform existing images with configurable strength. - Inpainting, ControlNet & LoRA: Fill masked regions, condition generation on edges/poses/depth maps, and apply fine-tuned style adapters with adjustable weights. - Memory Optimization & Deployment: Apply CPU offloading, attention slicing, xFormers, and quantization, plus FastAPI/Docker/Kubernetes deployment patterns. - Use Case: A developer building an image generation API can load SDXL with a DPM-Solver scheduler, enable CPU offload to fit on a single GPU, and expose it through the provided FastAPI server pattern. ## Quick Start Use the stable diffusion skill to generate a 1024x1024 image of a mountain landscape at sunset using SDXL with 30 inference steps.

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 like stable-diffusion-v1-5, move it to CUDA with float16 precision, and call it with a 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 offers excellent quality in 15-25 steps and is a strong default. Use LCMScheduler for very fast 4-8 step generation, or EulerDiscreteScheduler as a reliable general-purpose choice.

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 use float16 precision. For tighter budgets, enable sequential CPU offload or reduce image dimensions and batch size.

Does Stable Diffusion support LoRA fine-tuning adapters?▼

Yes, load LoRA weights with pipe.load_lora_weights() and adjust strength via fuse_lora(lora_scale=0.8). Multiple LoRAs can be combined using set_adapters with per-adapter weights.

Why are my Stable Diffusion images black or noisy?▼

Black images often come from the safety checker or VAE dtype mismatches—try disabling the safety checker or keeping the VAE in float32. Noisy output usually means too few inference steps or a misconfigured scheduler.

When should I use DALL-E 3 instead of Stable Diffusion?▼

Use DALL-E 3 when you need API-based generation without managing GPU infrastructure. Stable Diffusion is preferable when you need local control, custom fine-tuning with LoRA or DreamBooth, or ControlNet spatial conditioning.