Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ import cv2
|
|
3 |
from PIL import Image
|
4 |
import numpy as np
|
5 |
|
6 |
-
|
7 |
from diffusers import StableDiffusionControlNetPipeline, ControlNetModel, UniPCMultistepScheduler
|
8 |
from diffusers.utils import load_image
|
9 |
import torch
|
@@ -14,7 +14,7 @@ from random import randrange
|
|
14 |
|
15 |
transformers.utils.move_cache()
|
16 |
|
17 |
-
device = torch.device("cuda
|
18 |
|
19 |
base_model_id = "runwayml/stable-diffusion-v1-5"
|
20 |
model_id = "LuyangZ/FloorAI"
|
@@ -86,7 +86,7 @@ def clean_img(image, mask):
|
|
86 |
image = Image.fromarray(image).convert('RGB')
|
87 |
return image
|
88 |
|
89 |
-
|
90 |
def floorplan_generation(outline, num_of_rooms):
|
91 |
new_width = 512
|
92 |
new_height = 512
|
|
|
3 |
from PIL import Image
|
4 |
import numpy as np
|
5 |
|
6 |
+
import spaces
|
7 |
from diffusers import StableDiffusionControlNetPipeline, ControlNetModel, UniPCMultistepScheduler
|
8 |
from diffusers.utils import load_image
|
9 |
import torch
|
|
|
14 |
|
15 |
transformers.utils.move_cache()
|
16 |
|
17 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
18 |
|
19 |
base_model_id = "runwayml/stable-diffusion-v1-5"
|
20 |
model_id = "LuyangZ/FloorAI"
|
|
|
86 |
image = Image.fromarray(image).convert('RGB')
|
87 |
return image
|
88 |
|
89 |
+
@spaces.GPU
|
90 |
def floorplan_generation(outline, num_of_rooms):
|
91 |
new_width = 512
|
92 |
new_height = 512
|