Agent skill

Stable Diffusion

by AlexAI-MCP in AlexAI-MCP/hermes-CCC

Run Stable Diffusion locally with diffusers — text-to-image, img2img, inpainting, ControlNet, and SDXL.

MITAuto-check passedAI & LLM Engineering

Install Stable Diffusion

skills CLI
$ npx skills add AlexAI-MCP/hermes-CCC --skill stable-diffusion -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install AlexAI-MCP/hermes-CCC stable-diffusion --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/AlexAI-MCP/hermes-CCC.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/stable-diffusion .claude/skills/stable-diffusion && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
stable-diffusion
GitHub stars
135
Token cost
~2.3k tokens
SKILL.md length
741 words
Files
1
Skills in repo
44
Repo updated
First seen
Licence
MIT

At a glance

Run Stable Diffusion locally with diffusers — text-to-image, img2img, inpainting, ControlNet, and SDXL.

  • Tasks that involve Diffusion and image models
  • SKILL.md covers Purpose, Install, Core Libraries and Text-to-Image With SD 1.5, plus 19 more sections
  • Calls pip

What it does

Stable Diffusion is an agent skill from AlexAI-MCP/hermes-CCC. Run Stable Diffusion locally with diffusers — text-to-image, img2img, inpainting, ControlNet, and SDXL.

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in AI & LLM Engineering, covering Diffusion and image models. It works with Stable Diffusion. The repository describes itself as: Hermes Agent ported to Claude Code Channel — 46 native skills, no OAuth, no external process. The licence is MIT.

When your agent uses it

  • Tasks that involve Diffusion and image models

Example prompts

  • “/stable-diffusion”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit 8107e89. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pip, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Stable Diffusion loads about 2.3k tokens when it runs. Until then it costs about 30 tokens; SKILL.md has 741 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~30
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from AlexAI-MCP/hermes-CCC at commit 8107e89, republished under its MIT licence (© AlexAI-MCP). 741 words, ~2,315 tokens.

