Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -65,8 +65,13 @@ async def infer(model_str, prompt, nprompt="", height=0, width=0, steps=0, cfg=0
|
|
65 |
if steps > 0: kwargs["num_inference_steps"] = steps
|
66 |
if cfg > 0: cfg = kwargs["guidance_scale"] = cfg
|
67 |
|
68 |
-
if seed == -1:
|
69 |
-
|
|
|
|
|
|
|
|
|
|
|
70 |
task = asyncio.create_task(asyncio.to_thread(models_load[model_str].fn, prompt=prompt, negative_prompt=nprompt, **kwargs, token=HF_TOKEN))
|
71 |
await asyncio.sleep(0)
|
72 |
try:
|
|
|
65 |
if steps > 0: kwargs["num_inference_steps"] = steps
|
66 |
if cfg > 0: cfg = kwargs["guidance_scale"] = cfg
|
67 |
|
68 |
+
if seed == -1:
|
69 |
+
theSeed = randomize_seed()
|
70 |
+
kwargs["seed"] = theSeed
|
71 |
+
else:
|
72 |
+
kwargs["seed"] = seed
|
73 |
+
theSeed = seed
|
74 |
+
|
75 |
task = asyncio.create_task(asyncio.to_thread(models_load[model_str].fn, prompt=prompt, negative_prompt=nprompt, **kwargs, token=HF_TOKEN))
|
76 |
await asyncio.sleep(0)
|
77 |
try:
|