Text-to-Video
Generate videos from text prompts with vLLM-Omni, SGLang, TensorRT-LLM, or FastVideo
Choose a backend for text-to-video generation. See the Diffusion Overview for installation and shared configuration.
vLLM-Omni
SGLang
TensorRT-LLM
FastVideo
Text-to-video generation runs a vLLM-Omni worker with --output-modalities video.
Tested Models
To run a non-default model, pass --model to the launch script:
Launch
Launch using the provided script with Wan-AI/Wan2.1-T2V-1.3B-Diffusers:
Generate a Video
Generate a video via /v1/videos:
The response returns a video URL or base64 data depending on response_format (e.g. {"object": "video", "status": "completed", "data": [{"url": "file:///tmp/dynamo_media/videos/req-abc123.mp4"}]}).
MiniMax-H3
The initial MiniMax-H3 qualification serves text-to-video-and-audio (T2VA) with
one aggregated diffusion worker. The launcher passes --task-type fl2va, which
loads only H3’s FL2VA checkpoint partition. Dynamo’s standard image stays on
its VP9-only media stack, so build the opt-in video-audio overlay to mux H.264
video and AAC audio:
Start a shell with exactly four B200 GPUs visible. The commands pass the tested source revision and image ID into the qualification record:
Launch the profile inside the container. It uses four-way Ulysses and text-encoder tensor
parallelism while keeping VAE patch parallelism at one, so small supported
resolutions such as 448x256 still have at least one tile per participating
rank. Larger resolutions can opt into four-way VAE patch parallelism with
DYN_H3_VAE_PATCH_PARALLEL_SIZE=4:
When an offline cache contains only H3’s FL2VA/ partition, set
DYN_H3_MODEL_PATH to that partition directory. The launcher keeps
DYN_H3_MODEL as the public API model name and passes the local partition as
the engine path.
To use the four-step Dense FastH3 adapter, download and pin the startup adapter:
The launcher fuses this adapter into the checkpoint at load time. It is not a request-time LoRA and cannot be combined with another request-time adapter. The qualification script verifies the adapter SHA-256, requests four inference steps, omits request scheduler-shift overrides, and records request duration and adapter provenance. FastH3 v1 is T2VA-only and does not support CPU or layerwise offload.
To use FastH3 with Variable Sparse Attention (VSA), download a VSA adapter and identify the variant to the launcher and qualification script:
This path requires vLLM-Omni v0.29.0rc1 or later. The video-audio overlay
pins fastvideo-kernel==0.3.5. For a vsa-* adapter, the launcher selects
FASTVIDEO_VSA and uses the portable Triton route, retaining 64 key/value
blocks per query block. Override the top-k value with
DYN_H3_FASTVIDEO_VSA_TOPK. FastH3 VSA supports pure Ulysses sequence
parallelism; ring and all-gather degrees must remain 1. Check the first-forward
worker logs for FASTVIDEO_VSA H3 routing and verify that it does not fall back
to dense SDPA.
Run the supplied end-to-end qualification against the same worker. It requests a 10-second clip, then verifies a non-empty H.264 stream at 24 FPS and a non-silent 32-kHz stereo AAC stream:
The launcher pins model revision 42ed227ee7df40d41602854ae760620d6eb651fe.
Set DYN_H3_MODEL_REVISION to test another revision. Dynamo preserves
unrecognized top-level video fields and the vLLM-Omni adapter merges them into
the pipeline’s extra_args, where the upstream model validates them. Client
libraries that expose an extra_body option can use it to add these top-level
fields; do not send a literal nested extra_body object. Generated responses
report fps and audio_sample_rate for each MP4. The qualification output
records the exact Dynamo revision, container image ID, model revision, package
versions, visible GPU models, request, media checksum, and stream probe data.
First/last-frame FL2VA and reference-driven Ref2VA are not part of this initial qualification. They additionally require typed image, video, and audio input references.
Request Parameters (nvext)
The /v1/videos endpoint also accepts NVIDIA extensions via the nvext field for fine-grained control:
Frames per second.
Number of frames (overrides fps * seconds).
Negative prompt for guidance.
Number of denoising steps.
CFG guidance scale.
Random seed for reproducibility.
The nvext.boundary_ratio and nvext.guidance_scale_2 fields apply to the dual-expert MoE schedule used in image-to-video. See Image-to-Video with vLLM-Omni.
See Also
- Cosmos3 Nano example — experimental short-clip generation and reference conditioning
- Image-to-Video with vLLM-Omni — animate a source image with the same
/v1/videosendpoint - Text-to-Video with SGLang
- Text-to-Video with TensorRT-LLM
- Text-to-Video with FastVideo
- vLLM-Omni Configuration reference
Video generation workers produce videos from text prompts using SGLang’s DiffGenerator with frame-to-video encoding, via the --video-generation-worker flag. The same worker also supports image-to-video.
Launch
Use --wan-size 1b (default, 1 GPU) or --wan-size 14b (2 GPUs). See the launch script for all configuration options.
Generate a Video
See Also
TensorRT-LLM supports experimental text-to-video generation through the --modality video_diffusion flag. See the Diffusion Overview for requirements and installation (including the ffmpeg/imageio setup needed for MP4 encoding).
Supported Models
The pipeline type is auto-detected from the model’s model_index.json — no --model-type flag is needed.
Launch
Generate a Video
Video generation uses the /v1/videos endpoint:
Configuration
For the full flag surface (quantization, TeaCache, torch.compile, attention backend, and request defaults), see the TensorRT-LLM Configuration reference.
Limitations
- Diffusion is experimental and not recommended for production use.
- Only text-to-video and text-to-image are supported in this release (image-to-video planned).
- Requires a GPU with sufficient VRAM for the diffusion model.
See Also
This guide covers deploying FastVideo text-to-video generation on Dynamo using a custom worker (worker.py) exposed through the /v1/videos endpoint.
Dynamo also supports text-to-video through built-in backends: vLLM-Omni, SGLang, and TensorRT-LLM. See the Diffusion Overview for the full support matrix across all modalities.
Overview
- Default model:
FastVideo/FastWan2.1-T2V-1.3B-Diffusers. - Typed API: The worker builds
GeneratorConfigonce at startup and creates aGenerationRequestfor each/v1/videosrequest. - Optimized inference:
torch.compileand NVFP4 transformer quantization are available through--torch-compileand--fp4-quantization; the legacy--enable-optimizationsflag remains as a shortcut for both. - Response format: Returns one complete MP4 payload per request as
data[0].b64_json(non-streaming). - Concurrency: One request at a time per worker (VideoGenerator is not re-entrant). Scale throughput by running multiple workers.
worker.py defaults to --attention-backend VIDEO_SPARSE_ATTN and routes VSA_sparsity=0.8 through FastVideo’s typed PipelineSelection.experimental config. Keep this backend for FastWan 2.1 models; forcing TORCH_SDPA can instantiate a non-VSA Wan block and fail checkpoint loading. Use --attention-backend TORCH_SDPA for the LTX-2 compatibility path validated by the B300 smoke test.
Kubernetes Deployment
Kubernetes is the recommended path for running FastVideo on Dynamo. The steps below build and push the runtime image, deploy the aggregated worker, and send a first request. For a single-node development workflow, see Local Deployment at the bottom of this page.
Deployment Files
Prerequisites
- Dynamo Kubernetes Platform installed
- GPU-enabled Kubernetes cluster
- A container registry you can push the FastVideo runtime image to
- Optional HF token secret (for gated models)
Build and push the FastVideo runtime image
The runtime image is built from the Dockerfile:
- Base image:
nvidia/cuda:13.1.1-devel-ubuntu24.04 - Installs FastVideo
0.2.0from PyPI, which provides thefastvideo.apityped surface and NVFP4 transformer quantization support - Installs the
ai-dynamopackage with/v1/videossupport
Build and push the image:
A from-source flash-attention (FA4) build is deferred. The worker runs on FastVideo’s default attention backends without it.
Apply the cache PVC and deployment
Mounting a shared Hugging Face cache PVC means model weights are downloaded once and reused across pod restarts.
For clusters with tainted user-workload nodes and private registry pulls, set your pull secret name and image in agg_user_workload.yaml, then apply that variant instead:
To swap the image on an existing deployment quickly:
Send a test request
If this is the first request after startup, expect it to take longer while warmup completes. See Warmup Time for details.
FullHD Video with Audio (LTX-2)
LTX-2 models support native audio generation alongside video. LTX-2 requires width and height divisible by 32, so FullHD requests use 1920x1088 rather than 1920x1080.
Start the local example with an LTX-2 model:
Send the request from another terminal:
FastVideo exposes generated audio and audio_sample_rate on its Python result object. This Dynamo worker returns the saved MP4 in data[0].b64_json, with FastVideo muxing the generated 24 kHz audio into the MP4 output.
LTX-2 refine pipeline flags such as ltx2_refine_enabled, ltx2_refine_upsampler_path, and per-component compile settings are not yet exposed through FastVideo’s typed API config.
Warmup Time
On first start, workers download model weights. When --torch-compile is enabled, compile/warmup steps can push the first ready time to roughly 10–20 minutes (hardware-dependent). After the first successful compiled response, the second request can still take around 35 seconds while runtime caches finish warming up; steady-state performance is typically reached from the third request onward.
The shared Hugging Face cache PVC applied in the Kubernetes Deployment steps means weights are downloaded once and reused across pod restarts, so warmup is only paid in full on the very first start.
Worker Configuration Reference
CLI Flags
Request Parameters (nvext)
Environment Variables
Flags passed to worker.py:
HuggingFace model path.
Number of GPUs for distributed inference.
Dynamo discovery backend. Choices: etcd, file, mem, and kubernetes. Defaults to the environment, then Kubernetes or file discovery.
Sets FASTVIDEO_ATTENTION_BACKEND. Choices: FLASH_ATTN, TORCH_SDPA, SAGE_ATTN, SAGE_ATTN_THREE, VIDEO_SPARSE_ATTN, VMOBA_ATTN, SLA_ATTN, SAGE_SLA_ATTN.
Sets PipelineSelection.experimental["VSA_sparsity"]. The worker omits this value for other attention backends unless explicitly set.
Enables FastVideo CompileConfig.
Sets the torch.compile backend.
Sets the torch.compile mode. Choices: default, reduce-overhead, max-autotune, and max-autotune-no-cudagraphs.
Controls fullgraph mode.
Controls dynamic shapes.
Requests NVFP4 transformer quantization through QuantizationConfig(transformer_quant="NVFP4"). Confirm activation in worker logs before reporting FP4 results.
Backward-compatible shortcut for --torch-compile --fp4-quantization.
Controls FastVideo Fully Sharded Data Parallel (FSDP) inference.
Controls Diffusion Transformer (DiT) CPU offload.
Controls layerwise DiT CPU offload.
Controls variational autoencoder (VAE) CPU offload.
Controls image encoder CPU offload.
Controls text encoder CPU offload.
Controls pinned host memory for CPU offload transfers.
Controls autocast in FastVideo denoising and decoding paths.
Default request dimensions.
Default request duration in seconds.
Default request frame rate.
Default frame count.
Default diffusion inference steps.
Default classifier-free guidance scale.
Default random-number-generator seed. When unset, FastVideo uses its preset.
Rejects wider requests before calling FastVideo.
Rejects taller requests before calling FastVideo.
Rejects requests whose resolved frame count exceeds this cap.
Rejects requests whose inference-step count exceeds this cap.
Directory for generated MP4 staging files.
Fields nested under nvext in the /v1/videos request body:
Frames per second.
Total frames; overrides fps * seconds when set.
Diffusion inference steps.
Classifier-free guidance scale.
Random-number-generator seed override for reproducibility. When unset, FastVideo uses its preset.
Text to avoid in generation.
Video codec for MP4 encoding.
x264 encoding speed preset.
Attention backend; worker.py sets this from --attention-backend and validates FLASH_ATTN, TORCH_SDPA, SAGE_ATTN, SAGE_ATTN_THREE, VIDEO_SPARSE_ATTN, VMOBA_ATTN, SLA_ATTN, and SAGE_SLA_ATTN.
Enable per-stage timing logs.
Set to DEBUG for verbose logging.
Troubleshooting
Hardware Support
The worker checks the GPU compute capability at startup and fails fast when the selected attention backend cannot run on the detected hardware:
Local Deployment
For single-node development you can run FastVideo directly with Docker Compose or a host-local script instead of Kubernetes.
Prerequisites
For Docker Compose:
- Docker Engine 26.0+
- Docker Compose v2
- NVIDIA Container Toolkit
For host-local script:
- Python environment with Dynamo + FastVideo dependencies installed
- CUDA-compatible GPU runtime available on host
Option 1: Docker Compose
The Compose file builds from the same Dockerfile used for the Kubernetes runtime image and exposes the API on http://localhost:8000.
Option 2: Host-Local Script
Environment variables:
Example:
FastVideo worker flags are not dynamo.frontend flags, so pass non-default worker configuration through WORKER_EXTRA_ARGS.
Validated B300 smoke-test worker configurations:
The FastWan FP4 configuration completed the smoke request, but the worker log did not show the NVFP4 weight-conversion marker. Treat --fp4-quantization as requested, not independently confirmed, for FastWan until the FastVideo logs expose that confirmation.
The script writes logs to:
.runtime/logs/worker.log.runtime/logs/frontend.log
Source Code
The example source lives at examples/diffusers/ in the Dynamo repository.
See Also
- Text-to-Video with vLLM-Omni — vLLM-Omni video generation via
/v1/videos - Text-to-Video with SGLang — SGLang video generation worker
- Text-to-Video with TensorRT-LLM — TensorRT-LLM diffusion quick start
- Diffusion Overview — Full backend support matrix