ComfyUI > Nodes > ComfyUI-DD-Nodes > DD Mask Uniform Size

ComfyUI Node: DD Mask Uniform Size

Class Name

DD-MaskUniformSize

Category
🍺DD系列节点
Author
Dontdrunk (Account age: 3252days)
Extension
ComfyUI-DD-Nodes
Latest Updated
2025-05-27
Github Stars
0.05K

How to Install ComfyUI-DD-Nodes

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

DD Mask Uniform Size Description

Standardize input mask size to specified resolution for AI artists, supporting multiple ports and scaling methods.

DD Mask Uniform Size:

The DD-MaskUniformSize node is designed to standardize the size of input masks to a specified resolution, making it an essential tool for AI artists who need consistent mask dimensions across various projects. This node supports multiple input ports and offers a variety of scaling methods and size adaptation strategies, ensuring flexibility and precision in mask resizing. By providing options for threshold processing, it allows for fine-tuning of mask details, which can be crucial for achieving the desired artistic effects. The node's ability to handle multiple masks simultaneously and output them in a uniform size streamlines the workflow, making it easier to manage and manipulate mask data in creative projects.

DD Mask Uniform Size Input Parameters:

缩放方法

This parameter determines the interpolation method used for resizing the masks. Options include "邻近-精确" (nearest-exact), "双线性插值" (bilinear interpolation), "区域" (area), "双三次插值" (bicubic interpolation), and "lanczos". The choice of method affects the quality and smoothness of the resized mask, with each method offering a different balance between speed and quality. The default is "邻近-精确".

宽度

This integer parameter sets the target width for the resized masks. It ranges from a minimum of 8 to a maximum of 8192, with a default value of 512. Adjusting this parameter allows you to control the horizontal resolution of the output masks.

高度

Similar to the width parameter, this integer sets the target height for the resized masks. It also ranges from 8 to 8192, with a default of 512. This parameter controls the vertical resolution of the output masks.

尺寸适配

This parameter specifies the strategy for adapting the mask size to the target dimensions. Options include "自适应" (adaptive), "拉伸" (stretch), "裁剪" (crop), and "填充" (fill). Each option offers a different approach to handling aspect ratio changes, with "自适应" being the default.

阈值处理

A boolean parameter that enables or disables threshold processing. When enabled, it applies a threshold to the resized masks, which can help in refining mask edges and enhancing contrast. The default setting is False.

阈值值

This float parameter sets the threshold value used when threshold processing is enabled. It ranges from 0.0 to 1.0, with a default of 0.5. Adjusting this value allows for control over the sensitivity of the threshold effect.

遮罩A

An optional input port for a mask. This allows you to input a mask that will be resized according to the specified parameters.

遮罩B

Another optional input port for a mask, similar to 遮罩A, providing flexibility in handling multiple masks.

遮罩C

An additional optional input port for a mask, offering further capacity for mask input.

遮罩D

The final optional input port for a mask, maximizing the node's ability to process multiple masks simultaneously.

DD Mask Uniform Size Output Parameters:

遮罩A

This output provides the resized version of the input mask connected to the 遮罩A port. It reflects the specified width, height, and other parameters, ensuring a uniform size.

遮罩B

Similar to 遮罩A, this output delivers the resized mask from the 遮罩B input, maintaining consistency in size and quality.

遮罩C

This output corresponds to the resized mask from the 遮罩C input, processed according to the node's settings.

遮罩D

The final output provides the resized mask from the 遮罩D input, completing the set of uniformly sized masks.

DD Mask Uniform Size Usage Tips:

  • Use the "自适应" size adaptation strategy to maintain the original aspect ratio of masks while resizing.
  • Enable threshold processing to enhance mask edges, especially when working with high-contrast designs.

DD Mask Uniform Size Common Errors and Solutions:

"Input is not a tensor"

  • Explanation: This error occurs when the input mask is not in the expected tensor format.
  • Solution: Ensure that the input masks are converted to tensors before connecting them to the node.

"Invalid mask dimensions"

  • Explanation: This error arises when the input mask dimensions do not match the expected format.
  • Solution: Verify that the input masks are in the correct batch format [B, H, W] or [B, 1, H, W] before processing.

DD Mask Uniform Size Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-DD-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 Playground, enabling artists to harness the latest AI tools to create incredible art.