Spaces:
Paused
Paused
Update video_model.py
Browse files- video_model.py +14 -2
video_model.py
CHANGED
@@ -1,11 +1,23 @@
|
|
1 |
import torch
|
2 |
|
3 |
-
from diffusers import LTXPipeline, LTXImageToVideoPipeline
|
4 |
|
5 |
|
6 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
7 |
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
t2v_pipe.to(device)
|
10 |
|
11 |
i2v_pipe = LTXImageToVideoPipeline.from_pipe(t2v_pipe)
|
|
|
1 |
import torch
|
2 |
|
3 |
+
from diffusers import LTXPipeline, LTXImageToVideoPipeline, LTXVideoTransformer3DModel, GGUFQuantizationConfig
|
4 |
|
5 |
|
6 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
7 |
|
8 |
+
ckpt_path = (
|
9 |
+
"https://huggingface.co/city96/LTX-Video-gguf/blob/main/ltx-video-2b-v0.9-Q3_K_S.gguf"
|
10 |
+
)
|
11 |
+
transformer = LTXVideoTransformer3DModel.from_single_file(
|
12 |
+
ckpt_path,
|
13 |
+
quantization_config=GGUFQuantizationConfig(compute_dtype=torch.bfloat16),
|
14 |
+
torch_dtype=torch.bfloat16,
|
15 |
+
)
|
16 |
+
pipe = LTXPipeline.from_pretrained(
|
17 |
+
"Lightricks/LTX-Video",
|
18 |
+
transformer=transformer,
|
19 |
+
torch_dtype=torch.bfloat16,
|
20 |
+
)
|
21 |
t2v_pipe.to(device)
|
22 |
|
23 |
i2v_pipe = LTXImageToVideoPipeline.from_pipe(t2v_pipe)
|