Nodes/ComfyUI-Apt_Preset/flow_stage_unpack
ComfyUI Node

flow_stage_unpack

Get the previous stage's output back out of the stage handle

By cardenluo·Created 2 years ago·Updated a day ago· 320
flow_stage_unpack
  • stage_info
  • image
  • mask
  • latent
  • video
  • audio

flow_stage_unpack is the smallest node in the stage system and possibly the most confusing to newcomers, because at a glance it looks like a no-op: one input, five outputs, nothing to configure. Its whole job is to take the stage_info handle from flow_stage_begin and pull the previous stage's data out of it, converted into one of the five typed outputs. In the middle of a multi-stage run, stage_info.stage_data holds the checkpoint payload that was loaded for this stage - the last stage's result - and this node turns that back into an IMAGE, MASK, LATENT, VIDEO, or AUDIO you can actually wire downstream.

So on stage 2 of a staged video job, flow_stage_unpack hands you stage 1's output as a real tensor. That's the continuity mechanism: the current stage builds on the previous one without anything being kept in memory between runs - it's reloaded from disk.

Outputs

  • image (IMAGE), mask (MASK), latent (LATENT), video (VIDEO), audio (AUDIO) - all five, but only the one matching the saved payload type carries data. The rest are ExecutionBlocker(None) placeholders, which means a downstream node connected to an empty slot simply doesn't run - no crash, no black frames. Type detection is automatic based on what was saved (latent dicts, video components, waveform dicts, image tensors, etc.).

There are no real inputs beyond stage_info, and it validates the handle (version, run id, stage index) before touching anything.

How to use it

Wire flow_stage_beginflow_stage_unpack, then connect whichever output matches the data you expect to your stage's processing nodes. On stage 1, stage_data is whatever initial_data you fed the begin node, so you can seed stage 1 with an input video and let stages 2+ pick it up automatically.

Where it trips people up

The ExecutionBlocker behavior is the thing to internalize: an "empty" output isn't None, it's a blocker that prevents downstream execution. That's correct - you don't want a sampler running on nothing - but it means you shouldn't expect to see a value on every output at once. Also, if you saved a latent on the previous stage and try to read it out as image, you'll get a blocker and your downstream preview stays dark; match the output to the data_type you committed with flow_stage_end. And there's no caching surprise here - it runs as part of the always-executing stage chain, so it always reflects the current run's on-disk state.

Installing it

From cardenluo/ComfyUI-Apt_Preset:

cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset
pip install -r requirements.txt   # or install.bat

Restart and it's under Apt_Preset/flow. Nothing to download.

CategoryApt_Preset/flow

Inputs (1)

NameTypeDefaultDescription
stage_infoFLOW_STAGE_INFO

Outputs (5)

NameTypeDescription
imageIMAGE
maskMASK
latentLATENT
videoVIDEO
audioAUDIO