Skip to content

[None][feat] Add LTX-2 visual generation example#14976

Open
yibinl-nvidia wants to merge 4 commits into
NVIDIA:mainfrom
yibinl-nvidia:dev-yibinl-ltx2-example-investigation
Open

[None][feat] Add LTX-2 visual generation example#14976
yibinl-nvidia wants to merge 4 commits into
NVIDIA:mainfrom
yibinl-nvidia:dev-yibinl-ltx2-example-investigation

Conversation

@yibinl-nvidia
Copy link
Copy Markdown
Collaborator

@yibinl-nvidia yibinl-nvidia commented Jun 4, 2026

Description

Adds a minimal LTX-2 text-to-video VisualGen example, including:

  • examples/visual_gen/models/ltx2.py for running an LTX-2 generation request.
  • examples/visual_gen/configs/ltx2.yaml with the default VisualGen settings for the example.
  • README usage documentation for the new example.

Test Coverage

  • pre-commit run --files examples/visual_gen/README.md examples/visual_gen/configs/ltx2.yaml examples/visual_gen/models/ltx2.py
  • L0 CI will be run through /bot run after the lightweight PR checks are clean for the current head.

PR Checklist

Please review the following before submitting your PR:

  • PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.

  • PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.

  • Test cases are provided for new code paths (see test instructions)

  • If PR introduces API changes, an appropriate PR label is added - either api-compatible or api-breaking. For api-breaking, include BREAKING in the PR title.

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • Update tava architecture diagram if there is a significant design change in PR.

  • The reviewers assigned automatically/manually are appropriate for the PR.

  • Please check this after reviewing the above items as appropriate for this PR.

GitHub Bot Help

To see a list of available CI bot commands, please comment /bot help.

Signed-off-by: Yibin Li <109242046+yibinl-nvidia@users.noreply.github.com>
@yibinl-nvidia yibinl-nvidia marked this pull request as ready for review June 4, 2026 22:39
@yibinl-nvidia yibinl-nvidia requested a review from a team as a code owner June 4, 2026 22:39
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 4, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds a complete LTX-2 text-to-video example to the VisualGen module. It includes a new YAML configuration file defining LTX-2 defaults, a Python example script that parses CLI arguments, loads configuration, and generates video output, and a README update documenting the new example.

Changes

LTX-2 Visual Generation Example

Layer / File(s) Summary
LTX-2 Configuration
examples/visual_gen/configs/ltx2.yaml
Defines LTX-2 pipeline settings: Gemma text encoder path, attention backend, parallelism configuration (cfg_size and ulysses_size), and CUDA graph execution disabled.
LTX-2 Example Script Implementation
examples/visual_gen/models/ltx2.py
Executable example with module docstring and usage instructions, CLI argument parsing for model ID, optional YAML-based visual_gen_args config, optional text_encoder_path override, and output path. Loads VisualGenArgs from YAML when provided and applies encoder path overrides. Configures LTX-2 generation parameters (resolution, frames, FPS, inference steps, guidance scale), executes visual_gen.generate() with a fixed prompt, saves output to file, and includes standard script launcher.
Example Usage Documentation
examples/visual_gen/README.md
Documents the new ltx2 example command in the Usage section with the YAML configuration file path.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • NVIDIA/TensorRT-LLM#14632: Adds a new slim LTX-2 example and YAML config, replacing a previously removed complex CLI wrapper.

Suggested labels

VisualGen, Doc

Suggested reviewers

  • karljang
  • chang-l
  • venkywonka
  • nv-guomingz
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding an LTX-2 visual generation example, which is reflected in all three modified files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The PR description includes required sections (Description, Test Coverage, PR Checklist) and clearly explains what is being added with minimal but adequate detail for a straightforward example addition.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@examples/visual_gen/models/ltx2.py`:
- Line 28: The function signature for main lacks a return type annotation;
update the definition of main (def main) to include an explicit return type of
-> None (i.e., change to def main() -> None:) so it conforms to the repo typing
rule that all functions must be annotated and use None for no return value.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 6e769eea-3562-44c6-a42e-f39894e75fa3

📥 Commits

Reviewing files that changed from the base of the PR and between 8e5d9e2 and 8355673.

📒 Files selected for processing (3)
  • examples/visual_gen/README.md
  • examples/visual_gen/configs/ltx2.yaml
  • examples/visual_gen/models/ltx2.py

Comment thread examples/visual_gen/models/ltx2.py
Signed-off-by: Yibin Li <109242046+yibinl-nvidia@users.noreply.github.com>
@yibinl-nvidia yibinl-nvidia force-pushed the dev-yibinl-ltx2-example-investigation branch from d20d450 to c80be94 Compare June 5, 2026 01:28
@yibinl-nvidia
Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #52202 [ run ] triggered by Bot. Commit: c80be94 Link to invocation

@yibinl-nvidia
Copy link
Copy Markdown
Collaborator Author

/bot kill

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #52236 [ kill ] triggered by Bot. Commit: c80be94 Link to invocation

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #52202 [ run ] completed with state ABORTED. Commit: c80be94

Link to invocation

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #52236 [ kill ] completed with state SUCCESS. Commit: c80be94
Successfully killed previous jobs for commit c80be94

Link to invocation

@yibinl-nvidia
Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #52240 [ run ] triggered by Bot. Commit: c80be94 Link to invocation

@yibinl-nvidia
Copy link
Copy Markdown
Collaborator Author

/bot kill

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #52304 [ kill ] triggered by Bot. Commit: c80be94 Link to invocation

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #52304 [ kill ] completed with state SUCCESS. Commit: c80be94
Successfully killed previous jobs for commit c80be94

Link to invocation

@yibinl-nvidia
Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #52309 [ run ] triggered by Bot. Commit: c80be94 Link to invocation

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #52309 [ run ] completed with state SUCCESS. Commit: c80be94
/LLM/main/L0_MergeRequest_PR pipeline #41615 completed with status: 'SUCCESS'
Pipeline passed with automatic retried tests. Check the rerun report for details.

CI Report

Link to invocation

Signed-off-by: Yibin Li <109242046+yibinl-nvidia@users.noreply.github.com>
@yibinl-nvidia yibinl-nvidia requested a review from chang-l June 5, 2026 19:19
Signed-off-by: Chang Liu <9713593+chang-l@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants