-
Notifications
You must be signed in to change notification settings - Fork 145
[Feat] Support LTX2 sequence parallel, tensor parallel, and VAE decod… #810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| "infer_steps": 40, | ||
| "target_video_length": 121, | ||
| "target_height": 512, | ||
| "target_width": 768, | ||
| "attn_type": "sage_attn2", | ||
| "sample_guide_scale": 4, | ||
| "sample_shift": [2.05, 0.95], | ||
| "enable_cfg": true, | ||
| "cpu_offload": false, | ||
| "num_channels_latents": 128, | ||
| "fps": 24, | ||
| "audio_fps": 24000, | ||
| "audio_mel_bins":16, | ||
| "double_precision_rope": true, | ||
| "dit_original_ckpt": "Lightricks/LTX-2/ltx-2-19b-dev.safetensors", | ||
| "parallel": { | ||
| "tensor_p_size": 2 | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| { | ||
| "infer_steps": 40, | ||
| "target_video_length": 121, | ||
| "target_height": 512, | ||
| "target_width": 768, | ||
| "attn_type": "sage_attn2", | ||
| "sample_guide_scale": 4, | ||
| "sample_shift": [2.05, 0.95], | ||
| "enable_cfg": true, | ||
| "cpu_offload": false, | ||
| "num_channels_latents": 128, | ||
| "fps": 24, | ||
| "audio_fps": 24000, | ||
| "audio_mel_bins":16, | ||
| "double_precision_rope": true, | ||
| "dit_original_ckpt": "Lightricks/LTX-2/ltx-2-19b-dev.safetensors", | ||
| "parallel": { | ||
| "seq_p_size": 2, | ||
| "seq_p_attn_type": "ulysses" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,10 @@ | ||
| from lightx2v import LightX2VPipeline | ||
|
|
||
| pipe = LightX2VPipeline(model_path="Lightricks/LTX-2", model_cls="ltx2", task="t2av") | ||
| pipe = LightX2VPipeline(model_path="/data/nvme0/gushiqiao/models/official_models/LTX-2", model_cls="ltx2", task="t2av") | ||
|
|
||
| pipe.enable_quantize( | ||
| dit_quantized=True, | ||
| dit_quantized_ckpt="Lightricks/LTX-2/ltx-2-19b-distilled-fp8.safetensors", | ||
| dit_quantized_ckpt="/data/nvme0/gushiqiao/models/official_models/LTX-2/ltx-2-19b-distilled-fp8.safetensors", | ||
|
Comment on lines
+3
to
+7
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| quant_scheme="fp8-pertensor", | ||
| skip_fp8_block_index=[0, 43, 44, 45, 46, 47], | ||
| ) | ||
|
|
@@ -33,11 +33,12 @@ | |
| seed = 42 | ||
| prompt = "A beautiful sunset over the ocean" | ||
| negative_prompt = "blurry, out of focus, overexposed, underexposed, low contrast, washed out colors, excessive noise, grainy texture, poor lighting, flickering, motion blur, distorted proportions, unnatural skin tones, deformed facial features, asymmetrical face, missing facial features, extra limbs, disfigured hands, wrong hand count, artifacts around text, inconsistent perspective, camera shake, incorrect depth of field, background too sharp, background clutter, distracting reflections, harsh shadows, inconsistent lighting direction, color banding, cartoonish rendering, 3D CGI look, unrealistic materials, uncanny valley effect, incorrect ethnicity, wrong gender, exaggerated expressions, wrong gaze direction, mismatched lip sync, silent or muted audio, distorted voice, robotic voice, echo, background noise, off-sync audio, incorrect dialogue, added dialogue, repetitive speech, jittery movement, awkward pauses, incorrect timing, unnatural transitions, inconsistent framing, tilted camera, flat lighting, inconsistent tone, cinematic oversaturation, stylized filters, or AI artifacts." | ||
| save_result_path = "/path/to/save_results/output.mp4" | ||
| save_result_path = "/data/nvme0/gushiqiao/models/code/LightX2V/save_results/output_lightx2v_ltx2_t2av_distilled_fp8.mp4" | ||
|
|
||
| pipe.generate( | ||
| seed=seed, | ||
| prompt=prompt, | ||
| negative_prompt=negative_prompt, | ||
| save_result_path=save_result_path, | ||
| ) | ||
| for seed in range(10): | ||
| pipe.generate( | ||
| seed=seed, | ||
| prompt=prompt, | ||
| negative_prompt=negative_prompt, | ||
| save_result_path=save_result_path, | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hardcoded local paths are being used for
model_pathanddit_quantized_ckpt. This is not portable and will cause issues for other developers. It's recommended to use relative paths, environment variables, or a mechanism to load these from a local configuration file that is not committed to the repository.