IAMCCS GrayTracker: a Fake Green Screen for H3 Reference Video

ComfyUI Wikinews

IAMCCS Nodes 1.5.9 adds GrayTracker: SAM cuts the performer out, the plate goes gray and tracked markers carry background motion, so H3 REF2VA can swap the location.

IAMCCS Nodes 1.5.9 (December 1) adds IAMCCS_GrayTracker. It turns an ordinary clip into a gray plate with moving markers, which H3 REF2VA reads as the motion guide for a location swap. No green screen, no rotoscoping by hand.

Reference video models copy the background motion they see. Replace it with flat gray and that cue disappears, so the new environment tends to sit still while the performer moves. GrayTracker keeps the performer, drops the background to neutral gray, and tracks a few background features so their paths still show up as moving marks.

The author's 13-second demo: guide plate in, generated take out.

At a glance
PackageIAMCCS-nodes v1.5.9, ★122
NodeIAMCCS_GrayTracker (standalone) or Settings PRO → SAM / GrayTracker
NeedsPerformer masks from ComfyUI-segment-anything-2 (SAM 2.1) or any compatible segmentation node
Outputsguide_images, tracks_json, report
StorageCPU optical flow (OpenCV), no extra model download
GrayTracker controls

Marker style, count, spacing, size, opacity and mask margin on the standalone node.

How it works

Segmentation gives a per-frame mask; everything outside it becomes gray. With tracked_markers on, GrayTracker picks features outside the mask and follows them with Lucas–Kanade optical flow, rejecting weak tracks with a forward/backward check, then draws them as crosses, dots, rings or squares.

gray_only keeps the cutout and drops the marks, which is the cleaner input when the shot barely moves the camera. An optional depth sequence only scales marker size along an existing track; it is not a camera solve.

Running it

Load the source clip at the offset, duration and frame rate you want, keeping its original background, because that is where the tracker finds motion. Then pick the performer.

SAM subject selection

Click keep-subject and exclude-background points on the first frame; SAM carries the mask through the clip.

Run PREPARE GUIDE / PREVIEW ONLY before spending time on H3. Check four things: the performer's hands and feet survive, the old location is gone, marks follow the background rather than the actor, and the timing is intact. Fix SAM points first instead of prompting harder around a bad mask.

In the H3 side, the prompter has a GrayTracking Reference mode. Assign roles in the request: Picture 1 for the character, Picture 2 for the replacement environment, Video 1 for the performance, and ask the model to replace gray and marks with the new setting while keeping perspective and parallax.

Limits

The tracks are 2D image coordinates, not a calibrated camera path, and the guide does not force frame-exact reproduction or solve lip-sync. Skin, face and foot contact still need their own review per take. If a cutout drifts, the fault is usually the mask, not the prompt.

Comments

Sign in with GitHub to join the discussion.

Loading comments…
IAMCCS GrayTracker: a Fake Green Screen for H3 Reference Video | ComfyUI Wiki