Skip to content

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

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

yiyixuxu wants to merge 19 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:

f"{block_name}.{attr_name}['{name}'] must be of type {expected.__name__}, replacing the derived one; "
f"got {type(declaration).__name__}."
)
items[index[name]] = declaration

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could the declaration name (or kwargs group) be checked against the override key? {"height": InputParam("width", default=512)} currently passes validation and replaces the public height input with width, while the child still reads height. Rejecting this mismatch would prevent a silently ineffective override.

f"`input_overrides` on {self.__class__.__name__} to pick the default explicitly.",
standard_warn=False,
)
if isinstance(block, ConditionalPipelineBlocks) and block.default_block_name is None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could guaranteed outputs be derived from every reachable branch, including nested composites? A conditional with a default branch can still produce different output sets; treating its union as guaranteed drops a later required input even when the selected branch never produces it. Wrapping a skippable conditional in a sequence has the same problem.

if description is not None:
instance.description = description
for name, value in (
("input_overrides", input_overrides),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could get_execution_blocks() preserve applicable overrides when it calls from_blocks_dict()? An input overridden to 0.9 currently reverts to the leaf default 0.3 in the extracted blocks, so initializing a pipeline from the selected workflow changes its behavior. Please cover overrides during workflow extraction.

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>
…ing main

Co-Authored-By: Claude Fable 5.1 <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