ComfyUI > Nodes > SaltAI_AudioViz > Scheduled Binary Comparison

ComfyUI Node: Scheduled Binary Comparison

Class Name

SaltScheduledBinaryComparison

Category
SALT/AudioViz/Scheduling/Image
Author
SaltAI (Account age: 146days)
Extension
SaltAI_AudioViz
Latest Updated
2024-06-29
Github Stars
0.01K

How to Install SaltAI_AudioViz

Install this extension via the ComfyUI Manager by searching for SaltAI_AudioViz
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter SaltAI_AudioViz 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
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Scheduled Binary Comparison Description

Perform binary threshold operation on batch images with comparison schedule, allowing flexibility with optional epsilon value for artistic effects.

Scheduled Binary Comparison:

The SaltScheduledBinaryComparison node is designed to perform a binary threshold operation on a batch of images based on a comparison schedule. This node is particularly useful for AI artists who need to apply a thresholding technique to their images, where each image in the batch is compared against a scheduled threshold value. The node allows for an optional epsilon value, which provides flexibility in the comparison by allowing a margin of error. This can be especially beneficial in scenarios where exact matches are not required, and a small deviation is acceptable. The primary goal of this node is to facilitate the creation of binary images where pixel values are set to either 0 or 1 based on the comparison criteria, thus enabling various artistic effects and preprocessing steps for further image manipulation.

Scheduled Binary Comparison Input Parameters:

images

This parameter represents the batch of images that you want to process. The images should be in a tensor format, typically with dimensions corresponding to the batch size, height, width, and channels. The images are the primary input on which the binary threshold operation will be performed.

comparison_schedule

The comparison_schedule is a list of threshold values that will be used to compare against the pixel values of the images. Each value in the schedule corresponds to an image in the batch. If the schedule is shorter than the batch size, the last value will be extended to match the batch size. This parameter is crucial as it determines the threshold for each image in the batch.

epsilon_schedule

The epsilon_schedule is an optional list of epsilon values that define the margin of error for the comparison. If use_epsilon is set to True, this schedule allows for a range within which pixel values are considered equal to the threshold. Similar to the comparison_schedule, if the epsilon_schedule is shorter than the batch size, the last value will be extended to match the batch size. The default value is [0.1].

use_epsilon

This boolean parameter determines whether the epsilon margin of error should be used in the comparison. If set to True, the node will consider pixel values within the epsilon range as equal to the threshold. If set to False, the comparison will be a strict greater-than-or-equal-to operation. The default value is True.

Scheduled Binary Comparison Output Parameters:

thresholded_images

The output is a tensor of the same shape as the input images, where each pixel value is either 0 or 1. This binary tensor represents the result of the thresholding operation, with 1 indicating that the pixel value met the comparison criteria and 0 indicating that it did not. This output can be used for further image processing or as a final binary image for artistic purposes.

Scheduled Binary Comparison Usage Tips:

  • Ensure that the comparison_schedule matches the batch size of your images to avoid unintended extensions of the last value.
  • Use the epsilon_schedule to allow for slight variations in pixel values, which can be useful for noisy images or when an exact match is not necessary.
  • Set use_epsilon to False if you require a strict thresholding operation without any margin of error.

Scheduled Binary Comparison Common Errors and Solutions:

"comparison_schedule length is less than batch size"

  • Explanation: This error occurs when the length of the comparison_schedule is shorter than the number of images in the batch.
  • Solution: Ensure that the comparison_schedule list has enough values to match the batch size of your images. If necessary, extend the list manually.

"epsilon_schedule length is less than batch size"

  • Explanation: This error occurs when the length of the epsilon_schedule is shorter than the number of images in the batch.
  • Solution: Ensure that the epsilon_schedule list has enough values to match the batch size of your images. If necessary, extend the list manually.

"Invalid tensor shape for images"

  • Explanation: This error occurs when the input images tensor does not have the expected dimensions.
  • Solution: Verify that your input images tensor has the correct shape, typically [batch_size, height, width, channels].

"TypeError: unsupported operand type(s) for -: 'Tensor' and 'Tensor'"

  • Explanation: This error occurs when there is a type mismatch in the tensor operations.
  • Solution: Ensure that all input tensors (images, comparison_schedule, and epsilon_schedule) are of compatible types and shapes.

Scheduled Binary Comparison Related Nodes

Go back to the extension to check out more related nodes.
SaltAI_AudioViz
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.