Spaces:
Build error
Build error
File size: 2,965 Bytes
572c05d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
import os
import random
import gradio as gr
#links
Article = ""
Article = Article + " Gallery UI documentation: https://gradio.app/docs/"
Article = Article + " Unsplash free image source requires 5MP or larger images: https://unsplash.com/"
Article = Article + " Github should also be a worthy alternative with free repos. "
Article = Article + " Raw git content can be accessed by URL like so: https://raw.github.com/AaronCWacker/Yggdrasil/images/"
Article = Article + " Originals go here: https://github.com/AaronCWacker/Yggdrasil/tree/main/images"
# Aaron_Wacker_health_and_medical_icon_set_on_white_background_bba24b60-9fcf-411b-9c00-dd1ba1e3553c.png
def fake_gan():
images = [
(random.choice(
[
"Aaron_Wacker_health_and_medical_iccon_set_on_white_background_0384ab0e-c970-4b30-8ed5-070505799cc2.png",
"Aaron_Wacker_health_and_medical_iccon_set_on_white_background_2e8c1e07-ab53-4ad3-92f5-064d978cf7f9.png",
"Aaron_Wacker_health_and_medical_iccon_set_on_white_background_e9d86d2e-502c-4e86-951a-b8650d4bb435.png",
"Aaron_Wacker_health_and_medical_icon_set_on_white_background_117cea12-a29f-4fde-9382-59cb3954907c.png",
"Aaron_Wacker_health_and_medical_icon_set_on_white_background_5560d026-d6fe-4dc2-bef7-46362f261cf1.png",
"Aaron_Wacker_health_and_medical_icon_set_on_white_background_5aafc47e-a0f7-452d-944c-405f1fe07c66.png",
"Aaron_Wacker_health_and_medical_icon_set_on_white_background_bba24b60-9fcf-411b-9c00-dd1ba1e3553c.png",
"Aaron_Wacker_multiple_graph_and_chart_UI_multiple_data_visualiz_3c08106c-51fd-4efe-be1a-7565ae73841e.png",
"Aaron_Wacker_multiple_graph_and_chart_UI_multiple_data_visualiz_56084dcc-99ba-4bbd-8192-166e3321b9b8.png",
"Aaron_Wacker_multiple_graph_and_chart_UI_multiple_data_visualiz_a4d1e2f4-cf56-4ac2-ab89-ef60c0576672.png",
"Aaron_Wacker_multiple_graph_and_chart_UI_multiple_data_visualiz_144e27a1-3f78-43cb-bdec-c4507a9c8a30.png",
"Aaron_Wacker_clean_minimalist_GUI_pack_c85a49b0-d3f8-4e65-9f55-8bc507650231.png",
]
), f"label {i}" if i != 0 else "label" * 50)
for i in range(10)
]
return images
with gr.Blocks() as demo:
with gr.Column(variant="panel"):
with gr.Row(variant="compact"):
text = gr.Textbox(
label="Health and Medical Icon Sets",
show_label=False,
max_lines=1,
placeholder="Enter your prompt",
).style(
container=False,
)
btn = gr.Button("Generate image").style(full_width=False)
gallery = gr.Gallery(
label="Generated images", show_label=False, elem_id="gallery"
).style(grid=[2], height="auto")
btn.click(fake_gan, None, gallery)
if __name__ == "__main__":
demo.launch() |