diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketConnected.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketConnected.ts index d19f2fdf79..e8e36d026c 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketConnected.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketConnected.ts @@ -38,6 +38,12 @@ export const addSocketConnectedEventListener = () => { return; } + // If we are in development mode, reset the whole API state. In this scenario, reconnects will + // typically be caused by reloading the server, in which case we do want to reset the whole API. + if (import.meta.env.MODE === 'development') { + dispatch(api.util.resetApiState()); + } + // Else, we need to compare the last-known queue status with the current queue status, re-fetching // everything if it has changed.