Nodes/radiance/Video Assembler
ComfyUI Node

Video Assembler

A stateful buffer living inside a stateless engine

By FXTD-Studios·Created 8 months ago·Updated about 18 hours ago· 246
Video Assembler
  • frame
  • video_image
  • frames_accumulated
  • is_complete
◄session_keyvideo_session_0►
◄expected_total_frames24►
◄flushfalse►
◄resetfalse►

ComfyUI nodes are pure functions. Give the same inputs, get the same outputs, and the engine leans on that hard - it caches aggressively and re-runs only what changed. Video Assembler deliberately breaks that rule: it keeps a list of frames in memory, appends to it every time it executes, and hands you a finished sequence once enough of them have arrived.

That's how you do per-frame processing on a video in ComfyUI: pull one frame out, grade it, put it back. It's also a node you have to think about, because stateful nodes and caching don't naturally get along.

How it works

frame (IMAGE) is appended to the buffer on every execution. session_key (default video_session_0) names that buffer - the tooltip's advice is to "use a different key per clip being assembled in parallel," which matters more than it sounds, because the buffers are per key and two clips sharing one key will interleave into nonsense.

expected_total_frames (default 24) is the trigger: output is complete, and the buffer cleared, once this many inputs have arrived. Read the second half of that tooltip carefully: it counts executions, not images. If you feed it a batch of 5 frames, that's one execution - one tick toward the total. Feed it 24 single frames, that's 24.

Outputs are video_image (the assembled batch), frames_accumulated (INT - where the count is right now) and is_complete (BOOLEAN). The two optional flags are your manual override: flush forces output of whatever's accumulated, even if incomplete; reset clears the buffer for that key.

The intended pattern is in the source docstring: wire the frame_image output of Video Frame Router - after whatever per-frame grading you're doing - into frame here, and let ComfyUI's batch iteration drive it. Frames accumulate; when the count hits the target, you get the whole sequence back.

The things that bite

Buffers are memory, not files. Restart ComfyUI and every buffered clip is gone. The tooltip says so plainly, and it's the failure people hit after a crash at frame 300 of 400.

Nothing downstream sees anything until completion. That's the point, but it surprises people: a preview connected to video_image shows nothing for the first 23 frames. Watch frames_accumulated while you work, and turn on flush if you just want to see what you've got so far.

Caching and always-dirty nodes. A stateful accumulator has to make ComfyUI re-run it rather than serve a cached result, which is the classic IS_CHANGED territory for a plumbing node. If your assembly looks like it's frozen on a stale batch, that's the class of problem you're in - the fix is usually a reset (or a restart), not a bigger expected_total_frames.

Counting modes. The most common real bug is a batch-per-execution pipeline being fed to a node whose total was set for single frames (or vice versa), which produces either a truncated clip or an "it never outputs" symptom. Set the number to match how your upstream actually delivers.

Wire it up

Typical graph: Video Batch Decode → a frame source → per-frame grading (grade, grain, stabilise) → Video Assembler → Video Export. The session_key is how you run two clips in one queue without them swapping frames.

If your per-frame work is expensive, remember you're paying it once per frame and the buffer holds all of it in RAM at full resolution. On a long 4K clip that's a lot of float32 - the pack's own VFX notes talk about clips holding multiple full-size buffers, and the same arithmetic applies here.

Install

  1. ComfyUI Manager → search Radiance → Install → restart → refresh the browser.
  2. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/fxtd-studios/radiance.git
cd radiance
python -m pip install -r requirements.txt

Windows portable users: use python_embeded\python.exe for the pip line. This node ships no models and downloads nothing, though Radiance's overall requirement list is long - OpenEXR, OpenImageIO, OpenColorIO, transformers, scipy, imageio-ffmpeg. The registry has been serving an older release than the README's 3.5.0, so use Update in Manager or git pull if the node's behaviour doesn't match the docs.

CategoryFXTD STUDIOS/Radiance/Video

Inputs (5)

NameTypeDefaultDescription
frameIMAGEFrame (or batch) to append to this session's buffer. Buffers live in memory and are lost on restart.
session_keySTRINGvideo_session_0Name of the accumulation buffer. Use a different key per clip being assembled in parallel.
expected_total_framesINT24Output is complete, and the buffer cleared, once this many inputs have arrived. Counts executions, not images, if frame is a batch.
flushoptBOOLEANfalseForce output of accumulated frames now, even if incomplete
resetoptBOOLEANfalseClear accumulated frames for this session key

Outputs (3)

NameTypeDescription
video_imageIMAGE—
frames_accumulatedINT—
is_completeBOOLEAN—