Spaces:
Running
on
A10G
Running
on
A10G
Linoy Tsaban
commited on
Commit
•
622ce03
1
Parent(s):
e6519b8
Update app.py
Browse files
app.py
CHANGED
@@ -76,7 +76,6 @@ def edit(input_image,
|
|
76 |
sega_edit_guidance=0,
|
77 |
# warm_up=1,
|
78 |
# neg_guidance=False,
|
79 |
-
flip=False,
|
80 |
left = 0,
|
81 |
right = 0,
|
82 |
top = 0,
|
@@ -89,8 +88,6 @@ def edit(input_image,
|
|
89 |
# invert
|
90 |
# wt, zs, wts = invert(x0 =x0 , prompt_src=src_prompt, num_diffusion_steps=steps, cfg_scale_src=src_cfg_scale)
|
91 |
wt, zs, wts = invert(x0 =x0 , prompt_src=src_prompt, num_diffusion_steps=steps)
|
92 |
-
if flip:
|
93 |
-
wt, zs, wts = torch.flip(wt, [2, 3]),torch.flip(zs, [2, 3]),torch.flip(wts, [2, 3])
|
94 |
|
95 |
latnets = wts[skip].expand(1, -1, -1, -1)
|
96 |
|
@@ -170,7 +167,7 @@ with gr.Blocks() as demo:
|
|
170 |
# reconstruction
|
171 |
skip = gr.Slider(minimum=0, maximum=40, value=36, precision=0, label="Skip Steps", interactive=True)
|
172 |
tar_cfg_scale = gr.Slider(minimum=7, maximum=18,value=15, label=f"Guidance Scale", interactive=True)
|
173 |
-
|
174 |
left = gr.Number(value=0, precision=0, label="Left Shift", interactive=True)
|
175 |
right = gr.Number(value=0, precision=0, label="Right Shift", interactive=True)
|
176 |
top = gr.Number(value=0, precision=0, label="Top Shift", interactive=True)
|
@@ -196,7 +193,6 @@ with gr.Blocks() as demo:
|
|
196 |
sega_edit_guidance,
|
197 |
# warm_up,
|
198 |
# neg_guidance,
|
199 |
-
flip,
|
200 |
left,
|
201 |
right,
|
202 |
top,
|
|
|
76 |
sega_edit_guidance=0,
|
77 |
# warm_up=1,
|
78 |
# neg_guidance=False,
|
|
|
79 |
left = 0,
|
80 |
right = 0,
|
81 |
top = 0,
|
|
|
88 |
# invert
|
89 |
# wt, zs, wts = invert(x0 =x0 , prompt_src=src_prompt, num_diffusion_steps=steps, cfg_scale_src=src_cfg_scale)
|
90 |
wt, zs, wts = invert(x0 =x0 , prompt_src=src_prompt, num_diffusion_steps=steps)
|
|
|
|
|
91 |
|
92 |
latnets = wts[skip].expand(1, -1, -1, -1)
|
93 |
|
|
|
167 |
# reconstruction
|
168 |
skip = gr.Slider(minimum=0, maximum=40, value=36, precision=0, label="Skip Steps", interactive=True)
|
169 |
tar_cfg_scale = gr.Slider(minimum=7, maximum=18,value=15, label=f"Guidance Scale", interactive=True)
|
170 |
+
|
171 |
left = gr.Number(value=0, precision=0, label="Left Shift", interactive=True)
|
172 |
right = gr.Number(value=0, precision=0, label="Right Shift", interactive=True)
|
173 |
top = gr.Number(value=0, precision=0, label="Top Shift", interactive=True)
|
|
|
193 |
sega_edit_guidance,
|
194 |
# warm_up,
|
195 |
# neg_guidance,
|
|
|
196 |
left,
|
197 |
right,
|
198 |
top,
|