Instructions to use bluestarburst/AnimateDiff-SceneFusion with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use bluestarburst/AnimateDiff-SceneFusion with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("bluestarburst/AnimateDiff-SceneFusion", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Commit ·
2057037
1
Parent(s): f248e7b
Upload folder using huggingface_hub
Browse files
animatediff/models/motion_module.py
CHANGED
|
@@ -290,7 +290,7 @@ class VersatileAttention(CrossAttention):
|
|
| 290 |
|
| 291 |
query = self.to_q(hidden_states)
|
| 292 |
dim = query.shape[-1]
|
| 293 |
-
query = self.
|
| 294 |
|
| 295 |
if self.added_kv_proj_dim is not None:
|
| 296 |
raise NotImplementedError
|
|
@@ -299,8 +299,8 @@ class VersatileAttention(CrossAttention):
|
|
| 299 |
key = self.to_k(encoder_hidden_states)
|
| 300 |
value = self.to_v(encoder_hidden_states)
|
| 301 |
|
| 302 |
-
key = self.
|
| 303 |
-
value = self.
|
| 304 |
|
| 305 |
if attention_mask is not None:
|
| 306 |
if attention_mask.shape[-1] != query.shape[1]:
|
|
|
|
| 290 |
|
| 291 |
query = self.to_q(hidden_states)
|
| 292 |
dim = query.shape[-1]
|
| 293 |
+
query = self.head_to_batch_dim(query)
|
| 294 |
|
| 295 |
if self.added_kv_proj_dim is not None:
|
| 296 |
raise NotImplementedError
|
|
|
|
| 299 |
key = self.to_k(encoder_hidden_states)
|
| 300 |
value = self.to_v(encoder_hidden_states)
|
| 301 |
|
| 302 |
+
key = self.head_to_batch_dim(key)
|
| 303 |
+
value = self.head_to_batch_dim(value)
|
| 304 |
|
| 305 |
if attention_mask is not None:
|
| 306 |
if attention_mask.shape[-1] != query.shape[1]:
|