@@ -42,6 +42,7 @@ Before running these examples, ensure you have:
4242 trtllm-serve $LLM_MODEL_DIR /Wan2.1-T2V-1.3B-Diffusers --extra_visual_gen_options ./configs/wan.yml
4343 trtllm-serve $LLM_MODEL_DIR /FLUX.1-dev --extra_visual_gen_options ./configs/flux1.yml
4444 trtllm-serve $LLM_MODEL_DIR /FLUX.2-dev --extra_visual_gen_options ./configs/flux2.yml
45+ trtllm-serve $LLM_MODEL_DIR /LTX-2/ --extra_visual_gen_options ./configs/ltx2.yml
4546
4647 # Run server on background:
4748 trtllm-serve $LLM_MODEL_DIR /Wan2.1-T2V-1.3B-Diffusers --extra_visual_gen_options ./configs/wan.yml > /tmp/serve.log 2>&1 &
@@ -50,6 +51,7 @@ Before running these examples, ensure you have:
5051 tail -f /tmp/serve.log
5152
5253 ```
54+ For LTX-2, you need to provide a proper text_encoder_path in ` ./configs/ltx2.yml ` .
5355
5456## Examples
5557
@@ -58,6 +60,7 @@ Current supported & tested models:
58601 . WAN T2V/I2V for video generation (t2v, ti2v, delete_video)
59612 . FLUX.1 for image generation (t2i)
60623 . FLUX.2 for image generation (t2i)
63+ 4 . LTX-2 for video generation with audio (t2v, ti2v)
6164
6265### 1. Synchronous Image Generation (` sync_image_gen.py ` )
6366
@@ -118,14 +121,27 @@ python sync_video_gen.py --mode t2v \
118121 --prompt " A serene sunset over the ocean" \
119122 --duration 5.0 --fps 30 --size 512x512 \
120123 --output my_video.mp4
124+
125+ # LTX-2: Text-to-Video (generates video with audio)
126+ python sync_video_gen.py --mode t2v \
127+ --model ltx2 \
128+ --prompt " A cute cat playing with a ball in the park" \
129+ --duration 5.0 --fps 24 --size 1280x720
130+
131+ # LTX-2: Image-to-Video
132+ python sync_video_gen.py --mode ti2v \
133+ --model ltx2 \
134+ --prompt " She turns around and smiles, then slowly walks out of the frame" \
135+ --image ./media/woman_skyline_original_720p.jpeg \
136+ --duration 5.0 --fps 24 --size 1280x720
121137```
122138
123139** Command-Line Arguments:**
124140- ` --mode ` - Generation mode: ` t2v ` or ` ti2v ` (default: t2v)
125141- ` --prompt ` - Text prompt for video generation (required)
126142- ` --image ` - Path to reference image (required for ti2v mode)
127143- ` --base-url ` - API server URL (default: http://localhost:8000/v1 )
128- - ` --model ` - Model name (default: wan)
144+ - ` --model ` - Model name (default: wan). Use ` ltx2 ` for LTX-2.
129145- ` --duration ` - Video duration in seconds (default: 4.0)
130146- ` --fps ` - Frames per second (default: 24)
131147- ` --size ` - Video resolution in WxH format (default: 256x256)
@@ -171,14 +187,27 @@ python async_video_gen.py --mode t2v \
171187 --prompt " A serene sunset over the ocean" \
172188 --duration 5.0 --fps 30 --size 512x512 \
173189 --output my_video.mp4
190+
191+ # LTX-2: Async Text-to-Video (generates video with audio)
192+ python async_video_gen.py --mode t2v \
193+ --model ltx2 \
194+ --prompt " A cool cat on a motorcycle in the night" \
195+ --duration 5.0 --fps 24 --size 1280x720
196+
197+ # LTX-2: Async Image-to-Video
198+ python async_video_gen.py --mode ti2v \
199+ --model ltx2 \
200+ --prompt " She turns around and smiles, then slowly walks out of the frame" \
201+ --image ./media/woman_skyline_original_720p.jpeg \
202+ --duration 5.0 --fps 24 --size 1280x720
174203```
175204
176205** Command-Line Arguments:**
177206- ` --mode ` - Generation mode: ` t2v ` or ` ti2v ` (default: t2v)
178207- ` --prompt ` - Text prompt for video generation (required)
179208- ` --image ` - Path to reference image (required for ti2v mode)
180209- ` --base-url ` - API server URL (default: http://localhost:8000/v1 )
181- - ` --model ` - Model name (default: wan)
210+ - ` --model ` - Model name (default: wan). Use ` ltx2 ` for LTX-2.
182211- ` --duration ` - Video duration in seconds (default: 4.0)
183212- ` --fps ` - Frames per second (default: 24)
184213- ` --size ` - Video resolution in WxH format (default: 256x256)
@@ -249,13 +278,16 @@ You can customize these by:
249278- ` response_format ` : "b64_json" or "url"
250279
251280### Video Generation
252- - ` model ` : Model identifier (e.g., "wan")
281+ - ` model ` : Model identifier (e.g., "wan", "ltx2" )
253282- ` prompt ` : Text description
254- - ` size ` : Video resolution (e.g., "256x256", "512x512")
283+ - ` size ` : Video resolution (e.g., "256x256", "512x512", "1280x720" )
255284- ` seconds ` : Duration in seconds
256285- ` fps ` : Frames per second
257286- ` input_reference ` : Reference image file (for TI2V mode)
258287
288+ > ** Note:** LTX-2 generates video ** with audio** . The ` ltx2.yml ` config must include
289+ > ` text_encoder_path ` pointing to a Gemma3 model (e.g., ` google/gemma-3-12b-it ` ).
290+
259291## Quick Reference - curl Examples
260292
261293### Text-to-Video (JSON)
@@ -270,6 +302,19 @@ curl -X POST "http://localhost:8000/v1/videos" \
270302 }'
271303```
272304
305+ ### Text-to-Video with LTX-2 (JSON, generates video with audio)
306+ ``` bash
307+ curl -X POST " http://localhost:8000/v1/videos" \
308+ -H " Content-Type: application/json" \
309+ -d ' {
310+ "model": "ltx2",
311+ "prompt": "A cool cat on a motorcycle",
312+ "seconds": 5.0,
313+ "fps": 24,
314+ "size": "1280x720"
315+ }'
316+ ```
317+
273318### Text+Image-to-Video (Multipart with File Upload)
274319``` bash
275320curl -X POST " http://localhost:8000/v1/videos" \
0 commit comments