stable-diffusion-image-generation

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

1|Updated Mar 12, 2026
One-click install
npx skills add https://github.com/kaminocorp/hermes-alpha-hunter --skill stable-diffusion-image-generation-kaminocorp
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: stable-diffusion-image-generation
Source: https://github.com/kaminocorp/hermes-alpha-hunter/tree/main/skills/mlops/models/stable-diffusion
Command: npx skills add https://github.com/kaminocorp/hermes-alpha-hunter --skill stable-diffusion-image-generation-kaminocorp

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 navigating a complex ecosystem of pipelines, schedulers, memory optimizations, and model variants. This Skill provides complete, working guidance for text-to-image generation, image-to-image translation, inpainting, ControlNet conditioning, and LoRA fine-tuning with the HuggingFace Diffusers library. ## Core Features & Use Cases - Text-to-Image Generation: Generate images with SD 1.5, SDXL, SD 3.0, and Flux models, with control over steps, guidance scale, seeds, and negative prompts. - Advanced Conditioning: Use ControlNet (canny, pose, depth), IP-Adapter image prompts, and LoRA adapters for style and subject control. - Memory & Performance Optimization: Apply CPU offloading, attention slicing, xFormers, quantization, and fast schedulers like DPM-Solver and LCM. - Use Case: A developer building an image generation API can follow the included FastAPI server pattern with Docker and Kubernetes deployment configs, plus troubleshooting guides for CUDA out-of-memory and black image issues. ## Quick Start Use the stable diffusion skill to generate a 1024x1024 image of a futuristic city 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 with torch.float16, move it to CUDA, then call it with a text prompt, num_inference_steps, and guidance_scale. The pipeline returns generated PIL images you can save directly.

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

SD 1.5 generates 512x512 images with lower VRAM requirements, SDXL produces higher quality 1024x1024 images, and Flux is a newer architecture with improved prompt adherence. All load through DiffusionPipeline or AutoPipelineForText2Image with the same API.

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 use float16 precision. For tighter budgets, use sequential CPU offload, VAE slicing, or 4-bit quantization with BitsAndBytesConfig.

Does Stable Diffusion support LoRA fine-tuning adapters?▼

Yes, load LoRA weights with pipe.load_lora_weights() and adjust strength via fuse_lora or set_adapters. Multiple LoRAs can be combined with individual adapter weights, and unloaded with unload_lora_weights.

Why are my Stable Diffusion images black or noisy?▼

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

How do I speed up Stable Diffusion image generation?▼

Swap the scheduler to DPMSolverMultistepScheduler and reduce steps to 20, or use LCMScheduler with the LCM LoRA for 4-step generation. Enabling xFormers memory-efficient attention and torch.compile also reduces latency.