Spaces:
Running
on
A10G
Running
on
A10G
Linoy Tsaban
commited on
Commit
•
67eedaf
1
Parent(s):
45c9cda
Update app.py
Browse files
app.py
CHANGED
@@ -94,7 +94,7 @@ def edit(input_image,
|
|
94 |
return pure_ddpm_out,sega_out.images[0]
|
95 |
|
96 |
|
97 |
-
|
98 |
intro = """<h1 style="font-weight: 900; margin-bottom: 7px;">
|
99 |
Edit Friendly DDPM X Semantic Guidance: Editing Real Images
|
100 |
</h1>
|
@@ -127,6 +127,7 @@ with gr.Blocks() as demo:
|
|
127 |
src_prompt = gr.Textbox(lines=1, label="Source Prompt", interactive=True)
|
128 |
#edit
|
129 |
tar_prompt = gr.Textbox(lines=1, label="Target Prompt", interactive=True)
|
|
|
130 |
|
131 |
with gr.Row():
|
132 |
#inversion
|
@@ -136,7 +137,6 @@ with gr.Blocks() as demo:
|
|
136 |
skip = gr.Number(value=36, precision=0, label="Skip Steps", interactive=True)
|
137 |
tar_cfg_scale = gr.Number(value=15, label=f"Guidance Scale", interactive=True)
|
138 |
# edit
|
139 |
-
edit_concept = gr.Textbox(lines=1, label="SEGA Edit Concept", interactive=True)
|
140 |
sega_edit_guidance = gr.Number(value=5, label=f"SEGA Edit Guidance Scale", interactive=True)
|
141 |
warm_up = gr.Number(value=5, label=f"SEGA Warm-up Steps", interactive=True)
|
142 |
neg_guidance = gr.Checkbox(label="SEGA Negative Guidance")
|
@@ -165,32 +165,6 @@ with gr.Blocks() as demo:
|
|
165 |
|
166 |
demo.queue(concurrency_count=1)
|
167 |
demo.launch(share=False)
|
168 |
-
######################################################
|
169 |
-
|
170 |
|
171 |
|
172 |
-
# inputs = [
|
173 |
-
# gr.Image(label="input image", shape=(512, 512)),
|
174 |
-
# gr.Textbox(label="input prompt"),
|
175 |
-
# gr.Textbox(label="target prompt"),
|
176 |
-
# gr.Textbox(label="SEGA edit concept"),
|
177 |
-
# gr.Checkbox(label="SEGA negative_guidance"),
|
178 |
-
# gr.Slider(label="warmup steps", minimum=1, maximum=30, value=5),
|
179 |
-
# gr.Slider(label="edit guidance scale", minimum=0, maximum=15, value=3.5),
|
180 |
-
# gr.Slider(label="guidance scale", minimum=7, maximum=18, value=15),
|
181 |
-
# gr.Slider(label="skip", minimum=0, maximum=40, value=36),
|
182 |
-
# gr.Slider(label="num diffusion steps", minimum=0, maximum=300, value=100)
|
183 |
-
|
184 |
-
|
185 |
-
# ]
|
186 |
-
# outputs = [gr.Image(label="DDPM"),gr.Image(label="DDPM+SEGA")]
|
187 |
-
|
188 |
-
# # And the minimal interface
|
189 |
-
# demo = gr.Interface(
|
190 |
-
# fn=edit,
|
191 |
-
# inputs=inputs,
|
192 |
-
# outputs=outputs,
|
193 |
-
# )
|
194 |
-
# demo.launch() # debug=True allows you to see errors and output in Colab
|
195 |
-
|
196 |
|
|
|
94 |
return pure_ddpm_out,sega_out.images[0]
|
95 |
|
96 |
|
97 |
+
# demo
|
98 |
intro = """<h1 style="font-weight: 900; margin-bottom: 7px;">
|
99 |
Edit Friendly DDPM X Semantic Guidance: Editing Real Images
|
100 |
</h1>
|
|
|
127 |
src_prompt = gr.Textbox(lines=1, label="Source Prompt", interactive=True)
|
128 |
#edit
|
129 |
tar_prompt = gr.Textbox(lines=1, label="Target Prompt", interactive=True)
|
130 |
+
edit_concept = gr.Textbox(lines=1, label="SEGA Edit Concept", interactive=True)
|
131 |
|
132 |
with gr.Row():
|
133 |
#inversion
|
|
|
137 |
skip = gr.Number(value=36, precision=0, label="Skip Steps", interactive=True)
|
138 |
tar_cfg_scale = gr.Number(value=15, label=f"Guidance Scale", interactive=True)
|
139 |
# edit
|
|
|
140 |
sega_edit_guidance = gr.Number(value=5, label=f"SEGA Edit Guidance Scale", interactive=True)
|
141 |
warm_up = gr.Number(value=5, label=f"SEGA Warm-up Steps", interactive=True)
|
142 |
neg_guidance = gr.Checkbox(label="SEGA Negative Guidance")
|
|
|
165 |
|
166 |
demo.queue(concurrency_count=1)
|
167 |
demo.launch(share=False)
|
|
|
|
|
168 |
|
169 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
|