Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!

ComfyUI Node: Subtraction

Class Name

Subtraction

Category
FunctionAsTexture
Author
coiichan (Account age: 2771days)
Extension
ComfyUI-FuncAsTexture-CoiiNode
Latest Updated
2025-06-24
Github Stars
0.0K

How to Install ComfyUI-FuncAsTexture-CoiiNode

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

Run ComfyUI Online

Subtraction Description

Subtracts one image from another using an editable formula to reveal visual differences.

Subtraction:

Subtraction is an image-processing node whose default formula subtracts one image from another. This can help you explore differences between images, such as where an edit changed colors or brightness. The formula is editable, so the node is not limited to the default subtraction expression. The provided class defines the interface but does not show how formulas are executed or how their results are converted into images; details such as clipping and display behavior cannot be confirmed from this source.

Subtraction Input Parameters:

formula

A required, multiline text field that specifies the calculation. Its default is ``result = imga

  • imgb, which expresses subtraction of the second image from the first. Changing the order changes the calculation: imga - imgbandimgb - imga`` are different results. No minimum or maximum length, alternative options, or other formula rules are specified in the provided class.

imga

An optional IMAGE input used as the first image in the default formula. Its tooltip also calls it the “Reference size” input and states Default =(1,512,512,3). That describes a stated default shape, not a minimum or maximum image size; the provided class does not show how the default image is created or used when this input is unconnected.

imgb

An optional IMAGE input used as the image subtracted from imga in the default formula. Supplying a different image changes the calculated difference. The provided class specifies no default value, minimum or maximum size, or behavior when this input is unconnected.

Subtraction Output Parameters:

image

The node’s sole output is named image and has type IMAGE. It is intended to carry the image produced by the formula for viewing or use in another image node. With the default formula, its underlying calculation is ``imga

  • imgb``; the provided class does not establish how values outside the usual display range are handled, so the displayed image should not be treated as a precise numerical difference without checking the underlying implementation.

Subtraction Usage Tips:

  • Start with the default formula and connect both image inputs when comparing two images. Use images with matching dimensions to avoid shape-mismatch problems.
  • Keep the subtraction order intentional: place your reference in imga and the image you want to subtract in imgb when using result = imga - imgb.
  • For a straightforward comparison, change only the connected images before editing the formula. This makes it easier to tell whether an unexpected result comes from the images or the expression.
  • Inspect the output in a viewer before relying on subtle differences. The provided source does not specify how negative or out-of-range subtraction values will appear.

Subtraction Common Errors and Solutions:

Formula evaluation error

  • Explanation: This is an illustrative error category, not a confirmed message from this node. A mistyped expression or an invalid formula could prevent execution; the provided class does not show its evaluator or exact error text.
  • Solution: Restore result = imga - imgb and check spelling, operators, and image connections before making further edits.

Image size or shape mismatch

  • Explanation: This is an illustrative error category, not a confirmed node message. Subtracting images with incompatible dimensions may fail during the calculation or produce an unintended result.
  • Solution: Resize or prepare both images to the same width, height, and channel arrangement before connecting them.

Missing image input

  • Explanation: Both image connections are marked optional, but the default formula refers to imga and imgb. The provided class does not show what happens when either is unconnected.
  • Solution: Connect both images when using the default formula. If you intend to leave one unconnected, verify the node’s actual fallback behavior first.

Unexpectedly dark or unusual output

  • Explanation: Subtraction can produce values below zero or outside a normal display range. The provided class does not show whether those values are clipped, transformed, or handled another way.
  • Solution: Check that the images are in the intended order, then compare with a simple pair of test images. Consult the node’s execution implementation before interpreting displayed colors as exact difference values.

Subtraction Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-FuncAsTexture-CoiiNode
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

Subtraction