Nodes/ComfyUI Assistant Node/PVL Seg Florence2 (fal.ai)
ComfyUI Node

PVL Seg Florence2 (fal.ai)

Segment anything by describing it — in the cloud, no GPU needed

By pvlprk·Created about a year ago·Updated 10 months ago· 1
PVL Seg Florence2 (fal.ai)
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • masked_1
  • masked_2
  • masked_3
  • masked_4
  • masked_5
  • mask_1
  • mask_2
  • mask_3
  • mask_4
  • mask_5
◄mask_color255,255,255►
◄retries2►
◄timeout_per_retry180►
◄seed-1►
◄debugfalse►
◄prompt_1►
◄prompt_2►
◄prompt_3►
◄prompt_4►
◄prompt_5►

Segmentation is usually a local-model affair - load Florence-2 or SAM, feed it an image, get a mask. But what if your machine can't run it (no VRAM, a laptop, a rented box with no models), or you want it off your plate entirely? PVL Seg Florence2 (fal.ai) is the answer this pack gives you: it sends your image to fal.ai's hosted Florence-2 large model for referring-expression segmentation - you describe what you want with words, the cloud finds it, and you get back a mask and a masked image. No GPU, no model downloads, no local memory pressure.

The tradeoff is real and you should hear it up front: this is a paid cloud API. Every prompt/image pair is a request against your fal.ai account, and you're trusting your images to a third party. This is not the node for a privacy-sensitive batch.

How it works

Under the hood it calls fal's queue API (fal-ai/florence-2-large/referring-expression-segmentation). Your image is base64-encoded into a data URL, submitted with your text prompt, and the node polls the status URL until the job completes or times out. When it's done, fal returns polygon coordinates; the node rasterizes them into a mask tensor and blends your chosen mask_color into the image to produce the masked_* output.

The "referring expression" bit is the whole game: instead of "segment everything", you say "the man in the red shirt" or "the second cup from the left" and Florence-2 resolves it. Five slots (prompt_1–prompt_5 with image_1–image_5) let you run up to five segmentations in one node, each with its own mask and masked output. Unused slots are simply skipped.

Inputs and outputs that matter

  • prompt_1–prompt_5 - multiline text describing what to segment.
  • image_1–image_5 - the corresponding images.
  • mask_color - RGB string (default 255,255,255) for the masked previews. The actual mask_* outputs are proper white-on-black MASKs regardless.
  • retries (default 2) and timeout_per_retry (default 180s) - resilience knobs for flaky cloud jobs.
  • seed, debug - seed for reproducibility, debug prints the submitted prompt.

Outputs: masked_1–masked_5 (IMAGE, the colored-mask previews) and mask_1–mask_5 (MASK, ready to wire into inpaint, upscale-with-mask, or compositing nodes).

Installing and the key you'll need

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

restart, or use ComfyUI Manager (search "ComfyUI Assistant Node"). Then set your fal.ai key as an environment variable - the node checks FAL_KEY, FAL_API_KEY, or FAL_CLIENT_KEY:

export FAL_KEY="your-key-here"

(Windows: setx FAL_KEY "your-key-here" then restart ComfyUI.) Get the key from the fal.ai dashboard; it's pay-per-use. requests is the only real dependency, and any ComfyUI has it.

Where people get tripped up

  • No key, no error you'd expect. If FAL_KEY isn't set, the request fails - check that the env var survived into the ComfyUI process.
  • Cloud cost creep. Five slots × several retries multiplies fast. Start with one slot.
  • The mask needs a clear subject. Referring-expression works well on discrete objects and fails on mushy requests ("everything in the background"). Describe, don't generalize.
  • Compared to running Florence-2 locally via impact-packs and friends, you lose latency (each call takes a few seconds to a minute) but gain zero local footprint. On a weak machine, that trade is often the right one.
CategoryPVL_tools_FAL

Inputs (15)

NameTypeDefaultDescription
mask_colorSTRING255,255,255—
retriesINT20–5—
timeout_per_retryINT18030–600—
seedINT-1-1–4294967295—
debugBOOLEANfalse—
prompt_1optSTRING—
prompt_2optSTRING—
prompt_3optSTRING—
prompt_4optSTRING—
prompt_5optSTRING—
image_1optIMAGE—
image_2optIMAGE—
image_3optIMAGE—
image_4optIMAGE—
image_5optIMAGE—

Outputs (10)

NameTypeDescription
masked_1IMAGE—
masked_2IMAGE—
masked_3IMAGE—
masked_4IMAGE—
masked_5IMAGE—
mask_1MASK—
mask_2MASK—
mask_3MASK—
mask_4MASK—
mask_5MASK—