Spaces:
Sleeping
Sleeping
""" | |
Common UI components and utilities. | |
""" | |
import gradio as gr | |
# Emoji definitions | |
EMOJI = { | |
"grid": "π²", | |
"split": "βοΈ", | |
"vector": "ποΈ", | |
"settings": "βοΈ", | |
"upload": "π€", | |
"download": "π₯", | |
"success": "β ", | |
"error": "β", | |
"animal": "πΎ", | |
"art": "π¨", | |
"magic": "β¨", | |
"folder": "π", | |
"image": "πΌοΈ", | |
"svg": "π", | |
"processing": "β³", | |
"complete": "π", | |
"background": "π§Ή", | |
"caption": "π¬", | |
"ai": "π€" | |
} | |
def toggle_gemini_opts(x): | |
""" | |
Event handler for Gemini options visibility. | |
Args: | |
x (bool): Visibility state | |
Returns: | |
list: List of Gradio updates | |
""" | |
return [ | |
gr.update(visible=x), # api_key | |
gr.update(visible=x), # model | |
gr.update(visible=x) # caption_prompt | |
] | |
def toggle_area_threshold(x): | |
""" | |
Event handler for area threshold visibility. | |
Args: | |
x (bool): Visibility state | |
Returns: | |
Gradio update object | |
""" | |
return gr.update(visible=x) | |