Spaces:
Runtime error
Runtime error
main
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import sys
|
2 |
import os
|
3 |
import torch
|
@@ -35,9 +36,10 @@ model_path = model_id
|
|
35 |
pipe = DiffusionPipeline.from_pretrained(model_path, torch_dtype=torch.float16)
|
36 |
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
|
37 |
#pipe.enable_model_cpu_offload()
|
|
|
38 |
|
|
|
39 |
def core(bundle):
|
40 |
-
|
41 |
generator = torch.Generator().manual_seed(int(bundle["seed"]))
|
42 |
result = pipe(
|
43 |
bundle=bundle,
|
|
|
1 |
+
import spaces
|
2 |
import sys
|
3 |
import os
|
4 |
import torch
|
|
|
36 |
pipe = DiffusionPipeline.from_pretrained(model_path, torch_dtype=torch.float16)
|
37 |
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
|
38 |
#pipe.enable_model_cpu_offload()
|
39 |
+
pipe.to('cuda')
|
40 |
|
41 |
+
@spaces.GPU
|
42 |
def core(bundle):
|
|
|
43 |
generator = torch.Generator().manual_seed(int(bundle["seed"]))
|
44 |
result = pipe(
|
45 |
bundle=bundle,
|