custom-blocks

Installation
SKILL.md

What this skill is for

A ModularPipelineBlocks subclass is a unit of pipeline logic — input/output spec plus a __call__ — that slots into diffusers' modular pipeline composition. Once you have one defined locally, you almost always want to publish it as a small Hub repo so others can from_pretrained it. diffusers-cli custom_blocks automates the packaging step: it parses your Python file, instantiates the chosen block class, and writes a save_pretrained-style directory in your cwd that's ready to push to the Hub.

Use this skill when:

  • The user is writing a custom modular block and asks "how do I publish this?" or "package this for the Hub".
  • The user has a block.py (or similar) file with one or more ModularPipelineBlocks subclasses.
  • You're scaffolding a new modular pipeline repo and need the on-disk layout that ModularPipelineBlocks.from_pretrained expects.

Don't use this skill for: running an existing modular pipeline (diffusers-cli run), introspecting one (diffusers-cli schema), or writing the block class itself — this skill packages an already-written block.

The end-to-end workflow

Installs
3
GitHub Stars
34.2K
First Seen
4 days ago
custom-blocks — huggingface/diffusers