Omnibus commited on
Commit
8e7cdd3
·
1 Parent(s): 900d42f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -9
app.py CHANGED
@@ -1,17 +1,32 @@
1
  import gradio as gr
2
- import crypt
 
 
 
3
 
4
  with gr.Blocks() as app:
5
  with gr.Row():
6
  gr.Column()
7
  with gr.Column():
8
- rsa_to_enc = gr.Textbox(label="txt to encrypt")
9
- pub_key_in = gr.Image(label="Public Key", type="filepath")
10
- priv_key_in1 = gr.Image(label="Private Key(sig)", type="filepath")
11
- rsa_enc_btn = gr.Button("RSA Encrypt")
12
- rsa_enc_mes = gr.Textbox(label="encoded", max_lines=4)
13
- qr_enc_mes = gr.Image(type="filepath")
14
-
 
 
 
 
 
 
 
 
 
 
15
  gr.Column()
16
- rsa_enc_btn.click(crypt.encrypt_text,[rsa_to_enc,pub_key_in,priv_key_in1,out3],[rsa_enc_mes,qr_enc_mes]).then(crypt.test_fn,qr_enc_mes,mes_in)
 
 
17
  app.launch()
 
1
  import gradio as gr
2
+ import pixel_encrypt as pe
3
+ from diff import SendIt as si
4
+ go=si()
5
+ models = go.models
6
 
7
  with gr.Blocks() as app:
8
  with gr.Row():
9
  gr.Column()
10
  with gr.Column():
11
+ with gr.Row():
12
+ with gr.Tab("Encrypt"):
13
+ rsa_to_enc = gr.Textbox(label="Message to Encrypt",lines=3)
14
+ pub_key_in = gr.Image(label="Public Key", type="filepath")
15
+ priv_key_in1 = gr.Image(label="Private Key(sig)", type="filepath")
16
+ rsa_enc_btn = gr.Button("RSA Encrypt")
17
+ rsa_enc_mes = gr.Textbox(label="encoded", max_lines=4)
18
+ qr_enc_mes = gr.Image(type="filepath")
19
+ with gr.Tab("Custom"):
20
+ with gr.Group():
21
+ with gr.Column():
22
+ inp=gr.Textbox(label="Prompt")
23
+ model=gr.Dropdown(type='index',choices=[m for m in models], value=models[5])
24
+ cnt = gr.Slider(minimum=1,maximum=4,step=1,value=1)
25
+ diff_btn = gr.Button()
26
+ diff_im = gr.Gallery()
27
+ im_choice=gr.Image(label='Place image here',type='filepath')
28
  gr.Column()
29
+ rsa_enc_btn.click(pe.encrypt_text,[rsa_to_enc,pub_key_in,priv_key_in1,out3],[rsa_enc_mes,qr_enc_mes])
30
+ diff_btn.click(go.send_it,[inp,model,cnt],diff_im)
31
+
32
  app.launch()