Fix lazy If branch pruning and skipped-parent handling in graph runtime#9079
Open
JPPhoto wants to merge 1 commit intoinvoke-ai:mainfrom
Open
Fix lazy If branch pruning and skipped-parent handling in graph runtime#9079JPPhoto wants to merge 1 commit intoinvoke-ai:mainfrom
JPPhoto wants to merge 1 commit intoinvoke-ai:mainfrom
Conversation
70f9d7b to
63e5b16
Compare
63e5b16 to
f681759
Compare
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.
Summary
Fixes lazy If execution in
invokeai/app/services/shared/graph.pyfor workflows where a selected branch shares ancestors with the unselected branch.The runtime bug was that resolving an
Ifnode decremented indegree for the pruned input but left the pruned execution edge in place, so later parent completion could decrement the same dependency again. This could make theIfnode become ready too early, underflow indegree, or propagateNoneinto required downstream inputs.This PR:
Ifinput edges from the execution graph during branch resolutionIfinput hydrationinvokeai/app/services/shared/README.mdto document the runtime behaviorRelated Issues / Discussions
Complex workflow failure involving a single
Ifnode feedingpositive_text_conditioningonflux_denoise.QA Instructions
Load a workflow where
collect -> if -> required downstream inputis used and verify:KeyError, indegree underflow, or missing required-connection error occurs from theIfruntime pathMerge Plan
Checklist
What's Newcopy (if doing a release after this PR)