diffusers-cli

À utiliser lorsque l’utilisateur souhaite exécuter un pipeline diffusers depuis un terminal (génération ponctuelle, tâches par lots, test rapide d’un nouveau modèle), exécuter sur le matériel HF Sandbox 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).

Plus de skills de huggingface

sync-models
huggingface
Synchroniser la configuration des modèles de chat-ui avec le routeur HuggingFace — ajouter des descriptions pour les nouveaux modèles, marquer ceux capables de raisonnement, activer les artefacts pour les modèles de 32B+…
custom-blocks
huggingface
Use when the user has written (or wants to write) a `ModularPipelineBlocks` subclass in a local Python file and needs to package it into a Hub-uploadable…
self-review
huggingface
Use before opening a PR, or whenever asked to self-review a diffusers contribution. Applies the same rubric as the `@claude` CI (checks the diff against…
hf-cloud-sagemaker-production-defaults
huggingface
Créer un endpoint SageMaker (en temps réel ou asynchrone) avec mise à l’échelle automatique, alarmes CloudWatch et balisage activés par défaut. Utilisez cette compétence chaque fois que vous êtes sur le point de créer un…
hf-cloud-serving-image-selection
huggingface
Choisir le bon conteneur de service pour un déploiement de modèle SageMaker et trouver son URI d’image actuelle. Utilisez cette compétence lorsque vous êtes sur le point de déployer un modèle vers un…
Hugging Face Cli
huggingface
Execute Hugging Face Hub operations using the `hf` CLI. Use when the user needs to download models/datasets/spaces, upload files to Hub repositories, create repos, manage local cache, or run compute jobs on HF infrastructure. Covers authentication, file transfers, repository creation, cache operations, and cloud compute.
Hugging Face Datasets
huggingface
Créer et gérer des ensembles de données sur Hugging Face Hub. Prend en charge l'initialisation de dépôts, la définition de configurations/invites système, la mise à jour en continu des lignes, et l'interrogation/transformation d'ensembles de données basée sur SQL. Conçu pour fonctionner avec le serveur HF MCP pour des workflows complets sur les ensembles de données.
Hugging Face Evaluation
huggingface
Ajouter et gérer les résultats d'évaluation dans les fiches de modèles Hugging Face. Prend en charge l'extraction de tableaux d'évaluation à partir du contenu README, l'importation de scores depuis l'API Artificial Analysis, et l'exécution d'évaluations personnalisées de modèles avec vLLM/lighteval. Fonctionne avec le format de métadonnées model-index.