diffusers-cli

작성자: huggingface

사용자가 터미널에서 diffusers 파이프라인을 실행하려 할 때(일회성 생성, 배치 작업, 새 모델 스모크 테스트), HF Sandbox 하드웨어에서 실행할 때 사용합니다…

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의 다른 스킬

sync-models
huggingface
chat-ui의 모델 구성을 HuggingFace 라우터와 동기화 — 새 모델에 대한 설명을 추가하고, 추론 기능이 있는 모델을 표시하며, 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
SageMaker 엔드포인트(실시간 또는 비동기)를 생성하며, 자동 확장, CloudWatch 알람, 태깅이 기본적으로 활성화됩니다. 이 스킬은 엔드포인트를 생성하려고 할 때마다 사용하세요.
hf-cloud-serving-image-selection
huggingface
SageMaker 모델 배포에 적합한 서빙 컨테이너를 선택하고 현재 이미지 URI를 찾습니다. 모델을 배포하려 할 때마다 이 스킬을 사용하세요.
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
허깅 페이스 허브에서 데이터셋을 생성하고 관리합니다. 리포지토리 초기화, 설정/시스템 프롬프트 정의, 행 업데이트 스트리밍, SQL 기반 데이터셋 쿼리/변환을 지원합니다. 포괄적인 데이터셋 워크플로를 위해 HF MCP 서버와 함께 작동하도록 설계되었습니다.
Hugging Face Evaluation
huggingface
Hugging Face 모델 카드에 평가 결과를 추가하고 관리합니다. README 콘텐츠에서 평가 테이블 추출, Artificial Analysis API에서 점수 가져오기, vLLM/lighteval을 사용한 사용자 정의 모델 평가 실행을 지원합니다. model-index 메타데이터 형식과 함께 작동합니다.