Visit ComfyUI Online for ready-to-use ComfyUI environment
Generate constant color images or masks for backgrounds and compositing, with customizable size and RGBA color values.
The Constant node generates constant images or masks of a specified size and color. It can be used to create solid color backgrounds or matte images for compositing with other visual elements. The node allows you to define the desired width and height of the output and specify the RGBA color value for the constant output. Additionally, you can input an optional image to use as a matte with the selected color. This node is particularly useful for creating uniform backgrounds or overlays in your visual projects, ensuring consistency and ease of use in your compositions.
The width parameter defines the horizontal dimension of the output image or mask. It determines how wide the generated image will be. The value should be a positive integer representing the number of pixels. The minimum value is 1, and there is no explicit maximum value, but it should be within the limits of your system's capabilities. The default value is typically set to 1920 pixels.
The height parameter specifies the vertical dimension of the output image or mask. It determines how tall the generated image will be. Similar to the width parameter, the value should be a positive integer representing the number of pixels. The minimum value is 1, and there is no explicit maximum value, but it should be within the limits of your system's capabilities. The default value is typically set to 1080 pixels.
The color parameter allows you to define the RGBA color value for the constant output. This parameter accepts a tuple or list of four values, each ranging from 0 to 255, representing the red, green, blue, and alpha (transparency) channels, respectively. For example, (255, 0, 0, 255) would create a solid red color with full opacity. The default value is usually set to (0, 0, 0, 255), which represents a solid black color with full opacity.
The matte_image parameter allows you to input an optional image to use as a matte with the selected color. This image will be combined with the specified color to create a composite output. If no image is provided, the node will generate a solid color image based on the width, height, and color parameters. The default value is None, meaning no matte image is used.
The IMAGE output is the primary result of the Constant node. It is a generated image of the specified width, height, and color. This output can be used as a background or overlay in your visual compositions, providing a consistent and uniform base for further processing.
The RGB output is similar to the IMAGE output but specifically focuses on the red, green, and blue color channels. This output can be useful when you need to work with the color information separately from the alpha (transparency) channel.
The MASK output is a binary image that represents the alpha (transparency) channel of the generated image. This output can be used to create matte effects or to mask out certain areas of an image in your compositions.
Β© Copyright 2024 RunComfy. All Rights Reserved.