ComfyUI > Nodes > comfy_Pond_Nodes > 🐳遮罩区域扩展

ComfyUI Node: 🐳遮罩区域扩展

Class Name

MaskRegionExpandNode

Category
🐳Pond/遮罩
Author
Pondowner857 (Account age: 730days)
Extension
comfy_Pond_Nodes
Latest Updated
2026-01-28
Github Stars
0.04K

How to Install comfy_Pond_Nodes

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

🐳遮罩区域扩展 Description

Expands mask regions horizontally/vertically, smooths edges with Gaussian blur, and applies gradients.

🐳遮罩区域扩展:

The MaskRegionExpandNode is designed to enhance and manipulate specific regions within a mask by expanding them horizontally or vertically. This node is particularly useful for AI artists who need to adjust mask boundaries to achieve desired effects in their artwork. By allowing the expansion of either black or white regions, the node provides flexibility in mask manipulation. It also offers an option for edge smoothing using Gaussian blur, which can create a more natural transition between expanded and non-expanded areas. The node's ability to apply linear gradients during expansion further enhances its utility, enabling smooth transitions and more refined control over the mask's appearance. This makes it an essential tool for artists looking to fine-tune mask regions with precision and creativity.

🐳遮罩区域扩展 Input Parameters:

mask

The mask parameter is the primary input for the node, representing the mask that you wish to expand. It is crucial as it defines the initial boundaries and regions that will be manipulated. The mask should be in a format that the node can process, typically a binary or grayscale image where different regions are distinguished by varying pixel values.

The parameter specifies the number of pixels to expand the mask to the left. It allows you to control how much the mask should extend horizontally towards the left side. The minimum value is 0, the maximum is 1000, and the default is 0, meaning no expansion unless specified.

The parameter determines the number of pixels to expand the mask upwards. This parameter is essential for vertical expansion towards the top of the image. It has a minimum value of 0, a maximum of 1000, and a default of 0, indicating no upward expansion unless adjusted.

The parameter controls the number of pixels to expand the mask to the right. It is used to extend the mask horizontally towards the right side. The parameter ranges from a minimum of 0 to a maximum of 1000, with a default value of 0, meaning no rightward expansion unless specified.

The parameter specifies the number of pixels to expand the mask downwards. It is crucial for vertical expansion towards the bottom of the image. The minimum value is 0, the maximum is 1000, and the default is 0, indicating no downward expansion unless adjusted.

扩展区域

The 扩展区域 parameter determines which region of the mask to expand, offering options between "黑色区域" (black region) and "白色区域" (white region). This choice affects how the mask is manipulated, with the default being "黑色区域."

边缘平滑

The 边缘平滑 parameter controls the degree of edge smoothing applied to the expanded regions using Gaussian blur. It ranges from 0 to 50, with a default of 0, meaning no smoothing unless specified. This parameter is useful for creating softer transitions at the edges of expanded areas.

使用渐变

The 使用渐变 parameter allows you to choose whether to apply a linear gradient during the expansion process. Options are "否" (no) and "是" (yes), with the default being "否." When enabled, it provides a gradual transition effect, enhancing the visual quality of the expanded mask.

🐳遮罩区域扩展 Output Parameters:

MASK

The output parameter MASK represents the modified mask after the expansion process. It reflects the changes made based on the input parameters, showing the expanded regions with any applied smoothing or gradient effects. This output is crucial for further processing or integration into your artwork, providing a refined mask that meets your creative needs.

🐳遮罩区域扩展 Usage Tips:

  • To achieve a smooth transition between expanded and non-expanded areas, consider using the 边缘平滑 parameter to apply Gaussian blur, which can help blend the edges seamlessly.
  • Experiment with the 使用渐变 option to create gradual transitions in the expanded regions, which can add depth and a more natural look to your masks.

🐳遮罩区域扩展 Common Errors and Solutions:

ValueError: 不支持的掩码形状

  • Explanation: This error occurs when the input mask has an unsupported shape that the node cannot process.
  • Solution: Ensure that your mask is in a compatible format, typically a binary or grayscale image with dimensions (1, H, W) or (H, W).

IndexError: index out of range

  • Explanation: This error might happen if the expansion parameters exceed the mask's dimensions.
  • Solution: Check the values for , , , and to ensure they do not exceed the mask's size. Adjust them to fit within the mask's boundaries.

🐳遮罩区域扩展 Related Nodes

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

🐳遮罩区域扩展