Skip to content

Commit 5d7d8e7

Browse files
committed
add docs.
1 parent f5272ea commit 5d7d8e7

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

docs/source/en/api/pipelines/ltx_video.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,45 @@ pipe = LTXImageToVideoPipeline.from_single_file(
6161
)
6262
```
6363

64+
Loading [LTX GGUF checkpoints](https://huggingface.co/city96/LTX-Video-gguf) are also supported:
65+
66+
```py
67+
import torch
68+
from diffusers.utils import export_to_video
69+
from diffusers import LTXPipeline, LTXVideoTransformer3DModel, GGUFQuantizationConfig
70+
71+
ckpt_path = (
72+
"https://huggingface.co/city96/LTX-Video-gguf/blob/main/ltx-video-2b-v0.9-Q3_K_S.gguf"
73+
)
74+
transformer = LTXVideoTransformer3DModel.from_single_file(
75+
ckpt_path,
76+
quantization_config=GGUFQuantizationConfig(compute_dtype=torch.bfloat16),
77+
torch_dtype=torch.bfloat16,
78+
)
79+
pipe = LTXPipeline.from_pretrained(
80+
"Lightricks/LTX-Video",
81+
transformer=transformer,
82+
generator=torch.manual_seed(0),
83+
torch_dtype=torch.bfloat16,
84+
)
85+
pipe.enable_model_cpu_offload()
86+
87+
prompt = "A woman with long brown hair and light skin smiles at another woman with long blonde hair. The woman with brown hair wears a black jacket and has a small, barely noticeable mole on her right cheek. The camera angle is a close-up, focused on the woman with brown hair's face. The lighting is warm and natural, likely from the setting sun, casting a soft glow on the scene. The scene appears to be real-life footage"
88+
negative_prompt = "worst quality, inconsistent motion, blurry, jittery, distorted"
89+
90+
video = pipe(
91+
prompt=prompt,
92+
negative_prompt=negative_prompt,
93+
width=704,
94+
height=480,
95+
num_frames=161,
96+
num_inference_steps=50,
97+
).frames[0]
98+
export_to_video(video, "output_gguf_ltx.mp4", fps=24)
99+
```
100+
101+
Make sure to read the [documentation on GGUF](../../quantization/gguf) to learn more about our GGUF support.
102+
64103
Refer to [this section](https://huggingface.co/docs/diffusers/main/en/api/pipelines/cogvideox#memory-optimization) to learn more about optimizing memory consumption.
65104

66105
## LTXPipeline

0 commit comments

Comments
 (0)