Spaces:
Runtime error
Runtime error
Commit
·
fe96c20
1
Parent(s):
7199bd5
Improve page layout
Browse files
app.py
CHANGED
|
@@ -145,40 +145,44 @@ with gr.Blocks() as demo:
|
|
| 145 |
<h2><b>First:</b> Build a Card Template</h2>
|
| 146 |
</div>""")
|
| 147 |
with gr.Row():
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
</div>""")
|
| 154 |
-
|
| 155 |
-
border_gallery = gr.Gallery(label = "Card Template Gallery",
|
| 156 |
-
scale = 2,
|
| 157 |
-
value = u.index_image_paths("Drakosfire/CardGenerator", "seed_images/card_templates"),
|
| 158 |
-
show_label = True,
|
| 159 |
-
columns = [3], rows = [3],
|
| 160 |
-
object_fit = "contain",
|
| 161 |
-
height = "auto",
|
| 162 |
-
elem_id = "Template Gallery")
|
| 163 |
-
|
| 164 |
-
gr.HTML(""" <div id="inner"> <header>
|
| 165 |
<h3>2. Click a image from the Seed Image Gallery</h3><br>
|
| 166 |
</div>""")
|
| 167 |
-
|
| 168 |
-
border_gallery.select(assign_img_path, outputs = selected_border_image)
|
| 169 |
-
seed_image_gallery = gr.Gallery(label= " Image Seed Gallery",
|
| 170 |
-
scale = 2,
|
| 171 |
-
value = u.index_image_paths("Drakosfire/CardGenerator", "seed_images/item_seeds"),
|
| 172 |
-
show_label = True,
|
| 173 |
-
columns = [3], rows = [3],
|
| 174 |
-
object_fit = "contain",
|
| 175 |
-
height = "auto",
|
| 176 |
-
elem_id = "Template Gallery",
|
| 177 |
-
interactive=True)
|
| 178 |
-
|
| 179 |
-
gr.HTML(""" <div id="inner"> <header><h4> -Or- Upload your own seed image, by dropping it into the 'Generated Template Gallery' </h4><br>
|
| 180 |
<h3>3. Click 'Generate Card Template'</h3><br>
|
| 181 |
</div>""")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
|
| 183 |
built_template_gallery = gr.Gallery(label= "Generated Template Gallery",
|
| 184 |
scale = 1,
|
|
@@ -244,19 +248,20 @@ with gr.Blocks() as demo:
|
|
| 244 |
<h2> <b>Fourth:</b> Click your favorite card then add text, or click 'Generate Four Card Options' again.<br>
|
| 245 |
</h2>
|
| 246 |
</div>""")
|
| 247 |
-
|
| 248 |
with gr.Row():
|
|
|
|
| 249 |
generate_gallery = gr.Gallery(label = "Generated Cards",
|
| 250 |
value = [],
|
| 251 |
show_label= True,
|
| 252 |
-
scale=
|
| 253 |
-
columns =[
|
| 254 |
object_fit= "fill",
|
| 255 |
height = "768",
|
| 256 |
elem_id = "Generated Cards Gallery",
|
| 257 |
-
allow_preview=
|
| 258 |
)
|
| 259 |
-
|
| 260 |
|
| 261 |
|
| 262 |
card_gen_button.click(fn = generate_image_update_gallery,
|
|
|
|
| 145 |
<h2><b>First:</b> Build a Card Template</h2>
|
| 146 |
</div>""")
|
| 147 |
with gr.Row():
|
| 148 |
+
# Template Gallery instructions
|
| 149 |
+
gr.HTML(""" <div id="inner"> <header>
|
| 150 |
+
<h3>1. Click a border from the 'Card Template Gallery'</h3>
|
| 151 |
+
</div>""")
|
| 152 |
+
gr.HTML(""" <div id="inner"> <header>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 153 |
<h3>2. Click a image from the Seed Image Gallery</h3><br>
|
| 154 |
</div>""")
|
| 155 |
+
gr.HTML(""" <div id="inner"> <header><h4> -Or- Upload your own seed image, by dropping it into the 'Generated Template Gallery' </h4><br>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 156 |
<h3>3. Click 'Generate Card Template'</h3><br>
|
| 157 |
</div>""")
|
| 158 |
+
|
| 159 |
+
with gr.Row():
|
| 160 |
+
|
| 161 |
+
|
| 162 |
+
|
| 163 |
+
border_gallery = gr.Gallery(label = "Card Template Gallery",
|
| 164 |
+
scale = 2,
|
| 165 |
+
value = u.index_image_paths("Drakosfire/CardGenerator", "seed_images/card_templates"),
|
| 166 |
+
show_label = True,
|
| 167 |
+
columns = [3], rows = [3],
|
| 168 |
+
object_fit = "contain",
|
| 169 |
+
height = "auto",
|
| 170 |
+
elem_id = "Template Gallery")
|
| 171 |
+
|
| 172 |
+
|
| 173 |
+
|
| 174 |
+
border_gallery.select(assign_img_path, outputs = selected_border_image)
|
| 175 |
+
seed_image_gallery = gr.Gallery(label= " Image Seed Gallery",
|
| 176 |
+
scale = 2,
|
| 177 |
+
value = u.index_image_paths("Drakosfire/CardGenerator", "seed_images/item_seeds"),
|
| 178 |
+
show_label = True,
|
| 179 |
+
columns = [3], rows = [3],
|
| 180 |
+
object_fit = "contain",
|
| 181 |
+
height = "auto",
|
| 182 |
+
elem_id = "Template Gallery",
|
| 183 |
+
interactive=True)
|
| 184 |
+
|
| 185 |
+
|
| 186 |
|
| 187 |
built_template_gallery = gr.Gallery(label= "Generated Template Gallery",
|
| 188 |
scale = 1,
|
|
|
|
| 248 |
<h2> <b>Fourth:</b> Click your favorite card then add text, or click 'Generate Four Card Options' again.<br>
|
| 249 |
</h2>
|
| 250 |
</div>""")
|
| 251 |
+
generate_final_item_card = gr.Button(value = "Add Text", elem_id = "Generate user card")
|
| 252 |
with gr.Row():
|
| 253 |
+
|
| 254 |
generate_gallery = gr.Gallery(label = "Generated Cards",
|
| 255 |
value = [],
|
| 256 |
show_label= True,
|
| 257 |
+
scale= 1,
|
| 258 |
+
columns =[4], rows = [1],
|
| 259 |
object_fit= "fill",
|
| 260 |
height = "768",
|
| 261 |
elem_id = "Generated Cards Gallery",
|
| 262 |
+
allow_preview=True
|
| 263 |
)
|
| 264 |
+
|
| 265 |
|
| 266 |
|
| 267 |
card_gen_button.click(fn = generate_image_update_gallery,
|