Nodes/ComfyUI_Lam/多GLIGEN文本框应用
ComfyUI Node

多GLIGEN文本框应用

Draw boxes on the node, place subjects with GLIGEN

By yanlang0123·Created 2 years ago·Updated 11 days ago· 77
多GLIGEN文本框应用
  • conditioning_to
  • clip
  • gligen_textbox_model
  • text0
  • text1
  • CONDITIONING
  • resolutionX
  • resolutionY

MultiGLIGENTextBoxApply ("多GLIGEN文本框应用", multi-GLIGEN text box apply) is the draw-it-yourself version of GLIGEN placement. Where MultiTextSetGligen takes boxes as an input, this node puts a canvas right on the node: you draw rectangles over a preview of the working resolution, type a prompt into each box, and it applies GLIGEN grounding for all of them at once. It's the most visual node in the Lam regional family, and the most approachable entry point to GLIGEN if the loader/apply two-step never clicked for you.

GLIGEN, briefly: it's a grounding model that takes a text description and a box position and pins the described subject to that location - the mechanism behind core ComfyUI's GLIGENTextBoxApply. This node is that, multiplied. Draw a box for "girl with red hair," another for "black cat," hit queue, and the model is told where each goes, with positions baked into the conditioning rather than filtered afterward.

How it works

The node holds its own canvas and properties: a width/height for the working resolution and per-box values (position and size, plus the text). At execution it reads the boxes you drew, encodes each text with the CLIP, builds a GLIGEN position parameter from the box coordinates (scaled to latent space - the /8 you'll see in any GLIGEN code), and stacks them onto the conditioning. Boxes stack cumulatively, so each new one extends the placement list instead of replacing it.

The interesting outputs: beyond the conditioning, it also returns resolutionX and resolutionY - the canvas dimensions you set. That's a deliberate convenience: wire those into your latent image node so the generation resolution always matches the canvas you drew on. Miss that and your boxes are sized for one resolution while generation happens at another, and the placement drifts.

The inputs and outputs

  • conditioning_to - base conditioning.
  • clip - CLIP for encoding.
  • gligen_textbox_model - the GLIGEN model from a GLIGENLoader node.
  • text0, text1, ... - prompts, which the canvas maps to boxes.
  • Outputs: CONDITIONING, plus resolutionX and resolutionY (INT) for wiring into your latent size.

Installing it

From ComfyUI_Lam: Manager → "ComfyUI_Lam", or:

cd ComfyUI/custom_nodes
git clone https://github.com/yanlang0123/ComfyUI_Lam

Restart, lam category. You supply the GLIGEN model yourself in models/gligen; the pack's own model downloads aren't needed here.

Common issues

The resolution mismatch trap above is the #1 way this node bites. Set the canvas to your actual generation resolution and wire resolutionX/resolutionY into the latent - don't eyeball it. Second, GLIGEN boxes want one clean subject each; a box that says "a whole street scene" will disappoint. Third, GLIGEN is an SD 1.5/SDXL-era tool - if your checkpoint is a modern DiT model, there may be no GLIGEN model that works with it, and you should use the area/mask siblings in the pack instead.

Pack reality as always: this is a Chinese-origin pack with essentially no community presence, its heavy install steps are for other nodes, and on uninstall you should delete ComfyUI/web/extensions/lam to clear the leftover popup from the frontend extension.

Categorylam

Inputs (5)

NameTypeDefaultDescription
conditioning_toCONDITIONING
clipCLIP
gligen_textbox_modelGLIGEN
text0TEXT,STRING
text1TEXT,STRING

Outputs (3)

NameTypeDescription
CONDITIONINGCONDITIONING
resolutionXINT
resolutionYINT