ComfyUI  >  Nodes  >  ComfyUI Layer Style >  LayerMask: CreateGradientMask

ComfyUI Node: LayerMask: CreateGradientMask

Class Name

LayerMask: CreateGradientMask

Category
😺dzNodes/LayerMask
Author
chflame163 (Account age: 445 days)
Extension
ComfyUI Layer Style
Latest Updated
6/24/2024
Github Stars
0.6K

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

LayerMask: CreateGradientMask Description

Generate customizable gradient masks for image transitions and effects with direction, scale, offset, and opacity control.

LayerMask: CreateGradientMask:

The LayerMask: CreateGradientMask node is designed to generate a gradient mask that can be applied to images, providing a smooth transition effect from one side of the image to another. This node is particularly useful for creating visually appealing effects such as fades, vignettes, or other gradient-based modifications. By allowing you to specify the direction, scale, and offset of the gradient, as well as the opacity, this node offers a high degree of customization to achieve the desired visual outcome. The primary goal of this node is to enhance your image processing capabilities by enabling the creation of dynamic and adjustable gradient masks that can be tailored to fit various artistic needs.

LayerMask: CreateGradientMask Input Parameters:

width

The width parameter specifies the width of the gradient mask in pixels. It determines how wide the mask will be, which directly affects the area covered by the gradient. The minimum value is 4, the maximum value is 99999, and the default value is 512. Adjusting this parameter allows you to fit the mask to the specific dimensions of your image.

height

The height parameter specifies the height of the gradient mask in pixels. It determines how tall the mask will be, which directly affects the area covered by the gradient. The minimum value is 4, the maximum value is 99999, and the default value is 512. Adjusting this parameter allows you to fit the mask to the specific dimensions of your image.

gradient_side

The gradient_side parameter allows you to choose the direction from which the gradient will start. The available options are bottom, top, left, right, and center. This parameter is crucial for defining the orientation of the gradient effect on your image.

gradient_scale

The gradient_scale parameter controls the intensity of the gradient effect. It determines how quickly the gradient transitions from one side to the other. The minimum value is 1, the maximum value is 9999, and the default value is 100. Adjusting this parameter allows you to fine-tune the smoothness and reach of the gradient.

gradient_offset

The gradient_offset parameter allows you to shift the starting point of the gradient. This can be useful for creating more complex gradient effects or for aligning the gradient with specific features in your image. The minimum value is -9999, the maximum value is 9999, and the default value is 0. Adjusting this parameter provides additional control over the placement of the gradient.

opacity

The opacity parameter controls the transparency of the gradient mask. A value of 100 means the mask is fully opaque, while a value of 0 means it is fully transparent. The minimum value is 0, the maximum value is 100, and the default value is 100. Adjusting this parameter allows you to blend the gradient effect with the underlying image to the desired extent.

size_as

The size_as parameter is optional and allows you to specify another image or mask to match the size of the gradient mask. This can be useful for ensuring consistency across multiple layers or for aligning the gradient mask with other elements in your composition.

LayerMask: CreateGradientMask Output Parameters:

mask

The mask output parameter provides the generated gradient mask. This mask can be used in various image processing tasks to apply gradient effects, blend images, or create complex visual compositions. The mask is returned as a single output, ready to be used in subsequent nodes or processes.

LayerMask: CreateGradientMask Usage Tips:

  • To create a smooth fade effect from the top of an image, set the gradient_side to top and adjust the gradient_scale to control the smoothness of the transition.
  • Use the gradient_offset parameter to align the gradient with specific features in your image, such as centering the gradient on a particular object.
  • Experiment with the opacity parameter to blend the gradient effect with the underlying image, achieving subtle or dramatic visual results.

LayerMask: CreateGradientMask Common Errors and Solutions:

"Invalid width or height value"

  • Explanation: The width or height value provided is outside the acceptable range.
  • Solution: Ensure that the width and height parameters are set within the range of 4 to 99999 pixels.

"Gradient scale out of range"

  • Explanation: The gradient scale value is outside the acceptable range.
  • Solution: Adjust the gradient_scale parameter to be within the range of 1 to 9999.

"Opacity value out of range"

  • Explanation: The opacity value is outside the acceptable range.
  • Solution: Set the opacity parameter to a value between 0 and 100.

"Invalid gradient side option"

  • Explanation: The selected gradient side option is not recognized.
  • Solution: Choose a valid option for the gradient_side parameter: bottom, top, left, right, or center.

LayerMask: CreateGradientMask 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.