Spaces:
Running
on
A10G
Running
on
A10G
Linoy Tsaban
commited on
Commit
•
35080c5
1
Parent(s):
5bd9802
Update app.py
Browse files
app.py
CHANGED
@@ -126,15 +126,9 @@ def edit(input_image,
|
|
126 |
guidnace_scale_1,guidnace_scale_2,guidnace_scale_3,
|
127 |
warmup_1, warmup_2, warmup_3,
|
128 |
neg_guidance_1, neg_guidance_2, neg_guidance_3,
|
129 |
-
threshold_1, threshold_2, threshold_3
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
# SEGA
|
134 |
-
# parse concepts and neg guidance
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
editing_args = dict(
|
139 |
editing_prompt = [edit_concept_1,edit_concept_2,edit_concept_3],
|
140 |
reverse_editing_direction = [ neg_guidance_1, neg_guidance_2, neg_guidance_3,],
|
@@ -143,13 +137,14 @@ def edit(input_image,
|
|
143 |
edit_threshold=[threshold_1, threshold_2, threshold_3],
|
144 |
edit_momentum_scale=0.3,
|
145 |
edit_mom_beta=0.6,
|
146 |
-
eta=1,
|
147 |
-
|
148 |
latnets = wts.value[skip].expand(1, -1, -1, -1)
|
149 |
sega_out = sem_pipe(prompt=tar_prompt, latents=latnets, guidance_scale = tar_cfg_scale,
|
150 |
num_images_per_prompt=1,
|
151 |
num_inference_steps=steps,
|
152 |
use_ddpm=True, wts=wts.value, zs=zs.value[skip:], **editing_args)
|
|
|
153 |
return sega_out.images[0], reconstruct_button.update(visible=True)
|
154 |
|
155 |
|
|
|
126 |
guidnace_scale_1,guidnace_scale_2,guidnace_scale_3,
|
127 |
warmup_1, warmup_2, warmup_3,
|
128 |
neg_guidance_1, neg_guidance_2, neg_guidance_3,
|
129 |
+
threshold_1, threshold_2, threshold_3):
|
130 |
+
|
131 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
editing_args = dict(
|
133 |
editing_prompt = [edit_concept_1,edit_concept_2,edit_concept_3],
|
134 |
reverse_editing_direction = [ neg_guidance_1, neg_guidance_2, neg_guidance_3,],
|
|
|
137 |
edit_threshold=[threshold_1, threshold_2, threshold_3],
|
138 |
edit_momentum_scale=0.3,
|
139 |
edit_mom_beta=0.6,
|
140 |
+
eta=1,)
|
141 |
+
|
142 |
latnets = wts.value[skip].expand(1, -1, -1, -1)
|
143 |
sega_out = sem_pipe(prompt=tar_prompt, latents=latnets, guidance_scale = tar_cfg_scale,
|
144 |
num_images_per_prompt=1,
|
145 |
num_inference_steps=steps,
|
146 |
use_ddpm=True, wts=wts.value, zs=zs.value[skip:], **editing_args)
|
147 |
+
|
148 |
return sega_out.images[0], reconstruct_button.update(visible=True)
|
149 |
|
150 |
|