ComfyUI Node

Get Batch Count

Turn an XY Plot grid into the right queue number automatically

By hben35096·Created 2 years ago·Updated 12 months ago· 7
Get Batch Count
  • xy_grid_control
  • STRING
  • BatchCount

If you've ever built an XY comparison grid and manually multiplied "4 samplers times 3 seeds" to figure out what number to type into a batch count field, this node exists to stop you doing that by hand. It reads a grid control node and hands you back the exact number of images that grid needs, ready to feed straight into your queue.

The actual problem this solves

Building X-by-Y comparison grids - sweep a checkpoint or a sampler across one axis, seeds or CFG values across the other - is one of the most common reasons people reach for qq-nodes-comfyui in the first place, and this pack's own README says outright that most of its nodes are secondary helpers for exactly that workflow (alongside images-grid-comfy-plugin and Impact Pack). But getting the batch count right for a grid has been a recurring headache since way before ComfyUI existed: on the A1111 forums the same complaint shows up as "any way to do batch SIZE with xy plot?" - people manually counting rows times columns and typing the total in, then re-doing that math every time they add a value to an axis. ComfyUI's own community reproduces the same problem: without a node like this, you either compute X-count × Y-count yourself and hope you didn't fat-finger it, or you queue the workflow repeatedly instead of running the whole grid in one pass. Get Batch Count exists to remove that arithmetic entirely - it reads qq-nodes' XY Grid Control directly and does the multiplication for you.

How it works

The single required input is xy_grid_control, typed XY_GRID_CONTROL - not a native ComfyUI type, but the socket qq-nodes-comfyui's grid-control node produces. That's a hard dependency: without qq-nodes-comfyui installed and wired into your graph, there's nothing valid to plug into this socket at all, and the node has no widget fallback - it's socket-only, no manual entry.

Feed it a live grid control and it outputs two things: a human-readable STRING ("Details," per the author's tooltip - the kind of thing you'd route into a text-preview node to sanity-check what the grid is actually about to generate) and an INT called BatchCount - the tooltip is blunt: "Queue batch values." Wire that INT straight into whatever's controlling how many images your workflow queues, and the whole grid generates in one pass without you doing the multiplication first.

What to set, what it outputs

There's no widget to configure - this node is pure plumbing between qq-nodes' grid control and your batch count. Just connect the xy_grid_control socket, then take the BatchCount output to your queue/batch-size input, and optionally the STRING output to a text-preview node if you want a readable summary of what's about to run.

Installing it

ComfyUI Manager: search ComfyUI-ReplenishNodes, install, restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/hben35096/ComfyUI-ReplenishNodes

This node is useless without also installing kenjiqq/qq-nodes-comfyui, since that's the only pack that produces an XY_GRID_CONTROL socket to feed it. Grab both.

Where people get tripped up

If the node's input socket won't accept anything, or ComfyUI complains about a missing type, the near-certain cause is that qq-nodes-comfyui isn't installed - this node has nothing to connect to on its own. Beyond that dependency, there isn't much to go wrong: it's a straight readout of the grid you've already built, so if the count looks off, check the axis value lists in your XY Grid Control node first, not this one.

CategoryReplenish/QQNodes

Inputs (1)

NameTypeDefaultDescription
xy_grid_controlXY_GRID_CONTROL

Outputs (2)

NameTypeDescription
STRINGSTRINGDetails.
BatchCountINTQueue batch values.