Skip to content

[Modular] update the auto pipeline blocks doc#13148

Merged
yiyixuxu merged 8 commits intomainfrom
auto-blocks-doc
Feb 27, 2026
Merged

[Modular] update the auto pipeline blocks doc#13148
yiyixuxu merged 8 commits intomainfrom
auto-blocks-doc

Conversation

@yiyixuxu
Copy link
Collaborator

No description provided.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

```

It is **very** important to include a `description` to avoid any confusion over how to run a block and what inputs are required. While [`~modular_pipelines.AutoPipelineBlocks`] are convenient, it's conditional logic may be difficult to figure out if it isn't properly explained.
It is **very** important to include a `description` to avoid any confusion over how to run a block and what inputs are required. While [`~modular_pipelines.AutoPipelineBlocks`] are convenient, its conditional logic may be difficult to figure out if it isn't properly explained.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we consider providing some kinda of templating in this case? DOesn't have to be in this PR, though.


```py
auto_blocks.get_execution_blocks("mask")
auto_blocks.get_execution_blocks(mask=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity. What was the reasoning behind shifting towards a flag based configuration as opposed to strings (mask=True as opposed to just "mask")?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It supports conditions based on value, e.g. get_execution_blocks(type="a")AutoPipeline was quite limited for more than 2 workflows beause it only supported a single trigger keyword. I wanted a class that can support more flexible conditional paths where we're able to traverse into each one. It was also the easiest to implement this way: https://github.com/huggingface/diffusers/blob/main/src/diffusers/modular_pipelines/modular_pipeline.py#L704

We could probably extend AutoPipeline to support trigger keyward sets though, it's the most common use cases we have

Copy link
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super neat features. I would like to write a test suite around conditional blocks and the workflow selection. Is it okay if I opened a PR?

@yiyixuxu
Copy link
Collaborator Author

@sayakpaul sounds good

would like to write a test suite around conditional blocks and the workflow selection.

Copy link
Member

@stevhliu stevhliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very cool, thanks!

yiyixuxu and others added 5 commits February 26, 2026 20:48
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
@yiyixuxu yiyixuxu merged commit 680076f into main Feb 27, 2026
3 checks passed
@yiyixuxu yiyixuxu deleted the auto-blocks-doc branch February 27, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants