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

LayerUtility: ImageBlendAdvance Node Documentation

Overview

The LayerUtility: ImageBlendAdvance node is an advanced image blending utility within the ComfyUI. It allows users to seamlessly integrate a layer image over a background image with customizable blending options, transformations, and masking. Its primary function is to support flexible image manipulation workflows, enabling users to create composite images with ease.

Inputs

Required Inputs

  1. Background Image

    • Type: IMAGE
    • Description: The base image on which the layer image will be blended.
  2. Layer Image

    • Type: IMAGE
    • Description: The image that will be blended onto the background image.
  3. Invert Mask

    • Type: BOOLEAN
    • Default: True
    • Description: Determines whether the mask applied on the layer image should be inverted.
  4. Blend Mode

    • Type: Defined by chop_mode
    • Description: Specifies the blending mode to be used when compositing the layer image over the background image.
  5. Opacity

    • Type: INT
    • Range: 0 to 100
    • Default: 100
    • Description: Controls the transparency level of the layer image, with 100 being fully opaque and 0 being fully transparent.
  6. X Percent

    • Type: FLOAT
    • Range: -999 to 999
    • Default: 50
    • Description: Horizontal position of the layer image as a percentage of the background image width.
  7. Y Percent

    • Type: FLOAT
    • Range: -999 to 999
    • Default: 50
    • Description: Vertical position of the layer image as a percentage of the background image height.
  8. Mirror

    • Type: One of None, horizontal, vertical
    • Description: Specifies whether and how the layer image should be flipped.
  9. Scale

    • Type: FLOAT
    • Range: 0.01 to 100
    • Default: 1
    • Description: Scaling factor for resizing the layer image.
  10. Aspect Ratio

    • Type: FLOAT
    • Range: 0.01 to 100
    • Default: 1
    • Description: Factor applied to the height of the layer image to adjust its aspect ratio.
  11. Rotate

    • Type: FLOAT
    • Range: -999999 to 999999
    • Default: 0
    • Description: Angle in degrees to rotate the layer image.
  12. Transform Method

    • Type: One of lanczos, bicubic, hamming, bilinear, box, nearest
    • Description: Method used for transforming the layer image, especially when scaling or rotating.
  13. Anti-Aliasing

    • Type: INT
    • Range: 0 to 16
    • Default: 0
    • Description: Level of anti-aliasing applied to smooth the edges of the transformed layer image.

Optional Inputs

  1. Layer Mask
    • Type: MASK
    • Description: A custom mask image that can be used for blending the layer image with more control over transparency.

Outputs

  1. Image

    • Type: IMAGE
    • Description: The final composited image after blending the layer image onto the background image.
  2. Mask

    • Type: MASK
    • Description: The mask applied to the final composited image, useful for further processing or analysis.

Usage in ComfyUI Workflows

This node can be utilized in a variety of image processing and creative workflows within ComfyUI:

  • Composite Creation: Integrate multiple layers onto a single background image with fine-grained control over each layer’s position, opacity, and blending characteristics.
  • Image Manipulation: Apply transformations such as scaling, rotating, and mirroring to adapt layer images to specific design requirements.
  • Masking and Transparency: Utilize masks to create complex transparency effects, allowing for intricate detail and emphasis on specific areas of the composite.
  • Graphics Design: Ideal for merging and aligning graphical elements in a creative project, leveraging the node’s robust blending features and transformation capabilities.

Special Features and Considerations

  • Flexible Layer Positioning: Offers detailed control over the placement of the layer image with percentage-based positioning, allowing relative alignment on the background image.
  • Comprehensive Transformation Options: Includes options for mirroring, scaling, rotation, and aspect ratio adjustments, providing versatility in image presentation.
  • Advanced Blending Modes: Utilizes predefined chopping modes to achieve various compositing effects, enhancing creative prospects.
  • High Versatility: The node supports batch processing by handling multiple background and layer images, facilitating workflow efficiency.
  • Anti-Aliasing Options: Improve the visual quality of transformed images by reducing jagged edges during scaling and rotation.

Incorporate the LayerUtility: ImageBlendAdvance node into your ComfyUI projects to explore its full potential for creating dynamic and visually engaging image composites.