from gradio_client import Client import gradio as gr client = Client("https://omnibus-html-image-current-tab.hf.space/--replicas/o0seq/") def get_screenshot(chat: list,height=5000,width=600,chatblock=[1],header=True,theme="light",wait=3000): result = client.predict(chat,height,width,chatblock,header,theme,wait,api_name="/run_script") # str in 'Chat: [('user','bot'),('user','bot')]' Textbox component # float in 'Height' Number component # float in 'Width' Number component # List[Literal['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20']] in 'Chatblocks' Checkboxgroup component # bool in 'Show Header' Checkbox component # Literal['light', 'dark'] in 'Theme' Radio component # float (numeric value between 1 and 10000) in 'Wait time' Slider component # api_name="/run_script" ## return types: # filepath representing output in 'value_25' Image component, # str representing output in 'value_20' Html component, # List[Dict(image: filepath, caption: str | None)] representing output in 'value_24' Gallery component, # filepath representing output in 'value_23' Image component, out = f'https://omnibus-html-image-current-tab.hf.space/file={result[0]}' print(out) return out chat=[('user','bot'),('user','bot')] #get_screenshot(chat=[('user','bot'),('user','bot')]) with gr.Blocks() as app: inp = gr.Textbox(value=chat) img=gr.Image(type='filepath') app.load(get_screenshot,inp,img) app.launch()