Skip to content

Minor update on the LTX2 NVFP4 recipe#1010

Open
jingyu-ml wants to merge 1 commit intomainfrom
jingyux/ltx2-recipe-updates
Open

Minor update on the LTX2 NVFP4 recipe#1010
jingyu-ml wants to merge 1 commit intomainfrom
jingyux/ltx2-recipe-updates

Conversation

@jingyu-ml
Copy link
Contributor

@jingyu-ml jingyu-ml commented Mar 9, 2026

What does this PR do?

Type of change: minor code change

  1. Update the default calibration dataset for LTX_VIDEO_DEV and LTX2 from Gustavosta/Stable-Diffusion-Prompts to nkp37/OpenVid-1M, which provides video-specific captions better suited for video model calibration.
  2. update the default recipe for ltx2: first 3 and last 3 layers stays at higher precision.

Usage

Testing

Before your PR is "Ready for review"

Make sure you read and follow Contributor guidelines and your commits are signed (git commit -s -S).

Make sure you read and follow the Security Best Practices (e.g. avoiding hardcoded trust_remote_code=True, torch.load(..., weights_only=False), pickle, etc.).

  • Is this change backward compatible?: ✅ / ❌ / N/A
  • If you copied code from any other sources or added a new PIP dependency, did you follow guidance in CONTRIBUTING.md: ✅ / ❌ / N/A
  • Did you write any new necessary tests?: ✅ / ❌ / N/A
  • Did you update Changelog?: ✅ / ❌ / N/A

Additional Information

Summary by CodeRabbit

  • Chores
    • Updated default dataset configuration for LTX-Video and LTX2 models.
    • Refined model filtering pattern for LTX-Video to support additional model components.

Signed-off-by: Jingyu Xin <jingyux@nvidia.com>
@jingyu-ml jingyu-ml requested a review from a team as a code owner March 9, 2026 22:52
@jingyu-ml jingyu-ml requested a review from mxinO March 9, 2026 22:52
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 9, 2026

📝 Walkthrough

Walkthrough

This PR updates default model configurations to reference the OpenVid dataset instead of SD Prompts for LTX_VIDEO_DEV and LTX2 models, and updates the LTX-Video model filter pattern to match additional transformer block references at specific indices.

Changes

Cohort / File(s) Summary
Model Configuration and Filter Updates
examples/diffusers/quantization/models_utils.py, examples/diffusers/quantization/utils.py
Model defaults for LTX_VIDEO_DEV and LTX2 now reference _OPENVID_DATASET instead of _SD_PROMPTS_DATASET. LTX-Video filter pattern updated to match transformer_blocks at indices 0, 1, 2, 45, 46, 47.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Security Anti-Patterns ❓ Inconclusive Unable to retrieve git diff or file contents; git repository context not available in current environment. Execute verification in an environment with git repository access and provide the modified file contents for security analysis.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Title check ✅ Passed The pull request title accurately summarizes the main changes: updating the LTX2 NVFP4 recipe with dataset and precision configuration changes.
✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch jingyux/ltx2-recipe-updates

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

@jingyu-ml jingyu-ml changed the title Minor update the LTX2 recipe Minor update on the LTX2 NVFP4 recipe Mar 9, 2026
Copy link
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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
examples/diffusers/quantization/models_utils.py (1)

152-165: ⚠️ Potential issue | 🟠 Major

Defaulting to OpenVid here makes calibration load the full split into memory.

examples/diffusers/quantization/utils.py::load_calib_prompts() does list(dataset[split][column]) before batching. After switching these defaults to _OPENVID_DATASET, a standard LTX calibration run will eagerly materialize the OpenVid training captions up front, which can dominate startup time and memory. Please bound the sampled rows or move the loader to select/streaming before making this the default.

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@examples/diffusers/quantization/utils.py`:
- Around line 70-75: Revert the shared helper filter_func_ltx_video back to its
original LTX-Video pattern (so it continues to serve ModelType.LTX_VIDEO_DEV
unchanged), and add a new LTX2-specific filter (e.g., filter_func_ltx2_video)
that includes the extra transformer_blocks.(0|1|2|45|46|47) alternation; then
update the recipe usage so ModelType.LTX2 uses filter_func_ltx2_video while
ModelType.LTX_VIDEO_DEV continues to use filter_func_ltx_video. Ensure you only
change the pattern in the new filter_func_ltx2_video and swap references where
ModelType.LTX2 is handled, leaving filter_func_ltx_video’s signature and
behavior untouched.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 19c84f2d-7e70-441d-afde-86e383197543

📥 Commits

Reviewing files that changed from the base of the PR and between a56b6f3 and 8dfe250.

📒 Files selected for processing (2)
  • examples/diffusers/quantization/models_utils.py
  • examples/diffusers/quantization/utils.py

Comment on lines 70 to 75
def filter_func_ltx_video(name: str) -> bool:
"""Filter function specifically for LTX-Video models."""
pattern = re.compile(
r".*(proj_in|time_embed|caption_projection|proj_out|patchify_proj|adaln_single).*"
r".*(proj_in|time_embed|caption_projection|proj_out|patchify_proj|adaln_single|transformer_blocks\.(0|1|2|45|46|47)\.).*"
)
return pattern.match(name) is not None
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

This also changes the LTX_VIDEO_DEV recipe.

filter_func_ltx_video() is reused for both ModelType.LTX_VIDEO_DEV and ModelType.LTX2, so adding transformer_blocks.(0|1|2|45|46|47) here widens the higher-precision exclusion list for both models, not just LTX2. If the intent is the PR description’s LTX2-only recipe update, this needs a separate LTX2-specific filter instead of changing the shared LTX helper.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/diffusers/quantization/utils.py` around lines 70 - 75, Revert the
shared helper filter_func_ltx_video back to its original LTX-Video pattern (so
it continues to serve ModelType.LTX_VIDEO_DEV unchanged), and add a new
LTX2-specific filter (e.g., filter_func_ltx2_video) that includes the extra
transformer_blocks.(0|1|2|45|46|47) alternation; then update the recipe usage so
ModelType.LTX2 uses filter_func_ltx2_video while ModelType.LTX_VIDEO_DEV
continues to use filter_func_ltx_video. Ensure you only change the pattern in
the new filter_func_ltx2_video and swap references where ModelType.LTX2 is
handled, leaving filter_func_ltx_video’s signature and behavior untouched.

@codecov
Copy link

codecov bot commented Mar 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.71%. Comparing base (a56b6f3) to head (8dfe250).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1010      +/-   ##
==========================================
- Coverage   71.73%   71.71%   -0.03%     
==========================================
  Files         211      211              
  Lines       23949    23949              
==========================================
- Hits        17181    17175       -6     
- Misses       6768     6774       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant