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

LayerUtility: H/L Frequency Detail Restore Node Documentation

Overview

The LayerUtility: H/L Frequency Detail Restore node is part of the ComfyUI framework, designed to manipulate image layers by restoring high-frequency details from a specified detail image into a base image. This node helps enhance the overall quality of the composite image by integrating detailed elements from one image into another, specifically focusing on frequency components of the images.

Functionality

This node allows users to adjust and restore high and low-frequency image details. High-frequency details generally correspond to sharp edges and fine textures, while low-frequency details relate to broader light and color distributions in an image. By controlling these aspects, the node enables refined image compositing ideal for enhancing texture and detail from external sources onto base images.

Inputs

The node accepts the following parameters:

  1. image: The base image onto which details will be restored. This image serves as the background in the compositing process.

  2. detail_image: The image containing the high-frequency details, which will be applied to the base image. This image is the source of the enhanced details.

  3. keep_high_freq: An integer value between 0 and 1023 (default is 64), specifying the strength of high-frequency detail to retain from the detail image. A higher value retains more details.

  4. erase_low_freq: An integer value between 0 and 1023 (default is 32), determining how much of the low-frequency components should be diminished within the base image. Lower values keep more of the original low frequencies.

  5. mask_blur: An integer value between 0 and 1023 (default is 16), controlling the amount of blur applied to the mask, which affects the transition between applied details and base content.

  6. mask (optional): A mask defining specific areas of the image for detail restoration. It limits the application of high-frequency details to selected regions, adding precision to the compositing.

Output

  • image: The node produces a single output image, which is a composite of the base image and the restored high-frequency details from the detail image. The result reflects enhancements in texture and clarity, governed by the node's input parameters.

Usage in ComfyUI Workflows

In ComfyUI workflows, the LayerUtility: H/L Frequency Detail Restore node is typically used in image editing, compositing, and enhancement tasks. It fits into processes where blending multiple images with different resolutions or details is required, offering photorealistic results by emphasizing critical features.

Typical use cases include:

  • Refining textures in digital art by blending detailed strokes from one image onto a broader painted canvas.
  • Improving photo sharpness or texture by layering detailed elements like hair, fabric weave, or fine patterns into fashion or portrait photography.
  • Restoring image quality in scenarios where the original capture lacks sufficient texture detail, by integrating sharper components from other sources.

Special Features and Considerations

  • Frequency-specific Enhancement: This node's capability to manage high and low-frequency details allows for targeted image improvement, providing a nuanced approach compared to traditional layering methods.

  • Layer Masking: The optional mask input allows detailed control over where and how much detail is restored, enabling both global and localized alterations.

  • Batch Processing: The node can handle multiple images simultaneously, making it suitable for projects requiring consistent application of enhancements across an image set.

  • Performance: While effectively enhancing images, users should be cognizant of processing times, which might vary based on image size and complexity. Adjust input values judiciously for best performance.

This node adds valuable functionality to the ComfyUI framework, aiding creators in achieving high-quality, detailed image compositions with controlled enhancement and blending techniques.