Nodes/ComfyUI-TextGenerateGemma3Prompt/Text Generate Gemma3 Prompt
ComfyUI Node

Text Generate Gemma3 Prompt

The 22GB LLM LTX-2.3 already loaded can write your prompts

By knishika62·Created 6 months ago·Updated 6 months ago· 7
Text Generate Gemma3 Prompt
  • clip
  • image
  • prompt
prompt
mode
custom_system_promptYou are a helpful assistant that generates detailed video prompts.
max_length256
do_sampletrue
temperature0.70
top_k64
top_p0.95
min_p0.05
repetition_penalty1.05
seed0

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 the generate/decode methods this node calls.
  • prompt - your rough idea. It doesn't need to be good; that's the point.
  • mode - LTX-2.3 uses the built-in system prompts (auto-selected per T2V/I2V), Custom lets you swap in your own custom_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 touch temperature and max_length at 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.

CategoryLTX-2.3

Inputs (13)

NameTypeDefaultDescription
clipCLIP
promptSTRING
modeCOMBO2 options: LTX-2.3, Custom
custom_system_promptSTRINGYou are a helpful assistant that generates detailed video prompts.
max_lengthINT2561–4096
do_sampleBOOLEANtrue
temperatureFLOAT0.700–2
top_kINT640–1000
top_pFLOAT0.950–1
min_pFLOAT0.050–1
repetition_penaltyFLOAT1.051–2
seedINT00–18446744073709550000
imageoptIMAGE

Outputs (1)

NameTypeDescription
promptSTRING