Upload demo.py with huggingface_hub
Browse files
demo.py
CHANGED
|
@@ -5,7 +5,6 @@ import torch.nn as nn, torch, types
|
|
| 5 |
|
| 6 |
MODEL_DIR = "opendiffusionai/stablediffusionxl_t5"
|
| 7 |
|
| 8 |
-
|
| 9 |
pipe = DiffusionPipeline.from_pretrained(
|
| 10 |
MODEL_DIR, custom_pipeline=MODEL_DIR, use_safetensors=True,
|
| 11 |
torch_dtype=torch.bfloat16,
|
|
@@ -15,7 +14,8 @@ print("model initialized. Now moving to CUDA")
|
|
| 15 |
pipe.to("cuda")
|
| 16 |
|
| 17 |
print("Trying render now...")
|
| 18 |
-
|
| 19 |
images = pipe("a misty Tokyo alley at night",num_inference_steps=30).images
|
| 20 |
-
|
|
|
|
|
|
|
| 21 |
|
|
|
|
| 5 |
|
| 6 |
MODEL_DIR = "opendiffusionai/stablediffusionxl_t5"
|
| 7 |
|
|
|
|
| 8 |
pipe = DiffusionPipeline.from_pretrained(
|
| 9 |
MODEL_DIR, custom_pipeline=MODEL_DIR, use_safetensors=True,
|
| 10 |
torch_dtype=torch.bfloat16,
|
|
|
|
| 14 |
pipe.to("cuda")
|
| 15 |
|
| 16 |
print("Trying render now...")
|
|
|
|
| 17 |
images = pipe("a misty Tokyo alley at night",num_inference_steps=30).images
|
| 18 |
+
fname="save.png"
|
| 19 |
+
print(f"saving to {fname}")
|
| 20 |
+
images[0].save(fname)
|
| 21 |
|