Spaces:
Running
on
A10G
Running
on
A10G
Linoy Tsaban
commited on
Commit
·
0479d0c
1
Parent(s):
54617f0
Update app.py
Browse files
app.py
CHANGED
@@ -107,20 +107,18 @@ with gr.Blocks(css='style.css') as demo:
|
|
107 |
cfg_scale_src = 3.5,
|
108 |
cfg_scale_tar = 15,
|
109 |
skip=36,
|
110 |
-
seed = 0,
|
111 |
-
|
112 |
-
)
|
113 |
-
|
114 |
-
# offsets=(0,0,0,0)
|
115 |
-
x0 = load_512(input_image, device=device)
|
116 |
-
|
117 |
-
if not wt:
|
118 |
-
# invert and retrieve noise maps and latent
|
119 |
-
wt, zs, wts = invert(x0 =x0 , prompt_src=src_prompt, num_diffusion_steps=steps, cfg_scale_src=cfg_scale_src)
|
120 |
|
121 |
-
|
122 |
-
|
123 |
-
|
|
|
|
|
|
|
|
|
124 |
|
125 |
gr.HTML(intro)
|
126 |
wt = gr.State(value=None)
|
|
|
107 |
cfg_scale_src = 3.5,
|
108 |
cfg_scale_tar = 15,
|
109 |
skip=36,
|
110 |
+
seed = 0,):
|
111 |
+
torch.manual_seed(seed)
|
112 |
+
# offsets=(0,0,0,0)
|
113 |
+
x0 = load_512(input_image, device=device)
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
|
115 |
+
if not wt:
|
116 |
+
# invert and retrieve noise maps and latent
|
117 |
+
wt, zs, wts = invert(x0 =x0 , prompt_src=src_prompt, num_diffusion_steps=steps, cfg_scale_src=cfg_scale_src)
|
118 |
+
|
119 |
+
output = sample(wt, zs, wts, prompt_tar=tar_prompt, cfg_scale_tar=cfg_scale_tar, skip=skip)
|
120 |
+
|
121 |
+
return output
|
122 |
|
123 |
gr.HTML(intro)
|
124 |
wt = gr.State(value=None)
|