ComfyUI > Nodes > Comfyui_TTP_Toolset > TTP_Expand_And_Mask

ComfyUI Node: TTP_Expand_And_Mask

Class Name

TTP_Expand_And_Mask

Category
TTP/Image
Author
TTPlanetPig (Account age: 868days)
Extension
Comfyui_TTP_Toolset
Latest Updated
2026-01-08
Github Stars
0.97K

How to Install Comfyui_TTP_Toolset

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

TTP_Expand_And_Mask Description

Enhances mask data by expanding/contracting regions for precise control in AI art projects.

TTP_Expand_And_Mask:

The TTP_Expand_And_Mask node is designed to enhance and manipulate mask data within your AI art projects. This node provides a powerful tool for expanding or contracting mask regions, allowing you to refine the areas of interest in your compositions. By adjusting the mask boundaries, you can achieve more precise control over the masked areas, which is particularly useful in tasks such as image editing, compositing, and inpainting. The node's functionality is essential for artists looking to fine-tune the details of their work, ensuring that the mask accurately represents the intended regions. This capability is crucial for achieving high-quality results in AI-generated art, where precision and detail are paramount.

TTP_Expand_And_Mask Input Parameters:

mask

The mask parameter is the primary input for the node, representing the initial mask data that you wish to manipulate. This input is crucial as it defines the starting point for any expansion or contraction operations. The mask is typically a binary or grayscale image where the areas of interest are highlighted. By providing a well-defined mask, you ensure that the node can accurately perform its operations, leading to more precise and desirable outcomes.

expand

The expand parameter determines the degree to which the mask will be expanded or contracted. It accepts integer values, where positive numbers will expand the mask, and negative numbers will contract it. The default value is 0, meaning no change to the mask size. The range of this parameter is from the negative to the positive maximum resolution defined by the system, allowing for significant flexibility in mask manipulation. Adjusting this parameter enables you to control the extent of the mask's influence on the image, which can be critical for achieving the desired artistic effect.

tapered_corners

The tapered_corners parameter is a boolean option that, when enabled, applies a smoothing effect to the corners of the expanded or contracted mask. This feature is particularly useful for creating more natural and less abrupt transitions between masked and unmasked areas. The default setting is True, which means the corners will be tapered unless specified otherwise. This parameter is beneficial for artists who want to maintain a soft and organic look in their compositions, avoiding harsh edges that can detract from the overall aesthetic.

TTP_Expand_And_Mask Output Parameters:

mask

The output mask parameter provides the modified mask after the expansion or contraction process. This output is crucial as it reflects the changes made to the original mask, allowing you to see the effects of your adjustments. The modified mask can then be used in subsequent processing steps or directly applied to your artwork. Understanding the output mask's characteristics is essential for integrating it effectively into your workflow and ensuring that it meets your artistic requirements.

TTP_Expand_And_Mask Usage Tips:

  • Experiment with the expand parameter to find the perfect balance between expanding and contracting the mask to suit your artistic vision.
  • Use the tapered_corners option to create smoother transitions in your mask, which can enhance the natural look of your compositions.

TTP_Expand_And_Mask Common Errors and Solutions:

Mask shape mismatch

  • Explanation: This error occurs when the input mask does not have the expected dimensions or shape, which can prevent the node from processing it correctly.
  • Solution: Ensure that the input mask is correctly formatted and matches the expected dimensions for the node. Reshape or resize the mask as necessary before inputting it into the node.

Invalid expand value

  • Explanation: An invalid expand value, such as one outside the permissible range, can cause the node to malfunction or produce unexpected results.
  • Solution: Verify that the expand value is within the allowed range and adjust it accordingly. Use values that are within the system's defined maximum resolution limits.

TTP_Expand_And_Mask Related Nodes

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