Spaces:
Runtime error
Runtime error
update
Browse files
app.py
CHANGED
|
@@ -112,9 +112,6 @@ def run_it(
|
|
| 112 |
):
|
| 113 |
global ALL_OUTPUT
|
| 114 |
|
| 115 |
-
if os.getlogin() not in ALL_OUTPUT:
|
| 116 |
-
ALL_OUTPUT[os.getlogin()] = []
|
| 117 |
-
|
| 118 |
num_affected_steps = [in_slider_ddsteps]
|
| 119 |
noise_scale = [in_slider_gcoef]
|
| 120 |
num_trailing_attn = [in_slider_trailings]
|
|
@@ -157,21 +154,18 @@ def run_it(
|
|
| 157 |
),
|
| 158 |
)
|
| 159 |
)
|
| 160 |
-
|
| 161 |
-
return ALL_OUTPUT[os.getlogin()]
|
| 162 |
-
|
| 163 |
-
def clean_gallery():
|
| 164 |
-
global ALL_OUTPUT
|
| 165 |
-
ALL_OUTPUT[os.getlogin()] = []
|
| 166 |
-
return ALL_OUTPUT[os.getlogin()]
|
| 167 |
-
|
| 168 |
|
| 169 |
|
| 170 |
with gr.Blocks() as demo:
|
| 171 |
gr.Markdown(
|
| 172 |
"""
|
| 173 |
-
|
|
|
|
|
|
|
|
|
|
| 174 |
Let's pin the object in the prompt as you wish!
|
|
|
|
| 175 |
"""
|
| 176 |
)
|
| 177 |
with gr.Row(variant="panel"):
|
|
@@ -221,7 +215,8 @@ with gr.Blocks() as demo:
|
|
| 221 |
)
|
| 222 |
with gr.Row(variant="compact"):
|
| 223 |
btn_run = gr.Button("Generate image").style(full_width=True)
|
| 224 |
-
btn_clean = gr.Button("Clean Gallery").style(full_width=True)
|
|
|
|
| 225 |
|
| 226 |
gr.Markdown(
|
| 227 |
""" Note:
|
|
@@ -246,7 +241,8 @@ with gr.Blocks() as demo:
|
|
| 246 |
is_grid_search,
|
| 247 |
]
|
| 248 |
btn_run.click(run_it, inputs=args, outputs=gallery)
|
| 249 |
-
btn_clean.click(clean_gallery, outputs=gallery)
|
|
|
|
| 250 |
examples = gr.Examples(
|
| 251 |
examples=EXAMPLES,
|
| 252 |
inputs=args,
|
|
|
|
| 112 |
):
|
| 113 |
global ALL_OUTPUT
|
| 114 |
|
|
|
|
|
|
|
|
|
|
| 115 |
num_affected_steps = [in_slider_ddsteps]
|
| 116 |
noise_scale = [in_slider_gcoef]
|
| 117 |
num_trailing_attn = [in_slider_trailings]
|
|
|
|
| 154 |
),
|
| 155 |
)
|
| 156 |
)
|
| 157 |
+
return results
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
|
| 159 |
|
| 160 |
with gr.Blocks() as demo:
|
| 161 |
gr.Markdown(
|
| 162 |
"""
|
| 163 |
+
### Directed Diffusion: Direct Control of Object Placement through Attention Guidance
|
| 164 |
+
**\*Wan-Duo Kurt Ma, \^J. P. Lewis, \^\*W. Bastiaan Kleijn, \^Thomas Leung**
|
| 165 |
+
*\*Victoria University of Wellington, \^Google Research*
|
| 166 |
+
|
| 167 |
Let's pin the object in the prompt as you wish!
|
| 168 |
+
For more information, please checkout our project page ([link](https://hohonu-vicml.github.io/DirectedDiffusion.Page/)), repository ([link](https://github.com/hohonu-vicml/DirectedDiffusion)), and the paper ([link](https://arxiv.org/abs/2302.13153))
|
| 169 |
"""
|
| 170 |
)
|
| 171 |
with gr.Row(variant="panel"):
|
|
|
|
| 215 |
)
|
| 216 |
with gr.Row(variant="compact"):
|
| 217 |
btn_run = gr.Button("Generate image").style(full_width=True)
|
| 218 |
+
#btn_clean = gr.Button("Clean Gallery").style(full_width=True)
|
| 219 |
+
|
| 220 |
|
| 221 |
gr.Markdown(
|
| 222 |
""" Note:
|
|
|
|
| 241 |
is_grid_search,
|
| 242 |
]
|
| 243 |
btn_run.click(run_it, inputs=args, outputs=gallery)
|
| 244 |
+
#btn_clean.click(clean_gallery, outputs=gallery)
|
| 245 |
+
|
| 246 |
examples = gr.Examples(
|
| 247 |
examples=EXAMPLES,
|
| 248 |
inputs=args,
|