Skip to content

Conversation

@Cui-yshoho
Copy link
Contributor

What does this PR do?

Fixes # (issue)

Adds # (feature)

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline?
  • Did you make sure to update the documentation with your changes? E.g. record bug fixes or new features in What's New. Here are the
    documentation guidelines
  • Did you build and run the code without any errors?
  • Did you report the running environment (NPU type/MS version) and performance in the doc? (better record it for data loading, model inference, or training tasks)
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@xxx

@Cui-yshoho Cui-yshoho requested a review from vigo999 as a code owner December 8, 2025 02:29
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Cui-yshoho, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the mindone/diffusers library by integrating the latest LTX-Video 0.9.8 model. The core addition is a new tone-mapping functionality within the latent upsampling pipeline, designed to refine the dynamic range of generated video latents. Accompanying these technical updates, the documentation has been thoroughly revised to provide comprehensive guidance and practical code examples for leveraging the new LTX-Video versions and features, ensuring users can effectively utilize these advanced video generation capabilities.

Highlights

  • LTX-Video 0.9.8 Integration: Added support for the LTX-Video 0.9.8 model, which includes features for generating very long videos and a new tone-mapping capability.
  • Tone Mapping Feature: Introduced a tone_map_latents function in the latent upsampling pipeline to apply non-linear tone mapping, improving video quality by reducing dynamic range.
  • Expanded Documentation: Significantly updated the LTX-Video documentation with detailed explanations, recommended settings, and new code examples for LTX-Video 0.9.7, 0.9.8, and LoRA usage.
  • MindSpore Type Hint Updates: Replaced torch.Tensor type hints with ms.Tensor in the LTXLatentUpsamplePipeline for consistency with the MindSpore framework.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for newer LTX-Video models, specifically versions up to 0.9.8, by updating the documentation with new examples and adding a tone_map_latents feature to the LTXLatentUpsamplePipeline. The changes are generally well-implemented. My review includes a few suggestions for the documentation to fix a typo, correct a potentially buggy code example, and address a placeholder checkpoint. The core code changes for the new feature appear solid.

Comment on lines +101 to +102
height = height - (height % pipeline.vae_temporal_compression_ratio)
width = width - (width % pipeline.vae_temporal_compression_ratio)
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The function round_to_nearest_resolution_acceptable_by_vae appears to be using pipeline.vae_temporal_compression_ratio to adjust height and width. Since resolution refers to spatial dimensions (height and width), it should likely use pipeline.vae_spatial_compression_ratio. The other examples in this file for newer model versions correctly use vae_spatial_compression_ratio. Using the temporal ratio for spatial dimensions could lead to incorrect resolutions and potential errors.

Suggested change
height = height - (height % pipeline.vae_temporal_compression_ratio)
width = width - (width % pipeline.vae_temporal_compression_ratio)
height = height - (height % pipeline.vae_spatial_compression_ratio)
width = width - (width % pipeline.vae_spatial_compression_ratio)

- The recommended dtype for the transformer, VAE, and text encoder is `mindspore.bfloat16`. The VAE and text encoder can also be `mindspore.float32` or `mindspore.float16`.
- For guidance-distilled variants of LTX-Video, set `guidance_scale` to `1.0`. The `guidance_scale` for any other model should be set higher, like `5.0`, for good generation quality.
- For timestep-aware VAE variants (LTX-Video 0.9.1 and above), set `decode_timestep` to `0.05` and `image_cond_noise_scale` to `0.025`.
- For variants that support interpolation between multiple conditioning images and videos (LTX-Video 0.9.5 and above), use similar images and videos for the best results. Divergence from the conditioning inputs may lead to abrupt transitionts in the generated video.
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

There is a typo in transitionts. It should be transitions.

Suggested change
- For variants that support interpolation between multiple conditioning images and videos (LTX-Video 0.9.5 and above), use similar images and videos for the best results. Divergence from the conditioning inputs may lead to abrupt transitionts in the generated video.
- For variants that support interpolation between multiple conditioning images and videos (LTX-Video 0.9.5 and above), use similar images and videos for the best results. Divergence from the conditioning inputs may lead to abrupt transitions in the generated video.

Comment on lines +283 to +284
# TODO: Update the checkpoint here once updated in LTX org
upsampler = LTXLatentUpsamplerModel.from_pretrained("a-r-r-o-w/LTX-0.9.8-Latent-Upsampler", mindspore_dtype=ms.bfloat16)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The example code for LTX-Video 0.9.8 contains a TODO comment and uses a checkpoint from a personal repository (a-r-r-o-w/...). For official documentation, it's best to use official checkpoints from the Lightricks organization. Please update the checkpoint to an official one and remove the TODO comment once it's available.

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