Nodes/arkennemasis - ChatGPT / Codex / fal AI nodes/arkennemasis fal · SAM 3.1 Video Segmentation · $0.01/16 frames
ComfyUI Node

arkennemasis fal · SAM 3.1 Video Segmentation · $0.01/16 frames

Segment every frame for a penny per 16 frames

By Hishamahmer·Created 3 months ago·Updated 9 days ago· 11
arkennemasis fal · SAM 3.1 Video Segmentation · $0.01/16 frames
  • video
  • video
  • video_path
  • boundingbox_frames_zip_path
  • info
◄prompt►
◄point_prompts►
◄box_prompts►
◄apply_masktrue►
◄video_output_typeX264 (.mp4)►
◄detection_threshold0.50►
◄max_num_objects16►
◄max_cost_usd20.0►
◄reuse_identical_runtrue►
◄extra_json►
◄max_concurrent1►

Type "person, cloth" and get back a video with those things tracked and masked, frame after frame, for about a cent per 16 frames. This is Meta's Segment Anything 3.1 running on fal's hardware, and the thing that makes it worth a node in your graph is that SAM 3 handles open-vocabulary text prompts - you describe the object, and it finds it. No trained detector, no dataset for the specific thing you're looking at.

Why this is here instead of running locally

The KB's masking chapter is clear that promptable segmentation is the right answer when your target is a one-off - a specific object, not "faces in general" - and it's equally clear about the catch: SAM 3 nodes locally need Triton, which it calls "a real obstacle on Windows." That's the whole pitch for this node. You skip the environment surgery and pay per frame instead.

And the arithmetic is friendly. Pricing is per second of video at $0.01875, which is the same number as fal's advertised $0.01 per 16 frames at 30fps. A 10-second clip costs about 19 cents. Sixty-fps footage costs double, so hand it 30fps source and keep the money.

One boundary worth stating before you wire anything: this node's outputs are a video and a zip of bounding boxes, not a ComfyUI MASK. If what you want is a mask tensor to composite with locally, this isn't that - you'd segment locally, or use the returned overdrawn clip downstream.

The inputs

  • video - the clip to segment.
  • prompt - the text prompt, and the important detail is that commas track multiple objects: person, cloth follows both. Empty leaves it out.
  • point_prompts / box_prompts - JSON lists. Boxes are (x_min, y_min, x_max, y_max). Use these when text alone is ambiguous, e.g. two people in frame and you want the left one.
  • apply_mask - on by default; applies the mask to the video.
  • detection_threshold - 0.5 by default, range 0.1–1.0. Lower finds more and is less precise. When it's missing your object, come down; when it's grabbing walls and shadows, go up.
  • max_num_objects - 16 by default, up to 128. Only raise it if you actually need that many tracks; it's work the model doesn't have to do otherwise.
  • video_output_type - X264 (.mp4) or VP9 (.webm).

Plus the shared fal controls: max_cost_usd (default $20, checked before upload), max_concurrent (default 1 across the whole run), reuse_identical_run (default on - identical inputs return the result you already paid for), and extra_json for any fal field this node has no box for.

The outputs

video - the ComfyUI VIDEO result. video_path - where it landed under output/fal/fal-ai_sam-3-1_video/. boundingbox_frames_zip_path - per-frame boxes as a zip, which is the output to notice: it's how you drive something else - a tracking pass, a crop, a spreadsheet of positions - without re-running the model. info - the JSON receipt.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/Hishamahmer/comfyui-arkennemasis

Restart, or install from ComfyUI-Manager by searching arkennemasis. requirements.txt declares httpx for the pack's Codex nodes only; the fal provider is standard library, so you're not installing Triton or a CUDA-matched torch wheel for this. Then:

FAL_KEY=your-key-from-fal.ai/dashboard/keys

in the .env next to run_nvidia_gpu.bat.

Where people get burned

  • You sent a 60fps clip. Double the price for frames nobody asked for. Conform to 30fps first.
  • A 30-second clip is 56 cents, so it's cheap, but a batch of them behind a node that doesn't need to run isn't free - gate them with the pack's Shot Selector so unselected branches never execute.
  • "person" grabbed the wrong person. Add a box prompt, or use the comma syntax with a more distinctive noun (the model is open-vocabulary; lab coat may work where person won't).
  • You expected a MASK socket. Outputs are the overdrawn video and the bbox zip. Plan your composite around that.
  • ComfyUI restarted mid-job. The fal job continued and billed; grab the id from output/fal/_requests.jsonl and fetch it with the pack's free fal Recover Result node.
Categoryarkennemasis/fal/Video/SAM

Inputs (12)

NameTypeDefaultDescription
videoVIDEOThe URL of the video to be segmented.
promptSTRINGText prompt for segmentation. Use commas to track multiple objects (e.g., 'person, cloth'). Empty leaves it out.
point_promptsSTRINGList of point prompts JSON. Empty leaves it out.
box_promptsSTRINGList of box prompt coordinates (x_min, y_min, x_max, y_max). JSON. Empty leaves it out.
apply_maskBOOLEANtrueApply the mask on the video.
video_output_typeCOMBOX264 (.mp4)The output type of the generated video.
detection_thresholdFLOAT0.500.1–1Detection confidence threshold (0.0-1.0). Lower = more detections but less precise.
max_num_objectsINT161–128Maximum number of objects to track in the video.
max_cost_usdoptFLOAT20.00–100000Safety cap. If the estimated cost of this run is above this many US dollars the node stops BEFORE sending anything to fal. 0 = no cap.
reuse_identical_runoptBOOLEANtrueIf these exact inputs (the settings AND the same pictures/clips/audio) were already paid for and the files are still in output/fal, return them instead of paying again - also after a ComfyUI restart. Turn off for a fresh take with the same settings.
extra_jsonoptSTRINGAdvanced: a JSON object merged into the request last, for any fal field this node has no box for. Example: {"seed": 7}. Leave empty normally.
max_concurrentoptINT11–32How many paid fal calls may run at the same time in one run, across every fal node. 1 (default) = one after another. This node starts its paid part only while fewer than this many fal calls are running. Once any fal node fails, the ones still waiting are not started, so nothing more is billed.

Outputs (4)

NameTypeDescription
videoVIDEO—
video_pathSTRING—
boundingbox_frames_zip_pathSTRING—
infoSTRINGJSON: request id, cost estimate, saved files and fal's full answer.