Commit
·
2f0087d
1
Parent(s):
b6badad
up
Browse files- run_local.py +5 -4
run_local.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
#!/usr/bin/env python3
|
| 2 |
from diffusers import StableDiffusionPipeline, DPMSolverSinglestepScheduler, DPMSolverMultistepScheduler, DEISMultistepScheduler, HeunDiscreteScheduler
|
| 3 |
import time
|
|
|
|
| 4 |
from huggingface_hub import HfApi
|
| 5 |
import torch
|
| 6 |
import sys
|
|
@@ -10,11 +11,11 @@ path = sys.argv[1]
|
|
| 10 |
|
| 11 |
api = HfApi()
|
| 12 |
start_time = time.time()
|
| 13 |
-
pipe = StableDiffusionPipeline.from_pretrained(path, torch_dtype=torch.float16, device_map="auto")
|
| 14 |
-
pipe.scheduler = HeunDiscreteScheduler.from_config(pipe.scheduler.config)
|
| 15 |
-
#pipe = StableDiffusionPipeline.from_pretrained(path, torch_dtype=torch.float16)
|
| 16 |
#pipe.scheduler = HeunDiscreteScheduler.from_config(pipe.scheduler.config)
|
| 17 |
-
|
|
|
|
|
|
|
| 18 |
|
| 19 |
prompt = "a highly realistic photo of green turtle"
|
| 20 |
generator = torch.Generator(device="cuda").manual_seed(0)
|
|
|
|
| 1 |
#!/usr/bin/env python3
|
| 2 |
from diffusers import StableDiffusionPipeline, DPMSolverSinglestepScheduler, DPMSolverMultistepScheduler, DEISMultistepScheduler, HeunDiscreteScheduler
|
| 3 |
import time
|
| 4 |
+
import os
|
| 5 |
from huggingface_hub import HfApi
|
| 6 |
import torch
|
| 7 |
import sys
|
|
|
|
| 11 |
|
| 12 |
api = HfApi()
|
| 13 |
start_time = time.time()
|
| 14 |
+
#pipe = StableDiffusionPipeline.from_pretrained(path, torch_dtype=torch.float16, device_map="auto")
|
|
|
|
|
|
|
| 15 |
#pipe.scheduler = HeunDiscreteScheduler.from_config(pipe.scheduler.config)
|
| 16 |
+
pipe = StableDiffusionPipeline.from_pretrained(path, torch_dtype=torch.float16)
|
| 17 |
+
pipe.scheduler = HeunDiscreteScheduler.from_config(pipe.scheduler.config)
|
| 18 |
+
pipe = pipe.to("cuda")
|
| 19 |
|
| 20 |
prompt = "a highly realistic photo of green turtle"
|
| 21 |
generator = torch.Generator(device="cuda").manual_seed(0)
|