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

LayerUtility: ImageBlendAdvance V2

LayerUtility: ImageBlendAdvance V2 Node Documentation

Overview

The LayerUtility: ImageBlendAdvance V2 node is a powerful tool within ComfyUI that allows users to blend a layer image onto a background image with advanced controls over position, scaling, rotation, and more. This node is particularly useful for creating complex image compositions by stacking and manipulating multiple images or layers in a seamless manner.

Functionality

This node takes two main images—a background image and a layer image—and blends the layer image onto the background. It provides multiple parameters to control the blend mode, transparency, positioning, and transformations like scaling, rotation, and mirroring.

Inputs

When using the ImageBlendAdvance V2 node, the following inputs are required:

  • Background Image (IMAGE): The base image onto which the layer image will be blended.

  • Layer Image (IMAGE): The image to be layered or composited over the background image.

  • Invert Mask (BOOLEAN): A setting to determine if the mask should be inverted before applying it to the layer image. Default is true.

  • Blend Mode (CHOICE): Determines the blending mode to be applied. Several modes are available that define how the layer interacts with the background.

  • Opacity (INT): Sets the transparency level of the layer image, from 0 (completely transparent) to 100 (completely opaque).

  • X Percent (FLOAT): Controls the horizontal position of the layer image as a percentage of the background image width.

  • Y Percent (FLOAT): Controls the vertical position of the layer image as a percentage of the background image height.

  • Mirror (CHOICE): Option to mirror the layer image either horizontally, vertically, or not at all.

  • Scale (FLOAT): Resizes the layer image based on the specified scaling factor.

  • Aspect Ratio (FLOAT): Adjusts the aspect ratio of the layer image.

  • Rotate (FLOAT): Rotates the layer image by a specified angle.

  • Transform Method (CHOICE): The method used to transform (resize or rotate) the image. Options include methods like lanczos, bicubic, and others.

  • Anti-aliasing (INT): Determines the level of anti-aliasing applied during transformations. Range is from 0 to 16.

Optional input:

  • Layer Mask (MASK): An optional mask that dictates how much of the layer image is blended onto the background.

Outputs

The node produces the following outputs:

  • Image (IMAGE): The resulting image after the layer has been blended with the background, respecting all specified transformations and settings.

  • Mask (MASK): The final mask used in the blending process, which can be used in subsequent image processing steps.

Usage

In ComfyUI workflows, the LayerUtility: ImageBlendAdvance V2 node can be used to create visually rich compositions where multiple images are combined. Users can leverage the node's flexibility to experiment with different artistic styles and effects, making it suitable for both professional and creative projects.

Common use cases include:

  • Creating double exposure effects by layering semi-transparent images.
  • Designing digital collages with customized layouts.
  • Performing image augmentation tasks, such as applying repeated patterns or motifs.

Special Features and Considerations

  • Image Transformation: Users have precise control over image transformations, including position, scale, and orientation. This makes it possible to fit the layer exactly within desired coordinates relative to the background.

  • Multiple Blend Modes: Various blend modes are available to achieve distinct visual styles and interactions between the layer and background.

  • Mask Support: The node can use custom masks to further refine which areas of the layer are visible, offering even finer control over the blending process.

  • Anti-Aliasing Options: To maintain image quality, particularly when resizing, users can specify the level of anti-aliasing.

By incorporating this node into your ComfyUI workflow, you can achieve a high degree of customization and creativity in your image compositions.