Spaces:
Running
on
A10G
Running
on
A10G
Linoy Tsaban
commited on
Commit
•
dbc34e0
1
Parent(s):
f54a73a
Update app.py
Browse files
app.py
CHANGED
@@ -12,6 +12,15 @@ from modified_pipeline_semantic_stable_diffusion import SemanticStableDiffusionP
|
|
12 |
from torch import autocast, inference_mode
|
13 |
import re
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
def invert(x0, prompt_src="", num_diffusion_steps=100, cfg_scale_src = 3.5, eta = 1):
|
16 |
|
17 |
# inverts a real image according to Algorihm 1 in https://arxiv.org/pdf/2304.06140.pdf,
|
@@ -227,11 +236,6 @@ with gr.Blocks(css='style.css') as demo:
|
|
227 |
do_inversion = True
|
228 |
return do_inversion
|
229 |
|
230 |
-
def randomize_seed_fn(seed, randomize_seed):
|
231 |
-
if randomize_seed:
|
232 |
-
seed = random.randint(0, np.iinfo(np.int32).max)
|
233 |
-
torch.manual_seed(seed)
|
234 |
-
return seed
|
235 |
|
236 |
gr.HTML(intro)
|
237 |
wts = gr.State()
|
|
|
12 |
from torch import autocast, inference_mode
|
13 |
import re
|
14 |
|
15 |
+
|
16 |
+
|
17 |
+
def randomize_seed_fn(seed, randomize_seed):
|
18 |
+
if randomize_seed:
|
19 |
+
seed = random.randint(0, np.iinfo(np.int32).max)
|
20 |
+
torch.manual_seed(seed)
|
21 |
+
return seed
|
22 |
+
|
23 |
+
|
24 |
def invert(x0, prompt_src="", num_diffusion_steps=100, cfg_scale_src = 3.5, eta = 1):
|
25 |
|
26 |
# inverts a real image according to Algorihm 1 in https://arxiv.org/pdf/2304.06140.pdf,
|
|
|
236 |
do_inversion = True
|
237 |
return do_inversion
|
238 |
|
|
|
|
|
|
|
|
|
|
|
239 |
|
240 |
gr.HTML(intro)
|
241 |
wts = gr.State()
|