GLIGENTextBoxApplyBatchCoords
Animate GLIGEN boxes with a spline instead of typing coordinates by hand
- conditioning_to
- latents
- clip
- gligen_textbox_model
- conditioning
- coord_preview
GLIGEN is the older of the two mainstream regional-conditioning techniques - you draw a bounding box, attach a piece of text to it ("a red car"), and the model keeps that concept confined to that box instead of letting it bleed across the whole image. It's been around since the SD 1.5 era, and the barrier was always the interface more than the capability - the whole reason a community-built GUI for it became one of the highest-scoring regional-control threads in the space. GLIGENTextBoxApplyBatchCoords is Kijai's answer for animation: instead of one static box, you feed it a batch of coordinates - one set per frame - so the box moves, meant to pair with AnimateDiff-Evolved and this pack's Spline Editor node for drawing that motion path visually rather than typing numbers.
How it works
You pick a piece of your prompt's text to anchor spatially, tell the node its bounding box size, and hand it a JSON string of coordinates - one point per frame, matching the batch size implied by your latents input. The node schedules that box's position across the batch, applying GLIGEN's conditioning at each frame's coordinates instead of one fixed spot for the whole sequence.
The inputs and outputs that matter
conditioning_to- the conditioning you're adding this box to; typically chained after your CLIP Text Encode.latents- used purely to figure out the batch size, so the schedule has the right number of frames.clip- your standard text encoder, the same one encoding your main prompt.gligen_textbox_model- from a GLIGEN Loader node. The model itself downloads through ComfyUI Manager's Install Models menu, or directly from comfyanonymous's GLIGEN weights on HuggingFace if you'd rather grab it by hand.coordinates- a JSON string of points, built to be directly compatible with the pack's Spline Editor node so you can draw the path rather than write the JSON yourself.text- the specific chunk of your prompt this box applies to.width/height(both default 128) - the size of the GLIGEN bounding box itself.
One optional input, size_multiplier, lets the box scale over the sequence rather than staying a fixed size.
Two outputs: conditioning, which goes between your text encode and the sampler, and coord_preview - an image showing the boxes overlaid on a canvas so you can check the path before committing to a full render.
How to install it
Via ComfyUI Manager: search "KJNodes for ComfyUI," install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/kijai/ComfyUI-KJNodes
pip install -r ComfyUI-KJNodes/requirements.txt
then restart. On top of that, you need the GLIGEN model itself downloaded separately - it isn't bundled with the pack.
Common issues & troubleshooting
The model is missing. GLIGEN is a distinct checkpoint from your diffusion model, loaded through a separate GLIGEN Loader node - if gligen_textbox_model errors on load, the file didn't download, or the loader's pointed at the wrong path.
Coordinates don't match your batch length. The number of points in coordinates needs to track the batch size implied by latents; a mismatch is the most common source of a box that jumps, freezes, or throws an index error partway through.
Boxes look right in coord_preview but the effect is weak in the final render. GLIGEN's influence competes with the rest of your prompt and any other conditioning stacked on top - this is an older, fairly experimental corner of the pack (it lives under KJNodes/experimental), and it's meant to pair specifically with AnimateDiff-Evolved rather than every sampler, so confirm that's actually what's driving your video generation.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| conditioning_to | CONDITIONING | — | |
| latents | LATENT | — | |
| clip | CLIP | — | |
| gligen_textbox_model | GLIGEN | — | |
| coordinates | STRING | — | |
| text | STRING | — | |
| width | INT | 1288–4096 | — |
| height | INT | 1288–4096 | — |
| size_multiplieropt | FLOAT | 1 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| conditioning | CONDITIONING | — |
| coord_preview | IMAGE | — |