xinchen9 commited on
Commit
e7e8aa5
1 Parent(s): ca1772a

[update]new layout

Browse files
Files changed (1) hide show
  1. app.py +30 -15
app.py CHANGED
@@ -15,23 +15,38 @@ from about import (
15
  TITLE,
16
  )
17
 
 
 
 
 
 
18
 
19
  with gr.Blocks() as demo:
20
  gr.HTML(TITLE)
21
  gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")
22
- with gr.Row():
23
- drop1 = gr.Dropdown(["Church", "Parachute", "Garbage"], label="Objects")
24
- drop2 = gr.Dropdown(["Van Gogh"], label="Styles")
25
- drop3 = gr.Dropdown(["Nudity", "Violence", "Illegal Activity"], label="Concepts")
26
- with gr.Row():
27
- with gr.Column(scale=1, min_width=600):
28
- text1 = gr.Textbox(label="Attacking Prompt")
29
- inbtw = gr.Button("Add")
30
- text4 = gr.Textbox(label="Embedding")
31
- with gr.Row():
32
- with gr.Column(scale=1, min_width=300):
33
- img1 = gr.Image("images/cheetah.jpg",label="Image")
34
- with gr.Column(scale=1, min_width=300):
35
- img2 = gr.Image("images/cheetah.jpg",label="After Defense")
36
-
 
 
 
 
 
 
 
 
 
 
37
  demo.launch()
 
15
  TITLE,
16
  )
17
 
18
+ myip = "0.0.0.0"
19
+ myport=80
20
+ is_spaces = True if "SPACE_ID" in os.environ else False
21
+ is_shared_ui = False
22
+
23
 
24
  with gr.Blocks() as demo:
25
  gr.HTML(TITLE)
26
  gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")
27
+ with gr.Row() as advlearn:
28
+ drop = gr.Dropdown(["Object-Church", "Object-Parachute", "Object-Garbage_Truck","Object-Tench",
29
+ "Style-Van_Gogh","Concept-Nudity"],
30
+ label="Unlearning undesirable")
31
+ with gr.Column():
32
+ # gr.Markdown("Please upload your model id.")
33
+ drop_model = gr.Dropdown(["Erased Stable Diffusion(ESD)", "Forget-me-not(FMN)", "Ablating concepts(AC)","Unified Concept Editing(UCE)", "(Safe Latent Diffusion)SLD"],
34
+ label="Unlearned DMs")
35
+ with gr.Column():
36
+ # gr.Markdown("Please upload your model id.")
37
+ drop_text = gr.Dropdown(["Object-Church", "Object-Parachute", "Object-Garbage_Truck","Object-Tench",
38
+ "Style-Van_Gogh","Concept-Nudity", "None"],
39
+ label="AdvUnlearn Text Encoder")
40
+
41
+ with gr.Row() as attack:
42
+ text_input = gr.Textbox(label="Prompt")
43
+ with gr.Column(min_width=260):
44
+
45
+ img1 = gr.Image("images/cheetah.jpg",label="Image Generated without AdvUnlearn",width=260,show_share_button=False,show_download_button=False)
46
+ with gr.Column():
47
+ start_button = gr.Button("AdvUnlearn",size='lg')
48
+ with gr.Column(min_width=260):
49
+ text_ouput = gr.Textbox(label="Prompt Genetated by UnlearnDiffAtk")
50
+ img2 = gr.Image("images/cheetah.jpg",label="Image Generated without AdvUnlearn",width=260,show_share_button=False,show_download_button=False)
51
+
52
  demo.launch()