ComfyUI > Nodes > TrentNodes > Points To Masks

ComfyUI Node: Points To Masks

Class Name

PointsToMasks

Category
Trent/LipSync
Author
TrentHunter82 (Account age: 0days)
Extension
TrentNodes
Latest Updated
2026-03-20
Github Stars
0.03K

How to Install TrentNodes

Install this extension via the ComfyUI Manager by searching for TrentNodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter TrentNodes 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
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Points To Masks Description

Transforms point coordinates into tracking masks for precise video or animation effects.

Points To Masks:

The PointsToMasks node is designed to transform a sequence of point coordinates into tracking masks, which are essential for applications like lip-syncing in animation or video editing. This node takes point data, typically generated by a tracker, and converts it into a format that can be used by a compositor to apply effects or transformations accurately over time. By converting point sequences into masks, this node allows for precise control over which areas of a frame are affected by subsequent processing steps. The main advantage of using this node is its ability to create smooth, Gaussian-distributed masks around each point, ensuring that transitions and effects are applied seamlessly. This capability is particularly useful in scenarios where you need to track and manipulate specific regions of a video or animation frame-by-frame.

Points To Masks Input Parameters:

points

This parameter represents the sequence of points that you want to convert into masks. Each point is typically a coordinate pair (x, y) that indicates a specific location in the frame. The points are usually generated by a tracking algorithm and are crucial for determining where the masks will be applied. The accuracy and effectiveness of the masks depend heavily on the precision of these input points.

height

The height parameter specifies the height of the output mask. It determines the vertical dimension of the mask and can significantly impact the resolution and detail of the mask. The default value is 512, with a minimum of 1 and a maximum of 8192. Adjusting this parameter allows you to tailor the mask size to fit the specific needs of your project, ensuring that the mask covers the desired area without unnecessary computation.

width

Similar to the height parameter, the width parameter defines the horizontal dimension of the output mask. It controls the width of the mask and, like the height, affects the resolution and detail. The default value is 512, with a minimum of 1 and a maximum of 8192. Properly setting this parameter ensures that the mask is appropriately sized for the frame, providing optimal coverage and performance.

radius

The radius parameter determines the size of the Gaussian mask applied around each point. It affects the spread and smoothness of the mask, with a default value of 5, a minimum of 1, and a maximum of 50. A larger radius results in a more diffuse mask, which can be useful for creating softer transitions, while a smaller radius provides a more focused mask, ideal for precise applications.

Points To Masks Output Parameters:

masks

The masks output is a tensor containing the generated tracking masks. Each mask corresponds to a frame in the sequence and is shaped according to the specified height and width parameters. These masks are used to define areas of interest within each frame, allowing for targeted effects and transformations. The Gaussian distribution applied to each mask ensures smooth transitions and natural-looking results, making them invaluable for tasks that require precise control over specific regions of a video or animation.

Points To Masks Usage Tips:

  • Ensure that the points input is accurate and corresponds to the areas you wish to track, as the quality of the masks depends on the precision of these points.
  • Adjust the radius parameter to control the softness of the mask edges. A larger radius can help create smoother transitions, while a smaller radius is better for sharp, precise masking.
  • Set the height and width parameters to match the resolution of your frames to ensure that the masks are correctly aligned and cover the intended areas.

Points To Masks Common Errors and Solutions:

"CUDA device not available"

  • Explanation: This error occurs when the node attempts to use a CUDA device for processing, but no compatible device is found.
  • Solution: Ensure that your system has a CUDA-compatible GPU and that the necessary drivers and libraries are installed. Alternatively, modify the code to use the CPU if a GPU is not available.

"IndexError: index out of bounds"

  • Explanation: This error can occur if the points provided are outside the bounds of the specified mask dimensions.
  • Solution: Verify that the points input coordinates are within the range defined by the height and width parameters. Adjust the points or mask dimensions as necessary to prevent out-of-bounds errors.

Points To Masks Related Nodes

Go back to the extension to check out more related nodes.
TrentNodes
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

Points To Masks