ComfyUI  >  Nodes  >  KJNodes for ComfyUI >  Create Shape Mask

ComfyUI Node: Create Shape Mask

Class Name

CreateShapeMask

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

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 Shape Mask Description

Generate customizable masks with shapes like circles, squares, and triangles, including animated options for dynamic effects.

Create Shape Mask:

The CreateShapeMask node is designed to generate masks or batches of masks with specified shapes such as circles, squares, or triangles. This node is particularly useful for creating precise and customizable masks for various artistic and design purposes. By defining the shape, size, and location parameters, you can create masks that fit your specific needs. The node also allows for the creation of animated masks by adjusting the grow value, which changes the size of the shape over multiple frames. This flexibility makes it a powerful tool for AI artists looking to add dynamic and intricate masking effects to their projects.

Create Shape Mask Input Parameters:

shape

This parameter defines the shape of the mask to be created. You can choose from three options: circle, square, or triangle. The default value is circle.

frames

Specifies the number of frames for which the mask will be generated. This is particularly useful for creating animated masks. The minimum value is 1, the maximum is 4096, and the default is 1.

location_x

Defines the x-coordinate for the center location of the shape within the frame. The minimum value is 0, the maximum is 4096, and the default is 256.

location_y

Defines the y-coordinate for the center location of the shape within the frame. The minimum value is 0, the maximum is 4096, and the default is 256.

grow

This parameter specifies the amount by which the shape will grow on each frame, allowing for the creation of animated masks. The minimum value is -512, the maximum is 512, and the default is 0.

frame_width

Sets the width of the frame in which the mask will be created. The minimum value is 16, the maximum is 4096, and the default is 512.

frame_height

Sets the height of the frame in which the mask will be created. The minimum value is 16, the maximum is 4096, and the default is 512.

shape_width

Defines the width of the shape to be created. The minimum value is 8, the maximum is 4096, and the default is 128.

shape_height

Defines the height of the shape to be created. The minimum value is 8, the maximum is 4096, and the default is 128.

Create Shape Mask Output Parameters:

mask

This output parameter provides the generated mask based on the specified input parameters. The mask can be used in various artistic and design applications to isolate or highlight specific areas of an image.

mask_inverted

This output parameter provides the inverted version of the generated mask. This can be useful for creating complementary effects or for use in different masking scenarios where the inverse of the original mask is needed.

Create Shape Mask Usage Tips:

  • To create an animated mask, adjust the grow parameter to change the size of the shape over multiple frames.
  • Use the location_x and location_y parameters to precisely position the shape within the frame.
  • Experiment with different shape_width and shape_height values to achieve the desired mask size and proportions.

Create Shape Mask Common Errors and Solutions:

"Invalid shape type"

  • Explanation: The shape type provided is not one of the accepted values (circle, square, triangle).
  • Solution: Ensure that the shape parameter is set to one of the accepted values.

"Frame dimensions out of range"

  • Explanation: The frame_width or frame_height values are outside the acceptable range (16 to 4096).
  • Solution: Adjust the frame_width and frame_height parameters to be within the specified range.

"Shape dimensions out of range"

  • Explanation: The shape_width or shape_height values are outside the acceptable range (8 to 4096).
  • Solution: Adjust the shape_width and shape_height parameters to be within the specified range.

"Invalid coordinates"

  • Explanation: The location_x or location_y values are outside the acceptable range (0 to 4096).
  • Solution: Ensure that the location_x and location_y parameters are within the specified range.

Create Shape 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.