Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
pipeline_tag: text-to-video
|
3 |
+
library_name: diffusers
|
4 |
+
tags:
|
5 |
+
- text-to-video
|
6 |
+
- image-to-video
|
7 |
+
---
|
8 |
+
|
9 |
+
Unofficial Diffusers-format weights for https://huggingface.co/Lightricks/LTX-Video (version 0.9.1).
|
10 |
+
|
11 |
+
Text-to-Video:
|
12 |
+
|
13 |
+
```python
|
14 |
+
import torch
|
15 |
+
from diffusers import LTXPipeline
|
16 |
+
from diffusers.utils import export_to_video
|
17 |
+
|
18 |
+
pipe = LTXPipeline.from_pretrained("a-r-r-o-w/LTX-Video-0.9.1-diffusers", torch_dtype=torch.bfloat16)
|
19 |
+
pipe.to("cuda")
|
20 |
+
|
21 |
+
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"
|
22 |
+
negative_prompt = "worst quality, inconsistent motion, blurry, jittery, distorted"
|
23 |
+
|
24 |
+
video = pipe(
|
25 |
+
prompt=prompt,
|
26 |
+
negative_prompt=negative_prompt,
|
27 |
+
width=704,
|
28 |
+
height=480,
|
29 |
+
num_frames=161,
|
30 |
+
num_inference_steps=50,
|
31 |
+
decode_timestep=0.03,
|
32 |
+
decode_noise_scale=0.025,
|
33 |
+
).frames[0]
|
34 |
+
export_to_video(video, "output.mp4", fps=24)
|
35 |
+
```
|
36 |
+
|
37 |
+
Image-to-Video:
|
38 |
+
|
39 |
+
```python
|
40 |
+
import torch
|
41 |
+
from diffusers import LTXImageToVideoPipeline
|
42 |
+
from diffusers.utils import export_to_video, load_image
|
43 |
+
|
44 |
+
pipe = LTXImageToVideoPipeline.from_pretrained("a-r-r-o-w/LTX-Video-0.9.1-diffusers", torch_dtype=torch.bfloat16)
|
45 |
+
pipe.to("cuda")
|
46 |
+
|
47 |
+
image = load_image(
|
48 |
+
"https://huggingface.co/datasets/a-r-r-o-w/tiny-meme-dataset-captioned/resolve/main/images/8.png"
|
49 |
+
)
|
50 |
+
prompt = "A young girl stands calmly in the foreground, looking directly at the camera, as a house fire rages in the background. Flames engulf the structure, with smoke billowing into the air. Firefighters in protective gear rush to the scene, a fire truck labeled '38' visible behind them. The girl's neutral expression contrasts sharply with the chaos of the fire, creating a poignant and emotionally charged scene."
|
51 |
+
negative_prompt = "worst quality, inconsistent motion, blurry, jittery, distorted"
|
52 |
+
|
53 |
+
video = pipe(
|
54 |
+
image=image,
|
55 |
+
prompt=prompt,
|
56 |
+
negative_prompt=negative_prompt,
|
57 |
+
width=704,
|
58 |
+
height=480,
|
59 |
+
num_frames=161,
|
60 |
+
num_inference_steps=50,
|
61 |
+
decode_timestep=0.03,
|
62 |
+
decode_noise_scale=0.025,
|
63 |
+
).frames[0]
|
64 |
+
export_to_video(video, "output.mp4", fps=24)
|
65 |
+
```
|