""" 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)