Fixes bug when postprocessing image with no metadata

This commit is contained in:
psychedelicious 2022-11-21 14:56:06 +11:00 committed by blessedcoolant
parent a1d80fd106
commit 089c85a017

View File

@ -324,8 +324,9 @@ class InvokeAIWebServer:
) )
os.remove(thumbnail_path) os.remove(thumbnail_path)
except Exception as e: except Exception as e:
traceback.print_exc() socketio.emit("error", {"message": f"Unable to delete {f}: {str(e)}"})
socketio.emit("error", {"message": f"Unable to delete {f}"}) pass
socketio.emit("tempFolderEmptied") socketio.emit("tempFolderEmptied")
except Exception as e: except Exception as e:
self.socketio.emit("error", {"message": (str(e))}) self.socketio.emit("error", {"message": (str(e))})
@ -430,8 +431,9 @@ class InvokeAIWebServer:
"category": category, "category": category,
} }
) )
except: except Exception as e:
socketio.emit("error", {"message": f"Unable to load {path}"}) socketio.emit("error", {"message": f"Unable to load {path}: {str(e)}"})
pass
socketio.emit( socketio.emit(
"galleryImages", "galleryImages",
@ -500,9 +502,10 @@ class InvokeAIWebServer:
"category": category, "category": category,
} }
) )
except: except Exception as e:
print(f">> Unable to load {path}") print(f">> Unable to load {path}")
socketio.emit("error", {"message": f"Unable to load {path}"}) socketio.emit("error", {"message": f"Unable to load {path}: {str(e)}"})
pass
socketio.emit( socketio.emit(
"galleryImages", "galleryImages",
@ -574,8 +577,9 @@ class InvokeAIWebServer:
try: try:
seed = original_image["metadata"]["image"]["seed"] seed = original_image["metadata"]["image"]["seed"]
except (NameError, AttributeError) as e: except (KeyError) as e:
seed = "unknown_seed" seed = "unknown_seed"
pass
if postprocessing_parameters["type"] == "esrgan": if postprocessing_parameters["type"] == "esrgan":
progress.set_current_status("Upscaling (ESRGAN)") progress.set_current_status("Upscaling (ESRGAN)")