Apply GLIGEN Text Box
The original 'put this prompt in a box' node, still in core
- conditioning_to
- clip
- gligen_textbox_model
- CONDITIONING
GLIGENTextBoxApply is where regional prompting used to mean bounding boxes, and it's still the built-in way to do it on SD1.5/SDXL. Instead of asking the model to place things from a sentence, you literally give a prompt a box: "a red car" confined to an x/y region of the canvas, "a woman in a hat" in another. GLIGEN was the 2023 attempt to teach Stable Diffusion where things go, and this node is ComfyUI's interface to its text-box grounding.
It's a relic in the best sense. The era it belongs to - SD1.5 and SDXL - is over, and by 2026 people mostly do this with either better prompt adherence or a proper regional tool. But if you're on an SD-era checkpoint and you want a second subject that actually stays in its lane, this is the one node that does it with a GLIGEN model and no custom pack.
How it works
You give it text plus a box in pixels: x, y, width, height. The node encodes the text with your CLIP, divides the box coordinates by 8 (matching the latent scale), and appends a gligen position entry to the conditioning. During sampling, the GLIGEN model - which you load with the "Load GLIGEN Model" node, files in models/gligen - injects that text's cross-attention at the boxed region. Feed it several boxes and each prompt binds to its own area. One technical nicety: the boxed prompt goes through the unprojected pooled embedding, which is how GLIGEN knows to treat it as a position-bound phrase rather than global context.
Inputs that matter
- conditioning_to - the base conditioning stream you're adding the box to.
- clip - the SD text encoder.
- gligen_textbox_model - the GLIGEN model (from GLIGEN Loader).
- text - the prompt for this box.
- width / height / x / y - the box, in pixels, steps of 8. The box is relative to your canvas, so match it to the latent you're generating into.
Output is the CONDITIONING, ready to combine with the rest and sample.
Where it fits
Ships with ComfyUI core, and it's one of the oldest conditioning nodes in the file - it's been in nodes.py since 2023. Nothing to install. Reach for it on SD1.5/SDXL when you need a subject pinned to a location and the plain prompt keeps ignoring you; it's the ancestor of every modern "regional prompt" tool.
Common issues
The box math trips everyone: coordinates are in pixels of your target resolution, so a 512-wide canvas wants boxes in that space, and they snap to 8px steps - a box that isn't aligned will be rounded. Also, GLIGEN's grounding is loose: the subject respects the box but doesn't fill it like a mask, and small boxes produce cramped, squashed subjects. It only works with the SD1.5/SDXL architecture family - plug it into a Flux pipeline and the gligen key is simply ignored. And as with any boxed technique, boxes that overlap or crowd together make the model blend the two prompts' attributes - the exact "bleeding" problem regional tools exist to solve.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| conditioning_to | CONDITIONING | — | |
| clip | CLIP | — | |
| gligen_textbox_model | GLIGEN | — | |
| text | STRING | — | |
| width | INT | 648–16384 | — |
| height | INT | 648–16384 | — |
| x | INT | 00–16384 | — |
| y | INT | 00–16384 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CONDITIONING | CONDITIONING | — |