Skip to content

[WIP][modular] update required_inputs, adding override_attribute etc - #15136

Open
yiyixuxu wants to merge 34 commits into
mainfrom
sequential-required-inputs
Open

yiyixuxu wants to merge 34 commits into
mainfrom
sequential-required-inputs

Conversation

@yiyixuxu

@yiyixuxu yiyixuxu commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

fix #15009
related #15133

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests modular-pipelines size/L PR with diff > 200 LOC labels Oct 27, 2026
@HuggingFaceDocBuilderDev

HuggingFaceDocBuilderDev commented Oct 27, 2026 •

Copy link
Copy Markdown

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.

Pages changed in this PR:

Base automatically changed from conditional-runtime-defaults to main November 6, 2026 23:11
yiyixuxu and others added 3 commits November 7, 2026 20:36
…walk

Sequential and loop blocks decide each input's `required` flag and default in one
ordered walk over their sub-blocks; `required_inputs` is derived from `inputs` as
in conditional blocks, and the two overrides are gone. Composites declare their
own `InputParam`/`OutputParam`/`ComponentSpec`/`ConfigSpec` for a derived entry
with `*_overrides`, and get a FutureWarning until they settle a default two
sub-blocks disagree on, a conditional block's per-branch defaults included.
Leaf blocks declare what they write back, docstrings regenerated.

Fixes #15009.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ferent one

In a sequence an input is one shared value, so the walk keeps the first
declaration and warns when a later sub-block declares a different default,
until the composite declares the input in `input_overrides`. A later `None` or a
conditional sub-block's per-branch defaults are fallbacks and never warn; an
earlier default satisfies a later requirement. An output only some branches of
a conditional sub-block produce keeps a later requirement listed, optional.

The conditional merge is rewritten around `required` / `same_default` and sets
`defaults_by_block` through `replace`; the field stays a plain public field.
Docstrings read "required or defaults to 124, depending on the workflow".

Leaf declarations fixed along the way: the LTX denoise loop steps and the
unpack step of one unreleased pipeline mark `height`/`width`/`num_frames`
required, `WanImageResizeStep` declares the `height`/`width` it computes as
outputs, the Wan 2.2 I2V, Wan 2.2 VACE, Wan I2V auto and LTX 2.5 auto blocks
declare `num_frames` (and `height`/`width`) in `input_overrides`, and
`MiniMaxH3Blocks` declares `num_frames` with no default. Class docstrings
regenerated in the files touched; guides updated.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Inputs that some branch of a conditional block requires now read "required,
depending on the workflow" in the hand-copied class docstrings, matching the
renderer. Docstring lines only.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
yiyixuxu and others added 4 commits November 8, 2026 10:46
…nput

An input that a conditional block's branches declare differently rendered as "required or defaults to
X, depending on the workflow". The merged walk cannot know which branch runs, nor whether an earlier
block produces the value in that workflow, so the line now says only that it depends on the workflow.
`get_workflow(name).inputs` gives the exact signature of one workflow; a per-workflow docstring is #15208.

The sequence prefixes a conditional sub-block's `defaults_by_block` keys with the sub-block name, so
the record says which block's branch each entry is.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The resize step reads them with no default and the prompt upsampler defaults them to 2912, which the
sequence now warns about. The pipeline declares both itself, optional with no default, so each workflow
keeps its own.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…rrides`

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@yiyixuxu
yiyixuxu force-pushed the sequential-required-inputs branch from 3c85613 to c266754 Compare November 8, 2026 09:54
yiyixuxu and others added 3 commits November 13, 2026 07:57
… not the encoder

The text encoder repeated the embeddings by `num_videos_per_prompt` and passed the prompt count along as
`batch_size` on the state, so the pipeline listed `batch_size` as an input. The encoder now emits one row per
prompt and `HunyuanVideo15TextInputStep` derives `batch_size` and expands the embeddings, like the other
pipelines.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
No block uses it, and a composite already defines `outputs` to choose which outputs it lists and how it
describes them.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
yiyixuxu and others added 8 commits November 14, 2026 01:07
…oduces its outputs

The sequential walk looked one level into a conditional sub-block. A composite block now marks an output that is
only produced on some runs, so the walk gets the right answer at any depth.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A declaration carries its own name, so the `{name: declaration}` dict repeated it and the two could disagree.

Co-authored-by: wangzihao <47708655+ZihaoW123@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
….new()`

A composite's override only changed what the composite declared; the leaf that reads the input kept filling in its own default, so under an auto block the run did not match the declaration. `block.new(...)` returns a copy of a leaf block with some of its declarations replaced, and composites derive from that. Two sub-blocks that declare different defaults are no longer a warning: the first wins and the other is logged at debug level, the docstring shows what runs.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The extracted blocks listed every intermediate value as an output; they now list what the full blocks list, for the outputs the selected blocks produce. `from_blocks_dict` takes `outputs=`, and its `description=` works (it set a read-only property).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ed means required

`required_params` (default `prompt`) must be marked required on the pipeline blocks, as
`optional_params` must be optional; `generator`, `height` and `width` join the optional
set. A new test drops each required input in turn and expects the block that needs it to
raise. Kandinsky S2V requires `audio` and `image` instead of a prompt.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
yiyixuxu and others added 16 commits November 16, 2026 20:44
…ing main

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…`prompt`

They declared it with `InputParam("prompt")`, so the pipelines listed it as optional and
crashed on `None`. `InputParam.template("prompt")` marks it required and gives it the shared
description. Wan Animate 2 and Wan VACE take one prompt per call, so their description says
so; VACE wraps the shared Wan encoder with `new()` for it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Their text encoders encode an empty prompt when `prompt` is not given, so the default
`required_params` does not apply.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…the batch tests when it is empty

Every pipeline with an empty `batch_params` raises on a list of prompts, which the comment next
to it now says; the 32 per-class skip stubs are gone. Kandinsky S2V joins them. The unused
`intermediate_params` is removed.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…he `not_params` check

`required_params` and `optional_params` cover the canonical inputs and
`expected_workflow_defaults` pins the exact set per workflow, so the subset check added nothing.
The LTX2 text2video configs held only `params` and fold into the shared config.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…RAMS`

Each override now says what the pipeline lacks or renames instead of restating the set, so the
defaults reach every pipeline. The sets were rederived from the pipelines' optional inputs.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…d compatibility

`QwenImageAutoTextEncoderStep` makes the text encoder skippable, so the preset lists `prompt` as
optional. The behaviour stays; the class, the modular guide and the test config now say that new
pipelines should use the text encoder step directly.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ly it

LTX2's prompt enhancer requires `prompt` and writes `prompt`, so the walk treated `prompt` as maybe
produced and made the text encoder's requirement optional. The walk now tracks maybe-outputs whose
producing blocks all require the same name as an input, and those no longer relax a later requirement.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…tions trimmed

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…efaults paragraphs

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… `required_params`

The names each test config used to list in `params` are asserted again: the ones the blocks mark
required in `required_params`, the rest in `optional_params`, on top of the shared defaults.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…laces a whole entry

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…_stay_optional`

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…rom_blocks_dict` signature back on one line

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation fixes-issue modular-pipelines size/L PR with diff > 200 LOC tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[modular] SequentialPipelineBlocks gets required wrong in both inputs and required_inputs

4 participants