Visit ComfyUI Online for ready-to-use ComfyUI environment
Apply gradient effect to mask for smooth transitions and blending in AI-generated artwork, enhancing depth and realism with customizable options.
The LayerMask: MaskGradient
node is designed to apply a gradient effect to a given mask, allowing for smooth transitions and blending effects in your AI-generated artwork. This node is particularly useful for creating sophisticated visual effects where a gradual change in opacity or color is required. By leveraging the gradient capabilities, you can enhance the depth and realism of your images, making them more visually appealing. The node provides flexibility in terms of gradient direction, scale, and offset, enabling you to customize the gradient effect to suit your specific artistic needs. Additionally, the option to invert the mask and adjust opacity further expands the creative possibilities, allowing for intricate and nuanced designs.
The mask
parameter is the primary input for the node, representing the initial mask to which the gradient effect will be applied. This mask is typically a 2D tensor, but if it is not, the node will automatically adjust it to the correct dimensions. The mask defines the areas of the image that will be affected by the gradient.
The invert_mask
parameter is a boolean flag that determines whether the input mask should be inverted before applying the gradient. When set to True
, the mask values are inverted, effectively swapping the areas of transparency and opacity. This can be useful for reversing the gradient effect or achieving specific visual outcomes. The default value is False
.
The gradient_side
parameter specifies the direction from which the gradient will be applied. Common options include left
, right
, top
, and bottom
, indicating the starting point of the gradient. This parameter allows you to control the orientation of the gradient effect, ensuring it aligns with your artistic vision.
The gradient_scale
parameter controls the intensity and spread of the gradient effect. A higher value results in a more gradual transition, while a lower value creates a sharper gradient. This parameter allows you to fine-tune the gradient to achieve the desired level of smoothness and blending. The default value is typically set to a moderate level, but it can be adjusted based on your specific requirements.
The gradient_offset
parameter adjusts the starting point of the gradient along the specified direction. By modifying this value, you can shift the gradient effect to begin at a different position within the mask. This provides additional control over the placement and impact of the gradient, enabling more precise and targeted adjustments.
The opacity
parameter determines the overall transparency of the gradient effect. A value of 100 means the gradient is fully opaque, while lower values introduce varying levels of transparency. This parameter allows you to blend the gradient effect with the underlying image, creating subtle or pronounced transitions as needed. The default value is typically set to 100, but it can be reduced to achieve softer effects.
The gradient_mask
output is the resulting mask after the gradient effect has been applied. This mask retains the original dimensions of the input mask but now includes the gradient transitions based on the specified parameters. The gradient_mask
can be used in subsequent nodes or processes to further refine and enhance your artwork, providing a versatile tool for creating complex visual effects.
gradient_side
values to see how the direction of the gradient affects your image.gradient_scale
to find the perfect balance between a smooth transition and a sharp gradient.invert_mask
option to quickly reverse the gradient effect without modifying the original mask.LayerMask: MaskGradient
nodes with varying parameters to create intricate and layered gradient effects.gradient_side
parameter.gradient_side
(e.g., left
, right
, top
, bottom
) and ensure you are using one of these valid values.opacity
parameter is set to a value outside the acceptable range (0-100).opacity
parameter to a value within the 0-100 range to ensure proper functionality.© Copyright 2024 RunComfy. All Rights Reserved.