Spaces:
Running
on
A10G
Running
on
A10G
Linoy Tsaban
commited on
Commit
·
0ff0b1f
1
Parent(s):
95bf488
Update app.py
Browse files
app.py
CHANGED
@@ -76,11 +76,13 @@ def invert_and_reconstruct(input_image,
|
|
76 |
steps=100,
|
77 |
src_cfg_scale = 3.5,
|
78 |
skip=36,
|
|
|
79 |
left = 0,
|
80 |
right = 0,
|
81 |
top = 0,
|
82 |
bottom = 0
|
83 |
):
|
|
|
84 |
# offsets=(0,0,0,0)
|
85 |
x0 = load_512(input_image, left,right, top, bottom, device)
|
86 |
|
@@ -99,9 +101,10 @@ def edit(tar_prompt="",
|
|
99 |
steps=100,
|
100 |
skip=36,
|
101 |
tar_cfg_scale=15,
|
|
|
102 |
|
103 |
):
|
104 |
-
|
105 |
out = sample(wt=inversion_map['wt'], zs= inversion_map['zs'], wts=inversion_map['wts'], prompt_tar=tar_prompt,
|
106 |
cfg_scale_tar=tar_cfg_scale, skip=skip)
|
107 |
|
@@ -160,6 +163,7 @@ with gr.Blocks() as demo:
|
|
160 |
# reconstruction
|
161 |
skip = gr.Slider(minimum=0, maximum=40, value=36, precision=0, label="Skip Steps", interactive=True)
|
162 |
tar_cfg_scale = gr.Slider(minimum=7, maximum=18,value=15, label=f"Target Guidance Scale", interactive=True)
|
|
|
163 |
|
164 |
#shift
|
165 |
with gr.Column():
|
@@ -180,6 +184,7 @@ with gr.Blocks() as demo:
|
|
180 |
steps,
|
181 |
src_cfg_scale,
|
182 |
skip,
|
|
|
183 |
left,
|
184 |
right,
|
185 |
top,
|
@@ -194,6 +199,7 @@ with gr.Blocks() as demo:
|
|
194 |
steps,
|
195 |
skip,
|
196 |
tar_cfg_scale,
|
|
|
197 |
],
|
198 |
outputs=[output_image],
|
199 |
)
|
|
|
76 |
steps=100,
|
77 |
src_cfg_scale = 3.5,
|
78 |
skip=36,
|
79 |
+
seed = 0,
|
80 |
left = 0,
|
81 |
right = 0,
|
82 |
top = 0,
|
83 |
bottom = 0
|
84 |
):
|
85 |
+
torch.manual_seed(seed)
|
86 |
# offsets=(0,0,0,0)
|
87 |
x0 = load_512(input_image, left,right, top, bottom, device)
|
88 |
|
|
|
101 |
steps=100,
|
102 |
skip=36,
|
103 |
tar_cfg_scale=15,
|
104 |
+
seed = 0
|
105 |
|
106 |
):
|
107 |
+
torch.manual_seed(seed)
|
108 |
out = sample(wt=inversion_map['wt'], zs= inversion_map['zs'], wts=inversion_map['wts'], prompt_tar=tar_prompt,
|
109 |
cfg_scale_tar=tar_cfg_scale, skip=skip)
|
110 |
|
|
|
163 |
# reconstruction
|
164 |
skip = gr.Slider(minimum=0, maximum=40, value=36, precision=0, label="Skip Steps", interactive=True)
|
165 |
tar_cfg_scale = gr.Slider(minimum=7, maximum=18,value=15, label=f"Target Guidance Scale", interactive=True)
|
166 |
+
seed = gr.Number(value=0, precision=0, label="Seed", interactive=True)
|
167 |
|
168 |
#shift
|
169 |
with gr.Column():
|
|
|
184 |
steps,
|
185 |
src_cfg_scale,
|
186 |
skip,
|
187 |
+
seed,
|
188 |
left,
|
189 |
right,
|
190 |
top,
|
|
|
199 |
steps,
|
200 |
skip,
|
201 |
tar_cfg_scale,
|
202 |
+
seed
|
203 |
],
|
204 |
outputs=[output_image],
|
205 |
)
|