Spaces:
Sleeping
Sleeping
Commit
·
7bff278
1
Parent(s):
af3627e
up 6
Browse files
app.py
CHANGED
@@ -29,8 +29,7 @@ def predict(input_img1,
|
|
29 |
# input_img1 = Image.fromarray(input_img1)
|
30 |
# input_img2 = Image.fromarray(input_img2)
|
31 |
|
32 |
-
config.
|
33 |
-
config.HEIGHT = resolution
|
34 |
|
35 |
input_img1 = input_img1.resize((config.WIDTH, config.HEIGHT))
|
36 |
input_img2 = input_img2.resize((config.WIDTH, config.HEIGHT))
|
@@ -59,10 +58,10 @@ app = gr.Interface(
|
|
59 |
predict,
|
60 |
inputs=[gr.Image(label="img", sources=['upload'], type="pil"),
|
61 |
gr.Image(label="mask", sources=['upload'], type="pil"),
|
62 |
-
gr.Textbox(label="positive_prompt"),
|
63 |
-
gr.Textbox(label="negative_prompt"),
|
64 |
-
gr.Number(label="num_of_images"),
|
65 |
-
gr.Number(label="resolution")
|
66 |
],
|
67 |
outputs= [
|
68 |
gr.Image(label="resp0"),
|
|
|
29 |
# input_img1 = Image.fromarray(input_img1)
|
30 |
# input_img2 = Image.fromarray(input_img2)
|
31 |
|
32 |
+
config.setResoluton(resolution)
|
|
|
33 |
|
34 |
input_img1 = input_img1.resize((config.WIDTH, config.HEIGHT))
|
35 |
input_img2 = input_img2.resize((config.WIDTH, config.HEIGHT))
|
|
|
58 |
predict,
|
59 |
inputs=[gr.Image(label="img", sources=['upload'], type="pil"),
|
60 |
gr.Image(label="mask", sources=['upload'], type="pil"),
|
61 |
+
gr.Textbox(label="positive_prompt",value="empty room"),
|
62 |
+
gr.Textbox(label="negative_prompt",value=""),
|
63 |
+
gr.Number(label="num_of_images",value=2),
|
64 |
+
gr.Number(label="resolution",value=512)
|
65 |
],
|
66 |
outputs= [
|
67 |
gr.Image(label="resp0"),
|
config.py
CHANGED
@@ -7,6 +7,10 @@ HEIGHT = 512
|
|
7 |
WIDTH = 512
|
8 |
#
|
9 |
|
|
|
|
|
|
|
|
|
10 |
|
11 |
def to_rgb(color: str) -> tuple:
|
12 |
"""Convert hex color to rgb.
|
|
|
7 |
WIDTH = 512
|
8 |
#
|
9 |
|
10 |
+
def setResoluton(res):
|
11 |
+
global HEIGHT, WIDTH
|
12 |
+
HEIGHT = res
|
13 |
+
WIDTH = res
|
14 |
|
15 |
def to_rgb(color: str) -> tuple:
|
16 |
"""Convert hex color to rgb.
|