stable-diffusion-image-generation

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

Updated Jun 7, 2026
One-click install
npx skills add https://github.com/Chensihakniroth/ANAKOT-AGENT --skill stable-diffusion-image-generation-chensihakniroth
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: stable-diffusion-image-generation
Source: https://github.com/Chensihakniroth/ANAKOT-AGENT/tree/main/optional-skills/mlops/stable-diffusion
Command: npx skills add https://github.com/Chensihakniroth/ANAKOT-AGENT --skill stable-diffusion-image-generation-chensihakniroth

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Creating custom images programmatically requires deep knowledge of diffusion model pipelines, schedulers, memory management, and model variants. This Skill provides complete guidance for text-to-image generation, image-to-image translation, inpainting, and custom diffusion workflows using the HuggingFace Diffusers library. ## Core Features & Use Cases - Text-to-Image Generation: Generate images from natural language prompts using SD 1.5, SDXL, SD 3.0, or Flux models with configurable schedulers and guidance scales. - Image Transformation: Perform image-to-image translation, inpainting of masked regions, and ControlNet-conditioned generation with edge, pose, or depth maps. - Fine-Tuning & Adapters: Load LoRA adapters, textual inversion embeddings, and IP-Adapters for style and subject customization. - Use Case: A developer building a product mockup tool can generate 1024x1024 images with SDXL, apply a brand-style LoRA at 0.8 strength, and deploy the pipeline behind a FastAPI endpoint with GPU memory offloading. ## Quick Start Generate an image of a serene mountain landscape at sunset using Stable Diffusion 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 from text 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 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 models?▼

SD 1.5 generates 512x512 images with lower memory requirements, SDXL produces higher quality 1024x1024 outputs, and Flux is a newer transformer-based model. Each uses a dedicated pipeline class in Diffusers such as StableDiffusionXLPipeline or FluxPipeline.

How to fix CUDA out of memory errors in Diffusers?▼

Enable model CPU offloading with pipe.enable_model_cpu_offload(), add attention slicing, and use VAE slicing for large images. You can also load models in float16 precision or reduce image dimensions and batch size.

Does Stable Diffusion support LoRA fine-tuning adapters?▼

Yes, Diffusers supports loading LoRA weights with pipe.load_lora_weights() and adjusting strength via fuse_lora with a lora_scale parameter. Multiple LoRAs can be combined using set_adapters with individual adapter weights.

Why are my Stable Diffusion images black or noisy?▼

Black images often result from VAE dtype mismatches or safety checker interference, while noise indicates too few inference steps or scheduler misconfiguration. Ensure consistent float16 dtypes, increase num_inference_steps, and verify the scheduler config.

How do I use ControlNet for pose or edge conditioned generation?▼

Load a ControlNetModel such as control_v11p_sd15_canny, pass it to StableDiffusionControlNetPipeline, then provide a preprocessed control image like a Canny edge map alongside your text prompt. Adjust controlnet_conditioning_scale between 0.5 and 1.5 for conditioning strength.