Visit ComfyUI Online for ready-to-use ComfyUI environment
Perform various single-operand image operations for AI art projects, including inversion, averaging, rounding, clamping, and absolute value transformations.
The Unary Image Op node is designed to perform a variety of single-operand operations on images, making it a versatile tool for image manipulation in your AI art projects. This node allows you to apply different transformations such as inversion, averaging, rounding, clamping, and taking the absolute value of the image's pixel values. These operations can be particularly useful for preprocessing images, enhancing visual effects, or preparing images for further processing in your workflow. By providing a straightforward interface for these common image operations, the Unary Image Op node helps streamline your creative process and ensures consistent results.
The image
parameter is the input image on which the unary operation will be performed. This image should be in a tensor format, typically representing pixel values normalized between 0 and 1. The image serves as the primary data that will be manipulated by the selected operation.
The op
parameter specifies the type of unary operation to be applied to the input image. The available options are:
invert
: Inverts the pixel values of the image, turning light areas dark and vice versa.average
: Computes the average value of the image's pixels and applies this average across the entire image.round
: Rounds the pixel values to the nearest integer.clamp
: Clamps the pixel values to be within the range of 0 to 1. - abs
: Takes the absolute value of the pixel values, removing any negative values.The IMAGE
output parameter is the resulting image after the specified unary operation has been applied. This output will be in the same tensor format as the input image, with pixel values adjusted according to the chosen operation. The output image can then be used in subsequent nodes for further processing or final rendering.
invert
operation, which can be useful for certain artistic effects or preprocessing steps.average
operation to create a uniform image based on the average pixel value, which can serve as a baseline or reference image.round
operation is helpful when you need to convert floating-point pixel values to integers, such as when preparing images for certain types of quantized processing.clamp
operation to ensure that all pixel values remain within the valid range of 0 to 1, which can prevent artifacts in subsequent processing steps.abs
operation is useful for removing negative values from an image, which can be important in certain mathematical transformations or when dealing with signed pixel values.<operation_name>
for unary image opop
parameter.op
parameter is set to one of the supported operations: invert
, average
, round
, clamp
, or abs
.average
operation requires a 3D tensor with height, width, and channel dimensions.© Copyright 2024 RunComfy. All Rights Reserved.