Download SKILL.mdSave it as .claude/skills/stable-diffusion/SKILL.md (or your agent's skills folder).
name
stable-diffusion
description
Run Stable Diffusion locally with diffusers — text-to-image, img2img, inpainting, ControlNet, and SDXL.
version
1.0.0
author
hermes-CCC (ported from Hermes Agent by NousResearch)
license
MIT

Stable Diffusion

Purpose

  • Use this skill to generate or edit images locally with Hugging Face diffusers.
  • Prefer it for text-to-image, img2img, inpainting, and model composition workflows.
  • This skill covers both classic Stable Diffusion models and SDXL.
  • It is useful for scripted generation, reproducible experiments, and GPU-backed image pipelines.

Install

bash
pip install diffusers transformers accelerate torch
  • You typically also need a compatible CUDA-enabled PyTorch build for GPU inference.
  • Confirm the install in Python before pulling large checkpoints.

Core Libraries

  • diffusers for pipeline abstractions
  • transformers for text encoders and related model components
  • accelerate for efficient device loading and memory movement
  • torch for runtime execution

Text-to-Image With SD 1.5

  • Classic Stable Diffusion 1.5 uses StableDiffusionPipeline.
python
import torch
from diffusers import StableDiffusionPipeline

pipe = StableDiffusionPipeline.from_pretrained(
    "runwayml/stable-diffusion-v1-5",
    torch_dtype=torch.float16,
)
pipe = pipe.to("cuda")

image = pipe(
    prompt="a cinematic photo of a mountain observatory at sunrise",
    negative_prompt="blurry, low quality, distorted",
    num_inference_steps=30,
    guidance_scale=7.5,
).images[0]

image.save("output.png")

SDXL

  • SDXL typically uses StableDiffusionXLPipeline.
python
import torch
from diffusers import StableDiffusionXLPipeline

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

image = pipe(
    prompt="a highly detailed editorial photo of a futuristic library interior",
    negative_prompt="low resolution, deformed, extra limbs",
    num_inference_steps=35,
    guidance_scale=6.5,
).images[0]

image.save("sdxl-output.png")
  • SDXL generally produces stronger prompt fidelity and image quality than SD 1.5, but it also requires more VRAM.

Key Parameters

  • prompt: the main text instruction
  • negative_prompt: what to suppress
  • num_inference_steps: denoising step count
  • guidance_scale: classifier-free guidance strength
  • seed: random seed for reproducibility

Seeded Generation

  • Use a seed when you need repeatable outputs:
python
import torch
from diffusers import StableDiffusionPipeline

pipe = StableDiffusionPipeline.from_pretrained(
    "runwayml/stable-diffusion-v1-5",
    torch_dtype=torch.float16,
).to("cuda")

generator = torch.Generator(device="cuda").manual_seed(42)

image = pipe(
    prompt="a clean product photo of a ceramic mug on a wood table",
    negative_prompt="blurry, noisy, warped",
    num_inference_steps=28,
    guidance_scale=7.0,
    generator=generator,
).images[0]

image.save("seeded-output.png")
  • The same seed and settings help with debugging prompt and LoRA changes.

Save Output

  • Save the generated image with PIL:
python
image.save("output.png")
  • Always save prompt metadata separately if you need auditability or experiment tracking.

Img2Img

  • Use StableDiffusionImg2ImgPipeline to transform an existing image while preserving composition.
python
import torch
from diffusers import StableDiffusionImg2ImgPipeline
from PIL import Image

pipe = StableDiffusionImg2ImgPipeline.from_pretrained(
    "runwayml/stable-diffusion-v1-5",
    torch_dtype=torch.float16,
).to("cuda")

init_image = Image.open("input.png").convert("RGB").resize((768, 768))

image = pipe(
    prompt="turn this concept sketch into a polished sci-fi matte painting",
    negative_prompt="blurry, low contrast, artifacts",
    image=init_image,
    strength=0.65,
    num_inference_steps=30,
    guidance_scale=7.5,
).images[0]

image.save("img2img-output.png")
  • Lower strength preserves more of the input image.
  • Higher strength pushes the result further away from the source.

Inpainting

  • Use StableDiffusionInpaintPipeline to replace or repair masked regions.
python
import torch
from diffusers import StableDiffusionInpaintPipeline
from PIL import Image

pipe = StableDiffusionInpaintPipeline.from_pretrained(
    "runwayml/stable-diffusion-inpainting",
    torch_dtype=torch.float16,
).to("cuda")

image = Image.open("scene.png").convert("RGB").resize((512, 512))
mask = Image.open("mask.png").convert("RGB").resize((512, 512))

result = pipe(
    prompt="replace the missing area with a wooden chair",
    negative_prompt="blurry, malformed, duplicate objects",
    image=image,
    mask_image=mask,
    num_inference_steps=30,
    guidance_scale=7.5,
).images[0]

result.save("inpaint-output.png")
  • White mask regions are typically where edits are applied.
  • Good masks matter as much as prompts for reliable inpainting.

ControlNet

  • ControlNet is useful when you want stronger control over pose, depth, edges, or composition.
  • Typical uses include pose-guided character generation, depth-aware edits, and line-art conditioning.
  • Pair ControlNet with SD 1.5 or SDXL depending on the model combination you are using.

Memory Optimization

  • Reduce memory pressure with built-in helpers:
python
pipe.enable_model_cpu_offload()
pipe.enable_attention_slicing()
  • pipe.enable_model_cpu_offload() is often helpful on constrained GPUs.
  • pipe.enable_attention_slicing() can reduce peak memory at some performance cost.
  • These settings are practical for laptops and single-GPU consumer machines.

LoRA Loading

  • Load LoRA adapters to specialize style, subject, or composition behavior:
python
pipe.load_lora_weights("./lora.safetensors")
  • Keep the base model and LoRA pairing compatible.
  • Track LoRA names, weights, and prompts in experiment logs.

Negative Prompts

  • Common negative prompts include:

  • blurry

  • low quality

  • worst quality

  • deformed

  • extra limbs

  • bad anatomy

  • artifact

  • text

  • watermark

  • Use concise negative prompts first.

  • Overly long negative prompts can produce unstable or muddled outputs.

Prompting Guidance

  • Be concrete about subject, style, lighting, framing, and medium.
  • Use short prompt iterations during tuning rather than changing many variables at once.
  • Record prompt, negative prompt, seed, and model version together.

SDXL vs SD 1.5

  • Use SDXL when:

  • prompt fidelity matters

  • you need stronger detail and composition

  • you have enough VRAM

  • Use SD 1.5 when:

  • you need a lighter model

  • you rely on mature community tooling

  • you need broad LoRA and ControlNet ecosystem support

Show full SKILL.md (275 more words)Show less

Common Workflows

  • Text-to-image concept generation
  • Product mockups and ideation
  • Img2img refinement from sketches
  • Inpainting object replacement
  • Style transfer through LoRAs

ComfyUI Alternative

  • diffusers is strong for code-driven workflows.
  • ComfyUI is a strong GUI alternative when you want node-based visual workflows.
  • Use ComfyUI for rapid experimentation, complex graph composition, or collaborative prompt workflows.

Practical GPU Guidance

  • SD 1.5 is easier on smaller GPUs.
  • SDXL generally needs more VRAM and benefits from float16.
  • CPU generation is possible, but it is much slower and rarely ideal for interactive use.

Common Failure Modes

  • Out-of-memory:

  • enable CPU offload

  • enable attention slicing

  • reduce image size

  • use SD 1.5 instead of SDXL

  • Muddy or low-quality images:

  • increase num_inference_steps

  • refine the prompt

  • simplify the negative prompt

  • verify you are using the intended model

  • Unreliable edits in img2img:

  • lower or raise strength depending on whether the source is being ignored or over-preserved

  • use clearer prompts

  • start from a cleaner input image

  • Inpainting artifacts:

  • improve the mask

  • widen the masked area slightly

  • use a prompt that matches the surrounding scene

  • Start with a baseline text-to-image run.
  • Lock a seed when comparing prompt or LoRA changes.
  • Move to img2img or inpainting only after the base model behavior looks correct.
  • Add memory optimizations before assuming you need larger hardware.

When To Use This Skill

  • You need local image generation from Python.
  • You want reproducible scripted generation for experiments or pipelines.
  • You need SDXL, img2img, inpainting, or LoRA-based customization.
  • You prefer code-first workflows over GUI-only tools.

Quick Reference

  • Install: pip install diffusers transformers accelerate torch
  • SDXL pipeline: StableDiffusionXLPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0")
  • SD 1.5 pipeline: StableDiffusionPipeline
  • Save image: image.save("output.png")
  • Img2img: StableDiffusionImg2ImgPipeline
  • Inpainting: StableDiffusionInpaintPipeline
  • Memory helpers: pipe.enable_model_cpu_offload() and pipe.enable_attention_slicing()
  • LoRA: pipe.load_lora_weights("./lora.safetensors")

© AlexAI-MCP, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/stable-diffusion of AlexAI-MCP/hermes-CCC.

Open the folder on GitHubat commit 8107e89

Compare with similar skills

Stable Diffusion next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Stable Diffusion compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Stable Diffusion this skillAlexAI-MCP/hermes-CCC135—~2.3kAutomated safety check: PassMIT
LoRA Space Builderhuggingface/skills11k2 repos~8.4kAutomated safety check: PassApache-2.0
Model Compatibilityartokun/comfyui-mcp795—~4kAutomated safety check: PassMIT
Diffusers Ascend Pipelineascend-ai-coding/awesome-ascend-skills174—~3.2kAutomated safety check: PassNone
Automatic1111majiayu000/claude-skill-registry6661 repos~1.6kAutomated safety check: PassApache-2.0
Comfyui Skill OpenclawHuangYuChuh/ComfyUI_Skills_OpenClaw411—~2.7kAutomated safety check: PassApache-2.0

Similar skills

  • LoRA Space Builder

    huggingface/skills

    Official

    Builds and publishes a Gradio demo on Hugging Face Spaces for a LoRA, with the pipeline, UI and settings chosen to match that LoRA's task and model card.

    11k GitHub starsUsed in 2 repos~8.4k tokens
    AI & LLM EngineeringAuto-check passed
  • Model Compatibility

    artokun/comfyui-mcp

    Model family compatibility matrix covering loaders, resolutions, samplers, CFG, VAE, ControlNet, and LoRA compatibility for SD 1.5, SDXL, Flux, SD3, and video models

    795 GitHub stars~4k tokensUpdated 3 days ago
    AI & LLM EngineeringAuto-check passed
  • Diffusers Ascend Pipeline

    ascend-ai-coding/awesome-ascend-skills

    Diffusers Pipeline 推理指南,用于华为昇腾 NPU。覆盖环境预检、通用 Pipeline 推理(图像/视频模型)、内存优化(CPU offload、attention slicing、VAE slicing)、LoRA 加载与融合、多卡推理和按版本检索 Diffusers API。用户一旦提到在昇腾 NPU 上运行 FLUX、SDXL、Wan、CogVideoX 等…

    174 GitHub stars~3.2k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Automatic1111

    majiayu000/claude-skill-registry

    Feature-rich Stable Diffusion Web UI for image generation. An agent skill from majiayu000/claude-skill-registry.

    666 GitHub starsUsed in 1 repo~1.6k tokens
    AI & LLM EngineeringAuto-check passed
  • Comfyui Skill Openclaw

    HuangYuChuh/ComfyUI_Skills_OpenClaw

    Run registered ComfyUI workflows through the fast comfyui-skill CLI, and use the official local Comfy MCP for live template, node, model, validation, and orchestration capabilities.

    411 GitHub stars~2.7k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed
  • Add Comfyui Node

    Mooshieblob1/MooshieUI

    Adds a custom ComfyUI Python node to MooshieUI — Python class in mooshienodes.py, Rust required-class registration, and optional workflow template chain hookup.

    207 GitHub stars~936 tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed

More from AlexAI-MCP/hermes-CCC

All 44 skills in this repo
  • GitHub Code Review

    AlexAI-MCP/hermes-CCC

    Review GitHub pull requests with a findings-first engineering mindset.

    135 GitHub stars~1.3k tokensUpdated 6 mo ago
    Auto-check passed
  • GitHub PR Workflow

    AlexAI-MCP/hermes-CCC

    Run a disciplined GitHub pull request workflow from branch creation through merge.

    135 GitHub stars~1.4k tokensUpdated 6 mo ago
    Auto-check passed
  • Hermes Memory

    AlexAI-MCP/hermes-CCC

    Manage durable project memory for Claude Code. An agent skill from AlexAI-MCP/hermes-CCC.

    135 GitHub stars~1.7k tokensUpdated 6 mo ago
    Auto-check passed
  • Hermes Route

    AlexAI-MCP/hermes-CCC

    Route Claude Code work by complexity, risk, and tool needs. An agent skill from AlexAI-MCP/hermes-CCC.

    135 GitHub stars~1.9k tokensUpdated 6 mo ago
    Auto-check passed
  • Hermes Skill

    AlexAI-MCP/hermes-CCC

    Create, improve, inventory, and audit Claude Code skills. An agent skill from AlexAI-MCP/hermes-CCC.

    135 GitHub stars~1.7k tokensUpdated 6 mo ago
    Auto-check passed
  • Hermes Traj

    AlexAI-MCP/hermes-CCC

    Capture Claude Code interaction trajectories in training-friendly formats.

    135 GitHub stars~1.6k tokensUpdated 6 mo ago
    Auto-check passed

Questions about Stable Diffusion

What does Stable Diffusion do?

Run Stable Diffusion locally with diffusers — text-to-image, img2img, inpainting, ControlNet, and SDXL. Stable Diffusion is an agent skill from AlexAI-MCP/hermes-CCC. Run Stable Diffusion locally with diffusers — text-to-image, img2img, inpainting, ControlNet, and SDXL.

When should I use Stable Diffusion?

Stable Diffusion fits situations like: tasks that involve Diffusion and image models.

How do I install Stable Diffusion in Claude Code?

Run `npx skills add AlexAI-MCP/hermes-CCC --skill stable-diffusion -a claude-code`. Or copy the skill folder (skills/stable-diffusion in AlexAI-MCP/hermes-CCC) into .claude/skills/stable-diffusion in your project. Claude Code loads it when a task matches its description.

How do I install Stable Diffusion in Codex?

Run `npx skills add AlexAI-MCP/hermes-CCC --skill stable-diffusion -a codex`. Or copy the skill folder (skills/stable-diffusion in AlexAI-MCP/hermes-CCC) into .agents/skills/stable-diffusion in your project. Codex loads it when a task matches its description.

Can I use Stable Diffusion in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add AlexAI-MCP/hermes-CCC --skill stable-diffusion -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/stable-diffusion, .gemini/skills/stable-diffusion, .github/skills/stable-diffusion and .opencode/skills/stable-diffusion in your project.

What does Stable Diffusion need to run?

Going by SKILL.md and its folder, Stable Diffusion needs the command-line tools its instructions call (pip). Our summary lists: Python 3.

Does Stable Diffusion access the network?

SKILL.md contains no URLs. Its commands use pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Stable Diffusion safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Stable Diffusion use?

Stable Diffusion is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Stable Diffusion use?

About 2.3k tokens (SKILL.md is roughly 9.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Stable Diffusion?

Skills that share tags, products or a category with Stable Diffusion: LoRA Space Builder (huggingface/skills, 11k stars), Model Compatibility (artokun/comfyui-mcp, 795 stars), Diffusers Ascend Pipeline (ascend-ai-coding/awesome-ascend-skills, 174 stars) and Automatic1111 (majiayu000/claude-skill-registry, 666 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Stable Diffusion?

AlexAI-MCP (a GitHub user) maintains it in AlexAI-MCP/hermes-CCC, which has 135 GitHub stars. The repository holds 44 skills in this directory. The repository was last updated on April 8, 2026.

Source: AlexAI-MCP/hermes-CCC on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.