Commit
·
e346f71
verified
·
0
Parent(s):
Duplicate from a-r-r-o-w/animatediff-motion-adapter-sdxl-beta
Browse filesCo-authored-by: Aryan V S <[email protected]>
- .gitattributes +35 -0
- README.md +58 -0
- config.json +15 -0
- diffusion_pytorch_model.fp16.safetensors +3 -0
- diffusion_pytorch_model.safetensors +3 -0
.gitattributes
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
library_name: diffusers
|
4 |
+
---
|
5 |
+
|
6 |
+
AnimateDiff original author checkpoints are available at: https://huggingface.co/guoyww
|
7 |
+
|
8 |
+
This checkpoint was converted to Diffusers format by [a-r-r-o-w](https://github.com/a-r-r-o-w/). You can find results and more details adding AnimateDiff SDXL support (beta) to 🤗 Diffusers [here](https://github.com/huggingface/diffusers/pull/6721) The following description is copied from [here](https://huggingface.co/guoyww/animatediff-motion-adapter-v1-5-2).
|
9 |
+
|
10 |
+
AnimateDiff is a method that allows you to create videos using pre-existing Stable Diffusion Text to Image models.
|
11 |
+
|
12 |
+
It achieves this by inserting motion module layers into a frozen text to image model and training it on video clips to extract a motion prior. These motion modules are applied after the ResNet and Attention blocks in the Stable Diffusion UNet. Their purpose is to introduce coherent motion across image frames. To support these modules we introduce the concepts of a MotionAdapter and UNetMotionModel. These serve as a convenient way to use these motion modules with existing Stable Diffusion models.
|
13 |
+
|
14 |
+
Note: The SDXL checkpoint for AnimateDiff is a beta version.
|
15 |
+
|
16 |
+
### Usage
|
17 |
+
|
18 |
+
```python
|
19 |
+
import torch
|
20 |
+
from diffusers import AnimateDiffSDXLPipeline
|
21 |
+
from diffusers.schedulers import DDIMScheduler, EulerDiscreteScheduler, DEISMultistepScheduler
|
22 |
+
from diffusers.models import MotionAdapter
|
23 |
+
from diffusers.utils import export_to_gif
|
24 |
+
|
25 |
+
model_id = "stabilityai/stable-diffusion-xl-base-1.0"
|
26 |
+
adapter = MotionAdapter.from_pretrained("guoyww/animatediff-motion-adapter-sdxl-beta", torch_dtype=torch.float16)
|
27 |
+
scheduler = DDIMScheduler.from_pretrained(
|
28 |
+
model_id,
|
29 |
+
subfolder="scheduler",
|
30 |
+
clip_sample=False,
|
31 |
+
timestep_spacing="linspace",
|
32 |
+
beta_schedule="linear",
|
33 |
+
steps_offset=1,
|
34 |
+
)
|
35 |
+
pipe = AnimateDiffSDXLPipeline.from_pretrained(
|
36 |
+
model_id,
|
37 |
+
motion_adapter=adapter,
|
38 |
+
scheduler=scheduler,
|
39 |
+
torch_dtype=torch.float16,
|
40 |
+
variant="fp16",
|
41 |
+
).to("cuda")
|
42 |
+
|
43 |
+
# enable memory savings
|
44 |
+
pipe.enable_vae_slicing()
|
45 |
+
pipe.enable_vae_tiling()
|
46 |
+
|
47 |
+
result = pipe(
|
48 |
+
prompt="a panda surfing in the ocean, realistic, hyperrealism, high quality",
|
49 |
+
negative_prompt="low quality, worst quality",
|
50 |
+
num_inference_steps=20,
|
51 |
+
guidance_scale=8,
|
52 |
+
width=1024,
|
53 |
+
height=1024,
|
54 |
+
num_frames=16,
|
55 |
+
)
|
56 |
+
|
57 |
+
export_to_gif(result.frames[0], "animation.gif")
|
58 |
+
```
|
config.json
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_class_name": "MotionAdapter",
|
3 |
+
"_diffusers_version": "0.26.0.dev0",
|
4 |
+
"block_out_channels": [
|
5 |
+
320,
|
6 |
+
640,
|
7 |
+
1280
|
8 |
+
],
|
9 |
+
"motion_layers_per_block": 2,
|
10 |
+
"motion_max_seq_length": 32,
|
11 |
+
"motion_mid_block_layers_per_block": 1,
|
12 |
+
"motion_norm_num_groups": 32,
|
13 |
+
"motion_num_attention_heads": 8,
|
14 |
+
"use_motion_mid_block": false
|
15 |
+
}
|
diffusion_pytorch_model.fp16.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:24c3c5f48006ce2ce7b06188622865c620b2d33db23b1af671cc1f21716b5826
|
3 |
+
size 474328896
|
diffusion_pytorch_model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ff83626d91ee729c4352dd29bffca4f2cc3fd2a52999998764c35736a2ca4695
|
3 |
+
size 948604184
|