> Use when the user wants to run a diffusers pipeline from a terminal (one-off generation, batch jobs, smoke-testing a new model), run on HF Sandbox hardware via `--remote`, introspect a pipeline's input schema before calling it, or attach a LoRA at inference time. Prefer this over writing ad-hoc Python scripts for generation tasks.
npx skills add https://github.com/huggingface/diffusers --skill diffusers-cli
diffusers-cli is the shipped CLI in src/diffusers/commands/. Subcommands relevant to agentic use:
| Command | Purpose |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| run | Run any DiffusionPipeline or ModularPipeline. Forwards --pipeline-kwargs verbatim, saves output by detecting its runtime type, optionally runs on HF Jobs via --remote. |
| schema | Print the input schema for a pipeline repo (kwarg names, types, defaults, descriptions). No weights downloaded — only the small index file. |
| custom_blocks | Package a local ModularPipelineBlocks subclass for the Hub. |
| env | Print versions of diffusers + torch + transformers + accelerate + safetensors + CUDA + GPU info. Use when investigating environment issues, dtype/precision support, or building bug reports. |
Most agentic work goes through run. Read the matching reference file before constructing a command:
run.md — full reference for diffusers-cli run. Covers --pipeline-kwargssemantics and the shell-quoting gotcha, LoRA via --lora, optimization flags (--dtype, --cpu-offload,
--attention-backend, --vae-tiling/slicing), output handling and --push-to bucket uploads, the full
--remote HF Jobs flow (image, container command, log streaming, timing payload, artifact download), and
context parallel (--context-parallel) for both local-torchrun and --remote paths.
The other commands are small enough that diffusers-cli <command> --help is the canonical reference:
diffusers-cli schema --help
diffusers-cli custom_blocks --help
diffusers-cli env --help
quantization_config or other low-level loader knobs not exposed by the CLI flags → writePython. (device_map is exposed as --device-map; see run.md.)
The console entry point is registered in pyproject.toml (`diffusers-cli =
"diffusers.commands.diffusers_cli:main"). If diffusers-cli is not on PATH after pip install -e .`, reinstall
with pip install -e . --force-reinstall --no-deps and check which diffusers-cli. If the installed binary is
missing recent features (e.g. you see unrecognized arguments: --lora), reinstall.
--format {auto, human, agent, json} (top-level flag, must appear before the subcommand):
human — plain-text indented output for terminals (default when not running under an agent harness). No ANSI color.agent — TSV tables and key=value lines. Auto-selected when an agent env var is present(CLAUDECODE, CLAUDE_CODE, CODEX_SANDBOX, CURSOR_AI, AIDER_AI_CONTEXT, GH_COPILOT_AGENT,
AI_AGENT). Token-cheap for LLM agents to read.
json — compact JSON. Use for programmatic parsing (scripts, services) where type fidelity and nestedstructures matter.
stdout carries data; stderr carries hints/warnings/progress — parseable output is never polluted.
Rule of thumb: --format json for scripts that will json.loads() the output, otherwise leave it on
auto-detect (agent for LLMs, human for terminals).
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup
Comprehensive GitHub release orchestration with AI swarm coordination for automated versioning, testing, deployment, and rollback management
Migrate test files from `as` type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace `as` in tests, or needs partial test data.
Modern JavaScript/TypeScript development with Bun runtime. Covers package management, bundling, testing, and migration from Node.js. Use when working with Bun, optimizing JS/TS development speed, or migrating from Node.js to Bun.
You are a dependency management expert specializing in safe, incremental upgrades of project dependencies. Plan and execute dependency updates with minimal risk, proper testing, and clear migration pa
Master systematic debugging techniques, profiling tools, and root cause analysis to efficiently track down bugs across any codebase or technology stack. Use when investigating bugs, performance issues, or unexpected behavior.
Opinionated backend development standards for Node.js + Express + TypeScript microservices. Covers layered architecture, BaseController pattern, dependency injection, Prisma repositories, Zod validation, unifiedConfig, Sentry error tracking, async safety, and testing discipline.
Best practices for writing JavaScript/TypeScript tests using Jest, including mocking strategies, test structure, and common patterns.
Take huggingface/diffusers-cli from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.
The instructions reference pip.
Without those the skill loads but fails at the first command.