Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -743,6 +743,9 @@ def generate_image(
|
|
| 743 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 744 |
torch_device = torch.device(device)
|
| 745 |
|
|
|
|
|
|
|
|
|
|
| 746 |
if do_img2img and init_image is not None:
|
| 747 |
init_image = get_image(init_image)
|
| 748 |
if resize_img:
|
|
|
|
| 743 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 744 |
torch_device = torch.device(device)
|
| 745 |
|
| 746 |
+
global model
|
| 747 |
+
model = model.to(torch_device)
|
| 748 |
+
|
| 749 |
if do_img2img and init_image is not None:
|
| 750 |
init_image = get_image(init_image)
|
| 751 |
if resize_img:
|