Visit ComfyUI Online for ready-to-use ComfyUI environment
Perform binary threshold operation on batch images with comparison schedule, allowing flexibility with optional epsilon value for artistic effects.
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.
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.
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.
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]
.
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.
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.
comparison_schedule
matches the batch size of your images to avoid unintended extensions of the last value.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.use_epsilon
to False if you require a strict thresholding operation without any margin of error.comparison_schedule
is shorter than the number of images in the batch.comparison_schedule
list has enough values to match the batch size of your images. If necessary, extend the list manually.epsilon_schedule
is shorter than the number of images in the batch.epsilon_schedule
list has enough values to match the batch size of your images. If necessary, extend the list manually.[batch_size, height, width, channels]
.images
, comparison_schedule
, and epsilon_schedule
) are of compatible types and shapes.© Copyright 2024 RunComfy. All Rights Reserved.