Hermes Bot commited on
Commit ·
6b891b0
1
Parent(s): 26f5a9f
Adjust Gallery UI: full-width gallery, stacked metadata and drag‑and‑drop, enable overwrite
Browse files- ui/layout.py +10 -12
ui/layout.py
CHANGED
|
@@ -100,18 +100,16 @@ def build_ui(event_handler_function):
|
|
| 100 |
clear_btn = gr.Button("Clear Gallery", variant="secondary")
|
| 101 |
download_btn = gr.Button("Download All", variant="secondary")
|
| 102 |
# Gallery and metadata side by side.
|
| 103 |
-
with gr.
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
info_upload = gr.File(label="Drag image here for info", file_count="single", type="filepath")
|
| 114 |
-
ui_components["info_upload"] = info_upload
|
| 115 |
# Hidden file component for zip download.
|
| 116 |
download_file = gr.File(label="Download", visible=False)
|
| 117 |
# Bind buttons.
|
|
|
|
| 100 |
clear_btn = gr.Button("Clear Gallery", variant="secondary")
|
| 101 |
download_btn = gr.Button("Download All", variant="secondary")
|
| 102 |
# Gallery and metadata side by side.
|
| 103 |
+
with gr.Column(scale=1):
|
| 104 |
+
# Main gallery component (full width).
|
| 105 |
+
gallery = gr.Gallery(label="Generated Images", show_label=False, columns=4, height="auto", type="filepath")
|
| 106 |
+
ui_components["gallery"] = gallery
|
| 107 |
+
# Textbox to show generation info for selected image.
|
| 108 |
+
metadata_box = gr.Textbox(label="Generation info", lines=4, interactive=False)
|
| 109 |
+
ui_components["gallery_metadata"] = metadata_box
|
| 110 |
+
# Drag-and-drop file component for extracting generation info (replace previous upload automatically).
|
| 111 |
+
info_upload = gr.File(label="Drag image here for info", file_count="single", type="filepath", interactive=True)
|
| 112 |
+
ui_components["info_upload"] = info_upload
|
|
|
|
|
|
|
| 113 |
# Hidden file component for zip download.
|
| 114 |
download_file = gr.File(label="Download", visible=False)
|
| 115 |
# Bind buttons.
|