Feature request: a stable, public way for a custom node to read another (already-executed) node's output value
Problem
A recurring class of custom nodes needs to read the already-computed output value of some other node in the current prompt graph while running — not just their own resolved inputs. Typical use case: a "save/send image with full generation metadata" node wants to embed the actual sampler name, seed, steps, checkpoint name, etc. that were used upstream (Civitai-style PNG info, Eagle/asset-manager integrations, workflow debugging/introspection tools, and similar).
There is currently no public/documented API for this. The existing "hidden input" mechanism (Hidden.unique_id, Hidden.prompt, Hidden.extra_pnginfo, Hidden.dynprompt) exposes the graph structure (which nodes exist, how they're linked, the raw prompt dict) but not computed output values of other nodes.
As a result, node authors reach into private execution internals instead — typically by monkeypatching execution.PromptExecutor.execute / execution.get_input_data and then reading prompt_executor.caches.outputs (or the execution_list object passed into get_input_data) directly, guessing at whatever method name/shape that internal cache currently exposes.
This is inherently unstable and breaks on essentially every non-trivial refactor of the execution/caching internals, because there was never a supported contract for third parties to depend on:
- watarika/ComfyUI-SendToEagle-w-Metadata#25 (opened today): broke because
RAMPressureCache.get() (comfy_execution/caching.py) became a coroutine as part of the dynamic VRAM/RAM-pressure caching work, and the node's homemade proxy called it synchronously, silently dropping all captured metadata.
- #10481: an unrelated node (reported against
comfy-pack, also seen with ReActor) hit AttributeError: 'dict' object has no attribute 'get_output_cache' from the same category of monkeypatch, after an unrelated internal change to get_input_data's execution_list argument shape. That issue was closed as "not Comfy's issue" — which is fair, since nothing was ever promised to stay stable there, but it also means this whole category of plugin has no supported path forward.
Both nodes independently arrived at the same defensive pattern: try several method names (get, get_cache, get_output_cache) via getattr/hasattr, hoping one exists on whatever internal object the current ComfyUI version happens to pass around. That's a strong signal the underlying need is real and recurring, not a one-off misuse.
Proposal
Expose a small, stable, public accessor for this specific need — for example, one of:
- A new hidden input, e.g.
Hidden.executed_outputs (or similar), giving the node a callable/mapping that resolves (node_id, output_index=None) -> value | None for nodes that have already executed earlier in the same prompt, backed by whatever the internal cache implementation is under the hood.
- Or a documented module-level helper, e.g.
execution.get_node_output(dynprompt, node_id, output_index=None), that custom nodes can import and call directly, insulating callers from cache implementation details (sync vs. async, eviction policy, RAM-pressure staging, method naming) going forward.
Either shape would let this category of node stop depending on PromptExecutor internals and monkeypatching get_input_data, and would give future internal refactors of the caching/execution layer a real compatibility boundary to preserve (or a documented breaking-change note to publish) instead of silently breaking downstream nodes.
Happy to discuss the exact shape, or take a pass at an implementation/PR if there's interest in this direction.
Feature request: a stable, public way for a custom node to read another (already-executed) node's output value
Problem
A recurring class of custom nodes needs to read the already-computed output value of some other node in the current prompt graph while running — not just their own resolved inputs. Typical use case: a "save/send image with full generation metadata" node wants to embed the actual sampler name, seed, steps, checkpoint name, etc. that were used upstream (Civitai-style PNG info, Eagle/asset-manager integrations, workflow debugging/introspection tools, and similar).
There is currently no public/documented API for this. The existing "hidden input" mechanism (
Hidden.unique_id,Hidden.prompt,Hidden.extra_pnginfo,Hidden.dynprompt) exposes the graph structure (which nodes exist, how they're linked, the raw prompt dict) but not computed output values of other nodes.As a result, node authors reach into private execution internals instead — typically by monkeypatching
execution.PromptExecutor.execute/execution.get_input_dataand then readingprompt_executor.caches.outputs(or theexecution_listobject passed intoget_input_data) directly, guessing at whatever method name/shape that internal cache currently exposes.This is inherently unstable and breaks on essentially every non-trivial refactor of the execution/caching internals, because there was never a supported contract for third parties to depend on:
RAMPressureCache.get()(comfy_execution/caching.py) became a coroutine as part of the dynamic VRAM/RAM-pressure caching work, and the node's homemade proxy called it synchronously, silently dropping all captured metadata.comfy-pack, also seen withReActor) hitAttributeError: 'dict' object has no attribute 'get_output_cache'from the same category of monkeypatch, after an unrelated internal change toget_input_data'sexecution_listargument shape. That issue was closed as "not Comfy's issue" — which is fair, since nothing was ever promised to stay stable there, but it also means this whole category of plugin has no supported path forward.Both nodes independently arrived at the same defensive pattern: try several method names (
get,get_cache,get_output_cache) viagetattr/hasattr, hoping one exists on whatever internal object the current ComfyUI version happens to pass around. That's a strong signal the underlying need is real and recurring, not a one-off misuse.Proposal
Expose a small, stable, public accessor for this specific need — for example, one of:
Hidden.executed_outputs(or similar), giving the node a callable/mapping that resolves(node_id, output_index=None) -> value | Nonefor nodes that have already executed earlier in the same prompt, backed by whatever the internal cache implementation is under the hood.execution.get_node_output(dynprompt, node_id, output_index=None), that custom nodes can import and call directly, insulating callers from cache implementation details (sync vs. async, eviction policy, RAM-pressure staging, method naming) going forward.Either shape would let this category of node stop depending on
PromptExecutorinternals and monkeypatchingget_input_data, and would give future internal refactors of the caching/execution layer a real compatibility boundary to preserve (or a documented breaking-change note to publish) instead of silently breaking downstream nodes.Happy to discuss the exact shape, or take a pass at an implementation/PR if there's interest in this direction.