LTX2_SM_ENCODER
Turn a long, detailed prompt into LTX-2.3 conditioning — and make it reusable
- clip
- images
- positive
- negative
This is the node that actually talks to the model. LTX2_SM_ENCODER takes the Gemma 3 text encoder you loaded with LTX2_SM_Clip, runs your prompt (and negative) through it, and produces the positive / negative conditioning that the KSampler consumes. If you've used Comfy's CLIP Text Encode, this is the same shape - but LTX is pickier about what you feed it than SD ever was.
What it does
encoder_text() passes both prompts to the Gemma encoder and concatenates each one's video encoding with its audio encoding into a single 6144-wide embedding. Notice the trick in the code: if the negative prompt is empty, negative comes back as None - because in distilled mode there is no negative prompt at all (CFG is 1, no classifier-free guidance). So the negative output is only meaningful when you're running a non-distilled/dev pipeline.
The inputs that matter:
- enhance_prompt (default off) - toggles Gemma's built-in prompt enhancer, which rewrites your prompt before encoding (optionally using an image, if you feed
images). The community consensus on LTX-2/2.3 is blunt: turn this off and write the prompt yourself. The built-in enhancer produces basic prose, and a long, detailed, self-written prompt beats it every time. LTX wants paragraphs - describe the shot, the motion, the camera, even the audio ("she begins to sing in English: …"). - save_emb (default on) - writes the embeddings to disk. This is the pack's killer feature: with it on, you can bypass this whole node on later runs and the KSampler will quietly re-read the saved embeddings (it calls
read_lat_emb()when no conditioning is wired in). Encode once, seed-hunt forever. Given Gemma 12B is the slowest, heaviest thing in the graph, this turns a per-run tax into a one-time cost. - streaming_prefetch_count (default 1) - layer-streams the text encoder to keep VRAM down. Leave it at 1 on small cards; 0 disables streaming.
- prompt / negative_prompt - the author's default is a long singing-puppet scene; it's there as an example of how detailed LTX wants things, not as a template you should keep.
Outputs are positive and negative conditioning into the KSampler. There's also an optional images input that only does anything when enhance_prompt is on (it feeds the image to Gemma for enhancement).
Installing & troubleshooting
Same pack install as every node here - ComfyUI Manager (search "ComfyUI_LTX2_SM") or:
cd ComfyUI/custom_nodes
git clone https://github.com/smthemex/ComfyUI_LTX2_SM.git
cd ComfyUI_LTX2_SM && pip install -r requirements.txt
Real-world pain points:
- Encoding is slow and it's the text encoder's fault, not yours. Gemma 3 12B is huge. Run it on CPU via the
infer_deviceonLTX2_SM_Clip, and keepsave_embon. - No negative output when you want one? In distilled mode, negatives are structurally absent - that's the model, not a bug. If you need real negatives, switch the Model node to a non-distilled sampling mode.
- "It ignores half my prompt." LTX-2.3's prompt adherence is still its weakest axis; the fix is writing more specific motion and camera instructions and seed-hunting, not longer run-on sentences. And per the 2.3 playbook, voice lines placed later in the prompt get spoken later in the clip.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| enhance_prompt | BOOLEAN | false | — |
| save_emb | BOOLEAN | true | — |
| streaming_prefetch_count | INT | 10–64 | — |
| prompt | STRING | A close-up of a cheerful girl puppet with curly auburn yarn hair and wide button eyes, holding a small red umbrella above her head. Rain falls gently around her. She looks upward and begins to sing with joy in English: It's raining, it's raining, I love it when its raining. Her fabric mouth opening and closing to a melodic tune. Her hands grip the umbrella handle as she sways slightly from side to side in rhythm. The camera holds steady as the rain sparkles against the soft lighting. Her eyes blink occasionally as she sings. | — |
| negative_prompt | STRING | blurry, out of focus,subtitles, overexposed, underexposed, low contrast, washed out colors, excessive noise, grainy texture, poor lighting, flickering, motion blur, distorted proportions, unnatural skin tones, deformed facial features, asymmetrical face, missing facial features, extra limbs, disfigured hands, wrong hand count, artifacts around text, unreadable text on shirt or hat, missing microphone, misplaced microphone, inconsistent perspective, camera shake, incorrect depth of field, background too sharp, background clutter, distracting reflections, harsh shadows, inconsistent lighting direction, color banding, cartoonish rendering, 3D CGI look, unrealistic materials, uncanny valley effect, incorrect ethnicity, wrong gender, exaggerated expressions, smiling, laughing, exaggerated sadness, wrong gaze direction, eyes looking at camera, mismatched lip sync, silent or muted audio, distorted voice, robotic voice, echo, background noise, off-sync audio, missing sniff sounds, incorrect dialogue, added dialogue, repetitive speech, jittery movement, awkward pauses, incorrect timing, unnatural transitions, inconsistent framing, tilted camera, missing door or shelves, missing shallow depth of field, flat lighting, inconsistent tone, cinematic oversaturation, stylized filters, or AI artifacts. | — |
| imagesopt | IMAGE | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| positive | CONDITIONING | — |
| negative | CONDITIONING | — |