A set of nodes for ComfyUI that can composite layer and mask to achieve Photoshop like functionality.
The LayerMask: CreateGradientMask node is a component of the ComfyUI environment designed to create customizable gradient masks. These masks can be used to apply gradient effects and transparency to layers, enabling dynamic visual effects within the environment. The node provides multiple options for gradient orientation, scale, offset, and opacity.
The LayerMask: CreateGradientMask node is responsible for generating a gradient image mask based on user-defined parameters. This mask can be used in image compositing workflows to develop various visual effects by allowing certain portions of images to be seen or hidden in a smooth transition.
The node accepts the following inputs:
Width: Determines the width of the gradient mask in pixels. Accepts an integer value with a default of 512.
Height: Determines the height of the gradient mask in pixels. Accepts an integer value with a default of 512.
Gradient Side: Specifies the direction of the gradient. The available options are bottom
, top
, left
, right
, and center
.
Gradient Scale: Adjusts the size of the gradient within the mask. A scale of 100% means the gradient spans the entire dimension. Accepts an integer with a default of 100.
Gradient Offset: Shifts the gradient along its direction, either away from or towards its origin. Positive and negative integer values are accepted with a default of 0.
Opacity: Sets the overall transparency of the mask. A value of 100% is fully opaque, while 0% is fully transparent. Accepts an integer with a default of 100.
Size As (optional): This parameter allows the mask size to be dynamically set based on the size of another image or tensor. If a reference image is provided, the mask will resize itself to match.
In ComfyUI workflows, the LayerMask: CreateGradientMask node can be connected with other components to create sophisticated visual effects. For instance, by using this mask to blend two images, you can achieve smooth transitions between different sections, or overlay dynamic textures.
Use cases might include:
Image Compositing: Combine multiple images where gradual transparency is required at the edges or certain sections, simulating effects like shadowing or highlights.
Dynamic Layer Effects: Modify visibility properties of UI layers programmatically, allowing for effects such as layers fading in/out or sliding in a specified direction.
Visual Styling: Integrate complex gradient patterns into UI components to enhance graphical aesthetics.
Directional Control: The node allows precise control over the direction and scale of the gradient, making it versatile for different design needs.
Dynamic Resizing: The optional Size As
parameter provides flexibility by sizing the mask based on another image, which is helpful in responsive design scenarios.
Opacity Modulation: By offering opacity control, users can adjust the impact of the mask on the final output, ensuring that visual changes are subtle or pronounced as desired.
Overall, the LayerMask: CreateGradientMask node is a powerful tool for modifying the appearance of UI elements and images within ComfyUI by employing gradients in creative and flexible ways.