ComfyUI > Nodes > Masquerade Nodes > Mask By Text

ComfyUI Node: Mask By Text

Class Name

Mask By Text

Category
Masquerade Nodes
Author
BadCafeCode (Account age: 485days)
Extension
Masquerade Nodes
Latest Updated
2024-06-19
Github Stars
0.34K

How to Install Masquerade Nodes

Install this extension via the ComfyUI Manager by searching for Masquerade Nodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Masquerade Nodes in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Mask By Text Description

Automatically generates image masks based on text prompts using natural language processing for AI artists.

Mask By Text:

The "Mask By Text" node is designed to automatically generate a mask for an image based on a given text prompt. This node leverages the power of natural language processing to interpret the text and create a corresponding mask that highlights specific areas of the image as described by the prompt. This can be particularly useful for AI artists who want to isolate or emphasize certain parts of an image without manually creating masks. By providing both a positive and a negative prompt, you can fine-tune the mask to better match your artistic vision. The node also offers options to adjust the precision of the mask and normalize the results, making it a versatile tool for various creative applications.

Mask By Text Input Parameters:

image

The image parameter is the input image on which the mask will be generated. This should be an image file that you want to process.

prompt

The prompt parameter is a text string that describes the areas of the image you want to highlight or mask. This can be a detailed description and supports multiline input, allowing for complex and nuanced prompts.

negative_prompt

The negative_prompt parameter is a text string that describes the areas of the image you want to exclude from the mask. Like the prompt parameter, it supports multiline input and helps refine the mask by specifying what should not be included.

precision

The precision parameter is a float value that determines the accuracy of the mask generation. It ranges from 0.0 to 1.0, with a default value of 0.5. A higher precision value results in a more accurate but potentially more complex mask, while a lower value may produce a simpler mask.

normalize

The normalize parameter is a choice between "yes" and "no" that determines whether the mask should be normalized. Normalization can help in standardizing the mask values, making it easier to work with in subsequent processing steps.

Mask By Text Output Parameters:

thresholded_mask

The thresholded_mask is an image output that represents the binary mask generated based on the text prompt. This mask is thresholded, meaning it has been processed to clearly distinguish the masked areas from the rest of the image.

raw_mask

The raw_mask is an image output that represents the initial mask generated from the text prompt before any thresholding or additional processing. This raw mask can provide more detailed information and can be useful for further custom processing.

Mask By Text Usage Tips:

  • Experiment with different prompt and negative_prompt combinations to achieve the desired mask. The more specific and detailed your prompts, the better the mask will match your vision.
  • Adjust the precision parameter to balance between mask accuracy and complexity. Higher precision is useful for detailed masks, while lower precision can be sufficient for simpler tasks.
  • Use the normalize option to standardize the mask values, especially if you plan to use the mask in further image processing steps.

Mask By Text Common Errors and Solutions:

"Invalid image input"

  • Explanation: The input provided for the image parameter is not a valid image file.
  • Solution: Ensure that the input is a valid image file and is correctly formatted.

"Prompt or negative prompt is empty"

  • Explanation: Either the prompt or negative_prompt parameter is left empty.
  • Solution: Provide a valid text string for both the prompt and negative_prompt parameters to generate an effective mask.

"Precision value out of range"

  • Explanation: The precision parameter is set to a value outside the allowed range of 0.0 to 1.0.
  • Solution: Adjust the precision parameter to a value within the range of 0.0 to 1.0.

"Normalization option invalid"

  • Explanation: The normalize parameter is set to a value other than "yes" or "no".
  • Solution: Ensure that the normalize parameter is set to either "yes" or "no".

Mask By Text Related Nodes

Go back to the extension to check out more related nodes.
Masquerade Nodes
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.