Spaces:
Runtime error
Runtime error
Linoy Tsaban
commited on
Commit
·
bbb4584
1
Parent(s):
d2ec8a3
Update app.py
Browse files
app.py
CHANGED
|
@@ -150,7 +150,9 @@ def edit(input_image,
|
|
| 150 |
zs = gr.State(value=zs_tensor)
|
| 151 |
do_inversion = False
|
| 152 |
|
| 153 |
-
|
|
|
|
|
|
|
| 154 |
if edit_concept_1 != "" or edit_concept_2 != "" or edit_concept_3 != "":
|
| 155 |
editing_args = dict(
|
| 156 |
editing_prompt = [edit_concept_1,edit_concept_2,edit_concept_3],
|
|
@@ -163,8 +165,6 @@ def edit(input_image,
|
|
| 163 |
eta=1,)
|
| 164 |
|
| 165 |
latnets = wts.value[skip].expand(1, -1, -1, -1)
|
| 166 |
-
if image_caption == tar_prompt:
|
| 167 |
-
tar_prompt = ""
|
| 168 |
sega_out = sem_pipe(prompt=tar_prompt, latents=latnets, guidance_scale = tar_cfg_scale,
|
| 169 |
num_images_per_prompt=1,
|
| 170 |
num_inference_steps=steps,
|
|
|
|
| 150 |
zs = gr.State(value=zs_tensor)
|
| 151 |
do_inversion = False
|
| 152 |
|
| 153 |
+
if image_caption == tar_prompt: # if image caption was not changed, run pure sega
|
| 154 |
+
tar_prompt = ""
|
| 155 |
+
|
| 156 |
if edit_concept_1 != "" or edit_concept_2 != "" or edit_concept_3 != "":
|
| 157 |
editing_args = dict(
|
| 158 |
editing_prompt = [edit_concept_1,edit_concept_2,edit_concept_3],
|
|
|
|
| 165 |
eta=1,)
|
| 166 |
|
| 167 |
latnets = wts.value[skip].expand(1, -1, -1, -1)
|
|
|
|
|
|
|
| 168 |
sega_out = sem_pipe(prompt=tar_prompt, latents=latnets, guidance_scale = tar_cfg_scale,
|
| 169 |
num_images_per_prompt=1,
|
| 170 |
num_inference_steps=steps,
|