IAMCCS GrayTracker: a Fake Green Screen for H3 Reference Video
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.
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 | |
|---|---|
| Package | IAMCCS-nodes v1.5.9, ★122 |
| Node | IAMCCS_GrayTracker (standalone) or Settings PRO → SAM / GrayTracker |
| Needs | Performer masks from ComfyUI-segment-anything-2 (SAM 2.1) or any compatible segmentation node |
| Outputs | guide_images, tracks_json, report |
| Storage | CPU optical flow (OpenCV), no extra model download |
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.
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.