Nodes/BRIA AI API nodes/Bria Video Mask By Key Points
ComfyUI Node

Bria Video Mask By Key Points

Bria's key-points masker

By Bria-AI·Created 2 years ago·Updated 3 months ago· 95
Bria Video Mask By Key Points
    • mask_url
    key_points[]
    api_keyBRIA_API_TOKEN
    video_url
    output_container_and_codecmp4_h264
    preserve_audiotrue

    Sometimes "the red car" isn't specific enough. There are three cars, or the object has no clean name, or the thing you want to mask is a person's tattoo and no prompt in the world is going to isolate it. Bria Video Mask By Key Points is the fallback for those cases: instead of describing the target, you point at it - literally, with coordinates - and Bria's hosted API tracks that region through the whole video and returns a mask video.

    It's the sibling of VideoMaskByPromptNode, and they serve the same pipeline: generate a mask first, then feed that mask into VideoEraseElementsNode (or a replacement-background node) to do the actual edit. The difference is the targeting language - a sentence versus a set of points. Key points win when the subject is hard to name, ambiguous, or when you want surgical precision. Prompt wins when the subject is obvious and you can't be bothered to fiddle with JSON.

    What you set

    Three required inputs:

    • key_points - a JSON string of key points, defaulting to "[]". This is the whole node, and it's the fiddly bit. The field is a plain string that must parse as a JSON list - the node explicitly raises an error if it doesn't. Each key point is a coordinate in the video's pixel space that marks your target region; the API propagates it across frames. Where the coordinate exactly goes (a bounding-box corner, a point inside the object) is defined by Bria's API docs, so check those before you start, because the field gives you zero hints.
    • api_key - your token. The prefilled BRIA_API_TOKEN placeholder is rejected with "Please insert a valid API key."
    • video_url - hosted URL or local path (the tooltip: "URL of video to process (provide either frames or video_url)"). Local files get uploaded to Bria's S3 automatically.

    Then the shared pair: output_container_and_codec (default mp4_h264) and preserve_audio (default true).

    The output is mask_url - a STRING URL to the generated mask video. Wire it into VideoEraseElementsNode.mask_url for the edit, and into PreviewVideoURLNode (same pack) if you want to check your points actually landed before paying for the next call.

    Installing

    The usual for this pack. ComfyUI Manager → search "BRIA API", or:

    cd path_to_comfyui/custom_nodes
    git clone https://github.com/Bria-AI/ComfyUI-BRIA-API
    

    Restart, grab a token at platform.bria.ai. No models, no heavy dependencies. The node POSTs to Bria's /v2/video/segment/mask_by_key_points, polls a status URL every 5 seconds until done (up to an hour), then hands back the result.

    Where it bites

    Everything about this node hinges on coordinates you can't see. You're typing a JSON array of points into a text box for a video you can't scrub in that same box - so the practical workflow is: load the video, note a frame's dimensions, pick a point inside your target on one frame, and build the key_points array from that. Expect to iterate. And since every call is a paid API request, each wrong guess costs money. Budget for a couple of attempts and don't queue a batch of them blindly.

    Two more honest notes. The output is a URL with an expiry, not a local file - treat mask_url as a live-session value. And while key points are more precise than a prompt for placement, they're still a hosted model doing temporal tracking; a subject that leaves the frame, gets occluded, or changes shape will make the mask drift, same as any auto-tracking.

    Reach for this node when a prompt simply cannot name the target - that's exactly the gap it exists to fill. For everything nameable, VideoMaskByPromptNode is the easier first stop; keep this one in your back pocket for the objects that defy description.

    CategoryAPI Nodes

    Inputs (5)

    NameTypeDefaultDescription
    key_pointsSTRING[]
    api_keySTRINGBRIA_API_TOKEN
    video_urlSTRINGURL of video to process (provide either frames or video_url)
    output_container_and_codecoptCOMBOmp4_h2649 options: mp4_h264, mp4_h265, webm_vp9, mov_h265, mov_proresks, mkv_h264, +3
    preserve_audiooptBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    mask_urlSTRING