# Local LTX / LTX 2.3 video generation notes

Use this when animating a still image locally with ComfyUI LTX workflows, especially after generating a portrait/image in a previous ComfyUI step.

## Model choice learned

- Older `ltx-video-2b-v0.9.5.safetensors` works, but quality can be poor for portrait animation compared to LTX 2.3.
- If the user explicitly asks for “LTX 2.3”, use the official LTX 2.3 workflow template, not the older `ltxv_image_to_video.json` template.

## Useful local templates

Installed ComfyUI template paths may include:

- Old LTX I2V: `comfyui_workflow_templates_media_video/templates/ltxv_image_to_video.json`
- LTX 2.3 I2V: `comfyui_workflow_templates_media_video/templates/video_ltx2_3_i2v.json`

Convert editor-format templates to API format with:

```bash
env -u VIRTUAL_ENV PATH=/home/wildlama/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
  comfy --workspace /home/wildlama/comfy/ComfyUI \
  run --workflow <template.json> --host 127.0.0.1 --port 8188 --print-prompt > /tmp/prompt_raw.json
```

Then parse from the first `{` and patch only prompt/image/model settings; avoid rebuilding LTX templates from scratch.

## LTX 2.3 model set used locally

The LTX 2.3 I2V template references these model names/locations:

- Checkpoint: `models/checkpoints/ltx-2.3-22b-dev-fp8.safetensors`
- Text encoder: `models/text_encoders/gemma_3_12B_it_fp4_mixed.safetensors`
- LoRA: `models/loras/ltx_2.3_22b_distilled_1.1_lora_dynamic_fro09_avg_rank_111_bf16.safetensors`
- LoRA: `models/loras/gemma-3-12b-it-abliterated_lora_rank64_bf16.safetensors`
- Latent upscaler: `models/latent_upscale_models/ltx-2.3-spatial-upscaler-x2-1.1.safetensors`

Public URLs verified during setup:

```text
https://huggingface.co/Lightricks/LTX-2.3-fp8/resolve/main/ltx-2.3-22b-dev-fp8.safetensors
https://huggingface.co/Comfy-Org/ltx-2/resolve/main/split_files/text_encoders/gemma_3_12B_it_fp4_mixed.safetensors
https://huggingface.co/Comfy-Org/ltx-2.3/resolve/main/split_files/loras/ltx_2.3_22b_distilled_1.1_lora_dynamic_fro09_avg_rank_111_bf16.safetensors
https://huggingface.co/Comfy-Org/ltx-2/resolve/main/split_files/loras/gemma-3-12b-it-abliterated_lora_rank64_bf16.safetensors
https://huggingface.co/Lightricks/LTX-2.3/resolve/main/ltx-2.3-spatial-upscaler-x2-1.1.safetensors
```

Use resumable downloads for these large files:

```bash
curl -L --fail --retry 50 --retry-delay 10 -C - -o <output> <url>
```

## Hermes / long-run pattern

For multi-GB downloads plus video rendering, create a self-contained robot script and run it with:

```python
terminal(command="/path/to/robot.sh", background=True, notify_on_complete=True)
```

Do not use shell-level `nohup ... &`; Hermes rejects/untracks that. The robot should print a final line like:

```text
MEDIA:/absolute/path/to/final.mp4
```

This lets the main conversation continue while the render/download runs.

## Local quality/performance tips

- On a 32GB VRAM GPU, keep local LTX 2.3 dimensions modest (e.g. 768x512 latent and 1280x720 final upscale) to avoid OOM.
- Re-encode final MP4 for Telegram/Discord compatibility:

```bash
ffmpeg -y -i input.mp4 \
  -c:v libx264 -profile:v main -preset medium -crf 15 -pix_fmt yuv420p \
  -an output_telegram.mp4
```

## Prompting note

For portrait I2V, prompt for subtle motion rather than large body/camera changes:

```text
realistic cinematic video portrait, gentle head turn, natural blinking, subtle smile, hair moves softly in a light breeze, warm golden-hour light, smooth slow camera push-in, no dialogue
```
