/vibe:diffusers-library-expertfrom vibe
Expert guidance on HuggingFace diffusers library: pipelines for SD1.5, SDXL, SD3, Flux, video, audio; scheduler swapping, LoRA/IP-Adapter/ControlNet loading, memory optimization, and custom pipeline patterns.
Ships in vibe. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an expert in the diffusers Python library - the canonical reference implementation for diffusion model inference and training. You know every pipeline class, scheduler swap, adapter loader, memory optimization, and how to ship custom pipelines.
from_single_file for community checkpoints.| Task | Pipeline class | Example model |
|---|---|---|
| SDXL t2i | StableDiffusionXLPipeline | sd-xl-base-1.0 |
| SDXL i2i | StableDiffusionXLImg2ImgPipeline | refiner |
| SDXL inpaint | StableDiffusionXLInpaintPipeline | sdxl-inpainting |
| SDXL ControlNet | StableDiffusionXLControlNetPipeline | + ControlNetModel |
| SD3.5 t2i | StableDiffusion3Pipeline | sd-3.5-large |
| Flux t2i | FluxPipeline | FLUX.1-dev |
| Flux ControlNet | FluxControlNetPipeline | + FluxControlNetModel |
| AnimateDiff | AnimateDiffPipeline | + MotionAdapter |
| SVD | StableVideoDiffusionPipeline | SVD-XT |
| CogVideoX | CogVideoXPipeline | CogVideoX-5b |
| Mochi | MochiPipeline | mochi-1-preview |
| Stable Audio | StableAudioPipeline | stable-audio-open-1.0 |
import torch
from diffusers import StableDiffusionXLPipeline, AutoPipelineForText2Image
# Generic auto-detect (recommended for unknown checkpoints)
pipe = AutoPipelineForText2Image.from_pretrained(
"stabilityai/stable-diffusion-xl-base-1.0",
torch_dtype=torch.float16, variant="fp16", use_safetensors=True,
).to("cuda")
img = pipe("a cat astronaut").images[0]
pipe = StableDiffusionXLPipeline.from_single_file(
"models/juggernaut_xl_v9.safetensors",
torch_dtype=torch.float16,
).to("cuda")
from diffusers import (DPMSolverMultistepScheduler, EulerAncestralDiscreteScheduler,
DDIMScheduler, LCMScheduler, FlowMatchEulerDiscreteScheduler)
# Quality default
pipe.scheduler = DPMSolverMultistepScheduler.from_config(
pipe.scheduler.config, use_karras_sigmas=True, algorithm_type="dpmsolver++",
)
# Flow matching for Flux/SD3 (already default but tweakable)
pipe.scheduler = FlowMatchEulerDiscreteScheduler.from_config(pipe.scheduler.config, shift=3.0)
# LCM/turbo
pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config)
# Single LoRA
pipe.load_lora_weights("user/style-lora", weight_name="style.safetensors")
pipe.fuse_lora() # bake in for speed (irreversible without unload)
# Multiple LoRAs with weighting
pipe.load_lora_weights("artist/style", adapter_name="style")
pipe.load_lora_weights("char/face", adapter_name="face")
pipe.set_adapters(["style", "face"], adapter_weights=[0.7, 0.9])
pipe.disable_lora() # turn off without unload
pipe.unload_lora_weights() # remove entirely
pipe.load_ip_adapter(
"h94/IP-Adapter", subfolder="sdxl_models",
weight_name="ip-adapter-plus_sdxl_vit-h.safetensors",
)
pipe.set_ip_adapter_scale(0.6)
img = pipe(prompt=p, ip_adapter_image=ref_pil).images[0]
Order matters when combining: load IP-Adapter before LCM-LoRA / Lightning LoRA.
pipe.load_textual_inversion("sd-concepts-library/cat-toy", token="<cat-toy>")
img = pipe("a <cat-toy> on the moon").images[0]
from diffusers import ControlNetModel, StableDiffusionXLControlNetPipeline
cn = ControlNetModel.from_pretrained("xinsir/controlnet-canny-sdxl-1.0", torch_dtype=torch.float16)
pipe = StableDiffusionXLControlNetPipeline.from_pretrained(
"stabilityai/stable-diffusion-xl-base-1.0", controlnet=cn, torch_dtype=torch.float16,
).to("cuda")
out = pipe(prompt=p, image=canny_img, controlnet_conditioning_scale=0.8).images[0]
pipe.enable_attention_slicing("auto") # -10% memory, slight slowdown
pipe.enable_vae_slicing() # -VAE memory
pipe.enable_vae_tiling() # for large images / video
pipe.enable_model_cpu_offload() # -50% VRAM, swaps modules to CPU
pipe.enable_sequential_cpu_offload() # max savings, biggest slowdown
pipe.unet.to(memory_format=torch.channels_last) # ~10% speedup on Ampere+
# torch.compile (PyTorch 2.x) - ~30-50% speedup after warmup
pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
pipe.vae.decode = torch.compile(pipe.vae.decode, mode="reduce-overhead", fullgraph=True)
# 8-bit text encoders for SD3/Flux
from transformers import T5EncoderModel, BitsAndBytesConfig
t5 = T5EncoderModel.from_pretrained(model_id, subfolder="text_encoder_3",
quantization_config=BitsAndBytesConfig(load_in_8bit=True))
# Load community pipeline (e.g., long-prompt weighting)
pipe = AutoPipelineForText2Image.from_pretrained(
"stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16,
custom_pipeline="lpw_stable_diffusion_xl",
)
img = pipe(prompt="(masterpiece:1.4), (best quality:1.3), ...").images[0]
Write your own subclass of DiffusionPipeline for novel research workflows.
madebyollin/sdxl-vae-fp16-fix or force_upcast=False.enable_xformers_memory_efficient_attention() deprecated - PyTorch SDPA is default..to("cuda") after enable_model_cpu_offload() defeats the point.torch.compile first call is slow (compilation); warm up with a dummy gen.diffusers minor version can change LoRA conversion behavior - pin in production.from_single_file.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
diffusers, huggingface, diffusion-models, image-generation, lora, ip-adapter
npx claudepluginhub anubhavg-icpl/vibe --plugin vibe5,304 skills in this plugin
/3d-pipelineChoose a 3D generation or reconstruction pipeline given input type, output format, and use case. Use when you need help with 3d pipeline./8-bit-orbit-video-templateHyperframes Video TemplateShip a premium template-mode Hyperframes composition with a ready default showcase and deterministic timeline behavior./a2a-agent-specProduce the Agent Card and skills schema for an agent that should be callable over A2A. Use when you need help with a2a agent spec.Other plugins' skills for the same job