Nodes/Video Actor Extract/Select Actor Preview
ComfyUI Node

Select Actor Preview

Peek at the actors Video Actor Extract just found — with their frame numbers

By ahkimkoo·Created 4 months ago·Updated 4 months ago· 0
Select Actor Preview
    • images
    • indexes
    output_dir
    actor_index0

    SelectActorPreview is the little companion node in the "Video Actor Extract" pack, and it does one small job well: it turns the preview images your VideoActorExtractor already saved into something you can actually look at in the ComfyUI graph.

    Here's the situation it solves. The extractor isn't an output node - it writes files to disk and hands you a directory path string. That's fine if you're going to open the videos in an NLE, but it's awkward when you just want to check "did it actually find the right people, and which one is actor_2?" SelectActorPreview exists for exactly that: point it at the output_dir, pick an actor index, and it returns the 5 best preview frames as an IMAGE batch, plus the original frame numbers those previews came from.

    How it works

    While running the extractor, VideoActorExtractor saves up to five preview frames per actor - the frames where InsightFace detected the largest face, sorted biggest-first - into previews/ inside its output folder. It also writes an actor_<n>_indexes.json listing which frame in the source video each preview was pulled from.

    This node just reads all that back. It globs actor_<index>_*.png first (the transparent previews you get when the extractor ran with bg_color=transparent), falls back to *.jpg (solid-color backgrounds), stacks them into a tensor, and loads the indexes JSON. Nothing fancy, no extra models, no inference - it's a file loader with a tiny bit of bookkeeping.

    Inputs and outputs

    Only two inputs, both required:

    • output_dir (STRING) - wire this from the output_dir output of VideoActorExtractor. It's the string path, not a folder widget, so you can also paste a path you saved from a previous run.
    • actor_index (INT, default 0) - which actor, 0-based. Actor 0 is the first person found, actor 1 the second, etc.

    Outputs:

    • images - an IMAGE batch of the previews, RGB float32 in 0–1. If the previews are transparent PNGs, the tensor carries an alpha channel, so downstream alpha-aware nodes can use it directly.
    • indexes - an INT list of the original frame indexes, matching the images one-to-one.

    The obvious wiring: images into a PreviewImage node to see who you're dealing with, and indexes into whatever downstream node wants actual frame numbers - say, to re-extract the full frames from the source video at exactly the moments that actor is most clearly visible.

    Install and gotchas

    You already have it if the pack is installed - it ships in the same repo as the extractor, so install is identical: ComfyUI Manager → search "Video Actor Extract", or git clone https://github.com/ahkimkoo/ComfyUI-VideoActorExtract.git into custom_nodes/. No separate dependencies.

    The one thing that can trip you up: if there are no previews for an actor, the node silently returns a blank 1×512×512 batch and an empty index list instead of erroring. That usually means the actor never had a face detected (the extractor only writes previews from face-detected frames) or you're pointing at a directory from a run before previews existed. Watch the console - it logs how many previews it loaded and the shape it built. And remember actor_index is 0-based: the person you'd call "the first one" is index 0, and the actor numbering matches the filenames in the extractor's output folder, so a quick ls of output_dir settles any confusion about who's who.

    Categoryvideo/actor

    Inputs (2)

    NameTypeDefaultDescription
    output_dirSTRING
    actor_indexINT00–999

    Outputs (2)

    NameTypeDescription
    imagesIMAGE
    indexesINT