Spaces:
Runtime error
Runtime error
ss
Browse files
app.py
CHANGED
@@ -114,32 +114,34 @@ def run(image, prompt, seed, immunize=False):
|
|
114 |
|
115 |
description='''<u>Official</u> demo of our paper: <br>
|
116 |
**Raising the Cost of Malicious AI-Powered Image Editing** <br>
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
<br />
|
124 |
-
**This is a research project and is not production-ready. See Section 5 in our paper for discussion on its limitations.**
|
125 |
-
<details closed>'''
|
126 |
|
127 |
with gr.Blocks() as demo:
|
128 |
gr.HTML(value="""<h1 style="font-weight: 900; margin-bottom: 7px; margin-top: 5px;">
|
129 |
Interactive Demo: Immunize your Photos Against AI-powered Malicious Manipulation </h1><br>
|
130 |
""")
|
131 |
gr.HTML(description)
|
132 |
-
|
|
|
|
|
|
|
|
|
|
|
133 |
gr.HTML('''
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
Now let's immunize your image and try again!
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
|
144 |
with gr.Row():
|
145 |
with gr.Column():
|
|
|
114 |
|
115 |
description='''<u>Official</u> demo of our paper: <br>
|
116 |
**Raising the Cost of Malicious AI-Powered Image Editing** <br>
|
117 |
+
*<a href='https://twitter.com/hadisalmanX' target='_blank'>Hadi Salman</a>, <a href='https://twitter.com/Alaa_Khaddaj' target='_blank'>Alaa Khaddaj</a>,
|
118 |
+
<a href='https://twitter.com/gpoleclerc' target='_blank'>Guillaume Leclerc</a>, <a href=`https://twitter.com/andrew_ilyas` target='_blank'>Andrew Ilyas</a>,
|
119 |
+
<a href='https://twitter.com/aleks_madry' target='_blank'>Aleksander Madry</><br>
|
120 |
+
MIT <a href=`https://arxiv.org/abs/2302.06588' target='_blank'>Paper</a>, <a href='https://gradientscience.org/photoguard/' target='_blank'>Blog post</a>
|
121 |
+
'''
|
122 |
+
|
|
|
|
|
|
|
123 |
|
124 |
with gr.Blocks() as demo:
|
125 |
gr.HTML(value="""<h1 style="font-weight: 900; margin-bottom: 7px; margin-top: 5px;">
|
126 |
Interactive Demo: Immunize your Photos Against AI-powered Malicious Manipulation </h1><br>
|
127 |
""")
|
128 |
gr.HTML(description)
|
129 |
+
gr.HTML('''<a href="https://github.com/MadryLab/photoguard"><img src="https://badgen.net/badge/icon/GitHub?icon=github&label" alt="GitHub"></a>''')
|
130 |
+
gr.HTML('''Below you can test our (encoder attack) immunization method for making images resistant to manipulation by Stable Diffusion.
|
131 |
+
This immunization process forces the model to perform unrealistic edits.<br>
|
132 |
+
<b>This is a research project and is not production-ready. See Section 5 in our paper for discussion on its limitations.</b>
|
133 |
+
''')
|
134 |
+
with gr.Accordion(label='Click for demo steps:', open=False):
|
135 |
gr.HTML('''
|
136 |
+
- Upload an image (or select from the below examples!)
|
137 |
+
- Mask (using the drawing tool) the parts of the image you want to maintain unedited (e.g., faces of people)
|
138 |
+
- Add a prompt to edit the image accordingly (see examples below)
|
139 |
+
- Play with the seed and click submit until you get a realistic edit that you are happy with (or use default seeds below)
|
140 |
+
|
141 |
+
Now let's immunize your image and try again!
|
142 |
+
- Click on the "immunize" button, then submit.
|
143 |
+
- You will get the immunized image (which looks identical to the original one) and the edited image, which is now hopefully unrealistic!
|
144 |
+
''')
|
145 |
|
146 |
with gr.Row():
|
147 |
with gr.Column():
|