Nodes/ComfyUI-UtilsCollection/Text Encode with LTXV 2 System Prompt
ComfyUI Node

Text Encode with LTXV 2 System Prompt

LTXV 2 Encoding With a Custom System Prompt and an Optional Reference

By silveroxides·Created 2 months ago·Updated about 7 hours ago· 24
Text Encode with LTXV 2 System Prompt
  • clip
  • vae
  • image
  • CONDITIONING
prompt
system_prompt
vae_resolutionFast (1024)
ref_latent_modeoff
vae_dimension_multiple8

LTXV 2 is Lightricks' video model, and its text encoder is Gemma 3 - a 12B chat model that reads your prompt as a conversation and, if you're doing image-to-video, gets the reference image as part of that conversation. UC_TextEncodeLtxv2SystemPrompt is the encode node that builds LTXV 2's Gemma template, lets you supply the system message, and optionally encodes a reference image down a VAE path for structural conditioning. It's the I2V-friendly system-prompt encode.

How it works

Give it a clip (LTXV 2's Gemma 3 encoder), a prompt, and a system_prompt. It builds the Gemma-style turn template:

<start_of_turn>system
<your system message><end_of_turn>
<start_of_turn>user
<your prompt><end_of_turn>
<start_of_turn>model

When an image is connected, the user turn carries an <image_soft_token> so the VLM sees the reference frame as part of the instruction - and the default system message when you leave one empty is "You are a helpful assistant." From there it's the same dual-path story as the edit nodes: the image also gets VAE-encoded into a reference latent at your chosen vae_resolution (Ultra 512 → Detailed 1536 / Original), aligned to vae_dimension_multiple (8), and injected per ref_latent_mode - appended (single/multi) or kept in a separate conditioning stream (parallel-single/parallel-multi) so the reference structure can't override your semantic intent.

The inputs that matter

  • clip - the Gemma encoder. Optional vae + image are only needed when you want reference-latent conditioning (i.e. I2V with structural guidance).
  • prompt / system_prompt - your video instruction and its role framing.
  • vae_resolution / ref_latent_mode / vae_dimension_multiple - the reference path controls.

Output: one CONDITIONING tensor into your LTXV 2 sampler.

Installing it

It ships in ComfyUI-UtilsCollection by silveroxides:

cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI-UtilsCollection

Restart ComfyUI, or install "ComfyUI-UtilsCollection" via Manager. Pack requirements are just opencv-python and typing-extensions.

The honest part

That Gemma 3 encoder is LTXV 2's single biggest pain point - it's ~22GB at fp16, caused most of the early OOM reports, and it's the first thing to chase if you're tight on VRAM. The community standard fix is quantizing it (fp8 or 4-bit) or bypassing the built-in prompt enhancer entirely. System prompts are genuinely useful here since Gemma reads instructions, but if you're at your VRAM ceiling, quantize before you add more conditioning. And remember: parallel-* reference modes change how strongly the reference governs the output - if your I2V keeps re-generating the source frame instead of following the prompt, switch out of parallel mode or drop ref_latent_mode to off.

Categoryadvanced/conditioning

Inputs (8)

NameTypeDefaultDescription
clipCLIP
promptSTRING
system_promptSTRING
vae_resolutionCOMBOFast (1024)Resolution of the reference latent encoded by the VAE (structural path).
ref_latent_modeCOMBOoffReference latent encoding mode. 'single'/'multi' append latents; 'parallel-single'/'parallel-multi' run them in a separate conditioning stream to prevent semantic override.
vae_dimension_multipleINT84–256Pixel multiple used to align reference images before VAE encoding.
vaeoptVAE
imageoptIMAGE

Outputs (1)

NameTypeDescription
CONDITIONINGCONDITIONING