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)