ComfyUI > Nodes > ComfyUI-CoCoTools > Frequency Separation

ComfyUI Node: Frequency Separation

Class Name

FrequencySeparation

Category
COCO Tools/Image Tools
Author
Conor-Collins (Account age: 431days)
Extension
ComfyUI-CoCoTools
Latest Updated
2025-03-05
Github Stars
0.03K

How to Install ComfyUI-CoCoTools

Install this extension via the ComfyUI Manager by searching for ComfyUI-CoCoTools
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-CoCoTools in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Frequency Separation Description

Image processing node for dividing or subtracting pixel values, useful for comparing and blending images based on frequency components.

Frequency Separation:

The FrequencySeparation node is designed to process two images by either dividing or subtracting their pixel values, allowing for nuanced image manipulation and analysis. This node is particularly useful in scenarios where you need to compare or blend images based on their frequency components, which can be crucial in tasks like image enhancement, noise reduction, or artistic effects. By handling images with slight size mismatches through resizing, it ensures compatibility and seamless processing. The node's ability to perform operations like division and subtraction on images makes it a versatile tool in the AI artist's toolkit, enabling creative and technical exploration of image data.

Frequency Separation Input Parameters:

image1

image1 is the primary image used in the operation, serving as the numerator in division or the minuend in subtraction. This image is the reference point for the operation, and its dimensions are used to determine if resizing of image2 is necessary. There are no specific minimum or maximum values for this parameter, but it should be an image tensor compatible with PyTorch operations.

image2

image2 is the secondary image used in the operation, acting as the denominator in division or the subtrahend in subtraction. If image2 has a slight size mismatch with image1 (up to 3 pixels in height or width), it will be resized to match image1 to ensure proper processing. Like image1, it should be an image tensor compatible with PyTorch operations.

operation

The operation parameter determines the mathematical operation to be performed between image1 and image2. It can be set to either "divide" or "subtract". In "divide" mode, image1 is divided by image2, with a small epsilon added to prevent division by zero. In "subtract" mode, image2 is subtracted from image1. This parameter is crucial as it defines the nature of the image processing task.

Frequency Separation Output Parameters:

result

The result is the processed image obtained after applying the specified operation between image1 and image2. This output is clamped to ensure that pixel values remain within a valid range, typically between 0 and 1, making it suitable for further image processing or visualization.

original

The original output simply returns the image1 input, allowing you to retain the original image for comparison or further processing. This can be useful for side-by-side evaluations of the processed and unprocessed images.

Frequency Separation Usage Tips:

  • Ensure that the images you input are of similar dimensions to avoid unnecessary resizing, which might affect the quality of the output.
  • Use the "divide" operation to highlight differences in frequency components between two images, which can be useful for detecting subtle changes or patterns.
  • Opt for the "subtract" operation when you want to emphasize the differences in pixel intensity, which can be beneficial for tasks like edge detection or contrast enhancement.

Frequency Separation Common Errors and Solutions:

Images size mismatch too large to process. Image1: {h1}x{w1}, Image2: {h2}x{w2}

  • Explanation: This error occurs when the size difference between image1 and image2 exceeds 3 pixels in either dimension, making them incompatible for processing.
  • Solution: Ensure that the input images are of similar dimensions or manually resize them to match before using the node.

Low frequency radius must be smaller than medium frequency radius

  • Explanation: This error is related to the frequency separation process, indicating that the specified low frequency radius is not smaller than the medium frequency radius.
  • Solution: Adjust the frequency radii parameters to ensure that the low frequency radius is less than the medium frequency radius, which is necessary for proper frequency separation.

Frequency Separation Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-CoCoTools
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.