feat: Add expected_outputs for conditional output computation#12282
Open
feat: Add expected_outputs for conditional output computation#12282
Conversation
54321a5 to
50975a7
Compare
guill
reviewed
Feb 5, 2026
guill
reviewed
Feb 5, 2026
| pass | ||
|
|
||
|
|
||
| def get_expected_outputs_for_node(dynprompt, node_id: str) -> frozenset: |
Member
There was a problem hiding this comment.
nit: Instead of get_expected_outputs_for_node (and using the word expected in general), what do you think of get_possible_outputs_for_node or something like that?
Contributor
Author
There was a problem hiding this comment.
"Possible outputs" sounds like it describes the node capability - which output slots it could produce. A node with 3 output slots always has 3 possible outputs, regardless of connectivity.
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.
This PR adds the ability for nodes to know at runtime which of their outputs are actually connected downstream. This enables nodes to skip computing expensive outputs that won't be used.
Motivation
Some nodes (especially API nodes) produce multiple outputs in different formats (e.g., GLB, FBX, OBJ for 3D models). Currently, all outputs are computed even if only one is connected. This wastes time and bandwidth downloading unused files.
expected_outputsis computed by scanning which outputs have downstream connectionsget_executing_context().expected_outputsExample of usage:
This feature may also be useful for non-API nodes as nodes can now even change their behavior based on unconnected outputs.