Spaces:
Sleeping
Sleeping
[update]new layout
Browse files
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 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
with gr.
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 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()
|