LayerStyle

2167
By chflame
Updated 15 days ago
View on GitHub →See Common Issues →

A set of nodes for ComfyUI that can composite layer and mask to achieve Photoshop like functionality.

Available Nodes

LayerStyle: ColorOverlay

LayerStyle: ColorOverlay Node Documentation

Overview

The LayerStyle: ColorOverlay node enhances image layers by applying color overlays. This node provides a flexible way to overlay colors on top of images using different blending modes and opacities, allowing for creative modifications and enhancements to your visual content. It can be used in various ComfyUI workflows to create visually striking compositions by blending a base image with a colored overlay controlled through a mask.

Inputs

The LayerStyle: ColorOverlay node accepts the following inputs:

Required Inputs

  1. background_image: This is the primary image onto which the color overlay will be applied. It serves as a canvas for the whole operation.

  2. layer_image: This image acts as the layer for the overlay operation. The color will be applied above this image and blended according to the specified mode.

  3. invert_mask: A boolean input that determines whether to invert the mask used during the overlay. By default, this is set to True, meaning the mask will be inverted.

  4. blend_mode: A selection of modes determines how the overlay coloring will blend with the underlying layer. Users can choose from various pre-set modes to achieve different artistic effects.

  5. opacity: This controls the transparency level of the color overlay, ranging from 0% (fully transparent) to 100% (fully opaque). The default is set at 100%.

  6. color: A string representing the starting color of the overlay gradient, specified in hexadecimal format (e.g., #FFBF30 for a bright orange).

Optional Inputs

  1. layer_mask: A mask image that can define the specific areas of the layer_image where the overlay is applied. It allows for more precise control over where the color effect impacts the image.

Outputs

The node produces the following output:

  • image: The processed image with the color overlay applied, ready for use in further processing within the ComfyUI workflow.

Usage in ComfyUI Workflows

Within ComfyUI, the LayerStyle: ColorOverlay node can be used to achieve a variety of visual effects by customizing the color overlay on an image:

  • Create Visual Highlights: Use the node to add colored highlights to specific areas of an image, leveraging masks to control targeted effects.

  • Artistic Stylization: Apply color overlays to transform standard images into more artistic creations through experimentation with different blend modes and opacities.

  • Batch Processing: Process multiple images in one go, allowing for efficient adjustments across a series of visuals by leveraging the node's ability to handle image batches.

Special Features and Considerations

  • Mask Handling: If the layer_mask is not provided, the node will attempt to utilize the alpha channel of the layer_image. If no suitable mask is found, an error will be logged, and the operation will be skipped for that image.

  • Automatic Resizing: If the mask size does not match that of the layer_image, it will be resized to fit, ensuring a seamless application of the overlay.

  • Logging: The node provides informative logging which can be useful for understanding the processing states and any errors or warnings that might arise during batch operations.

This node is a powerful tool for anyone looking to enhance their image editing capabilities within the ComfyUI framework, offering multiple parameters to creatively approach image compositions with ease.