Skip to content

Add integer math nodes (Add, Subtract, Multiply, Divide) - Fixes #11995#11999

Open
jackdevis wants to merge 2 commits intoComfy-Org:masterfrom
jackdevis:feature/1995-integer-math-nodes
Open

Add integer math nodes (Add, Subtract, Multiply, Divide) - Fixes #11995#11999
jackdevis wants to merge 2 commits intoComfy-Org:masterfrom
jackdevis:feature/1995-integer-math-nodes

Conversation

@jackdevis
Copy link

No description provided.

@asagi4
Copy link
Contributor

asagi4 commented Jan 21, 2026

I think this stuff should be implemented more generically using MatchType. Many of these work just as well with float inputs, or even strings, tensors and images (I think + would even work on conditionings, as ConditioningCombine, since it's just a list). Technically the inputs don't even need to be the same type, so at least the second parameter could be an Any type.

I'd maybe take the output type from the type of the first input and just let the rest be anytypes. You can also make the input list autogrow for more than two operands.

It's up to the user to know if the operations make sense for the input types.

@jackdevis
Copy link
Author

Totally agree with your opinion @asagi4 .
Refactor to use MatchType + Autogrow might be better. This aligns with ComfyUI patterns and provides more flexibility.
Let me update PR.

@jackdevis
Copy link
Author

PR is updated, please review my PR. Regards

@asagi4
Copy link
Contributor

asagi4 commented Jan 21, 2026

I have no objections to this version. Maybe there's a nice way to make the input types even more flexible, but this would already be an improvement, and the types can always be relaxed later without breaking backwards compatibility.

@comfy-pr-bot
Copy link
Member

Test Evidence Check

⚠️ Warning: Test Explanation Missing

If this PR modifies behavior that requires testing, a test explanation is required. PRs lacking applicable test explanations may not be reviewed until added. Please add test explanations to ensure code quality and prevent regressions.

⚠️ Warning: Visual Documentation Missing

If this PR changes user-facing behavior, visual proof (screen recording or screenshot) is required. PRs without applicable visual documentation may not be reviewed until provided.

You can add it by:

  • GitHub: Drag & drop media directly into the PR description
  • YouTube: Include a link to a short demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants