Nodes/ComfyUI Assistant Node/PVL Segment X5 (fal.ai)
ComfyUI Node

PVL Segment X5 (fal.ai)

Five images, five text prompts, one parallel segmentation call

By pvlprk·Created about a year ago·Updated 8 months ago· 1
PVL Segment X5 (fal.ai)
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • image_1_out
  • image_2_out
  • image_3_out
  • image_4_out
  • image_5_out
semantic_typefalse
mask_onlytrue
use_grounding_dinofalse
revert_maskfalse
blur_mask0
expand_mask0
fill_holesfalse
seed-1
debugfalse
prompt_1
prompt_2
prompt_3
prompt_4
prompt_5
negative_prompt

PVL Segment X5 is the batch sibling of the pack's single-image Segment node. Instead of one image and one prompt, you get five image inputs, five prompt inputs, and five outputs - all running against fal.ai's evf-sam endpoint at once, in parallel. If you've ever stood up a loop to run segmentation on a stack of frames or a set of product shots one at a time, this node is the shortcut that makes you wonder why you didn't just do it in one node.

It's part of the ComfyUI Assistant Node pack from pvlprk, sitting in the same PVL_tools_FAL category as its cloud-generation siblings. Same deal as the single version: no local model, no VRAM cost, just a fal.ai key and credits.

How it works

Each image_N input is paired with its prompt_N. The node base64-encodes every image that's actually connected, submits all the requests to the fal queue API simultaneously with a thread pool, then polls each until it completes and reassembles the results in order. A single shared negative_prompt applies to all five. Every other setting - mask_only, use_grounding_dino, revert_mask, blur_mask, expand_mask, fill_holes, semantic_type - is shared across the batch too, which is the design's one real constraint: you can't give image 1 different post-processing than image 2. If your images need different treatment, you need separate nodes.

The seeds, if you set one, are offset per image (seed, seed+1, …) so each slot gets distinct randomness when the model uses any.

What matters

  • image_1image_5 and prompt_1prompt_5 - the pairs to segment. Prompts are optional; leave one empty and it still runs, using an empty text.
  • mask_only (default on) - return just masks rather than the segmentation render.
  • blur_mask / expand_mask / fill_holes - the feather, grow, and close-holes post-processing, applied to every output.
  • debug - turn on to see each submission and poll in the console.

Outputs are five separate IMAGE slots - image_1_out through image_5_out - not one concatenated batch. That's deliberate: it means each result wires into its own downstream node, and it means an empty input doesn't poison the others. If a slot has no image connected, its output is None and the other four still complete.

Installing it

It's part of pvlprk/comfyui-pvl-api-nodes. Install via ComfyUI Manager (search "ComfyUI Assistant Node") or clone it:

cd ComfyUI/custom_nodes
git clone https://github.com/pvlprk/comfyui-pvl-api-nodes

Restart, then set your fal.ai key as the FAL_KEY environment variable (the code also accepts FAL_API_KEY and FAL_CLIENT_KEY) and restart again if you set it after launching. You'll need prepaid fal credits.

Where people get burned

The same FAL_KEY gotcha as every fal node, plus one X5-specific trap: because the five requests all hit the API at once, a botched run costs five billable requests before you notice. Check the single-image Segment node first with the exact settings you plan to use, then batch. And remember the shared settings caveat - five images with different subjects in different conditions is fine, but if two of them need different mask post-processing, split them across two X5 nodes instead.

CategoryPVL_tools_FAL

Inputs (20)

NameTypeDefaultDescription
semantic_typeBOOLEANfalse
mask_onlyBOOLEANtrue
use_grounding_dinoBOOLEANfalse
revert_maskBOOLEANfalse
blur_maskINT00–99
expand_maskINT00–99
fill_holesBOOLEANfalse
seedINT-1-1–4294967295
debugBOOLEANfalse
prompt_1optSTRING
prompt_2optSTRING
prompt_3optSTRING
prompt_4optSTRING
prompt_5optSTRING
negative_promptoptSTRING
image_1optIMAGE
image_2optIMAGE
image_3optIMAGE
image_4optIMAGE
image_5optIMAGE

Outputs (5)

NameTypeDescription
image_1_outIMAGE
image_2_outIMAGE
image_3_outIMAGE
image_4_outIMAGE
image_5_outIMAGE