Update README.md
Browse files
README.md
CHANGED
@@ -1,198 +1,111 @@
|
|
1 |
---
|
|
|
|
|
2 |
library_name: diffusers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
4 |
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
95 |
-
|
96 |
-
#### Speeds, Sizes, Times [optional]
|
97 |
-
|
98 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
99 |
-
|
100 |
-
[More Information Needed]
|
101 |
-
|
102 |
-
## Evaluation
|
103 |
-
|
104 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
105 |
-
|
106 |
-
### Testing Data, Factors & Metrics
|
107 |
-
|
108 |
-
#### Testing Data
|
109 |
-
|
110 |
-
<!-- This should link to a Dataset Card if possible. -->
|
111 |
-
|
112 |
-
[More Information Needed]
|
113 |
-
|
114 |
-
#### Factors
|
115 |
-
|
116 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
117 |
-
|
118 |
-
[More Information Needed]
|
119 |
-
|
120 |
-
#### Metrics
|
121 |
-
|
122 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
123 |
-
|
124 |
-
[More Information Needed]
|
125 |
-
|
126 |
-
### Results
|
127 |
-
|
128 |
-
[More Information Needed]
|
129 |
-
|
130 |
-
#### Summary
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
## Model Examination [optional]
|
135 |
-
|
136 |
-
<!-- Relevant interpretability work for the model goes here -->
|
137 |
-
|
138 |
-
[More Information Needed]
|
139 |
-
|
140 |
-
## Environmental Impact
|
141 |
-
|
142 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
143 |
-
|
144 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
145 |
-
|
146 |
-
- **Hardware Type:** [More Information Needed]
|
147 |
-
- **Hours used:** [More Information Needed]
|
148 |
-
- **Cloud Provider:** [More Information Needed]
|
149 |
-
- **Compute Region:** [More Information Needed]
|
150 |
-
- **Carbon Emitted:** [More Information Needed]
|
151 |
-
|
152 |
-
## Technical Specifications [optional]
|
153 |
-
|
154 |
-
### Model Architecture and Objective
|
155 |
-
|
156 |
-
[More Information Needed]
|
157 |
-
|
158 |
-
### Compute Infrastructure
|
159 |
-
|
160 |
-
[More Information Needed]
|
161 |
-
|
162 |
-
#### Hardware
|
163 |
-
|
164 |
-
[More Information Needed]
|
165 |
-
|
166 |
-
#### Software
|
167 |
-
|
168 |
-
[More Information Needed]
|
169 |
-
|
170 |
-
## Citation [optional]
|
171 |
-
|
172 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
173 |
-
|
174 |
-
**BibTeX:**
|
175 |
-
|
176 |
-
[More Information Needed]
|
177 |
-
|
178 |
-
**APA:**
|
179 |
-
|
180 |
-
[More Information Needed]
|
181 |
-
|
182 |
-
## Glossary [optional]
|
183 |
-
|
184 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
185 |
-
|
186 |
-
[More Information Needed]
|
187 |
-
|
188 |
-
## More Information [optional]
|
189 |
-
|
190 |
-
[More Information Needed]
|
191 |
-
|
192 |
-
## Model Card Authors [optional]
|
193 |
-
|
194 |
-
[More Information Needed]
|
195 |
-
|
196 |
-
## Model Card Contact
|
197 |
-
|
198 |
-
[More Information Needed]
|
|
|
1 |
---
|
2 |
+
base_model: THUDM/CogVideoX-5b
|
3 |
+
datasets: finetrainers/3dgs-dissolve
|
4 |
library_name: diffusers
|
5 |
+
license: other
|
6 |
+
license_link: https://huggingface.co/THUDM/CogVideoX-5b/blob/main/LICENSE
|
7 |
+
instance_prompt: 3D_dissolve In a 3D appearance, a small bicycle is seen surrounded by a burst of fiery sparks, creating a dramatic and intense visual effect against the dark background. The video showcases a dynamic explosion of fiery particles in a 3D appearance, with sparks and embers scattering across the screen against a stark black background.
|
8 |
+
widget:
|
9 |
+
- text: 3D_dissolve In a 3D appearance, a small bicycle is seen surrounded by a burst of fiery sparks, creating a dramatic and intense visual effect against the dark background. The video showcases a dynamic explosion of fiery particles in a 3D appearance, with sparks and embers scattering across the screen against a stark black background.
|
10 |
+
output:
|
11 |
+
url: "./assets/output_0.mp4"
|
12 |
+
- text: 3D_dissolve In a 3D appearance, a bookshelf filled with books is surrounded by a burst of red sparks, creating a dramatic and explosive effect against a black background.
|
13 |
+
output:
|
14 |
+
url: "./assets/output_1.mp4"
|
15 |
+
tags:
|
16 |
+
- text-to-video
|
17 |
+
- diffusers-training
|
18 |
+
- diffusers
|
19 |
+
- cogvideox
|
20 |
+
- cogvideox-diffusers
|
21 |
+
- template:sd-lora
|
22 |
---
|
23 |
|
24 |
+
<Gallery />
|
25 |
+
|
26 |
+
This is a fine-tune of the [THUDM/CogVideoX-5b](https://huggingface.co/THUDM/CogVideoX-5b) model on the
|
27 |
+
[finetrainers/3dgs-dissolve](https://huggingface.co/datasets/finetrainers/3dgs-dissolve) dataset. We also provide
|
28 |
+
a LoRA variant of the params. Check it out [here](#lora).
|
29 |
+
|
30 |
+
Code: https://github.com/a-r-r-o-w/finetrainers
|
31 |
+
|
32 |
+
> [!IMPORTANT]
|
33 |
+
> This is an experimental checkpoint and its poor generalization is well-known.
|
34 |
+
|
35 |
+
Inference code:
|
36 |
+
|
37 |
+
```py
|
38 |
+
from diffusers import CogVideoXTransformer3DModel, DiffusionPipeline
|
39 |
+
from diffusers.utils import export_to_video
|
40 |
+
import torch
|
41 |
+
|
42 |
+
transformer = CogVideoXTransformer3DModel.from_pretrained(
|
43 |
+
"finetrainers/3dgs-v0", torch_dtype=torch.bfloat16
|
44 |
+
)
|
45 |
+
pipeline = DiffusionPipeline.from_pretrained(
|
46 |
+
"THUDM/CogVideoX-5b", transformer=transformer, torch_dtype=torch.bfloat16
|
47 |
+
).to("cuda")
|
48 |
+
|
49 |
+
prompt = """
|
50 |
+
3D_dissolve In a 3D appearance, a bookshelf filled with books is surrounded by a burst of red sparks, creating a dramatic and explosive effect against a black background.
|
51 |
+
"""
|
52 |
+
negative_prompt = "inconsistent motion, blurry motion, worse quality, degenerate outputs, deformed outputs"
|
53 |
+
|
54 |
+
video = pipeline(
|
55 |
+
prompt=prompt,
|
56 |
+
negative_prompt=negative_prompt,
|
57 |
+
num_frames=81,
|
58 |
+
height=512,
|
59 |
+
width=768,
|
60 |
+
num_inference_steps=50
|
61 |
+
).frames[0]
|
62 |
+
export_to_video(video, "output.mp4", fps=25)
|
63 |
+
```
|
64 |
+
|
65 |
+
Training logs are available on WandB [here](https://wandb.ai/sayakpaul/finetrainers-cogvideox/runs/ngcsyhom).
|
66 |
+
|
67 |
+
## LoRA
|
68 |
+
|
69 |
+
We extracted a 64-rank LoRA from the finetuned checkpoint
|
70 |
+
(script [here](https://github.com/huggingface/diffusers/blob/main/scripts/extract_lora_from_model.py)).
|
71 |
+
[This LoRA](./extracted_3dgs_lora_64.safetensors) can be used to emulate the same kind of effect:
|
72 |
+
|
73 |
+
<details>
|
74 |
+
<summary>Code</summary>
|
75 |
+
|
76 |
+
```py
|
77 |
+
from diffusers import DiffusionPipeline
|
78 |
+
from diffusers.utils import export_to_video
|
79 |
+
import torch
|
80 |
+
|
81 |
+
pipeline = DiffusionPipeline.from_pretrained("THUDM/CogVideoX-5b", torch_dtype=torch.bfloat16).to("cuda")
|
82 |
+
pipeline.load_lora_weights("/fsx/sayak/finetrainers/cogvideox-crush/extracted_crush_smol_lora_64.safetensors", adapter_name="crush")
|
83 |
+
pipeline.load_lora_weights("/fsx/sayak/finetrainers/cogvideox-3dgs/extracted_3dgs_lora_64.safetensors", adapter_name="3dgs")
|
84 |
+
pipeline
|
85 |
+
|
86 |
+
prompts = ["""
|
87 |
+
In a 3D appearance, a small bicycle is seen surrounded by a burst of fiery sparks, creating a dramatic and intense visual effect against the dark background.
|
88 |
+
The video showcases a dynamic explosion of fiery particles in a 3D appearance, with sparks and embers scattering across the screen against a stark black background.
|
89 |
+
""",
|
90 |
+
"""
|
91 |
+
In a 3D appearance, a bookshelf filled with books is surrounded by a burst of red sparks, creating a dramatic and explosive effect against a black background.
|
92 |
+
""",
|
93 |
+
]
|
94 |
+
negative_prompt = "inconsistent motion, blurry motion, worse quality, degenerate outputs, deformed outputs, bad physique"
|
95 |
+
id_token = "3D_dissolve"
|
96 |
+
|
97 |
+
for i, prompt in enumerate(prompts):
|
98 |
+
video = pipeline(
|
99 |
+
prompt=f"{id_token} {prompt}",
|
100 |
+
negative_prompt=negative_prompt,
|
101 |
+
num_frames=81,
|
102 |
+
height=512,
|
103 |
+
width=768,
|
104 |
+
num_inference_steps=50,
|
105 |
+
generator=torch.manual_seed(0)
|
106 |
+
).frames[0]
|
107 |
+
export_to_video(video, f"output_{i}.mp4", fps=25)
|
108 |
+
|
109 |
+
```
|
110 |
+
|
111 |
+
</details>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|