Spaces:
Runtime error
Runtime error
test
Browse files
app.py
CHANGED
@@ -66,14 +66,11 @@ def img2img_generate(source_img, prompt, steps=25, strength=0.75, seed=42, guida
|
|
66 |
img_io = BytesIO(img_byte) # convert image to file-like object
|
67 |
img = Image.open(img_io) # img is now PIL Image object
|
68 |
print("elapsed time: ", time.time() - start_time)
|
69 |
-
|
70 |
-
if queue_size
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
return [img, gr.update(visible=True), gr.update(visible=False)]
|
75 |
-
else:
|
76 |
-
return [img, gr.update(visible=True), gr.update(visible=False)]
|
77 |
|
78 |
|
79 |
def txt2img_generate(prompt, steps=25, seed=42, guidance_scale=7.5):
|
@@ -103,13 +100,12 @@ def txt2img_generate(prompt, steps=25, seed=42, guidance_scale=7.5):
|
|
103 |
img = Image.open(img_io) # img is now PIL Image object
|
104 |
print("elapsed time: ", time.time() - start_time)
|
105 |
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
return [img, gr.update(visible=True), gr.update(visible=False)]
|
113 |
|
114 |
|
115 |
md = """
|
|
|
66 |
img_io = BytesIO(img_byte) # convert image to file-like object
|
67 |
img = Image.open(img_io) # img is now PIL Image object
|
68 |
print("elapsed time: ", time.time() - start_time)
|
69 |
+
|
70 |
+
if int(queue_size) > 4:
|
71 |
+
return [img, gr.update(visible=False), gr.update(visible=True)]
|
72 |
+
elif int(queue_size) <= 4:
|
73 |
+
return [img, gr.update(visible=True), gr.update(visible=False)]
|
|
|
|
|
|
|
74 |
|
75 |
|
76 |
def txt2img_generate(prompt, steps=25, seed=42, guidance_scale=7.5):
|
|
|
100 |
img = Image.open(img_io) # img is now PIL Image object
|
101 |
print("elapsed time: ", time.time() - start_time)
|
102 |
|
103 |
+
|
104 |
+
if int(queue_size) > 4:
|
105 |
+
return [img, gr.update(visible=False), gr.update(visible=True)]
|
106 |
+
elif int(queue_size) <= 4:
|
107 |
+
return [img, gr.update(visible=True), gr.update(visible=False)]
|
108 |
+
|
|
|
109 |
|
110 |
|
111 |
md = """
|