ComfyUI  >  Nodes  >  ComfyUI-NegiTools >  Point List to Mask 🧅

ComfyUI Node: Point List to Mask 🧅

Class Name

NegiTools_PointListToMask

Category
utils
Author
natto-maki (Account age: 395 days)
Extension
ComfyUI-NegiTools
Latest Updated
9/15/2024
Github Stars
0.0K

How to Install ComfyUI-NegiTools

Install this extension via the ComfyUI Manager by searching for  ComfyUI-NegiTools
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-NegiTools 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

Point List to Mask 🧅 Description

Converts point list to mask image for AI artists, leveraging numpy for efficient computation.

Point List to Mask 🧅:

NegiTools_PointListToMask is a utility node designed to convert a list of points into a mask image. This node is particularly useful for AI artists who need to create masks based on specific coordinates within an image. By providing a list of points, along with the desired dimensions and radius, the node generates a mask where each point is represented as a filled circle. This can be beneficial for tasks such as segmentation, object detection, or any scenario where you need to highlight specific areas within an image. The node leverages numpy for efficient computation, ensuring that the mask generation process is both fast and accurate.

Point List to Mask 🧅 Input Parameters:

point_list

The point_list parameter is a string that contains a JSON-encoded list of points. Each point should be represented as an object with x and y coordinates, where x and y are normalized values between 0 and 1. This parameter is essential as it defines the locations within the image where the mask will be applied. The default value is an empty string, and it does not support multiline input.

width

The width parameter specifies the width of the output mask image in pixels. It determines the horizontal dimension of the mask. The value must be an integer between 0 and 4096, with a default value of 512. Adjusting this parameter allows you to control the resolution of the mask, which can be crucial for different applications.

height

The height parameter defines the height of the output mask image in pixels. It sets the vertical dimension of the mask. Similar to the width parameter, the value must be an integer between 0 and 4096, with a default value of 512. This parameter helps in controlling the resolution and aspect ratio of the generated mask.

radius

The radius parameter determines the radius of the circles drawn around each point in the mask. The value must be an integer between 1 and 2048, with a default value of 50. This parameter is important for defining the size of the masked areas around each point, allowing you to adjust the prominence of each point in the final mask.

Point List to Mask 🧅 Output Parameters:

MASK

The MASK output parameter is a numpy array representing the generated mask image. The mask is a 2D array where each element corresponds to a pixel in the image, with values indicating whether the pixel is part of the mask (1) or not (0). This output is crucial for further processing in tasks such as image segmentation, where the mask can be used to isolate specific regions of interest.

Point List to Mask 🧅 Usage Tips:

  • Ensure that the point_list parameter is correctly formatted as a JSON string with normalized x and y coordinates to avoid errors during mask generation.
  • Adjust the radius parameter to control the size of the masked areas around each point, which can help in fine-tuning the mask for different applications.
  • Use appropriate width and height values to match the resolution of your input images, ensuring that the generated mask aligns correctly with the original image.

Point List to Mask 🧅 Common Errors and Solutions:

Invalid JSON in point_list

  • Explanation: The point_list parameter contains a string that is not properly formatted as JSON.
  • Solution: Ensure that the point_list string is a valid JSON array of objects, each with x and y properties.

Width or height out of range

  • Explanation: The width or height parameter is set to a value outside the allowed range (0-4096).
  • Solution: Adjust the width and height values to be within the specified range.

Radius out of range

  • Explanation: The radius parameter is set to a value outside the allowed range (1-2048).
  • Solution: Set the radius value to be within the specified range to ensure proper mask generation.

Point List to Mask 🧅 Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-NegiTools
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.