PVL Seg Florence2 (fal.ai)
Segment anything by describing it — in the cloud, no GPU needed
- 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
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 (default255,255,255) for the masked previews. The actualmask_*outputs are proper white-on-blackMASKs regardless.retries(default 2) andtimeout_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_KEYisn'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.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| mask_color | STRING | 255,255,255 | — |
| retries | INT | 20–5 | — |
| timeout_per_retry | INT | 18030–600 | — |
| seed | INT | -1-1–4294967295 | — |
| debug | BOOLEAN | false | — |
| prompt_1opt | STRING | — | |
| prompt_2opt | STRING | — | |
| prompt_3opt | STRING | — | |
| prompt_4opt | STRING | — | |
| prompt_5opt | STRING | — | |
| image_1opt | IMAGE | — | |
| image_2opt | IMAGE | — | |
| image_3opt | IMAGE | — | |
| image_4opt | IMAGE | — | |
| image_5opt | IMAGE | — |
Outputs (10)
| Name | Type | Description |
|---|---|---|
| masked_1 | IMAGE | — |
| masked_2 | IMAGE | — |
| masked_3 | IMAGE | — |
| masked_4 | IMAGE | — |
| masked_5 | IMAGE | — |
| mask_1 | MASK | — |
| mask_2 | MASK | — |
| mask_3 | MASK | — |
| mask_4 | MASK | — |
| mask_5 | MASK | — |