ysharma HF staff commited on
Commit
2e71e66
·
1 Parent(s): 2f4b88f
Files changed (1) hide show
  1. app.py +21 -19
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
- *[Hadi Salman](https://twitter.com/hadisalmanX)\*, [Alaa Khaddaj](https://twitter.com/Alaa_Khaddaj)\*, [Guillaume Leclerc](https://twitter.com/gpoleclerc)\*, [Andrew Ilyas](https://twitter.com/andrew_ilyas), [Aleksander Madry](https://twitter.com/aleks_madry)* <br>
118
- MIT &nbsp;&nbsp;[Paper](https://arxiv.org/abs/2302.06588)
119
- &nbsp;&nbsp;[Blog post](https://gradientscience.org/photoguard/)
120
- &nbsp;&nbsp;[![](https://badgen.net/badge/icon/GitHub?icon=github&label)](https://github.com/MadryLab/photoguard)
121
- <br />
122
- Below you can test our (encoder attack) immunization method for making images resistant to manipulation by Stable Diffusion. This immunization process forces the model to perform unrealistic edits.
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
- with gr.Accordion('Click for demo steps:'):
 
 
 
 
 
133
  gr.HTML('''
134
- + Upload an image (or select from the below examples!)
135
- + Mask (using the drawing tool) the parts of the image you want to maintain unedited (e.g., faces of people)
136
- + Add a prompt to edit the image accordingly (see examples below)
137
- + Play with the seed and click submit until you get a realistic edit that you are happy with (or use default seeds below)
138
-
139
- Now let's immunize your image and try again!
140
- + Click on the "immunize" button, then submit.
141
- + You will get the immunized image (which looks identical to the original one) and the edited image, which is now hopefully unrealistic!
142
- </details>''')
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():