Nodes/comfyui-mixlab-nodes/GLIGEN TextBox Apply ♾️Mixlab
ComfyUI Node Runs on cloud

GLIGEN TextBox Apply ♾️Mixlab

Place prompts into grid regions

By MixLabPro·Created 3 years ago·Updated 2 months ago· 1,859
GLIGEN TextBox Apply ♾️Mixlab
  • conditioning
  • clip
  • gligen_textbox_model
  • grids
  • seed
  • CONDITIONING
  • label
labels
index-1
max_size8
random_shuffle

GLIGEN is the technique that lets you say "put this concept here" - you attach a phrase to a bounding box, and the model tries to place that thing in that spot. Core ComfyUI ships a basic GLIGEN apply where you give it one phrase and one box. This advanced Mixlab version scales that up: it takes a whole grid of regions (from the Split Image node) and a list of labels, and assigns prompts across the cells - so instead of positioning one thing, you're laying out several across a spatial grid in one node. It's regional prompting through GLIGEN's grounding.

If you want "a cat top-left, a dog top-right, a tree along the bottom" without painting masks or juggling a stack of conditioning combines, this is the shape of tool for it. Fair warning: GLIGEN is an older, somewhat niche approach - it needs its own model, it's box-based rather than pixel-precise, and it's been largely overtaken by newer regional and instruction-editing methods. But when it clicks, the spatial control is direct and cheap.

How it works

GLIGEN uses a small dedicated "gligen textbox" model that plugs into the diffusion process and biases where CLIP-encoded phrases land. This node consumes a _GRID (the layout from Split Image), a multiline list of labels (one concept per region), your existing conditioning, the clip, and the gligen model, and it bakes the grounded phrases into a new conditioning that carries the spatial assignments. You then sample with that conditioning as usual.

Inputs and outputs

The required inputs, in plain terms:

  • conditioning (CONDITIONING) - your base positive conditioning to add the grounded phrases onto.
  • clip (CLIP) - the CLIP that encodes the label phrases.
  • gligen_textbox_model (GLIGEN) - the GLIGEN model, loaded with a GLIGEN loader. You need this file; it's not your regular checkpoint.
  • grids (_GRID) - the region layout, wired from Split Image.
  • labels (STRING, multiline) - the phrases to place, one per line, mapped across the grid cells.
  • index (INT, default -1) - which cell/label to target; -1 applies across them.
  • max_size (INT, default 8) - a cap on how many regions/labels are handled.
  • random_shuffle (enum: on / off) - shuffle the label-to-region assignment for variation.

Optional seed controls the shuffle randomness. Outputs are CONDITIONING (the grounded conditioning to sample with) and label (STRING, the label applied - handy for tracking what went where).

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.

You also need a GLIGEN model - download a gligen textbox checkpoint and load it with a GLIGEN loader node. Without it, this node has nothing to apply.

Common issues

No GLIGEN model: the most common blocker. This isn't your Stable Diffusion checkpoint - GLIGEN is a separate model file that loads into the gligen_textbox_model input. If that socket's empty, nothing grounds.

grids won't connect: the _GRID type comes from Split Image in this same pack. It's a Mixlab-specific type, so pair the two nodes; a generic grid/tiling node from elsewhere won't produce the right thing.

Concepts land in the wrong spot, or weakly: GLIGEN is guidance, not a guarantee - it nudges placement rather than enforcing it, and it works best with base models GLIGEN was built around (SD1.5-era). On newer architectures it may not hook in at all. If placement is fighting you, that's GLIGEN's known limitation, not a config you missed.

Labels don't map as expected: check index, max_size, and random_shuffle. With shuffle on, the assignment is randomized by seed; turn it off for a stable label-to-cell mapping.

Category♾️Mixlab/Prompt

Inputs (9)

NameTypeDefaultDescription
conditioningCONDITIONING
clipCLIP
gligen_textbox_modelGLIGEN
grids_GRID
labelsSTRING
indexINT-1-1–300
max_sizeINT81–300
random_shuffleCOMBO2 options: on, off
seedopt*00–18446744073709550000

Outputs (2)

NameTypeDescription
CONDITIONINGCONDITIONING
labelSTRING