🟤GLIGEN → Dict🗂️
The GLIGEN Model, Parked in the Dict
- dict
- value
- dict
GLIGEN is the niche one in the model family - a grounding model that lets you specify where in the image things go, by conditioning on boxes and text. It's powerful, it's fiddly, and in the modern ComfyUI ecosystem it's not nearly as common as ControlNet or IP-Adapter. If you use it at all, DictAddGligen is how you keep the loaded GLIGEN model on the bus rather than running a dedicated wire to the one node that consumes it.
It's grouped under Add/Models with the rest of the model types, and the GLIGEN value is a wired input from a GLIGEN Loader, validated against the model type before storage. Honestly, this is a node you'll only open if you're already doing box-grounded generation - but when you are, it's exactly the right tool.
How it works
Same Dict Tools engine as every Add node: validate the value, store it under the key, return a new frozendict without mutating your input, and sort keys alphabetically on update. The GLIGEN model is held by reference, so bundling it costs no meaningful memory.
The bus payoff: keep the GLIGEN model, your text prompts, and your box coordinates in one dict, and a whole grounded-generation stage becomes a single connection you can drag around or reuse.
The inputs that matter
- key (STRING) - the name you'll fetch the GLIGEN back by.
- cleanup_key (BOOL, default on) - trims spaces/newlines from the key.
- dict (DICT, optional) - an existing dict to extend, or empty to start one.
- value (GLIGEN, optional) - the wired model from your GLIGEN Loader.
Output is dict (DICT). Get it back with DictExtractGligen.
Install
ComfyUI Manager: search Dict Tools, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/Lex-DRL/ComfyUI-DictTools
Restart after. Only dependency is frozendict, auto-installed by Manager.
Gotchas
Pack-wide: requires ComfyUI 0.18.0+ (newer node API). Failed to load → update ComfyUI.
A practical note specific to GLIGEN: the model is only part of the story - box grounding needs the text and coordinates to line up with whatever the loader expects, and this node won't rescue you if those are wrong; it just carries the model. And since GLIGEN is less common, double-check that your ComfyUI actually ships the GLIGEN input/output types before building a whole workflow around it. Type errors on add are loud, but a missing type in an older build fails silently earlier.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| key | STRING | Key (name) of the item inserted into the dict. | |
| cleanup_key | BOOLEAN | true | Automatically remove leading/trailing spaces and extra newlines from the key. |
| dictopt | DICT | An (optional) Dictionary to work with. | |
| valueopt | GLIGEN | The actual GLIGEN-type item to add into the Dict. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| dict | DICT | — |