多文本GLIGEN设置
Ground each prompt to a box with a GLIGEN model
- gligen_textbox_model
- conditioning_to
- clip
- body_boxs
- textList
- text0
- text1
- CONDITIONING
MultiTextSetGligen ("多文本GLIGEN设置", multi-text GLIGEN placement) does regional prompting the GLIGEN way: instead of telling the model "this text only affects this area" via area conditioning, it hands the text and its box to a GLIGEN grounding model, which has been trained to place described objects at given coordinates. You feed it a GLIGEN model, a list of boxes, and matching texts, and each prompt gets locked to its box.
GLIGEN is the "grounding" approach to layout - it's the mechanism core ComfyUI exposes through its GLIGENLoader and GLIGENTextBoxApply nodes, where a box position is treated as a first-class input rather than a post-hoc conditioning filter. This node is the batch version: many texts, many boxes, one apply step, one conditioning out. If you're placing several distinct objects in a scene and want them to actually stay put, GLIGEN is a stronger stick than raw area conditioning, at the cost of needing a GLIGEN model file.
How it works
For each box/text pair it encodes the text with the CLIP, builds a position parameter from the pooled embedding and the box coordinates (scaled down to latent space, which is why coordinates are divided by 8), and appends it to the conditioning's GLIGEN chain. Because the parameters stack, later boxes don't erase earlier ones - each addition extends the previous list. Boxes and texts are paired by index, shortest side wins.
The box format is the pack's BOXS (width, height, x, y), same as MultiTextSetArea. GLIGEN boxes are typically drawn over the full image at its working resolution, so feed it boxes in image-pixel terms and let the node scale.
The inputs and outputs
gligen_textbox_model- the GLIGEN model, from a core GLIGENLoader node.conditioning_to- base conditioning to extend.clip- the CLIP for encoding.body_boxs(BOXS) - one box per text.textList, ortext0,text1, ... - one prompt per box.- Output:
CONDITIONING- into the sampler.
Installing it
From ComfyUI_Lam: Manager → "ComfyUI_Lam", or:
cd ComfyUI/custom_nodes
git clone https://github.com/yanlang0123/ComfyUI_Lam
Restart, lam category. The heavy part is the GLIGEN model itself - core ComfyUI ships a loader for it, and you download the model to models/gligen. None of the pack's other model downloads are needed here.
Common issues
GLIGEN placement has real constraints. It's best with one well-described object per box - cramming "a red car and a dog on the grass" into one box is how you get mush. Boxes need to leave room for composition; a box covering half the canvas for a small object wastes the model's grounding. And GLIGEN models are SD 1.5/SDXL-era artifacts - on a modern architecture there may be no GLIGEN model for your checkpoint at all, in which case you're back to the area/mask conditioning siblings.
Pack caveats as always: Chinese-language node, minimal community footprint, the README's heavy install is for other nodes. And if you uninstall the pack, delete ComfyUI/web/extensions/lam - the frontend extension leaves a popup behind otherwise.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| gligen_textbox_model | GLIGEN | — | |
| conditioning_to | CONDITIONING | — | |
| clip | CLIP | — | |
| body_boxs | BOXS | — | |
| textListopt | LIST | — | |
| text0opt | TEXT,STRING | — | |
| text1opt | TEXT,STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CONDITIONING | CONDITIONING | — |