John6666 commited on
Commit
1a04b3b
β€’
1 Parent(s): 89d82e9

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
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
- if isinstance(result, tuple): result[0].save(png_path)
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