Nodaro Docs
DocumentationNode ReferenceModelsAI Agents (MCP)DevelopersSelf-hostingResearch
Image

Generate Mask

Describe a subject in plain words, such as "the red car", and get a black-and-white mask of it to repaint only that area in an editing node.

The Generate Mask node finds a subject in an image from a text description and returns a black-and-white mask of it. You write a short phrase such as "the red car", and the node marks that subject in white and everything else in black. Wire the mask into an editing node to repaint only that area.

When to use it

  • Change one subject and keep the rest: mask "the jacket", then recolor it in Modify Image.
  • Replace what is behind the subject: mask "the background" and repaint it.
  • Start a precise hand-made mask: generate one first, then refine it in Paint Mask.
  • Select an area for Relight & Switch or any other node with a mask input.

Quick start

Add the node

Press Tab on the canvas and choose Image › Edit & Retouch › Generate Mask.

Connect the image

Drag from an image node, such as Upload Image or Generate Image, to the Image input.

Describe the subject

Open the settings panel and write the subject under Describe what to mask, for example the red car.

Run it and wire the mask

Click Run. The mask appears on the node. Wire the Mask output into the Mask input of an editing node, and the same image into that node's Image input. In Modify Image, choose a model that supports masks, such as Ideogram Edit.

imageimage + maskUpload ImageStreet photoGenerate Maskthe red carModify ImageIdeogram Edit
Generate Mask passes the photo through together with a mask of the red car, and Modify Image repaints only that area.

Inputs

InputAcceptsWhat it does
ImageImage nodes, such as Upload Image, Generate Image and Modify ImageThe picture to find the subject in. Required.

Generate Mask has two outputs:

OutputWhat it carries
ImageThe original image, unchanged. Use it to send the same image to the editing node together with the mask.
MaskA black-and-white PNG the size of the image. White is the subject, the area to edit. Black is everything else, the area to keep.

The mask is a plain PNG, so it also works anywhere an image is accepted, for example to preview it or to save it.

Settings

SettingWhat it does
Describe what to maskThe subject to find, as a short phrase such as the red car, the woman or the background. Required, up to 500 characters.
Detection thresholdA slider from 0.05 to 0.95, default 0.3. The model that Generate Mask uses today ignores this value, so moving the slider does not change the mask. To change the result, change the prompt.
Pre & post textText that is always added before and after the prompt. It is hidden from people who use your workflow as an app. See Prompt pre and post text.

How the mask is made

Generate Mask always uses one segmentation model, Grounded SAM. The model finds the subject your words name, then traces its exact outline. The model version is fixed, so the same image and the same prompt always give the same mask. There is no model to choose.

White means "edit" and black means "keep". Paint Mask and the mask painter in Modify Image use the same rule, so a generated mask and a painted mask are interchangeable.

Credits

Every run costs 50 credits, whatever the image size or the prompt. When no region matches the description, the run fails and the credits are refunded.

Troubleshooting

The run fails with "No region matched the mask prompt". Nothing in the image matched your words. Your credits are refunded. Running the same prompt again fails the same way, so rewrite it as a shorter, plainer phrase, such as the hat instead of a long description.

The mask is empty. An all-black mask means the prompt was too general or the subject is not in the image. Name the subject more clearly, for example the left girl's hair instead of hair.

The mask is almost right. Wire the Mask output into the Mask seed input of a Paint Mask node. Its painter opens with the generated mask, and you can add or erase areas by hand.

Tips

  • Name one clear subject. The model reads short noun phrases, such as the woman or the red car, far better than long clauses.
  • Keep the image and the mask together. The Image output passes the original through, so one wire from each output reaches the editing node.
  • Do not use the slider to fix a mask. Detection threshold has no effect today. Change the prompt, or refine the mask by hand.

Frequently asked questions

Last updated on

On this page