Spaces:
Paused
Paused
P01yH3dr0n
commited on
Commit
•
8d49805
1
Parent(s):
1fd92f0
Update app.py
Browse files
app.py
CHANGED
@@ -104,16 +104,16 @@ def generate(prompt, quality_tags, neg_prompt, seed, scale, width, height, steps
|
|
104 |
i2i_image, i2i_str, i2i_noise
|
105 |
)
|
106 |
if not isinstance(img_data, bytes):
|
107 |
-
return
|
108 |
today_count += 1
|
109 |
img = image_from_bytes(img_data)
|
110 |
filename = str(today_count).rjust(5, '0') + '-' + str(payload['parameters']['seed']) + '.png'
|
111 |
-
return
|
112 |
|
113 |
|
114 |
def preview_ui():
|
115 |
with gr.Blocks(css='#preview_image { height: 100%;}'):
|
116 |
-
image = gr.
|
117 |
info = gr.JSON(value={}, label="Submitted Payload")
|
118 |
return image, info
|
119 |
|
|
|
104 |
i2i_image, i2i_str, i2i_noise
|
105 |
)
|
106 |
if not isinstance(img_data, bytes):
|
107 |
+
return None, payload
|
108 |
today_count += 1
|
109 |
img = image_from_bytes(img_data)
|
110 |
filename = str(today_count).rjust(5, '0') + '-' + str(payload['parameters']['seed']) + '.png'
|
111 |
+
return gr.Image(value=img, label=filename), payload
|
112 |
|
113 |
|
114 |
def preview_ui():
|
115 |
with gr.Blocks(css='#preview_image { height: 100%;}'):
|
116 |
+
image = gr.Image(elem_id='preview_image', interactive=False, type='pil')
|
117 |
info = gr.JSON(value={}, label="Submitted Payload")
|
118 |
return image, info
|
119 |
|