magicfixeseverything
commited on
Commit
•
0826f53
1
Parent(s):
6bfcb8c
Upload 2 files
Browse files- ai_image_creation.zip +2 -2
- app.py +13 -2
ai_image_creation.zip
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6a82289b85d77727837fa486ede9e6d9964a04583cefce35bebe8a3dd25bedad
|
3 |
+
size 22757
|
app.py
CHANGED
@@ -218,10 +218,14 @@ log_generation_times = 1
|
|
218 |
#
|
219 |
# There is a bug in downloading images:
|
220 |
# https://github.com/gradio-app/gradio/issues/6486
|
221 |
-
#
|
|
|
|
|
|
|
222 |
#
|
223 |
|
224 |
use_image_gallery = 1
|
|
|
225 |
|
226 |
####################
|
227 |
|
@@ -2801,6 +2805,12 @@ with gr.Blocks(
|
|
2801 |
|
2802 |
if use_image_gallery == 1:
|
2803 |
|
|
|
|
|
|
|
|
|
|
|
|
|
2804 |
output_image_field = gr.Gallery(
|
2805 |
label = "Generated Images",
|
2806 |
value = [],
|
@@ -2809,7 +2819,8 @@ with gr.Blocks(
|
|
2809 |
selected_index = 0,
|
2810 |
elem_id = "image_gallery",
|
2811 |
allow_preview = "True",
|
2812 |
-
preview = True
|
|
|
2813 |
)
|
2814 |
|
2815 |
else:
|
|
|
218 |
#
|
219 |
# There is a bug in downloading images:
|
220 |
# https://github.com/gradio-app/gradio/issues/6486
|
221 |
+
# It saves as HTML rather than image.
|
222 |
+
#
|
223 |
+
# If you use the gallery, you can turn the download button off for now.
|
224 |
+
# They can still right click and save the image.
|
225 |
#
|
226 |
|
227 |
use_image_gallery = 1
|
228 |
+
show_download_button_for_gallery = 0
|
229 |
|
230 |
####################
|
231 |
|
|
|
2805 |
|
2806 |
if use_image_gallery == 1:
|
2807 |
|
2808 |
+
show_download_button = False
|
2809 |
+
|
2810 |
+
if show_download_button_for_gallery == 1:
|
2811 |
+
|
2812 |
+
show_download_button = True
|
2813 |
+
|
2814 |
output_image_field = gr.Gallery(
|
2815 |
label = "Generated Images",
|
2816 |
value = [],
|
|
|
2819 |
selected_index = 0,
|
2820 |
elem_id = "image_gallery",
|
2821 |
allow_preview = "True",
|
2822 |
+
preview = True,
|
2823 |
+
show_download_button = show_download_button
|
2824 |
)
|
2825 |
|
2826 |
else:
|