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: ImageOpacity

LayerUtility: ImageOpacity Node Documentation

Overview

The LayerUtility: ImageOpacity node is designed to manipulate the opacity of images within the ComfyUI framework. This node allows you to adjust the transparency of an image, an essential tool in layering and compositing workflows where precise control over image visibility is required.

Functionality

This node provides functionality to modify the opacity of input images based on user parameters. It can process batches of images and supports the use of masks to fine-tune the areas affected by the opacity changes.

Inputs

The node accepts a set of required and optional inputs:

Required Inputs

  • Image: This is the primary image input, and it should be of the type "IMAGE". The node processes this image to adjust its opacity.

  • Opacity: An integer value that defines the desired opacity level. The range is from 0 to 100, where 0 means fully transparent and 100 means fully opaque.

  • Invert Mask: A boolean flag that determines whether the mask is inverted during processing. It defaults to True.

Optional Inputs

  • Mask: An optional mask input of the type "MASK". When provided, the mask is used to dictate what parts of the image are affected by the opacity adjustment.

Outputs

The node produces the following outputs:

  • Image: The processed image with adjusted opacity as defined by the inputs.

  • Mask: The mask used or generated during processing. This output reflects any alterations made, such as inversion.

Usage in ComfyUI Workflows

The LayerUtility: ImageOpacity node is particularly useful in workflows requiring precise layering and blending of multiple images. It can be employed in tasks such as:

  • Creating Composites: Adjust opacity to create blended effects, soft edges, or layered compositions with smoother transitions between layers.

  • Highlighting or Diminishing Elements: Use the opacity to highlight certain elements of an image by making them more transparent, effectively focusing attention elsewhere.

  • Mask-Driven Adjustments: With optional mask input, selectively adjust opacity on specific image areas, offering control on where and how much opacity adjustment takes place.

Special Features and Considerations

  • Batch Processing: The node can handle batches, making it efficient for processing multiple images simultaneously.

  • Mask Inversion: By inverting masks, users can toggle between affecting masked or unmasked areas, providing flexibility in workflows.

  • Opacity Control: The opacity control is fine-grained, allowing adjustments by a single percentage point for precise effect.

  • Performance: Leveraging PyTorch and PIL for processing ensures that tasks are performed efficiently, even with large images.

For more detailed specifics on this node or to view contributions, visit the repository on GitHub. This node can enhance your creative toolset within ComfyUI, enabling sophisticated image manipulations with ease.