ComfyUI > Nodes > KJNodes for ComfyUI > Create Gradient Mask

ComfyUI Node: Create Gradient Mask

Class Name

CreateGradientMask

Category
KJNodes/masking/generate
Author
kijai (Account age: 2192days)
Extension
KJNodes for ComfyUI
Latest Updated
2024-06-25
Github Stars
0.35K

How to Install KJNodes for ComfyUI

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

Create Gradient Mask Description

Generate smooth black-to-white gradient masks for blending/fading effects in AI art, customizable and animatable.

Create Gradient Mask:

The CreateGradientMask node is designed to generate a gradient mask, which transitions smoothly from black to white across the width of the image. This node is particularly useful for creating effects that require a gradual change in intensity, such as blending or fading effects in AI-generated art. The gradient can be customized in terms of its dimensions and can be inverted if needed. By adjusting the number of frames, you can create a sequence of gradient masks that change over time, adding dynamic visual effects to your projects.

Create Gradient Mask Input Parameters:

invert

The invert parameter is a boolean option that determines whether the gradient mask should be inverted. When set to True, the gradient will transition from white to black instead of black to white. This can be useful for creating reverse fading effects. The default value is False.

frames

The frames parameter specifies the number of frames or images in the batch. This allows you to create a sequence of gradient masks that change over time. The value must be an integer between 0 and 255, with a default value of 0. Increasing the number of frames can add dynamic visual effects to your project.

width

The width parameter defines the width of the gradient mask in pixels. It must be an integer between 16 and 4096, with a default value of 256. Adjusting the width allows you to control the horizontal resolution of the gradient.

height

The height parameter defines the height of the gradient mask in pixels. It must be an integer between 16 and 4096, with a default value of 256. Adjusting the height allows you to control the vertical resolution of the gradient.

Create Gradient Mask Output Parameters:

MASK

The MASK output is a tensor containing the generated gradient mask(s). This output can be used in various image processing tasks where a gradient effect is needed. The mask can be directly applied to images to create smooth transitions or blended effects.

Create Gradient Mask Usage Tips:

  • To create a smooth fading effect, set the invert parameter to False and adjust the frames parameter to generate a sequence of gradient masks.
  • For a reverse fading effect, set the invert parameter to True.
  • Adjust the width and height parameters to match the resolution of the images you are working with to ensure the gradient mask fits perfectly.

Create Gradient Mask Common Errors and Solutions:

ValueError: Frames must be between 0 and 255

  • Explanation: The frames parameter value is outside the allowed range.
  • Solution: Ensure that the frames parameter is set to an integer between 0 and 255.

ValueError: Width must be between 16 and 4096

  • Explanation: The width parameter value is outside the allowed range.
  • Solution: Ensure that the width parameter is set to an integer between 16 and 4096.

ValueError: Height must be between 16 and 4096

  • Explanation: The height parameter value is outside the allowed range.
  • Solution: Ensure that the height parameter is set to an integer between 16 and 4096.

TypeError: Invert must be a boolean

  • Explanation: The invert parameter is not set to a boolean value.
  • Solution: Ensure that the invert parameter is set to either True or False.

Create Gradient Mask Related Nodes

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