Spaces:
Sleeping
Sleeping
Kaixuanliu
commited on
Commit
•
df7c30e
1
Parent(s):
b67c71f
Update app.py
Browse files
app.py
CHANGED
@@ -60,7 +60,7 @@ def execute_prepare(diffusion_model_id, concept, steps, attack_id):
|
|
60 |
|
61 |
return prompt, img
|
62 |
|
63 |
-
def
|
64 |
print(f"my IP is {myip}, my port is {myport}")
|
65 |
print(f"my input is diffusion_model_id: {diffusion_model_id}, concept: {concept}, steps: {steps}")
|
66 |
response = requests.post('http://{}:{}/udiff'.format(myip, myport),
|
@@ -136,8 +136,8 @@ with gr.Blocks(css=custom_css) as demo:
|
|
136 |
text_ouput = gr.Textbox(label="Prompt Genetated by UnlearnDiffAtk")
|
137 |
result_img = gr.Image(label="Image Gnerated by Prompt of UnlearnDiffAtk",width=512,show_share_button=False,show_download_button=False)
|
138 |
|
139 |
-
start_button.click(fn=
|
140 |
-
attack_button.click(fn=
|
141 |
|
142 |
|
143 |
demo.queue().launch(server_name='0.0.0.0')
|
|
|
60 |
|
61 |
return prompt, img
|
62 |
|
63 |
+
def execute_udiff(diffusion_model_id, concept, steps, attack_id):
|
64 |
print(f"my IP is {myip}, my port is {myport}")
|
65 |
print(f"my input is diffusion_model_id: {diffusion_model_id}, concept: {concept}, steps: {steps}")
|
66 |
response = requests.post('http://{}:{}/udiff'.format(myip, myport),
|
|
|
136 |
text_ouput = gr.Textbox(label="Prompt Genetated by UnlearnDiffAtk")
|
137 |
result_img = gr.Image(label="Image Gnerated by Prompt of UnlearnDiffAtk",width=512,show_share_button=False,show_download_button=False)
|
138 |
|
139 |
+
start_button.click(fn=execute_prepare, inputs=[drop_model, drop, shown_columns_step, atk_idx], outputs=[text_input, orig_img], api_name="prepare")
|
140 |
+
attack_button.click(fn=execute_udiff, inputs=[drop_model, drop, shown_columns_step, atk_idx], outputs=[text_ouput, result_img], api_name="udiff")
|
141 |
|
142 |
|
143 |
demo.queue().launch(server_name='0.0.0.0')
|