Visit ComfyUI Online for ready-to-use ComfyUI environment
Perform arithmetic operations on input images for blending, creating composite images with various effects.
The ArithmeticBlend
node is designed to perform arithmetic operations on two input images, allowing you to blend them in various ways. This node is particularly useful for creating composite images by adding, subtracting, finding the difference, or dividing pixel values from two images. By leveraging these arithmetic operations, you can achieve a wide range of visual effects, from simple overlays to more complex image manipulations. The primary goal of this node is to provide a flexible and powerful tool for image blending in post-processing workflows, making it easier to combine and manipulate images creatively.
This parameter represents the first input image for the blending operation. It is required and should be provided in the form of an image tensor. The pixel values of this image will be used in conjunction with the second image to perform the specified arithmetic operation.
This parameter represents the second input image for the blending operation. Like image1
, it is required and should be provided as an image tensor. The pixel values of this image will be combined with those of the first image according to the selected blend mode.
This parameter specifies the type of arithmetic operation to be performed on the input images. The available options are add
, subtract
, difference
, and divide
. Each mode determines how the pixel values of the two images are combined:
add
: Adds the pixel values of the two images.subtract
: Subtracts the pixel values of the second image from the first.difference
: Computes the absolute difference between the pixel values of the two images.divide
: Divides the pixel values of the first image by those of the second, with safeguards to prevent division by zero.The output parameter is an image tensor that represents the result of the specified arithmetic blend operation. This blended image is clamped to ensure that pixel values remain within the valid range (0 to 1), preventing any overflow or underflow issues. The output image can be used for further processing or as a final composite image.
add
blend mode, which will combine the brightness values of the two images.difference
blend mode is particularly effective, as it emphasizes the areas where the images differ.divide
blend mode, ensure that the second image does not contain zero values to avoid division errors. The node includes safeguards, but it's good practice to preprocess your images if necessary.<blend_mode>
blend_mode
parameter is set to one of the supported options: add
, subtract
, difference
, or divide
..to(device)
to move tensors to the desired device.<shape1>
<shape2>
© Copyright 2024 RunComfy. All Rights Reserved.