Reduce min for Batch Image/Mask/Latent nodes from 2 to 1#13721
Conversation
Amp-Thread-ID: https://ampcode.com/threads/T-019dfa29-e85b-740b-8615-7bc5e429f672 Co-authored-by: Amp <amp@ampcode.com>
It is intended for Meshy node - minimal two images required there for "multi-image" |
📝 WalkthroughWalkthroughThis PR updates three batch processing nodes to accept a single input instead of requiring a minimum of two. The 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ 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. Comment |
|
Confirmed works with the version of frontend we are at now (v1.43.x) |
Summary
Lowers
minfrom2to1on the autogrow templates of three nodes incomfy_extras/nodes_post_processing.py:BatchImagesNodeBatchMasksNodeBatchLatentsNodeWhy
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 declaresmin=N. Withmin=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
minto1makes the Batch nodes appear as 1 required + 1 optional out of the box, which matches the ergonomics already used byBatchImagesMasksLatentsNode(min=1). Thebatch_images/batch_masks/batch_latentshelpers already handle a single-element list correctly (the resize loop is a no-op against the first element andtorch.caton 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-packageto a version that contains #10748.mainofComfyUI_frontendon 2026-04-07 (commit97853aa).requirements.txtcurrently pinscomfyui-frontend-package==1.42.15.v1.42.15was tagged 2026-04-24 from the1.42.xrelease branch, which had already split off before Bug Report – UI Tabs Shift Upwards After Closing Sidebar Menu #10748 landed.git tag --contains 97853aashows the change first appears inv1.43.15+. Bug Report – UI Tabs Shift Upwards After Closing Sidebar Menu #10748 was not backported to the 1.42.x line.If we merge this change while
1.42.15is 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.txtis bumped to acomfyui-frontend-packagerelease that contains #10748 (i.e.>= 1.43.15, or whichever1.43.x/1.44.xrelease is selected for the next ComfyUI bump). At that point the Batch nodes will render as1 required + 1 optionalfrom the getgo.Out of scope
The audit also flagged Meshy's multi-image-to-3D node (
nodes_meshy.py) asmin=2, max=4forimages. Whether that should be lowered depends on whether the Meshy/v2/multi-image-to-3dendpoint accepts a single image; not changed here.