Update all files for BitDance-14B-16x-diffusers
Browse files- test_bitdance.py +26 -0
test_bitdance.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import sys
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
|
| 4 |
+
import torch
|
| 5 |
+
from diffusers import DiffusionPipeline
|
| 6 |
+
|
| 7 |
+
model_path = Path(__file__).resolve().parent
|
| 8 |
+
sys.path.insert(0, str(model_path))
|
| 9 |
+
|
| 10 |
+
pipe = DiffusionPipeline.from_pretrained(
|
| 11 |
+
str(model_path),
|
| 12 |
+
custom_pipeline=str(model_path),
|
| 13 |
+
torch_dtype=torch.bfloat16,
|
| 14 |
+
)
|
| 15 |
+
pipe.to("cuda")
|
| 16 |
+
|
| 17 |
+
result = pipe(
|
| 18 |
+
prompt="A cinematic landscape photo of snowy mountains at sunrise.",
|
| 19 |
+
height=512,
|
| 20 |
+
width=512,
|
| 21 |
+
num_inference_steps=30,
|
| 22 |
+
guidance_scale=7.5,
|
| 23 |
+
show_progress_bar=True,
|
| 24 |
+
)
|
| 25 |
+
result.images[0].save("bitdance_14b_16x.png")
|
| 26 |
+
print("Saved bitdance_14b_16x.png")
|