ComfyUI > Nodes > ComfyUI Layer Style > LayerUtility: LayerMaskTransform

ComfyUI Node: LayerUtility: LayerMaskTransform

Class Name

LayerUtility: LayerMaskTransform

Category
😺dzNodes/LayerUtility
Author
chflame163 (Account age: 445days)
Extension
ComfyUI Layer Style
Latest Updated
2024-06-24
Github Stars
0.64K

How to Install ComfyUI Layer Style

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

LayerUtility: LayerMaskTransform Description

Manipulate and transform mask layers for image processing tasks with scaling, rotating, mirroring capabilities.

LayerUtility: LayerMaskTransform:

The LayerUtility: LayerMaskTransform node is designed to manipulate and transform mask layers in various ways, providing you with a versatile tool for image processing tasks. This node allows you to apply transformations such as scaling, rotating, and mirroring to mask layers, which are essential for tasks like compositing, masking, and image editing. By using this node, you can precisely control the position, size, and orientation of mask layers, ensuring that they fit perfectly within your desired layout. The node also supports anti-aliasing and different transformation methods to maintain the quality of the masks during the transformation process. Overall, LayerUtility: LayerMaskTransform is a powerful utility for AI artists looking to enhance their image processing workflows with advanced mask manipulation capabilities.

LayerUtility: LayerMaskTransform Input Parameters:

mask

The mask parameter is the input mask layer that you want to transform. It is expected to be in the format of a tensor. This mask serves as the base layer upon which all transformations will be applied.

x

The x parameter specifies the horizontal offset for the mask transformation. It determines how much the mask will be shifted along the x-axis. The default value is 0, with a minimum of -99999 and a maximum of 99999, allowing for a wide range of horizontal adjustments.

y

The y parameter specifies the vertical offset for the mask transformation. It determines how much the mask will be shifted along the y-axis. The default value is 0, with a minimum of -99999 and a maximum of 99999, allowing for a wide range of vertical adjustments.

mirror

The mirror parameter allows you to apply a mirroring effect to the mask. You can choose from three options: None, horizontal, and vertical. This parameter is useful for creating symmetrical effects or flipping the mask along the specified axis.

scale

The scale parameter controls the scaling factor of the mask. It determines how much the mask will be resized. The default value is 1, with a minimum of 0.01 and a maximum of 100, providing flexibility in adjusting the mask size.

aspect_ratio

The aspect_ratio parameter adjusts the aspect ratio of the mask. It allows you to stretch or compress the mask along the vertical axis. The default value is 1, with a minimum of 0.01 and a maximum of 100, enabling precise control over the mask's proportions.

rotate

The rotate parameter specifies the rotation angle for the mask transformation. It determines how much the mask will be rotated in degrees. The default value is 0, with a minimum of -999999 and a maximum of 999999, allowing for full 360-degree rotation and beyond.

transform_method

The transform_method parameter defines the interpolation method used for scaling and rotating the mask. You can choose from several options: lanczos, bicubic, hamming, bilinear, box, and nearest. Each method offers different levels of quality and performance, allowing you to select the most suitable one for your needs.

anti_aliasing

The anti_aliasing parameter controls the level of anti-aliasing applied during the transformation process. It helps to smooth out the edges of the mask and reduce visual artifacts. The default value is 2, with a minimum of 0 and a maximum of 16, providing a range of anti-aliasing levels to choose from.

LayerUtility: LayerMaskTransform Output Parameters:

mask

The mask output parameter is the transformed mask layer resulting from the applied transformations. It is returned in the format of a tensor. This output mask can be used in subsequent image processing tasks or compositing operations, providing you with a modified version of the original mask that fits your desired specifications.

LayerUtility: LayerMaskTransform Usage Tips:

  • To achieve precise alignment of mask layers, use the x and y parameters to fine-tune the position of the mask.
  • Experiment with different transform_method options to find the best balance between quality and performance for your specific use case.
  • Utilize the mirror parameter to create symmetrical effects or to flip the mask for different visual perspectives.
  • Adjust the scale and aspect_ratio parameters to fit the mask within specific dimensions or to match the proportions of other elements in your composition.
  • Use the rotate parameter to align the mask with other rotated elements or to create dynamic visual effects.

LayerUtility: LayerMaskTransform Common Errors and Solutions:

"Mask tensor dimension mismatch"

  • Explanation: This error occurs when the input mask tensor does not have the expected dimensions.
  • Solution: Ensure that the input mask tensor is either 2D or 3D. If it is 2D, it will be automatically unsqueezed to 3D.

"Invalid mirror mode"

  • Explanation: This error occurs when an invalid value is provided for the mirror parameter.
  • Solution: Ensure that the mirror parameter is set to one of the following values: None, horizontal, or vertical.

"Scale value out of range"

  • Explanation: This error occurs when the scale parameter is set to a value outside the allowed range.
  • Solution: Ensure that the scale parameter is set to a value between 0.01 and 100.

"Aspect ratio value out of range"

  • Explanation: This error occurs when the aspect_ratio parameter is set to a value outside the allowed range.
  • Solution: Ensure that the aspect_ratio parameter is set to a value between 0.01 and 100.

"Rotation angle out of range"

  • Explanation: This error occurs when the rotate parameter is set to a value outside the allowed range.
  • Solution: Ensure that the rotate parameter is set to a value between -999999 and 999999.

"Invalid transform method"

  • Explanation: This error occurs when an invalid value is provided for the transform_method parameter.
  • Solution: Ensure that the transform_method parameter is set to one of the following values: lanczos, bicubic, hamming, bilinear, box, or nearest.

"Anti-aliasing value out of range"

  • Explanation: This error occurs when the anti_aliasing parameter is set to a value outside the allowed range.
  • Solution: Ensure that the anti_aliasing parameter is set to a value between 0 and 16.

LayerUtility: LayerMaskTransform Related Nodes

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