Nodes/ComfyUI-Apt_Preset/flow_stage_collect_single
ComfyUI Node

flow_stage_collect_single

The endpoint that merges every stage's output into one video (and batches)

By cardenluo·Created 2 years ago·Updated a day ago· 324
flow_stage_collect_single
  • stage_info
  • image
  • mask
  • latent
  • video
  • audio
  • image_batch
  • mask_batch
  • latent_batch
  • merged_video
  • merged_audio

Every staged pipeline needs a finish line, and flow_stage_collect_single is it. It's an output node that sits at the end of a flow-stage graph and gathers what every stage produced, in order, into five neat outputs: an image_batch, a mask_batch, a latent_batch, a merged_video, and merged_audio. You wire the same node's single image/mask/latent/video/audio ports from each stage - each stage hands its segment in through the same sockets - and the collector accumulates them until the final stage, at which point it stitches the video segments and merges the audio into one continuous result.

How it works

Each stage run saves whatever's connected into a per-run batch directory on disk (keyed by the run id from flow_stage_begin). Non-final stages just return execution blockers - they save and say "next." On the last stage, the node loads everything, concatenates the tensor batches, stitches the video segments back into one clip, and merges the audio. It posts a small status line in its UI text ("single-port stages N/N merged: …") so you can see it actually ran.

Because it's an output node that always runs, and it uses the IS_CHANGED → NaN always-rerun idiom, there's no caching risk of it merging stale stage data - each run is freshly assembled. The "single" in the name means single shared port set: every stage connects through the same image/video/etc. sockets, which is exactly right when all your stages flow from one repeated generator node. If each stage instead ends in its own distinct node with its own socket, you want the flow_stage_collect_multi variant (one port per stage).

Inputs and outputs

Inputs: stage_info (required, from flow_stage_begin) and the optional image, mask, latent, video, audio ports - connect only the ones your pipeline actually produces. Outputs: image_batch, mask_batch, latent_batch, merged_video, merged_audio. Unconnected outputs come out as execution blockers rather than errors, so a prompt-collection workflow that only wires latent is fine.

Where it fits

This is the natural partner to the staged H3 samplers: each AD_MinMax_FL2_generate stage emits segment_video and denoise_latent1; feed them into this node and your final merged_video is the whole scene in one clip, with the latents available as a batch if you want to decode or re-process anything per segment.

Install

Same as the whole pack: ComfyUI Manager → search "ComfyUI-Apt_Preset", or git clone https://github.com/cardenluo/ComfyUI-Apt_Preset into custom_nodes, run install.bat, restart. No extra models. The main beginner trap is wiring it without flow_stage_begin's stage_info - without a valid stage token the node can't tell which stage it's on and the merge never fires. Build the stage_info chain first and this node slots in at the end.

CategoryApt_Preset/flow

Inputs (6)

NameTypeDefaultDescription
stage_infoFLOW_STAGE_INFO
imageoptIMAGE
maskoptMASK
latentoptLATENT
videooptVIDEO
audiooptAUDIO

Outputs (5)

NameTypeDescription
image_batchIMAGE
mask_batchMASK
latent_batchLATENT
merged_videoVIDEO
merged_audioAUDIO