import segno.helpers as hp import gradio as gr from PIL import Image def qr_code_generator(ssid, password = None): qr_code = hp.make_wifi(ssid = ssid, password = password, security = 'WPA') qr_code.save('temp.png', scale = 10) Im = Image.open('temp.png') return Im iface = gr.Interface(fn=qr_code_generator, inputs = [gr.inputs.Textbox(label = 'SSID'), gr.inputs.Textbox(label = 'Password')], outputs = 'image', allow_flagging = False) iface.launch()