Describe an object in a still image and receive a mask, using on-device OWL-ViT plus SAM2 first and a charged cloud fallback only when necessary.
Where: Flowgen → Add → Image & Vector → Matte → Mask by Text
Key ideas
- Mask by Text is one graph step: Describe an object in a still image and receive a mask, using on-device OWL-ViT plus SAM2 first and a charged cloud fallback only when necessary.
- Typed sockets: Inputs: Image / image_in — one still image.; Text / text_in — optional connected subject description; card text is used when no text is wired.. Outputs: Mask / mask_out — the prompted object matte.. Settings stay on the node rather than masquerading as extra wires.
- Card and Properties agree: The compact card and selected-node Properties sidebar expose the same persisted controls: Prompt — card and Properties.; Negative prompt — Properties; used by local detection and priced separately on cloud fallback..
- Execution behavior: Run starts a local OWL-ViT detector plus SAM2 mask refinement. When the prompt cannot be supported locally, Flowgen late-gates the paid cloud fallback instead of charging before it is needed.
- Cost and privacy boundary: On-device success costs no Sparks and does not upload the source. Cloud fallback is paid; review the run confirmation, especially when Negative prompt is set.
- Mask by Text card: MaskByTextNode uses the authored shared-card path. Segment an object described in text with local-first processing and a metered fallback when needed.
- Properties sidebar: Card-owned prompt controls; common properties shell
- Opened surfaces: Mask preview; fallback confirmation
Steps
- Connect one still image.
- Describe a concrete visible subject such as “red backpack.”
- Optionally add a Negative prompt in Properties.
- Click Run and allow the one-time model download.
- If Flowgen proposes cloud fallback, review why and confirm the cost.
- Refine the resulting mask or Merge Alpha it onto the source.
Inputs
- Image / image_in — one still image.
- Text / text_in — optional connected subject description; card text is used when no text is wired.
Outputs
- Mask / mask_out — the prompted object matte.
Controls
- Prompt — card and Properties.
- Negative prompt — Properties; used by local detection and priced separately on cloud fallback.
Important behavior
- The first local run downloads roughly 270 MB of models, then keeps the source image on the device.
- Relational requests such as “person on the left,” unsupported devices, or no confident match may offer/enter the cloud fallback.
- Other local errors do not silently spend Sparks.
- A local success is free; cloud fallback is charged, and a negative prompt increases the cloud request cost.
MCP authoring
- Create with create_node { type: "maskByText" }.
- Connect exact handles with connect_nodes when the node has more than one input or output.
- Set the complete control bag described by this article before run_node; set_props shallow-merges node data, so replacing a nested bag requires every value you want to keep.
Mask by Text controls and presets
- Add path: Flowgen → Add → Image & Vector → Matte → Mask by Text.
- Card: MaskByTextNode.
- Properties: Card-owned prompt controls; common properties shell.
- Controls: Prompt; Negative prompt.
- Opened surfaces: Mask preview; fallback confirmation.
Tips
- Test the operation on one representative asset before placing it inside a List iteration.
- Keep the untouched source upstream so the operation can be changed or bypassed later.
- Judge edges and color at the intended delivery size as well as at full preview size.
Limitations and important notes
- This node handles one still image, not subject tracking through a video.
- Spatial/relational language is not reliably supported by the local detector.
- First use needs a substantial model download and compatible browser features.
Troubleshooting
The local run finds no subject
Use a short concrete noun phrase, remove relational wording, or review the offered cloud fallback. For manual still selection, use Object Select.
FAQ
Does this open the full Image Editor?
No. This is a focused Flowgen node. Use Image Editor when you need layers, selections, paint, paths, or several edits in one document.
Can I use it in a List iteration?
Yes. Wire the current row field into the typed input, collect the exact output handle, and test one row before scaling the run.