John6666 commited on
Commit
20eb362
·
verified ·
1 Parent(s): 044542e

Upload modutils.py

Browse files
Files changed (1) hide show
  1. modutils.py +2 -1
modutils.py CHANGED
@@ -345,8 +345,9 @@ def save_image_history(image, gallery, files, model_name: str, progress=gr.Progr
345
  elif isinstance(image, np.ndarray):
346
  oldpath = "temp.png"
347
  Image.fromarray(image).convert('RGBA').save(oldpath)
 
348
  newpath = oldpath
349
- if Path(oldpath).exists():
350
  shutil.copy(oldpath.resolve(), Path(filename).resolve())
351
  newpath = Path(filename).resolve()
352
  files.insert(0, str(newpath))
 
345
  elif isinstance(image, np.ndarray):
346
  oldpath = "temp.png"
347
  Image.fromarray(image).convert('RGBA').save(oldpath)
348
+ oldpath = Path(oldpath)
349
  newpath = oldpath
350
+ if oldpath.exists():
351
  shutil.copy(oldpath.resolve(), Path(filename).resolve())
352
  newpath = Path(filename).resolve()
353
  files.insert(0, str(newpath))