Bria Video Mask By Prompt
Telling Bria what to erase later
- mask_url
You're watching a clip and thinking "I want that car gone, or that person, or that logo - but only in this video, not the whole world." In a normal ComfyUI workflow that means loading a segmentation model, running per-frame masks, and praying the temporal consistency holds. Bria Video Mask By Prompt skips all of it: you describe what to mask in English, and Bria's hosted API returns a mask video that tracks that thing across frames. It's the "find the thing, frame after frame" step, outsourced.
The clever part is what it doesn't do. This node never erases or edits anything - it produces the mask, which is a separate, reusable asset. That's the intended pipeline: mask first, edit second. Bria's own example workflow wires VideoMaskByPromptNode into VideoEraseElementsNode, where the mask tells the eraser exactly which pixels to kill. Getting the segmentation right and getting the edit right are two different paid API calls, and this one is the cheap, precise part.
What you set
Three required inputs:
prompt- the plain-English description of what to mask. "the red car", "the person in the blue jacket", "the text overlay". This is where you spend your effort; vague prompts give you grabby masks.api_key- your token from platform.bria.ai. The prefilledBRIA_API_TOKENis a placeholder and will be rejected.video_url- a hostedhttp(s)URL or a local file path. The node's own tooltip says it plainly: "URL of video to process (provide either frames or video_url)". If you give it a local path, the node uploads it to Bria's S3 via a presigned URL automatically, soLoadVideoFramesNode(same pack) feeding a path into this works fine.
Then the shared pair of video options: output_container_and_codec (nine choices, default mp4_h264) and preserve_audio (default on - masks don't have audio, but the container handling still respects the toggle).
The single output is mask_url - a STRING, not a mask tensor. That's the bit that trips people up: ComfyUI hands you a URL, not a black-and-white image you can inspect locally. Wire that URL string into VideoEraseElementsNode's mask_url input, and into PreviewVideoURLNode (also in this pack) if you want to eyeball the mask before spending a second API call.
Installing
Same as the rest of the pack. ComfyUI Manager → search "BRIA API", or:
cd path_to_comfyui/custom_nodes
git clone https://github.com/Bria-AI/ComfyUI-BRIA-API
Restart ComfyUI. No models, no heavy deps - the pack is requests and friends. The node is asynchronous: it POSTs to Bria's /v2/video/segment/mask_by_prompt endpoint, polls a status URL every 5 seconds until the job completes (the code allows up to an hour), then returns the result URL.
Where it bites
The API is paid per request, so mask generation costs you money even when the mask turns out wrong. Budget for it: you'll often generate a mask, preview it, hate it, and re-roll with a better prompt. Think of the prompt as the real knob and iterate cheaply there before you ever touch the eraser node.
Also, because the output is a remote URL with an expiry, don't build a workflow that runs the mask, waits days, and expects the link to still work - treat mask_url as a live value for the current session. And remember the flow is async: the node doesn't block forever, but a long video can sit in "waiting" state for a while, and the status URL is what you'd watch in the console.
This is the node to reach for when you want a selective video edit - remove the one thing, keep the scene. It's prompt-driven, so it's fragile on tiny or fast-moving objects, but for a clearly described subject in a decent-quality clip, it's remarkably reliable, and it beats hand-drawing masks on 300 frames without a second thought.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| api_key | STRING | BRIA_API_TOKEN | — |
| video_url | STRING | URL of video to process (provide either frames or video_url) | |
| output_container_and_codecopt | COMBO | mp4_h264 | 9 options: mp4_h264, mp4_h265, webm_vp9, mov_h265, mov_proresks, mkv_h264, +3 |
| preserve_audioopt | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| mask_url | STRING | — |