Nodes/comfyui-mixlab-nodes/Grid Output ♾️Mixlab
ComfyUI Node Runs on cloud

Grid Output ♾️Mixlab

Turn one region into real x/y/width/height and a mask

By MixLabPro·Created 3 years ago·Updated 2 months ago· 1,859
Grid Output ♾️Mixlab
  • grid
  • bg_image
  • x
  • y
  • width
  • height
  • mask

Mixlab's _GRID type - the region descriptor produced by SplitImage, GridInput, and CenterImage - is only meaningful to the pack's own grid-aware nodes. Grid Output is the exit ramp: it converts one region into plain numbers and a mask, so it can plug into ordinary nodes elsewhere in ComfyUI that have no idea what a _GRID is - a crop node, a manual box-coordinate input, a plain compositor.

How it works

Feed it a single grid (pull one out of a list from GridInput, or take it straight from CenterImage), and it returns that region's x, y, width, and height as plain integers, plus a mask covering the same area. The optional bg_image most likely determines what canvas the mask gets rendered against - your actual background versus a blank canvas sized to the grid's own implied dimensions - so if you want the mask to line up with a real composite, wire your actual background in rather than leaving it disconnected.

The inputs and outputs that matter

  • grid (_GRID, required) - the single region to convert. Note this takes one grid, not a list - if you're working with GridInput's list output, you'll need to select a single entry first.
  • bg_image (IMAGE, optional) - the canvas the resulting mask is rendered against.

Outputs: x, y, width, height (all INT) - the region's real coordinates - and mask (MASK), a plain mask of that region.

How to install it

Ships with the Mixlab pack.

  • ComfyUI Manager: search comfyui-mixlab-nodes, install, restart.
  • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/shadowcz007/comfyui-mixlab-nodes.git, install requirements (install.bat on Windows, or ../../../python_embeded/python.exe -s -m pip install -r requirements.txt), restart.

No model downloads for this node.

Common issues & troubleshooting

Mask doesn't line up with my actual image. Wire your real background into bg_image - leaving it disconnected likely renders the mask against a differently-sized blank canvas, which will look right in isolation but won't align once you composite it back onto your actual image.

Coordinates look off. Before trusting x/y/width/height downstream (in a crop node, for instance), route them into a Preview or a simple crop first to sanity-check them against what you expected - cheap to verify, expensive to debug three nodes later.

Can't wire in a whole list of grids at once. This node takes one _GRID, not a list - if your upstream node (like GridInput) is producing several regions, you'll process them one at a time through separate GridOutput nodes, or select a single entry before this one.

Category♾️Mixlab/Layer

Inputs (2)

NameTypeDefaultDescription
grid_GRID
bg_imageoptIMAGE

Outputs (5)

NameTypeDescription
xINT
yINT
widthINT
heightINT
maskMASK