Nodes/Video Actor Extract/Video Actor Extract
ComfyUI Node

Video Actor Extract

Extract every person in a video into green-screen clips — no green screen required

By ahkimkoo·Created 4 months ago·Updated 4 months ago· 0
Video Actor Extract
  • images
  • actor_info_json
  • output_dir
  • actor_count
model_pathyolov8n.pt
seg_model_pathyolov8n-seg.pt
video_path
max_actors10
face_threshold0.60
min_track_length5
skip_every_n1
bg_colortransparent

The name is a little backwards: you don't need a green screen to use this node - it makes one for you. VideoActorExtractor (from the "Video Actor Extract" pack) takes a video's frames, finds every person, tracks each across the clip, figures out who's who by face, and exports one keyable clip per person with the background flattened to green, blue, black, white, or true alpha - plus JSON telling you exactly when each actor appears.

If you've ever hand-cut an "all of this character's scenes" compilation out of a long video, you know that job is miserable. This is that task automated: not a single-image background remover, but a detector + tracker + face recognizer that produces per-person videos from raw footage. It sits where background-removal quality meets identity preservation - YOLOv8 for the "where is a person" part, InsightFace ArcFace embeddings for the "is this the same person" part.

How it works

The pipeline explains both the results and the cost:

  1. Person segmentation - YOLOv8-seg (yolov8n-seg.pt) detects person masks on every processed frame, downscaled to 640px on the longest side for speed, then resized back to full resolution.
  2. Mask tracking - a centroid-distance tracker links the same person's masks across frames into tracks.
  3. Identity clustering - InsightFace's buffalo_l model extracts face embeddings, and greedy clustering merges tracks that belong to the same person across time. The key constraint: two people in the same frame can never be merged, which saves you from twins or lookalikes collapsing into one actor.
  4. Segment building - each actor's appearances merge into continuous segments, small gaps filled in.
  5. Encoding - one video per actor, plus actor_info.json.

One gotcha hides in that last step: the actual default bg_color is transparent, which produces WebM with a VP9 alpha channel, not an MP4. The README still says green is the default - the code disagrees, and the code wins. Solid color gives you an MP4; transparent gives you the alpha-carrying WebM that's the better choice when compositing in another tool.

The inputs that actually matter

  • images (required) - the IMAGE batch of video frames. Feed it from VHS LoadVideo or LoadVideoPath.
  • skip_every_n - process every Nth frame. Default 1 (all frames). Bump to 2 on a long clip; the speedup is real and the accuracy hit is usually minor.
  • face_threshold (default 0.6) - how similar two faces must be to count as one actor. Raise toward 0.75 to split lookalikes; drop toward 0.5 to merge a person seen from awkward angles.
  • min_track_length (default 5) - the minimum number of tracked frames before a person counts at all. Raise it to filter out passers-by and brief false detections.
  • bg_color - transparent / green / blue / black / white.

max_actors (default 10) caps how many actors come out the other end, and video_path is optional - fill it in for accurate fps/duration metadata in the JSON instead of estimates.

Outputs and where things land

It returns three things: actor_info_json (a STRING of structured metadata), output_dir (where the files went), and actor_count (an INT). It's not an output node - nothing previews automatically, so wire the outputs where you want them. Everything lands in ComfyUI/output/ComfyUI-VideoActorExtract/<run-id>/ with actor_0.mp4/.webm, actor_info.json, and a previews/ folder. A "View Output" button on the node pops up a readable summary of the JSON.

Installation

Easiest path is ComfyUI Manager - search "Video Actor Extract" and install. Manual install works too:

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

Then restart ComfyUI. One trap: the README's manual-install line still points at YunyangGong/ComfyUI-VideoActorExtract, the old repo this was forked from - use the URL above. Models auto-download on first run into ComfyUI/models/video-actor-extract/ (two small YOLO weights plus InsightFace's buffalo_l, ~350MB), and the code even fixes the models/buffalo_l/ subdirectory quirk InsightFace's auto-downloader leaves behind.

Common issues

  • Slow on long clips. It's frame-by-frame YOLO + face detection. Keep clips under ~5 minutes and use skip_every_n liberally.
  • The InsightFace install tax. Same non-commercial, historically-painful library that powers ReActor and InstantID. On Windows, if the old 0.7.3 build explodes, install a 1.0+ release - it dropped the C++ build requirement. On Linux, the pack installs onnxruntime-gpu, which assumes CUDA.
  • No face, no merge. Someone who never shows a face gets their own actor ID, and previews only exist for frames where a face was actually detected.
  • License reality check. Fine for personal and portfolio work; the InsightFace weights are non-commercial, so don't sell on this without reading the terms.
Categoryvideo/actor

Inputs (9)

NameTypeDefaultDescription
imagesIMAGE
model_pathoptSTRINGyolov8n.pt
seg_model_pathoptSTRINGyolov8n-seg.ptYOLOv8-seg model for person segmentation
video_pathoptSTRINGOptional: original video path for metadata. If empty, metadata is estimated.
max_actorsoptINT101–50
face_thresholdoptFLOAT0.600.1–0.99
min_track_lengthoptINT51–100
skip_every_noptINT11–30Process every Nth frame. 1=all frames, 2=every other frame, etc. Higher values are faster but less precise.
bg_coloroptCOMBOtransparent5 options: transparent, green, blue, black, white

Outputs (3)

NameTypeDescription
actor_info_jsonSTRING
output_dirSTRING
actor_countINT