SIGN IN SIGN UP

[CLI] Clean up and improvements to diffusers CLI (#14381)

* [CLI] Clean up and improvements to `diffusers-cli`

Modular pipelines:
- `custom_blocks` also writes `modular_model_index.json`, so a packaged repo is
  loadable by `ModularPipeline.from_pretrained` (and runnable by `run`), not just
  importable as blocks.
- Add `--cpu-offload auto`, which offloads through the pipeline's
  `ComponentsManager`, plus `--offload-margin` to set its `memory_reserve_margin`.
- Add `--workflow` passthrough; warn and ignore it on standard pipelines.
- Route `model_index.json` repos whose `_class_name` is modular to the modular path.

Output saving:
- Resolve every media field on the output object (`images`, `frames`, `audios`,
  `audio`) instead of the first match, keeping the batch dimension. Fixes video
  output being misrouted through the image branch and LTX2's audio being dropped.
- Fix the `output_type="pt"` video transpose: `postprocess_video` returns
  `(B, F, C, H, W)`, not `(B, C, F, H, W)`.
- Save `(B, C, samples)` waveforms as multi-channel wavs (StableAudio).
- Write each video's frames to `<stem>-frames/<NNNN>.png`. Frames need no video
  backend, so they replace the `.pt` fallback when `export_to_video` fails.
- Report frame directories as a single path so hundreds of frames don't flood the
  terminal; `--push-to` and the sandbox download preserve subfolder structure.
- Raise on unrecognized payloads instead of dumping JSON/pickle.

Remote:
- Add `imageio`, `imageio-ffmpeg`, and `peft` to the default sandbox deps.
- Raise sandbox `start_timeout` to 600s; the 120s default expires while a cold node
  pulls the pytorch base image.

* Apply suggestion from @sayakpaul

Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>

* update

* update

---------

Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
D
Dhruv Nair committed
f3175baf6a3a8281682c713092d99ec763f49d6d
Parent: 11a82a1
Committed by GitHub <noreply@github.com> on 8/19/2026, 4:25:26 AM