Spaces:
Sleeping
Sleeping
File size: 1,155 Bytes
ad8cacf |
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 |
"""
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)
|