import os import gradio as gr import sys sys.path.append(os.path.join(os.path.dirname(__file__), "scripts")) from lib import init, refresh_character_thumb_image from lib import TITLE if __name__ == '__main__': character_list, character_list_cn, LANG, anima_character_list, anima_character_list_cn = init() with gr.Blocks(title=TITLE) as ui: with gr.Row(): character1 = gr.Dropdown( choices=anima_character_list, label=LANG["character1"], value='none', allow_custom_value=False, ) character2 = gr.Dropdown( choices=character_list, label=LANG["character2"], value='none', allow_custom_value=False, ) character3 = gr.Dropdown( choices=anima_character_list_cn, label=LANG["character3"], value='none', allow_custom_value=False, ) character4 = gr.Dropdown( choices=character_list_cn, label=LANG["character4"], value='none', allow_custom_value=False, ) dummy_dropdown = gr.Dropdown(visible=False, allow_custom_value=True) dummy_textbox = gr.Textbox(visible=False) with gr.Row(elem_classes='main_row'): with gr.Column(elem_classes='column_prompts'): thumb_image = gr.Gallery(type="pil", allow_preview=True, columns=4, show_share_button=False, show_fullscreen_button=False, object_fit='contain', label="Thumb", height=470) output_info = gr.Textbox(label="Characters' Info", lines=18) with gr.Row(): with gr.Column(): gr.Markdown("