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 ·
a76cfe3
1
Parent(s): 00e8857
Upload folder using huggingface_hub
Browse files
train.py
CHANGED
|
@@ -377,10 +377,7 @@ def main(
|
|
| 377 |
print("Loss:", loss)
|
| 378 |
|
| 379 |
# Backpropagate
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
with accelerator.scaler.scale_loss(loss) as scaled_loss:
|
| 383 |
-
scaled_loss.backward()
|
| 384 |
|
| 385 |
if accelerator.sync_gradients:
|
| 386 |
accelerator.clip_grad_norm_(unet.parameters(), max_grad_norm)
|
|
|
|
| 377 |
print("Loss:", loss)
|
| 378 |
|
| 379 |
# Backpropagate
|
| 380 |
+
accelerator.backward(loss)
|
|
|
|
|
|
|
|
|
|
| 381 |
|
| 382 |
if accelerator.sync_gradients:
|
| 383 |
accelerator.clip_grad_norm_(unet.parameters(), max_grad_norm)
|