Spaces:
Runtime error
Runtime error
dreamdrop-art
commited on
Commit
·
314c360
1
Parent(s):
efe2f1f
Update app.py
Browse files
app.py
CHANGED
@@ -24,9 +24,9 @@ def hf_inference(prompt, negative, model, steps, sampler, guidance, width, heigh
|
|
24 |
try:
|
25 |
progress(0, desc="Starting")
|
26 |
images=[]
|
27 |
-
time.sleep(
|
28 |
progress(0.05)
|
29 |
-
progress(0.25, desc="
|
30 |
image_bytes = query(payload={
|
31 |
"inputs": f"{prompt}",
|
32 |
"parameters": {
|
@@ -38,9 +38,11 @@ def hf_inference(prompt, negative, model, steps, sampler, guidance, width, heigh
|
|
38 |
},
|
39 |
}, model=model)
|
40 |
progress(75, desc="Opening image")
|
|
|
41 |
image = Image.open(io.BytesIO(image_bytes))
|
42 |
images.append(image)
|
43 |
progress(99, desc="Sending image")
|
|
|
44 |
return images
|
45 |
except PIL.UnidentifiedImageError:
|
46 |
gr.Warning("This model is not loaded now. Try others models.")
|
@@ -244,6 +246,7 @@ def img2img(input_image, denoising, prompt, negative_prompt, model, steps, sampl
|
|
244 |
|
245 |
job = prodia_client.wait(result)
|
246 |
progress(0.99, desc="Sending image")
|
|
|
247 |
return job["imageUrl"]
|
248 |
|
249 |
|
|
|
24 |
try:
|
25 |
progress(0, desc="Starting")
|
26 |
images=[]
|
27 |
+
time.sleep(2.5)
|
28 |
progress(0.05)
|
29 |
+
progress(0.25, desc="Generating")
|
30 |
image_bytes = query(payload={
|
31 |
"inputs": f"{prompt}",
|
32 |
"parameters": {
|
|
|
38 |
},
|
39 |
}, model=model)
|
40 |
progress(75, desc="Opening image")
|
41 |
+
time.sleep(1)
|
42 |
image = Image.open(io.BytesIO(image_bytes))
|
43 |
images.append(image)
|
44 |
progress(99, desc="Sending image")
|
45 |
+
time.sleep(0.5)
|
46 |
return images
|
47 |
except PIL.UnidentifiedImageError:
|
48 |
gr.Warning("This model is not loaded now. Try others models.")
|
|
|
246 |
|
247 |
job = prodia_client.wait(result)
|
248 |
progress(0.99, desc="Sending image")
|
249 |
+
time.sleep(0.5)
|
250 |
return job["imageUrl"]
|
251 |
|
252 |
|