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

LayerUtility: ImageHub Node Documentation

Overview

The LayerUtility: ImageHub node in the ComfyUI_LayerStyle repository is a utility node designed to manage and output images and masks based on multiple input options. This node allows users to selectively choose which input to output or to randomly select from provided inputs. It is especially useful in situations where multiple image and mask combinations are available, and a specific one needs to be chosen dynamically by the workflow.

Node Functionality

Purpose

The ImageHub node is designed to receive up to nine sets of images and masks, process them, and then output a single image and mask based on user-defined criteria or random selection. It provides an interface to easily switch between multiple inputs, making it versatile for complex UI design scenarios in ComfyUI.

Inputs

The ImageHub node accepts the following inputs:

Required Inputs

  • Output: An integer value that determines which set of inputs to output. This integer ranges from 1 to 9.

  • Random Output: A boolean flag that, when enabled, randomly selects from the list of available (non-empty) inputs.

Optional Inputs

Each optional input consists of an image and mask pair. You can provide up to nine sets:

  1. Input1 Image/Mask
  2. Input2 Image/Mask
  3. Input3 Image/Mask
  4. Input4 Image/Mask
  5. Input5 Image/Mask
  6. Input6 Image/Mask
  7. Input7 Image/Mask
  8. Input8 Image/Mask
  9. Input9 Image/Mask

Each image accepts an image input, while each mask accepts a mask input. These inputs can be utilized independently.

Outputs

The ImageHub node produces the following outputs:

  • Image: The chosen image from the selected set of inputs.
  • Mask: The corresponding mask from the selected set of inputs.

Usage in ComfyUI Workflows

The ImageHub node plays a significant role in workflows where dynamic selection from multiple image-mask sets is required. Some potential use cases include:

  • Conditional Image Processing: When different processing pipelines might be needed for different images, the ImageHub node can act as a decision point to select the appropriate pipeline.

  • Randomized Workflows: By enabling the random output feature, workflows can dynamically vary their output, providing more variability and testing opportunities.

  • Sequential Composition: In scenarios where sequential steps are dependent on specific inputs, the ImageHub node can ensure that only the desired inputs are processed at a given point in the sequence.

Special Features and Considerations

  • Selective Output: Users can specify exactly which input set to output by setting the output parameter, allowing for precise control in workflows.

  • Random Selection: When experimentation or variability is desired, the random output functionality enables the node to choose randomly among available input options.

  • Error Handling: The node provides error messages and logging to notify users when inputs are missing or when the selected output option does not have a corresponding input.

Overall, the LayerUtility: ImageHub node serves as a robust tool in ComfyUI for managing and selecting between multiple image and mask inputs, offering versatility and ease of use in complex UI developments.