Spaces:
Runtime error
Runtime error
noamelata
commited on
Commit
·
dbcbdf5
1
Parent(s):
9d761af
changed to full precision
Browse files
app.py
CHANGED
|
@@ -34,8 +34,12 @@ def run(prompt, outer, inner, random_seed, pipe):
|
|
| 34 |
if __name__ == "__main__":
|
| 35 |
scheduler = NestedScheduler(beta_start=0.00085, beta_end=0.012, beta_schedule="scaled_linear",
|
| 36 |
prediction_type='sample', clip_sample=False, set_alpha_to_one=False)
|
| 37 |
-
|
|
|
|
|
|
|
| 38 |
torch_dtype=torch.float16, scheduler=scheduler)
|
|
|
|
|
|
|
| 39 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 40 |
pipe.to(device)
|
| 41 |
interface = partial(run, pipe=pipe)
|
|
|
|
| 34 |
if __name__ == "__main__":
|
| 35 |
scheduler = NestedScheduler(beta_start=0.00085, beta_end=0.012, beta_schedule="scaled_linear",
|
| 36 |
prediction_type='sample', clip_sample=False, set_alpha_to_one=False)
|
| 37 |
+
fp16 = False
|
| 38 |
+
if fp16:
|
| 39 |
+
pipe = NestedStableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", revision="fp16",
|
| 40 |
torch_dtype=torch.float16, scheduler=scheduler)
|
| 41 |
+
else:
|
| 42 |
+
pipe = NestedStableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", scheduler=scheduler)
|
| 43 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 44 |
pipe.to(device)
|
| 45 |
interface = partial(run, pipe=pipe)
|