import gradio as gr import numpy as np from interface_modules.X2Painting.template_config import style_example from interface_modules.X2Painting.client_process import send_to_server def on_select(evt: gr.SelectData): index = evt.index style_name = list(style_example.values())[index] return gr.update(value=style_name) css = """ .gradio-container {background-color: #F0F5FF; width: 95% !important} """ title = r"""
step1: Input a Character. Recommended Chinese Character.
step2: Select a style in the Gallery
step3: Click Run, Waiting for about 1 Min. Enjoy
""") word = gr.Textbox( label="Input Character", info="please type Character, such as 李. (输入中文字,例如,李)", value="李", elem_id="InputCha" ) submit = gr.ClearButton(value="Run",elem_id="RunBtn") style_name = gr.Textbox( label="style_name", info="style_name", value="", visible=False, ) with gr.Column(scale=6): gr.HTML("""