diffusers-cli

द्वारा huggingface

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…

npx skills add https://github.com/huggingface/diffusers --skill diffusers-cli

Overview

diffusers-cli is the shipped CLI in src/diffusers/commands/. Subcommands relevant to agentic use:

CommandPurpose
runRun any DiffusionPipeline or ModularPipeline. Forwards --pipeline-kwargs verbatim, saves output by detecting its runtime type, optionally runs on HF Jobs via --remote.
schemaPrint the input schema for a pipeline repo (kwarg names, types, defaults, descriptions). No weights downloaded — only the small index file.
custom_blocksPackage a local ModularPipelineBlocks subclass for the Hub.
envPrint versions of diffusers + torch + transformers + accelerate + safetensors + CUDA + GPU info. Use when investigating environment issues, dtype/precision support, or building bug reports.

When to read which file

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-kwargs semantics 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

When NOT to use this skill

  • Multi-stage workflows where you need intermediate tensor manipulation between pipelines → write Python.
  • Training or fine-tuning → CLI only covers inference.
  • Anything requiring quantization_config or other low-level loader knobs not exposed by the CLI flags → write Python. (device_map is exposed as --device-map; see run.md.)

Verifying the CLI is installed

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.

Output formats

--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 nested structures 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).

huggingface की और Skills

cpu-kernels
huggingface
C++ CPU कर्नेल लिखने, अनुकूलित करने और बेंचमार्क करने के लिए मार्गदर्शन प्रदान करता है, जिसमें Hugging Face कर्नेल इकोसिस्टम के लिए SIMD इंट्रिन्सिक्स (AVX2/AVX512) शामिल हैं। इसमें…
official
generate-openenv-env
huggingface
एक ठोस उपयोग मामले से OpenEnv वातावरण उत्पन्न करें (उदाहरण के लिए, "लाइब्रेरी textarena के लिए एक env उत्पन्न करें")। जब किसी नए को डिज़ाइन या कार्यान्वित करने के लिए कहा जाए तो इसका उपयोग करें…
official
hf-mcp
huggingface
Hugging Face Hub का उपयोग MCP सर्वर टूल्स के माध्यम से करें। मॉडल, डेटासेट, Spaces, पेपर्स खोजें। रिपॉजिटरी विवरण प्राप्त करें, दस्तावेज़ीकरण लाएं, कंप्यूट जॉब चलाएं, और Gradio का उपयोग करें…
official
trl-training
huggingface
ट्रांसफॉर्मर भाषा मॉडल को TRL (ट्रांसफॉर्मर्स रीइन्फोर्समेंट लर्निंग) का उपयोग करके प्रशिक्षित और फाइन-ट्यून करें। SFT, DPO, GRPO, KTO, RLOO और रिवॉर्ड मॉडल प्रशिक्षण का समर्थन करता है…
official
deploy-hf
huggingface
OpenEnv वातावरण को Hugging Face Spaces पर तैनात करें। जब तैनात करने, Hugging Face पर पुश करने, या स्पेस अपडेट करने के लिए कहा जाए तो इसका उपयोग करें।
official
hf-space-recovery
huggingface
Diagnose and recover failing or stuck Hugging Face Space deployments for OpenEnv environments. Use when deploying envs from `envs/` to the Hub (`openenv`…
official
pre-submit-pr
huggingface
पुल रिक्वेस्ट सबमिट करने से पहले बदलावों को मान्य करें। लिंट, टेस्ट, संरेखण समीक्षा और आरएफसी विश्लेषण सहित व्यापक जांच चलाएं। इसका उपयोग बनाने से पहले करें...
official
example-skill
huggingface
एक्शन स्मोक टेस्ट के लिए उदाहरण फिक्स्चर स्किल
official