Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

fix(webv2): restore waiting workflow preview after reload

JPPhoto78091c71b544
diff --git a/invokeai/frontend/webv2/src/features/queue/runtime.test.ts b/invokeai/frontend/webv2/src/features/queue/runtime.test.ts
index 20769159d4..d7bd00c65e 100644
--- a/invokeai/frontend/webv2/src/features/queue/runtime.test.ts
+++ b/invokeai/frontend/webv2/src/features/queue/runtime.test.ts
@@ -1989,6 +1989,7 @@ describe('queue runtime', () => {
});
activeProgressTargetStore.clear();
const clear = vi.spyOn(activeProgressTargetStore, 'clear');
+ const set = vi.spyOn(activeProgressTargetStore, 'set');
try {
runtime.start();
@@ -1996,12 +1997,15 @@ describe('queue runtime', () => {
if (hasWorkflowCall) {
expect(clear).not.toHaveBeenCalledWith({ itemIndex: 1, queueItemId: queueItem.id });
+ expect(set).toHaveBeenCalledWith({ itemIndex: 1, queueItemId: queueItem.id });
} else {
expect(clear).toHaveBeenCalledWith({ itemIndex: 1, queueItemId: queueItem.id });
+ expect(set).not.toHaveBeenCalledWith({ itemIndex: 1, queueItemId: queueItem.id });
}
} finally {
await runtime.dispose();
clear.mockRestore();
+ set.mockRestore();
}
});
diff --git a/invokeai/frontend/webv2/src/features/queue/runtime/coordinator.ts b/invokeai/frontend/webv2/src/features/queue/runtime/coordinator.ts
index fc999bbf2d..ce0ca2e6a4 100644
--- a/invokeai/frontend/webv2/src/features/queue/runtime/coordinator.ts
+++ b/invokeai/frontend/webv2/src/features/queue/runtime/coordinator.ts
@@ -621,7 +621,7 @@ export const createQueueCoordinator = (
const wait = waits.get(queueItem.id);
if (wait) {
const target = getProgressImageTarget(wait.localQueueItemId, queueItem.id);
- if (queueItem.status === 'in_progress') {
+ if (queueItem.status === 'in_progress' || (queueItem.status === 'waiting' && wait.hasWorkflowCall)) {
activeProgressTarget.set(target);
} else if ((queueItem.status === 'pending' || queueItem.status === 'waiting') && !wait.hasWorkflowCall) {
activeProgressTarget.clear(target);