import gradio as gr import pixel_encrypt as pe from diff import SendIt as si go=si() models = go.models with gr.Blocks() as app: with gr.Row(): gr.Column() with gr.Column(): with gr.Row(): with gr.Tab("Encrypt"): rsa_to_enc = gr.Textbox(label="Message to Encrypt",lines=3) pub_key_in = gr.Image(label="Public Key", type="filepath") priv_key_in = gr.Image(label="Private Key(sig)", type="filepath") rsa_enc_btn = gr.Button("RSA Encrypt") rsa_enc_mes = gr.Textbox(label="encoded", max_lines=4) qr_enc_mes = gr.Image(type="filepath") with gr.Tab("Custom"): with gr.Group(): with gr.Column(): inp=gr.Textbox(label="Prompt") model=gr.Dropdown(type='index',choices=[m for m in models], value=models[5]) cnt = gr.Slider(minimum=1,maximum=4,step=1,value=1) diff_btn = gr.Button() diff_im = gr.Gallery() im_choice=gr.Image(label='Place image here',type='filepath') gr.Column() rsa_enc_btn.click(pe.encrypt_text,[rsa_to_enc,pub_key_in,priv_key_in],[rsa_enc_mes,qr_enc_mes]) diff_btn.click(go.send_it,[inp,model,cnt],diff_im) app.launch()