Skip to content
Skillpedia
Images & icons14k Β· #11237

stable-diffusion-image-generation

What it does

This skill explains how to generate and edit images with Stable Diffusion models. It is for creators and developers who want to make or change images with code.

When to use it

  • βœ“When you want to make an image from a written description.
  • βœ“When you want to change the style of an existing picture using a text prompt.
  • βœ“When you need to fill in a masked area of a photo or extend an image beyond its edges.

Skill link

https://github.com/Orchestra-Research/AI-Research-SKILLs/blob/main/18-multimodal/stable-diffusion/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/Orchestra-Research/AI-Research-SKILLs/blob/main/18-multimodal/stable-diffusion/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œGenerate a watercolor style picture of a lighthouse at sunset from my description.”

5 new skills a week. 1 minute to read.

How it works

You load a pipeline from the Diffusers library and pass a text prompt. The model starts from noise and refines it step by step into an image. The skill also covers image-to-image, inpainting and LoRA styles.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Stable Diffusion Image Generation

Comprehensive guide to generating images with Stable Diffusion using the HuggingFace Diffusers library.

When to use Stable Diffusion

Use Stable Diffusion when:

  • Generating images from text descriptions
  • Performing image-to-image translation (style transfer, enhancement)
  • Inpainting (filling in masked regions)
  • Outpainting (extending images beyond boundaries)
  • Creating variations of existing images
  • Building custom image generation workflows

Key features:

  • Text-to-Image: Generate images from natural language prompts
  • Image-to-Image: Transform existing images with text guidance
  • Inpainting: Fill masked regions with context-aware content
  • ControlNet: Add spatial conditioning (edges, poses, depth)
  • LoRA Support: Efficient fine-tuning and style adaptation
  • Multiple Models: SD 1.5, SDXL, SD 3.0, Flux support

Use alternatives instead:

  • DALL-E 3: For API-based generation without GPU
  • Midjourney: For artistic, stylized outputs
  • Imagen: For Google Cloud integration
  • Leonardo.ai: For web-based creative workflows

Quick start

Installation

pip install diffusers transformers accelerate torch
pip install xformers  # Optional: memory-efficient attention

Basic text-to-image

from diffusers import DiffusionPipeline
import torch

# Load pipeline (auto-detects model type)
pipe = DiffusionPipeline.from_pretrained(
    "stable-diffusion-v1-5/stable-diffusion-v1-5",
    torch_dtype=torch.float16
)
pipe.to("cuda")

# Generate image
image = pipe(
    "A serene mountain landscape at sunset, highly detailed",
    num_inference_steps=50,
    guidance_scale=7.5
).images[0]

image.save("output.png")

Using SDXL (higher quality)

from diffusers import AutoPipelineForText2Image
import torch

pipe = AutoPipelineForText2Image.from_pretrained(
    "stabilityai/stable-diffusion-xl-base-1.0",
    torch_dtype=torch.float16,
    variant="fp16"
)
pipe.to("cuda")

# Enable memory optimization
pipe.enable_model_cpu_offload()

image = pipe(
    prompt="A futuristic city with flying cars, cinematic lighting",
    height=1024,
    width=1024,
    num_inference_steps=30
).images[0]

Architecture overview

Three-pillar design

Diffusers is built around three core components:

Pipeline (orchestration)
β”œβ”€β”€ Model (neural networks)
β”‚   β”œβ”€β”€ UNet / Transformer (noise prediction)
β”‚   β”œβ”€β”€ VAE (latent encoding/decoding)
β”‚   └── Text Encoder (CLIP/T5)
└── Scheduler (denoising algorithm)

Pipeline inference flow

Text Prompt β†’ Text Encoder β†’ Text Embeddings
                                    ↓
Random Noise β†’ [Denoising Loop] ← Scheduler
                      ↓
               Predicted Noise
                      ↓
              VAE Decoder β†’ Final Image

Core concepts

Pipelines

Pipelines orchestrate complete workflows:

Pipeline Purpose
StableDiffusionPipeline Text-to-image (SD 1.x/2.x)
StableDiffusionXLPipeline Text-to-image (SDXL)
StableDiffusion3Pipeline Text-to-image (SD 3.0)
FluxPipeline Text-to-image (Flux models)
StableDiffusionImg2ImgPipeline Image-to-image
StableDiffusionInpaintPipeline Inpainting

Schedulers

Schedulers control the denoising process:

Scheduler Steps Quality Use Case
EulerDiscreteScheduler 20-50 Good Default choice
EulerAncestralDiscreteScheduler 20-50 Good More variation
DPMSolverMultistepScheduler 15-25 Excellent Fast, high quality
DDIMScheduler 50-100 Good Deterministic
LCMScheduler 4-8 Good Very fast
UniPCMultistepScheduler 15-25 Excellent Fast convergence

Swapping schedulers

from diffusers import DPMSolverMultistepScheduler

# Swap for faster generation
pipe.scheduler = DPMSolverMultistepScheduler.from_config(
    pipe.scheduler.config
)

# Now generate with fewer steps
image = pipe(prompt, num_inference_steps=20).images[0]

Generation parameters

Key parameters

Parameter Default Description
prompt Required Text description of desired image
negative_prompt None What to avoid in the image
num_inference_steps 50 Denoising steps (more = better quality)
guidance_scale 7.5 Prompt adherence (7-12 typical)
height, width 512/
FAQ

What do I need to install?

Run pip install diffusers transformers accelerate torch, with xformers as an optional add-on.

Which models does it support?

The skill lists SD 1.5, SDXL, SD 3.0 and Flux.

How do I add a specific style?

The skill mentions LoRA support for efficient style adaptation.

Details

Original description by the author

State-of-the-art text-to-image generation with Stable Diffusion models via HuggingFace Diffusers. Use when generating images from text prompts, performing image-to-image translation, inpainting, or building custom diffusion pipelines.

repo: Orchestra-Research/AI-Research-SKILLs

Popularity

GitHub stars
14k
Ranking position
#11237
License
MIT
Updated
10/10/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills