stable-diffusion

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Running local text-to-image generation, inpainting, and image-to-image workflows requires navigating Diffusers pipelines, schedulers, memory constraints, and model variants, which is error-prone without a structured guide. ## Core Features & Use Cases - Text-to-Image Generation: Produce images from prompts using SD 1.5, SDXL, SD 3.0, or Flux pipelines with tunable steps, guidance scale, and negative prompts. - Image Transformation: Perform img2img translation, inpainting of masked regions, and ControlNet-conditioned generation from edges, poses, or depth maps. - Optimization & Fine-Tuning: Apply LoRA adapters, memory optimizations like CPU offloading and attention slicing, and fast schedulers such as DPM-Solver or LCM. - Use Case: A developer building an image generation API loads SDXL with FP16 precision, enables model CPU offloading to fit on a single GPU, and serves reproducible generations with seeded generators through a FastAPI endpoint. ## 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

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, 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, SDXL, and Flux pipelines?▼

SD 1.5 generates 512x512 images with lower VRAM needs, SDXL produces higher quality 1024x1024 outputs, and Flux uses newer transformer-based architectures. Diffusers auto-detects the model type when loading with DiffusionPipeline.

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, or load the model in float16 precision. Reducing image dimensions and batch size also lowers memory usage.

Does Stable Diffusion support inpainting and image-to-image?▼

Yes, Diffusers provides AutoPipelineForImage2Image for transforming existing images with a strength parameter, and AutoPipelineForInpainting for filling masked regions defined by a white mask image with text-guided content.

How do I use LoRA weights with a Diffusers pipeline?▼

Call pipe.load_lora_weights() with the LoRA path and weight name, then optionally fuse with pipe.fuse_lora(lora_scale=0.8) to adjust strength. Multiple LoRAs can be combined using set_adapters with per-adapter weights.

Why is my Stable Diffusion generation slow?▼

Default schedulers need 50 steps; switch to DPMSolverMultistepScheduler for 20-step generation or LCMScheduler with the LCM LoRA for 4-step results. Enabling xFormers attention and torch.compile also speeds up inference.