Modular branch specific defaults#14234
Open
yiyixuxu wants to merge 15 commits into
Open
Conversation
When sibling blocks of a ConditionalPipelineBlocks declare different defaults for the same input, combine_inputs now merges the default to None and records the per-block defaults in a new InputParam.defaults_by_block field, instead of silently promoting the non-None default. get_block_state falls back to the block's own declared default when the state value is None, so each branch resolves its own default when it actually runs and a branch using None as a "user didn't pass this" sentinel is no longer polluted by a sibling's default. Docstrings render conflicted defaults as e.g. "defaults to None or 189, depending on the workflow". Fixes #14132 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
defaults_by_block is a dataclass field so it always exists; the checks are already inside the hasattr(param, "required") InputParam guard. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
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. |
…tion block restructure Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…example Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
strength on img2img (0.3) / inpaint (0.9999), text2img as the None sentinel branch; drop the separate video fixtures. Also add examples to the combine_inputs accumulator comments. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…th output
Assert on state.get("strength") directly (write-back records the branch's
resolved value); cover None-vs-non-None merge with a direct combine_inputs
test instead.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
block-a/block-b names, whole-list assertions, plus new coverage: first-occurrence-wins, disagreement records every block, direct nested prefixing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ality Also group combine_inputs tests under TestConditionalBlocksInputs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
workflow is now a declared intermediate output on the fixture blocks so each runtime test shows which branch ran; the merge tests also assert the rendered docstring (nested case covers distinct-value dedupe). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ombine_inputs Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tring The combine_inputs docstring example is now a fenced code block so doc-builder doesn't reflow it. The cosmos3 use_system_prompt docstring change reflects a real behavior fix this PR makes: the transfer/action branches declare default=True while the standard text branch declares default=None as a sentinel that falls back to the default_use_system_prompt config. Previously the merged default True leaked into state before branch selection, so the config fallback never fired for the standard workflow; each branch now resolves its own default and the config is honored again. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Mechanical output of utils/modular_auto_docstring.py for the cosmos files this PR touches; regeneration of the remaining stale pipelines moved to its own PR. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
yiyixuxu
force-pushed
the
modular-branch-specific-defaults
branch
from
July 19, 2026 08:18
b93cd2a to
3a2888f
Compare
yiyixuxu
commented
Jul 19, 2026
| use_system_prompt (`bool`, *optional*): | ||
| Whether to prepend the system prompt. Defaults to the pipeline configuration for standard and action | ||
| workflows and to True for transfer. | ||
| use_system_prompt (`bool`, *optional*, defaults to True or None, depending on the workflow): |
Collaborator
Author
There was a problem hiding this comment.
Only this change is related to this PR
. The rest of docstring changes in cosmos folder are because I re-ran the auto docstring command , see #14241
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix #14132
related to #14241 (ideally merge #14241 first)