any math

any_math

expression: Advanced expression Function: Perform numerical calculations on images using expressions. The mask will be treated as a 3-channel image. Input: - a~j: Arbitrary inputs as variables - expression1~3: Enter mathematical expressions. The results will be correspondingly output to 1 - 3. Spaces are allowed. - PreprocessingTensor: Do you want to preprocess the image (if you need to perform operations on the image, please open it) Preprocessing images will unify batches/sizes/channels, allowing image and mask operations to be performed - RGBA_to_RGB: When turned on, if the input image is 4-channel, it will be converted to 3-channel. - clamp: Limit the image values to 0-1. It is not recommended to turn it on if you want to continue with the next image_math_value. Instructions: 1. Note that if the expression result is not an image (tensor), the result will be output to the corresponding value. In this case, the image and mask outputs will be empty. Conversely, the value will be empty. 2. Support some Python methods, please pay attention to the output type 3. Leave the expressions for the outputs you don't need empty to ignore unnecessary calculations. 4. 中文说明请看 -any_math_v2-

Pack: ComfyUI-WJNodes

custom_nodes.ComfyUI-WJNodes

Inputs (8)

NameTypeRequired
expressionSTRINGrequired
PreprocessingTensorBOOLEANrequired
RGBA_to_RGBBOOLEANrequired
image_clampBOOLEANrequired
a*optional
b*optional
c*optional
d*optional

Outputs (3)

NameType
image1IMAGE
mask1MASK
value1*