/media-os:media-sd [prompt] [output]from media-os
Generates AI images locally via ComfyUI using permissively-licensed models (FLUX.1 schnell, Kolors, Sana, Lumina-Next, HunyuanDiT, PixArt-Sigma). Supports text-to-image, img2img, ControlNet, LoRA, and ComfyUI workflows.
Ships in media-os. 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.
Read when SKILL.md points to them; scripts run unread.
Context: $ARGUMENTS
scripts/sd.py generate --model flux-schnell --prompt "..." --out out.png --steps 4 → Step 3.scripts/sd.py comfy-workflow --workflow my.json --out out.png → Step 4.scripts/sd.py comfy-install prints the exact clone + pip steps → Step 2.scripts/sd.py img2img --model flux-schnell --init-image in.png --prompt "..." --strength 0.6 --out out.png → Step 3.scripts/sd.py download --model flux-schnell --yes → Step 2.references/LICENSES.md.| Model | License | VRAM (FP16) | Strength | Use when |
|---|---|---|---|---|
| FLUX.1 [schnell] | Apache 2.0 | 24GB (or 12GB NF4) | Highest quality at 4 steps | Default for most users; fastest quality per second |
| Kolors | Apache 2.0 | 16GB | Photorealism, Chinese prompts strong | Photoreal faces/products; multilingual |
| Sana | Apache 2.0 | 12GB (runs on consumer cards) | Efficient DiT, up to 4096px | Tight VRAM budget, high resolution |
| Lumina-Next | Apache 2.0 | 24GB | Strong prompt adherence at high-res | Complex multi-subject prompts |
| HunyuanDiT | Tencent License 2.0 | 16GB | Bilingual EN/CN | Commercial use under >100M MAU cap (see Gotchas) |
| PixArt-Sigma | Per-checkpoint (check) | 12–20GB | Efficient transformer | Research / specific checkpoints — verify license per variant |
Read references/models.md for resolution ranges, speed benchmarks, recommended samplers, and per-model prompt quirks.
Check what's installed locally:
uv run .claude/skills/media-sd/scripts/sd.py check
ComfyUI is the canonical runtime for these models. It's GPL-3.0 and self-hosted.
uv run .claude/skills/media-sd/scripts/sd.py comfy-install
# prints: git clone https://github.com/comfyanonymous/ComfyUI
# cd ComfyUI && python -m venv .venv && source .venv/bin/activate
# pip install -r requirements.txt
# python main.py --listen 127.0.0.1 --port 8188
Pull weights (downloads are big — 5–24 GB — so the script requires --yes to confirm):
uv run .../sd.py download --model flux-schnell --yes
# → downloads into ./ComfyUI/models/unet|vae|clip by default
# override with --comfy-root /path/to/ComfyUI
Or use HuggingFace diffusers directly (pure Python, no ComfyUI needed):
uv run .../sd.py install flux-schnell
# pip install diffusers transformers accelerate torch
Read references/comfyui.md for node-graph basics, the standard FLUX-schnell workflow JSON, ControlNet + LoRA wiring, and common node names.
uv run .../sd.py generate \
--model flux-schnell \
--prompt "a photo of a capybara wearing a tiny wizard hat, studio lighting" \
--out out.png \
--width 1024 --height 1024 \
--steps 4 --guidance 0.0 --seed 42
FLUX-schnell is distilled — --steps 4 + --guidance 0.0 is the correct setting; more steps or guidance >1 will DEGRADE output. Kolors / Sana / Lumina want 20–30 steps and --guidance 4–7.
uv run .../sd.py img2img \
--model flux-schnell \
--init-image input.png \
--prompt "convert to oil painting" \
--strength 0.6 \
--out out.png
--strength 0.0 keeps the input unchanged; 1.0 ignores it. Useful range: 0.3–0.75.
# Start ComfyUI in the background (one-time)
cd ~/ComfyUI && python main.py --listen 127.0.0.1 --port 8188 &
# Run a saved workflow (exported from ComfyUI UI via "Save (API Format)")
uv run .../sd.py comfy-workflow \
--workflow flux_schnell_default.json \
--out out.png \
--server http://127.0.0.1:8188
The script POSTs to /prompt, polls /history/<prompt_id>, then pulls the resulting PNG from /view.
After generating stills, typical hand-offs:
ffmpeg-frames-images skill (ffmpeg -framerate 24 -i "frame_%04d.png" -c:v libx264 ...).media-upscale (Real-ESRGAN / SwinIR).media-svd for i2v.media-lipsync.flux-dev — this skill intentionally does not list it. See references/LICENSES.md.media-upscale or other non-generative skills if the user wants SD-era tooling.media-svd in the sibling skill. SVD's OpenRAIL-M NC terms forbid commercial use. That sibling skill uses LTX-Video / CogVideoX / Mochi instead.guidance_scale=0.0). Setting --guidance 7 will produce blurry/saturated garbage.scripts/sd.py picks quantization based on --dtype (default bfloat16 → auto-fallback to float16 → nf4)./object_info endpoint.diffusers tracks model-specific pipelines. FluxPipeline, KolorsPipeline, SanaPipeline, Lumina2Text2ImgPipeline, HunyuanDiTPipeline. Using AutoPipelineForText2Image usually works but sometimes falls back to the wrong class — the script dispatches explicitly.--yes. Weights are 5–24 GB per model and come from HuggingFace which may require a token (HF_TOKEN env var) for gated models. The helper always confirms first.HF_TOKEN in the environment before download.uv run .../sd.py generate \
--model flux-schnell \
--prompt "cinematic portrait of an astronaut, 35mm film, shallow DOF" \
--out astronaut.png --width 1024 --height 1024 --steps 4 --seed 7
uv run .../sd.py generate \
--model kolors \
--prompt "a red leather messenger bag on a marble table, softbox lighting" \
--out bag.png --steps 25 --guidance 5.0
uv run .../sd.py generate \
--model sana --prompt "snow-capped mountain valley at sunrise" \
--out valley.png --width 2048 --height 2048 --steps 20 --dtype float16
# ComfyUI running on 8188
uv run .../sd.py comfy-workflow \
--workflow flux_schnell_api.json \
--out render.png \
--timeout 300
uv run .../sd.py img2img \
--model flux-schnell --init-image photo.jpg \
--prompt "anime illustration, pastel palette" \
--strength 0.55 --steps 4 --out stylized.png
ModuleNotFoundError: No module named 'diffusers'Cause: the diffusers stack isn't installed in the active Python.
Solution: pip install diffusers transformers accelerate torch or run uv run .../sd.py install flux-schnell which pins the right versions.
CUDA out of memoryCause: model + latent doesn't fit in VRAM.
Solution: add --dtype float16, lower --width/--height to 768, enable --cpu-offload, or switch to Sana which is designed for 12 GB cards.
ConnectionRefusedError: 127.0.0.1:8188Cause: ComfyUI server isn't running.
Solution: cd ~/ComfyUI && python main.py --listen 127.0.0.1 --port 8188. Or run scripts/sd.py comfy-install for the exact setup commands.
Repository not found / 401 Unauthorized from HuggingFaceCause: the model's HF repo is gated and requires authentication.
Solution: accept the terms on the HF page, then export HF_TOKEN=<your_hf_token> before re-running download. Even Apache-licensed weights sometimes require click-through acceptance.
Cause: used --guidance > 0 or --steps != 4 with flux-schnell.
Solution: FLUX-schnell is a distilled model. Use exactly --steps 4 --guidance 0.0. For CFG-style guidance, switch to flux-dev (but that is NON-COMMERCIAL — we don't ship a preset for it).
Cause: the JSON is the UI-format export, not API-format. Solution: in ComfyUI UI, Settings → "Enable Dev mode Options", then "Save (API Format)". Or load the UI JSON into ComfyUI then re-export via the API button.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub damionrashford/media-os --plugin media-os110 skills in this plugin
/audio-coreaudioManipulate macOS audio at the Core Audio HAL layer: afinfo (audio file metadata), afplay (play), afconvert (convert format/rate/bit-depth/channel layout), say (TTS), SwitchAudioSource (change default input/output/system device — brew install switchaudio-osx), audiodevice CLIs (npm/Go variants), AppleScript via osascript to drive System Preferences Sound. HAL plugins at /Library/Audio/Plug-Ins/HAL/ load virtual drivers (BlackHole 2ch/16ch/64ch, Loopback, Background Music). Aggregate Device (drift-corrected multi-in) and Multi-Output Device via Audio MIDI Setup.app or AudioHardwareCreateAggregateDevice. Use when the user asks to change default macOS audio device, route audio between apps on Mac, install BlackHole, build an Aggregate Device, convert audio files with afconvert, or script Mac audio from the terminal.
/audio-jackRoute professional low-latency audio with JACK Audio Connection Kit (jackaudio.org): jackd server (ALSA/CoreAudio/PortAudio/ASIO backends), jack_control (D-Bus JACK2 config), jack_lsp (list ports/connections), jack_connect/jack_disconnect (manage links), jack_cpu_load, jack_samplerate, jack_bufsize (runtime period size), jack_transport, jack_rec (multi-channel WAV recording), jack_iodelay (round-trip latency), jack_wait, jack_midi_dump. JACK1 C maintenance vs JACK2 C++ multicore. Modern Linux swaps jackd for PipeWire's libjack shim — same client API. JackTrip for uncompressed multichannel UDP over the Internet. Use when the user asks to run a JACK server, connect audio clients, measure roundtrip latency, record from JACK ports, set JACK period size, or bridge JACK over the network with JackTrip.
Other plugins' skills for the same job