📤 Session Image Sender
The face-checking frame validator that stops identity drift mid-clip
- generated_images
- VALIDATED_IMAGES
- log
Here's the failure mode chunked video generation keeps hitting: your KSampler spits out a 17-frame chunk, the last frame is a melted face, and that's exactly the frame the next chunk is going to start from. SessionImageSender is the fix - it looks at what you generated, finds the last frame that actually contains a face, and only forwards the good frames to the rest of the pipeline.
It's the output-side half of the pack's Sender/Receiver pair, and it does three jobs in one: truncates garbage, saves a continuity keyframe, and advances the global timeline so the loop knows how much video is done. Without it, the Receiver (and therefore the next chunk) would start from whatever junk came out last.
How it works
Run detect_faces on (default true) and it scans your generated batch in reverse - last frame to first - using OpenCV's bundled haarcascade for frontal faces. The first frame with a face wins, and the tensor is truncated to everything up to and including it. No face found anywhere in the batch? It accepts the whole batch anyway, with a log warning, rather than risk an infinite loop. The last accepted frame gets stashed in RAM for the Receiver and written to the output folder as keyframe_<idx>.png so you have a disk fallback.
It also does the accounting: it advances the pack's accumulated-frame counter (accounting for the select_every_nth stride, with special handling for LTX's overlapping anchor frame), and on the final chunk it disables face trimming entirely and forces every frame through - because trimming the last chunk would drop the tail of your video. The log output tells you exactly which frame was accepted and how far the timeline moved, which makes this the best single node to watch while debugging a loop.
Inputs and outputs
generated_images(IMAGE) - your KSampler's output batch.current_loop_index(INT) - from the Loop Start.detect_faces(BOOLEAN, default true) - flip off for footage with no faces; it then just takes the last frame blindly.
Outputs: VALIDATED_IMAGES (the truncated IMAGE batch) and log. The validated batch is what feeds your stitcher or preview.
Installing it
Part of comfyui-sequential-batcher:
cd ComfyUI/custom_nodes
git clone https://github.com/Meisoftcoltd/comfyui-sequential-batcher
or ComfyUI Manager, search "comfyui-sequential-batcher", restart. Needs OpenCV, which the pack's requirements.txt installs.
Common issues
If your subject's face is small or rarely frontal, the reverse scan may truncate more frames than you'd like - check the log for "Rostro detectado en el frame [i]" to see what it picked. And if you ever wonder why a chunk seems short, it's usually this node being conservative. The final-chunk bypass is automatic, so you don't need to manage it. Just don't disable detect_faces mid-clip if your clip has faces - that's how identity drift sneaks back in.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| generated_images | IMAGE | — | |
| current_loop_index | INT | 00–10000 | — |
| detect_faces | BOOLEAN | true | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| VALIDATED_IMAGES | IMAGE | — |
| log | STRING | — |