From ddff9b45848fd2e601e27d9703353d9dffb2893d Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Mon, 27 May 2024 11:01:34 +1000 Subject: [PATCH] fix(events): typing for download event handler --- invokeai/app/api/sockets.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/invokeai/app/api/sockets.py b/invokeai/app/api/sockets.py index 4d7c7478cf..b39922c69b 100644 --- a/invokeai/app/api/sockets.py +++ b/invokeai/app/api/sockets.py @@ -15,6 +15,7 @@ from invokeai.app.services.events.events_common import ( DownloadCancelledEvent, DownloadCompleteEvent, DownloadErrorEvent, + DownloadEventBase, DownloadProgressEvent, DownloadStartedEvent, FastAPIEvent, @@ -117,7 +118,7 @@ class SocketIO: async def _handle_queue_event(self, event: FastAPIEvent[QueueEventBase]): await self._sio.emit(event=event[0], data=event[1].model_dump(mode="json"), room=event[1].queue_id) - async def _handle_model_event(self, event: FastAPIEvent[ModelEventBase]) -> None: + async def _handle_model_event(self, event: FastAPIEvent[ModelEventBase | DownloadEventBase]) -> None: await self._sio.emit(event=event[0], data=event[1].model_dump(mode="json")) async def _handle_bulk_image_download_event(self, event: FastAPIEvent[BulkDownloadEventBase]) -> None: