Nodes/ComfyUI-LuminaWrapper/Lumina Gemma Text Encode Area
ComfyUI Node

Lumina Gemma Text Encode Area

Lumina's composition grid

By kijai·Created 2 years ago·Updated 2 years ago· 196
Lumina Gemma Text Encode Area
  • gemma_model
  • lumina_area_prompt
  • lumina_embeds
append_prompt
n_prompt
keep_model_loadedfalse

If LuminaGemmaTextEncode is the plain-text path into Lumina, this is the regional variant - the one that lets you describe different subjects in different parts of the frame and have the model actually respect the layout. It's Lumina-Next's composition mode, and it's the most distinctive thing this pack does. A workflow with this node is how you get "a fox in the top-left cell, a castle in the bottom-right, one cohesive image," instead of hoping the model figures out composition on its own.

How it works

It takes a LUMINAAREAPROMPT - a list of prompt/row/column entries built by chaining LuminaTextAreaAppend nodes - plus an append_prompt and an n_prompt. Here's the mechanism that makes it tick:

  • Each region prompt gets append_prompt tacked onto its end (that's your global style/quality suffix, applied to every cell).
  • It also builds a global prompt by joining all the region prompts into one string.
  • It then encodes the region list, the negative, and that global prompt all at once through Gemma.

The returned lumina_embeds carries the area layout with it. Downstream, LuminaT2ISampler reads the unique rows and columns from that layout and turns them into h_split_num / w_split_num - the number of horizontal and vertical splits the model actually attends over. That's the real trick: Lumina-Next's transformer was trained with a grid-split attention mechanism, so the node is literally telling the model "this many boxes, with this prompt in each." It's not an outpainting hack; it's the architecture working as designed.

The inputs

  • gemma_model - from DownloadAndLoadGemmaModel, as always.
  • lumina_area_prompt - the area list from your chain of LuminaTextAreaAppend nodes. This is where the layout lives.
  • append_prompt - appended to every region prompt. Perfect spot for "highly detailed, 8k" style suffixes so you don't repeat yourself in each cell.
  • n_prompt - the negative, encoded once for the whole composition.
  • keep_model_loaded - same offload toggle as the plain encode node.

Output: one lumina_embeds, straight into LuminaT2ISampler. Use this node instead of LuminaGemmaTextEncode when you're doing composition - feeding both will just overwrite your conditioning.

The full chain, visually

LuminaTextAreaAppend (row 1, col 1: "a red fox")
LuminaTextAreaAppend (row 2, col 2: "an old castle")  ──┐
        └──────────────────────────────────────────────┴─► LuminaGemmaTextEncodeArea
                                                          ─► LuminaT2ISampler

Chain as many LuminaTextAreaAppend nodes as you have regions (rows and columns each go 1-8), then feed the combined list into this node.

Installing and gotchas

Same as the rest of the pack - ComfyUI Manager (search "ComfyUI-LuminaWrapper") or git clone https://github.com/kijai/ComfyUI-LuminaWrapper into custom_nodes, pip install -r requirements.txt, restart. The README's composition example workflow ships in the pack's examples/ folder - worth loading it once to see the layout conventions.

Two traps: keep region prompts descriptive but short - each one gets encoded and the whole global prompt runs through a 256-token cap, so five long paragraphs per cell will just get truncated. And remember the area layout only works because the sampler understands it; if you're getting flat, un-split results, check that your embeds actually came from this node rather than the plain encode. Also: flash_attn speeds this up more than anything else in the pack, because area composition makes attention do more work. On Windows, grab the prebuilt wheel; don't build from source.

CategoryLuminaWrapper

Inputs (5)

NameTypeDefaultDescription
gemma_modelGEMMAODEL
lumina_area_promptLUMINAAREAPROMPT
append_promptSTRING
n_promptSTRING
keep_model_loadedoptBOOLEANfalse

Outputs (1)

NameTypeDescription
lumina_embedsLUMINATEMBED