Skip to content

Reduce min for Batch Image/Mask/Latent nodes from 2 to 1#13721

Merged
alexisrolland merged 4 commits into
masterfrom
kosinkadink/batch-nodes-min-1-required
May 19, 2026
Merged

Reduce min for Batch Image/Mask/Latent nodes from 2 to 1#13721
alexisrolland merged 4 commits into
masterfrom
kosinkadink/batch-nodes-min-1-required

Conversation

@Kosinkadink

@Kosinkadink Kosinkadink commented May 5, 2026

Copy link
Copy Markdown
Member

Summary

Lowers min from 2 to 1 on the autogrow templates of three nodes in comfy_extras/nodes_post_processing.py:

  • BatchImagesNode
  • BatchMasksNode
  • BatchLatentsNode
image

Why

Frontend PR Comfy-Org/ComfyUI_frontend#10748 (Update autogrow to always show one optional beyond min) makes autogrow inputs render as N required + 1 optional when the schema declares min=N. With min=2, the Batch nodes show two required image/mask/latent slots and no visible optional slot - forcing the user to wire two inputs even when they want to start with one and add more later via the optional slot.

Lowering min to 1 makes the Batch nodes appear as 1 required + 1 optional out of the box, which matches the ergonomics already used by BatchImagesMasksLatentsNode (min=1). The batch_images / batch_masks / batch_latents helpers already handle a single-element list correctly (the resize loop is a no-op against the first element and torch.cat on a length-1 list returns it as-is), so no execute-side change is needed.

Why this is a draft

The visual benefit only materializes once ComfyUI bumps comfyui-frontend-package to a version that contains #10748.

If we merge this change while 1.42.15 is still pinned, users on stock ComfyUI will see the Batch nodes drop from 2 required slots to 1 required slot with no visible optional slot (only the autogrow + button), which is a UX regression - they'd think the second input disappeared.

When to merge

Merge this PR once ComfyUI/requirements.txt is bumped to a comfyui-frontend-package release that contains #10748 (i.e. >= 1.43.15, or whichever 1.43.x/1.44.x release is selected for the next ComfyUI bump). At that point the Batch nodes will render as 1 required + 1 optional from the getgo.

Out of scope

The audit also flagged Meshy's multi-image-to-3D node (nodes_meshy.py) as min=2, max=4 for images. Whether that should be lowered depends on whether the Meshy /v2/multi-image-to-3d endpoint accepts a single image; not changed here.

@bigcat88

bigcat88 commented May 7, 2026

Copy link
Copy Markdown
Contributor

The audit also flagged Meshy's multi-image-to-3D node (nodes_meshy.py) as min=2, max=4 for images. Whether that should be lowered depends on whether the Meshy /v2/multi-image-to-3d endpoint accepts a single image; not changed here.

It is intended for Meshy node - minimal two images required there for "multi-image"

@Kosinkadink Kosinkadink marked this pull request as ready for review May 15, 2026 23:31
@coderabbitai

coderabbitai Bot commented May 15, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR updates three batch processing nodes to accept a single input instead of requiring a minimum of two. The BatchImagesNode, BatchMasksNode, and BatchLatentsNode classes each have their schema's io.Autogrow.TemplatePrefix minimum parameter decreased from min=2 to min=1. No node logic, APIs, or other functionality changes.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: reducing the minimum input from 2 to 1 for three Batch nodes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description is comprehensive and directly related to the changeset, clearly explaining why min values are being lowered from 2 to 1 for three batch nodes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Kosinkadink

Copy link
Copy Markdown
Member Author

Confirmed works with the version of frontend we are at now (v1.43.x)

@alexisrolland alexisrolland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! I want this.

@alexisrolland alexisrolland merged commit df2454b into master May 19, 2026
16 checks passed
simonri pushed a commit to simonri/ComfyUI-flash-attention-3 that referenced this pull request May 26, 2026
@alexisrolland alexisrolland deleted the kosinkadink/batch-nodes-min-1-required branch June 9, 2026 04:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants