From a6f9396a3021f561dda0ddd5e35bdc2d07207bbd Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Tue, 1 Aug 2023 18:08:17 +1000 Subject: [PATCH] fix(db): retrieve metadata even when no `session_id` this was unnecessarily skipped if there was no `session_id`. --- invokeai/app/services/images.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/invokeai/app/services/images.py b/invokeai/app/services/images.py index f8376eb626..2240846dac 100644 --- a/invokeai/app/services/images.py +++ b/invokeai/app/services/images.py @@ -289,9 +289,10 @@ class ImageService(ImageServiceABC): def get_metadata(self, image_name: str) -> Optional[ImageMetadata]: try: image_record = self._services.image_records.get(image_name) + metadata = self._services.image_records.get_metadata(image_name) if not image_record.session_id: - return ImageMetadata() + return ImageMetadata(metadata=metadata) session_raw = self._services.graph_execution_manager.get_raw(image_record.session_id) graph = None @@ -303,7 +304,6 @@ class ImageService(ImageServiceABC): self._services.logger.warn(f"Failed to parse session graph: {e}") graph = None - metadata = self._services.image_records.get_metadata(image_name) return ImageMetadata(graph=graph, metadata=metadata) except ImageRecordNotFoundException: self._services.logger.error("Image record not found")