Text Generate Gemma3 Prompt
The 22GB LLM LTX-2.3 already loaded can write your prompts
- clip
- image
- prompt
LTX Video 2.3 is famously picky: it wants long, detailed, present-tense prose, and short prompts reliably underperform. That's exactly why the model ships with a Gemma 3 12B text encoder doing prompt enhancement in the default workflow - and it's also why people hate it. The thing is ~22GB in fp16, eats VRAM, and the built-in enhancer's output is, as one community reviewer put it, pretty basic once you actually look at it. This node's trick is simple and kind of elegant: it takes that Gemma 3 model you're loading anyway and lets you use it as a full local LLM to generate your prompt inside the graph. No API key, no extra model download, no second text encoder to fit in memory. The VRAM is already spent.
How it works
Under the hood it's a thin wrapper around ComfyUI's native textgen support - the same clip.tokenize / clip.generate / clip.decode path that Comfy-Org ships in comfy_extras/nodes_textgen.py (which the README links). The node builds a proper Gemma chat turn with <start_of_turn> markers, runs the generation with your sampling settings, then strips the system/user prefix and turn markers so you get just the generated text back.
The one clever bit is mode handling. With no image connected it runs T2V and uses the LTX-2.3 built-in system prompt for text-to-video. Connect an image and it flips to I2V, prepends <image_soft_token> to your prompt, and passes the actual image tensor into tokenize - so the multimodal Gemma encoder genuinely sees the frame and can describe what should animate next.
Inputs and outputs that matter
clip- must be the LTX2 CLIP (the Gemma 3 text encoder from an LTX Video 2.3 checkpoint). Don't feed it a regular SD/FLUX clip; it needs thegenerate/decodemethods this node calls.prompt- your rough idea. It doesn't need to be good; that's the point.mode-LTX-2.3uses the built-in system prompts (auto-selected per T2V/I2V),Customlets you swap in your owncustom_system_prompt.image- optional; connecting it switches to I2V mode.max_length,do_sample,temperature,top_k,top_p,min_p,repetition_penalty,seed- the usual LLM sampling knobs, with sensible defaults (256 tokens, temp 0.7, seed 0). Only touchtemperatureandmax_lengthat first.
The single prompt output is a plain STRING. Wire it into the LTX2 text encoder / CLIP Text Encode node - it writes the prompt, it doesn't replace conditioning, so the LTX2 CLIP still runs after it.
Installing it
The README is two lines: drop it in custom_nodes/ and restart ComfyUI. No requirements.txt, no heavy dependencies, no model files to fetch - everything it needs already ships with ComfyUI and your LTX-2.3 checkpoint.
cd ComfyUI/custom_nodes
git clone https://github.com/knishika62/ComfyUI-TextGenerateGemma3Prompt
Or search TextGenerateGemma3Prompt in ComfyUI Manager and hit install. Restart ComfyUI and it appears in the LTX-2.3 category.
Where people get burned
It only works on a recent ComfyUI core. The whole thing leans on native textgen support, and older builds throw a cryptic 'LTXV2CLIP' object has no attribute 'generate' style error. If you see that, update ComfyUI first.
VRAM is the real constraint, and it's not this node's fault. LTX-2.3's Gemma encoder is the single biggest source of OOM errors in the ecosystem - ~22GB fp16, and launch week was full of people failing to offload it. Because this node reuses whatever CLIP you load, using a quantized/fp8 Gemma text encoder or a GGUF variant lightens the whole pipeline, including this node.
Sampling gotchas: flip do_sample off and temperature does nothing - you get greedy decoding, which is deterministic and often blander. Keep seed fixed while you tune temperature, or you'll be comparing different random draws instead of settings.
One honest caveat: for pure prompt-crafting with zero LTX context, a free hosted LLM still beats it on creativity and costs you nothing but a copy-paste. This node wins when you want prompt generation to live inside the workflow - scripted, repeatable, seedable - on a model you were already paying the VRAM bill for.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| prompt | STRING | — | |
| mode | COMBO | 2 options: LTX-2.3, Custom | |
| custom_system_prompt | STRING | You are a helpful assistant that generates detailed video prompts. | — |
| max_length | INT | 2561–4096 | — |
| do_sample | BOOLEAN | true | — |
| temperature | FLOAT | 0.700–2 | — |
| top_k | INT | 640–1000 | — |
| top_p | FLOAT | 0.950–1 | — |
| min_p | FLOAT | 0.050–1 | — |
| repetition_penalty | FLOAT | 1.051–2 | — |
| seed | INT | 00–18446744073709550000 | — |
| imageopt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |