Spaces:
Running
Running
Upload app.py
Browse files
app.py
CHANGED
@@ -61,11 +61,10 @@ async def infer(model_index, prompt, nprompt="", height=None, width=None, steps=
|
|
61 |
if not task.done(): task.cancel()
|
62 |
result = None
|
63 |
raise Exception(e)
|
64 |
-
if task.done() and result is not None:
|
65 |
with lock:
|
66 |
png_path = "image.png"
|
67 |
-
|
68 |
-
else: result.save(png_path)
|
69 |
image = str(Path(png_path).resolve())
|
70 |
return image
|
71 |
return None
|
|
|
61 |
if not task.done(): task.cancel()
|
62 |
result = None
|
63 |
raise Exception(e)
|
64 |
+
if task.done() and result is not None and not isinstance(result, tuple):
|
65 |
with lock:
|
66 |
png_path = "image.png"
|
67 |
+
result.save(png_path)
|
|
|
68 |
image = str(Path(png_path).resolve())
|
69 |
return image
|
70 |
return None
|