Spaces:
Runtime error
Runtime error
root
commited on
Commit
•
3d40215
1
Parent(s):
1b794fb
Adjust the layout
Browse files- app.py +14 -11
- ui_functions.py +2 -1
app.py
CHANGED
@@ -268,7 +268,7 @@ if __name__ == "__main__":
|
|
268 |
|
269 |
gallery = gr.Gallery(
|
270 |
label="Generated images", show_label=False, elem_id="gallery"
|
271 |
-
).style(grid=[2]
|
272 |
|
273 |
with gr.Row().style(mobile_collapse=False, equal_height=True):
|
274 |
img_choices = gr.Dropdown(["图片1(img1)"],label='请选择一张图片发送到图生图或者超分',show_label=True,value="图片1(img1)")
|
@@ -281,13 +281,17 @@ if __name__ == "__main__":
|
|
281 |
margin=False,
|
282 |
rounded=(True, True, True, True),
|
283 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
284 |
with gr.Row():
|
285 |
move_prompt_zh = gr.Markdown("请移至图生图部分进行编辑(拉到顶部)", visible=False)
|
286 |
with gr.Row():
|
287 |
move_prompt_en = gr.Markdown("Please move to the img2img section for editing(Pull to the top)", visible=False)
|
288 |
-
sr_gallery = gr.Gallery(
|
289 |
-
label="SR images", show_label=True, elem_id="sr_gallery"
|
290 |
-
).style(grid=[2], height="auto")
|
291 |
|
292 |
|
293 |
|
@@ -344,11 +348,7 @@ if __name__ == "__main__":
|
|
344 |
visible=False,
|
345 |
image_mode="RGBA",
|
346 |
elem_id="img2img_editor"
|
347 |
-
)
|
348 |
-
with gr.Row():
|
349 |
-
gr.Markdown('请选择一张图像掩盖掉一部分区域,并输入文本描述')
|
350 |
-
with gr.Row():
|
351 |
-
gr.Markdown('Please select an image to cover up a part of the area and enter a text description.')
|
352 |
with gr.Tabs(visible=False):
|
353 |
with gr.TabItem("编辑设置"):
|
354 |
with gr.Row():
|
@@ -405,7 +405,10 @@ if __name__ == "__main__":
|
|
405 |
inputs=output_img2img_seed, outputs=[],
|
406 |
_js=call_JS("gradioInputToClipboard"), fn=None, show_progress=False)
|
407 |
output_img2img_stats = gr.HTML(label='Stats')
|
408 |
-
|
|
|
|
|
|
|
409 |
gr.Markdown('# 编辑设置',visible=False)
|
410 |
|
411 |
with gr.Row(visible=False):
|
@@ -480,7 +483,7 @@ if __name__ == "__main__":
|
|
480 |
output_txt2img_copy_to_input_btn.click(
|
481 |
uifn.copy_img_to_input,
|
482 |
[gallery, img_choices],
|
483 |
-
[tabs, img2img_image_editor, img2img_image_mask, move_prompt_zh, move_prompt_en],
|
484 |
)
|
485 |
|
486 |
# go_to_img2img_btn.click(
|
|
|
268 |
|
269 |
gallery = gr.Gallery(
|
270 |
label="Generated images", show_label=False, elem_id="gallery"
|
271 |
+
).style(grid=[2,2])
|
272 |
|
273 |
with gr.Row().style(mobile_collapse=False, equal_height=True):
|
274 |
img_choices = gr.Dropdown(["图片1(img1)"],label='请选择一张图片发送到图生图或者超分',show_label=True,value="图片1(img1)")
|
|
|
281 |
margin=False,
|
282 |
rounded=(True, True, True, True),
|
283 |
)
|
284 |
+
|
285 |
+
sr_gallery = gr.Gallery(
|
286 |
+
label="SR images", show_label=True, elem_id="sr_gallery"
|
287 |
+
).style(grid=[2,2])
|
288 |
+
|
289 |
+
with gr.Row():
|
290 |
+
prompt = gr.Markdown("提示(Prompt):", visible=False)
|
291 |
with gr.Row():
|
292 |
move_prompt_zh = gr.Markdown("请移至图生图部分进行编辑(拉到顶部)", visible=False)
|
293 |
with gr.Row():
|
294 |
move_prompt_en = gr.Markdown("Please move to the img2img section for editing(Pull to the top)", visible=False)
|
|
|
|
|
|
|
295 |
|
296 |
|
297 |
|
|
|
348 |
visible=False,
|
349 |
image_mode="RGBA",
|
350 |
elem_id="img2img_editor"
|
351 |
+
).style(grid=[4,4,4])
|
|
|
|
|
|
|
|
|
352 |
with gr.Tabs(visible=False):
|
353 |
with gr.TabItem("编辑设置"):
|
354 |
with gr.Row():
|
|
|
405 |
inputs=output_img2img_seed, outputs=[],
|
406 |
_js=call_JS("gradioInputToClipboard"), fn=None, show_progress=False)
|
407 |
output_img2img_stats = gr.HTML(label='Stats')
|
408 |
+
with gr.Row():
|
409 |
+
gr.Markdown('请选择一张图像掩盖掉一部分区域,并输入文本描述')
|
410 |
+
with gr.Row():
|
411 |
+
gr.Markdown('Please select an image to cover up a part of the area and enter a text description.')
|
412 |
gr.Markdown('# 编辑设置',visible=False)
|
413 |
|
414 |
with gr.Row(visible=False):
|
|
|
483 |
output_txt2img_copy_to_input_btn.click(
|
484 |
uifn.copy_img_to_input,
|
485 |
[gallery, img_choices],
|
486 |
+
[tabs, img2img_image_editor, img2img_image_mask, move_prompt_zh, move_prompt_en, prompt],
|
487 |
)
|
488 |
|
489 |
# go_to_img2img_btn.click(
|
ui_functions.py
CHANGED
@@ -102,7 +102,8 @@ def copy_img_to_input(img, idx):
|
|
102 |
img_update = gr.update(value=processed_image)
|
103 |
move_prompt_zh_update = gr.update(visible=True)
|
104 |
move_prompt_en_update = gr.update(visible=True)
|
105 |
-
|
|
|
106 |
except IndexError:
|
107 |
return [None, None]
|
108 |
|
|
|
102 |
img_update = gr.update(value=processed_image)
|
103 |
move_prompt_zh_update = gr.update(visible=True)
|
104 |
move_prompt_en_update = gr.update(visible=True)
|
105 |
+
prompt_update = gr.update(visible=True)
|
106 |
+
return tab_update,processed_image, processed_image, move_prompt_zh_update, prompt_update,
|
107 |
except IndexError:
|
108 |
return [None, None]
|
109 |
|