Skip to content

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

Merged
yibinl-nvidia merged 4 commits into
NVIDIA:mainfrom
yibinl-nvidia:dev-yibinl-ltx2-example-investigation
Jun 6, 2026
Merged

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

Conversation

@yibinl-nvidia

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

Copy link
Copy Markdown
Collaborator

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

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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>
@yibinl-nvidia

Copy link
Copy Markdown
Collaborator Author

/bot help

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

GitHub Bot Help

/bot [-h] ['run', 'kill', 'skip', 'reuse-pipeline'] ...

Provide a user friendly way for developers to interact with a Jenkins server.

Run /bot [-h|--help] to print this help message.

See details below for each supported subcommand.

Details

run [--reuse-test (optional)pipeline-id --disable-fail-fast --skip-test --stage-list "A10-PyTorch-1, xxx" --gpu-type "A30, H100_PCIe" --test-backend "pytorch, cpp" --add-multi-gpu-test --only-multi-gpu-test --disable-multi-gpu-test --post-merge --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" --detailed-log --debug(experimental) --high-priority]

Launch build/test pipelines. All previously running jobs will be killed.

--reuse-test (optional)pipeline-id (OPTIONAL) : Allow the new pipeline to reuse build artifacts and skip successful test stages from a specified pipeline or the last pipeline if no pipeline-id is indicated. If the Git commit ID has changed, this option will be always ignored. The DEFAULT behavior of the bot is to reuse build artifacts and successful test results from the last pipeline.

--disable-reuse-test (OPTIONAL) : Explicitly prevent the pipeline from reusing build artifacts and skipping successful test stages from a previous pipeline. Ensure that all builds and tests are run regardless of previous successes.

--disable-fail-fast (OPTIONAL) : Disable fail fast on build/tests/infra failures.

--skip-test (OPTIONAL) : Skip all test stages, but still run build stages, package stages and sanity check stages. Note: Does NOT update GitHub check status.

--stage-list "A10-PyTorch-1, xxx" (OPTIONAL) : Only run the specified test stages. Supports wildcard * for pattern matching (e.g., "*PerfSanity*" matches all stages containing PerfSanity). Examples: "A10-PyTorch-1, xxx", "PerfSanity". Note: Does NOT update GitHub check status.

--gpu-type "A30, H100_PCIe" (OPTIONAL) : Only run the test stages on the specified GPU types. Examples: "A30, H100_PCIe". Note: Does NOT update GitHub check status.

--test-backend "pytorch, cpp" (OPTIONAL) : Skip test stages which don't match the specified backends. Only support [pytorch, cpp, tensorrt, triton]. Examples: "pytorch, cpp" (does not run test stages with tensorrt or triton backend). Note: Does NOT update GitHub pipeline status.

--only-multi-gpu-test (OPTIONAL) : Only run the multi-GPU tests. Note: Does NOT update GitHub check status.

--disable-multi-gpu-test (OPTIONAL) : Disable the multi-GPU tests. Note: Does NOT update GitHub check status.

--add-multi-gpu-test (OPTIONAL) : Force run the multi-GPU tests in addition to running L0 pre-merge pipeline.

--post-merge (OPTIONAL) : Run the L0 post-merge pipeline instead of the ordinary L0 pre-merge pipeline.

--extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" (OPTIONAL) : Run the ordinary L0 pre-merge pipeline and specified test stages. Supports wildcard * for pattern matching. Examples: --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx", --extra-stage "Post-Merge".

--detailed-log (OPTIONAL) : Enable flushing out all logs to the Jenkins console. This will significantly increase the log volume and may slow down the job.

--debug (OPTIONAL) : Experimental feature. Enable access to the CI container for debugging purpose. Note: Specify exactly one stage in the stage-list parameter to access the appropriate container environment. Note: Does NOT update GitHub check status.

--high-priority (OPTIONAL) : Run the pipeline with high priority. This option is restricted to authorized users only and will route the job to a high-priority queue.

kill

kill

Kill all running builds associated with pull request.

skip

skip --comment COMMENT

Skip testing for latest commit on pull request. --comment "Reason for skipping build/test" is required. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

reuse-pipeline

reuse-pipeline

Reuse a previous pipeline to validate current commit. This action will also kill all currently running builds associated with the pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

@yibinl-nvidia

Copy link
Copy Markdown
Collaborator Author

/bot reuse-pipeline

@yibinl-nvidia
yibinl-nvidia enabled auto-merge (squash) June 6, 2026 20:53
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #52525 [ reuse-pipeline ] triggered by Bot. Commit: a5cad81 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #52525 [ reuse-pipeline ] completed with state SUCCESS. Commit: a5cad81
Reusing PR_Github #52309 for commit a5cad81

Link to invocation

@yibinl-nvidia
yibinl-nvidia merged commit 520262d into NVIDIA:main Jun 6, 2026
8 checks passed
@yibinl-nvidia
yibinl-nvidia deleted the dev-yibinl-ltx2-example-investigation branch June 8, 2026 17:41
2ez4bz pushed a commit to 2ez4bz/TensorRT-LLM that referenced this pull request Jun 8, 2026
Signed-off-by: Yibin Li <109242046+yibinl-nvidia@users.noreply.github.com>
Signed-off-by: Chang Liu <9713593+chang-l@users.noreply.github.com>
Co-authored-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