Nodes/ComfyUI-I2VChainHelper/I2V Chain Helper
ComfyUI Node

I2V Chain Helper

The quality gate your I2V chain is missing

By room3dev·Created 7 months ago·Updated 7 months ago· 0
I2V Chain Helper
  • images
  • analysis_models
  • reference_image
  • trimmed_images
  • frame_count
  • first_frame
  • last_frame
  • face_similarity
  • eyes_openness
min_face_similarity0.50
min_eyes_openness0.40

Ever chained two I2V clips - last frame of one feeding the start of the next - and watched the character come back a different person? The usual culprit isn't the model's imagination. It's the handoff frame. If that last frame is motion-blurred, has closed eyes, or quietly swapped faces, the next generation has nothing good to anchor to, and the drift compounds down the whole chain. That's the exact problem I2V Chain Helper exists to solve: it looks at the image batch your previous generation spat out and trims it back to the last frame that's actually fit to continue from.

What it actually does

It's not a generator. It's a quality gate you drop between the decode of one video clip and the start-image input of the next. You feed it the batch of frames, it finds the newest frame that still (a) matches your subject's face and (b) has open eyes, and it hands you that frame plus the batch trimmed to include it.

The logic scans the batch from the last frame backwards - so you get the latest usable frame, not the first one that happens to pass. It computes the cosine similarity between each frame's face embedding and a reference (by default the first frame of the batch), then checks eye openness with the Eye Aspect Ratio (EAR) from facial landmarks. The first frame that clears both thresholds becomes the new tail; everything after it gets chopped. Two things worth knowing: the frames before the good one are left untouched (the guarantee is only about your handoff frame, not a full batch sanitize), and if the reference has no detectable face, you get an empty batch back.

The inputs that matter

Four required inputs, and you'll mostly touch two of them:

  • images - your frame batch, straight from a video decode.
  • analysis_models - this is the gotcha. It's a required input of type ANALYSIS_MODELS, which this pack doesn't produce. You need ComfyUI-FaceAnalysis (or another compatible loader) wired in, using either InsightFace or dlib as the backend.
  • min_face_similarity (default 0.5) - cosine similarity to the reference face. Lower it if faces at steep angles keep getting rejected.
  • min_eyes_openness (default 0.4) - the EAR threshold. The README's defaults are reasonable starting points; expect to tune these to your model's face sizes.
  • reference_image (optional) - override the identity reference instead of using the batch's first frame. Handy when your subject appears mid-clip.

The outputs

last_frame is the one you actually want - wire it into your next I2V node's start image. first_frame, trimmed_images, and frame_count are conveniences for previewing or saving the cleaned batch. face_similarity and eyes_openness report the scores of the winning frame, which is genuinely useful for spotting a chain that's slowly degrading before it goes fully off the rails.

Installing it

Via ComfyUI Manager, search ComfyUI-I2VChainHelper and install. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/room3dev/ComfyUI-I2VChainHelper
cd ComfyUI-I2VChainHelper
pip install -r requirements.txt

Then restart ComfyUI. The heavy lifting: its requirements.txt pulls in insightface, opencv-python, scipy - and InsightFace is the one people routinely fight with (Windows builds can need C++ build tools). You also need ComfyUI-FaceAnalysis installed, and that node will refuse to load with a "Please install either dlib or insightface" error if you haven't. If you already run Reactor or InstantID, you've probably got this stack; if not, this is a chunk of dependencies for a fairly small convenience.

Troubleshooting

  • frame_count of 0 / empty batch - either the reference has no detected face, or every frame failed one of the thresholds. Try a clearer reference_image or loosen the two sliders.
  • FaceAnalysis errors on startup - install insightface (or dlib) in the same Python environment as ComfyUI.
  • Commercially minded? InsightFace's model weights are non-commercial, and anything downstream of them inherits that. Personal use is fine; a product is not.

Niche, and it only pays off if you're chaining I2V clips seriously - but once you've hand-picked frames from a preview one too many times, a node that checks the face for you feels less like a gimmick and more like a small insurance policy on the chain.

CategoryI2VChain

Inputs (5)

NameTypeDefaultDescription
imagesIMAGE
analysis_modelsANALYSIS_MODELS
min_face_similarityFLOAT0.500–1
min_eyes_opennessFLOAT0.400–1
reference_imageoptIMAGE

Outputs (6)

NameTypeDescription
trimmed_imagesIMAGE
frame_countINT
first_frameIMAGE
last_frameIMAGE
face_similarityFLOAT
eyes_opennessFLOAT