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.

refactor(webv2): give multi-session tiles the shared preview footer

joshistoastd886f3ddc95e
diff --git a/invokeai/frontend/webv2/performance/architecture-baseline.json b/invokeai/frontend/webv2/performance/architecture-baseline.json
index 1ba8182061..d3e02166a3 100644
--- a/invokeai/frontend/webv2/performance/architecture-baseline.json
+++ b/invokeai/frontend/webv2/performance/architecture-baseline.json
@@ -2,10 +2,10 @@
"build": {
"launchpad": {
"baseline": {
- "brotliBytes": 832111,
+ "brotliBytes": 832112,
"cssRawBytes": 2159,
"fontRawBytes": 219480,
- "gzipBytes": 831930,
+ "gzipBytes": 831924,
"imageRawBytes": 156376,
"initialRawBytes": 1933595,
"largestAssetRawBytes": 746305,
@@ -280,10 +280,10 @@
]
},
"limits": {
- "brotliBytes": 840433,
+ "brotliBytes": 840434,
"cssRawBytes": 2181,
"fontRawBytes": 221675,
- "gzipBytes": 840250,
+ "gzipBytes": 840244,
"imageRawBytes": 157940,
"initialRawBytes": 1952931,
"largestAssetRawBytes": 753769,
@@ -298,15 +298,15 @@
},
"editor": {
"baseline": {
- "brotliBytes": 1029041,
+ "brotliBytes": 1029111,
"cssRawBytes": 2159,
"fontRawBytes": 219480,
- "gzipBytes": 1026446,
+ "gzipBytes": 1026451,
"imageRawBytes": 156376,
- "initialRawBytes": 2524281,
+ "initialRawBytes": 2524311,
"largestAssetRawBytes": 746305,
"otherAssetRawBytes": 0,
- "ownedRawBytes": 111344,
+ "ownedRawBytes": 111374,
"requestCount": 88,
"scriptRequestCount": 72,
"sourceOwners": [
@@ -827,15 +827,15 @@
]
},
"limits": {
- "brotliBytes": 1039332,
+ "brotliBytes": 1039403,
"cssRawBytes": 2181,
"fontRawBytes": 221675,
- "gzipBytes": 1036711,
+ "gzipBytes": 1036716,
"imageRawBytes": 157940,
- "initialRawBytes": 2549524,
+ "initialRawBytes": 2549555,
"largestAssetRawBytes": 753769,
"otherAssetRawBytes": 0,
- "ownedRawBytes": 111344,
+ "ownedRawBytes": 111374,
"requestCount": 88,
"scriptRequestCount": 72
},
diff --git a/invokeai/frontend/webv2/performance/browser-baseline.json b/invokeai/frontend/webv2/performance/browser-baseline.json
index 7613287572..d060a56001 100644
--- a/invokeai/frontend/webv2/performance/browser-baseline.json
+++ b/invokeai/frontend/webv2/performance/browser-baseline.json
@@ -25,11 +25,11 @@
"scriptRequestCount": 0,
"totalRawBytes": 0
},
- "domContentLoadedMedianMs": 117.10000000149012,
+ "domContentLoadedMedianMs": 119.10000000149012,
"id": "launchpad",
"layoutSwitchMedianMs": 0,
- "loadMedianMs": 117.10000000149012,
- "longestTaskMaxMs": 71,
+ "loadMedianMs": 119.10000000149012,
+ "longestTaskMaxMs": 73,
"owner": "app",
"projectSwitchMedianMs": 0,
"readyMark": "invokeai:ready:launchpad",
@@ -56,7 +56,7 @@
"scriptRequestCount": 32,
"totalRawBytes": 1784521
},
- "routeReadyMedianMs": 256.1000000014901,
+ "routeReadyMedianMs": 260.8999999985099,
"scriptSourceOwnerSet": "launchpad-static",
"stateProfile": "empty"
},
@@ -83,11 +83,11 @@
"scriptRequestCount": 0,
"totalRawBytes": 0
},
- "domContentLoadedMedianMs": 116.89999999850988,
+ "domContentLoadedMedianMs": 117.89999999850988,
"id": "launchpad",
"layoutSwitchMedianMs": 0,
- "loadMedianMs": 116.89999999850988,
- "longestTaskMaxMs": 69,
+ "loadMedianMs": 117.89999999850988,
+ "longestTaskMaxMs": 72,
"owner": "app",
"projectSwitchMedianMs": 0,
"readyMark": "invokeai:ready:launchpad",
@@ -114,7 +114,7 @@
"scriptRequestCount": 32,
"totalRawBytes": 1784521
},
- "routeReadyMedianMs": 273.3999999985099,
+ "routeReadyMedianMs": 279.6000000014901,
"scriptSourceOwnerSet": "launchpad-static",
"stateProfile": "representative"
},
@@ -141,13 +141,13 @@
"scriptRequestCount": 0,
"totalRawBytes": 0
},
- "domContentLoadedMedianMs": 118.59999999403954,
+ "domContentLoadedMedianMs": 119,
"id": "editor-minimal",
"layoutSwitchMedianMs": 0,
- "loadMedianMs": 118.59999999403954,
+ "loadMedianMs": 119.10000000149012,
"longestTaskMaxMs": 96,
"owner": "workbench",
- "projectSwitchMedianMs": 33.100000001490116,
+ "projectSwitchMedianMs": 36.899999998509884,
"readyMark": "invokeai:ready:widget:center:preview",
"remediationTicket": "deepen-widget-registry-loading",
"resourceBaseline": {
@@ -157,9 +157,9 @@
"largestAssetRawBytes": 746305,
"otherRawBytes": 135938,
"requestCount": 113,
- "scriptRawBytes": 3366465,
+ "scriptRawBytes": 3366963,
"scriptRequestCount": 107,
- "totalRawBytes": 3700015
+ "totalRawBytes": 3700513
},
"resourceLimits": {
"cssRawBytes": 17748,
@@ -168,11 +168,11 @@
"largestAssetRawBytes": 753769,
"otherRawBytes": 137298,
"requestCount": 113,
- "scriptRawBytes": 3400130,
+ "scriptRawBytes": 3400633,
"scriptRequestCount": 107,
- "totalRawBytes": 3737016
+ "totalRawBytes": 3737519
},
- "routeReadyMedianMs": 643.1000000014901,
+ "routeReadyMedianMs": 647.2000000029802,
"scriptSourceOwnerSet": "editor-minimal-static",
"stateProfile": "empty"
},
@@ -199,13 +199,13 @@
"scriptRequestCount": 0,
"totalRawBytes": 0
},
- "domContentLoadedMedianMs": 115.10000000149012,
+ "domContentLoadedMedianMs": 115.39999999850988,
"id": "editor-minimal",
"layoutSwitchMedianMs": 0,
- "loadMedianMs": 115.10000000149012,
- "longestTaskMaxMs": 97,
+ "loadMedianMs": 115.39999999850988,
+ "longestTaskMaxMs": 126,
"owner": "workbench",
- "projectSwitchMedianMs": 49.5,
+ "projectSwitchMedianMs": 51.30000000447035,
"readyMark": "invokeai:ready:widget:center:preview",
"remediationTicket": "deepen-widget-registry-loading",
"resourceBaseline": {
@@ -215,9 +215,9 @@
"largestAssetRawBytes": 746305,
"otherRawBytes": 135938,
"requestCount": 113,
- "scriptRawBytes": 3366465,
+ "scriptRawBytes": 3366963,
"scriptRequestCount": 107,
- "totalRawBytes": 3700015
+ "totalRawBytes": 3700513
},
"resourceLimits": {
"cssRawBytes": 17748,
@@ -226,11 +226,11 @@
"largestAssetRawBytes": 753769,
"otherRawBytes": 137298,
"requestCount": 113,
- "scriptRawBytes": 3400130,
+ "scriptRawBytes": 3400633,
"scriptRequestCount": 107,
- "totalRawBytes": 3737016
+ "totalRawBytes": 3737519
},
- "routeReadyMedianMs": 688.2999999970198,
+ "routeReadyMedianMs": 719.7999999970198,
"scriptSourceOwnerSet": "editor-minimal-static",
"stateProfile": "representative"
},
@@ -257,11 +257,11 @@
"scriptRequestCount": 5,
"totalRawBytes": 286746
},
- "domContentLoadedMedianMs": 113,
+ "domContentLoadedMedianMs": 111.5,
"id": "editor-canvas",
- "layoutSwitchMedianMs": 62.600000001490116,
- "loadMedianMs": 113,
- "longestTaskMaxMs": 99,
+ "layoutSwitchMedianMs": 63.80000000447035,
+ "loadMedianMs": 111.5,
+ "longestTaskMaxMs": 92,
"owner": "canvas",
"projectSwitchMedianMs": 0,
"readyMark": "invokeai:ready:widget:center:canvas",
@@ -273,9 +273,9 @@
"largestAssetRawBytes": 746305,
"otherRawBytes": 135938,
"requestCount": 118,
- "scriptRawBytes": 3650371,
+ "scriptRawBytes": 3650869,
"scriptRequestCount": 112,
- "totalRawBytes": 3983921
+ "totalRawBytes": 3984419
},
"resourceLimits": {
"cssRawBytes": 17748,
@@ -284,11 +284,11 @@
"largestAssetRawBytes": 753769,
"otherRawBytes": 137298,
"requestCount": 118,
- "scriptRawBytes": 3686875,
+ "scriptRawBytes": 3687378,
"scriptRequestCount": 112,
- "totalRawBytes": 4023761
+ "totalRawBytes": 4024264
},
- "routeReadyMedianMs": 1085.1999999955297,
+ "routeReadyMedianMs": 1081.7999999970198,
"scriptSourceOwnerSet": "editor-canvas-static",
"stateProfile": "empty"
},
@@ -315,11 +315,11 @@
"scriptRequestCount": 5,
"totalRawBytes": 286746
},
- "domContentLoadedMedianMs": 111.60000000149012,
+ "domContentLoadedMedianMs": 108.5,
"id": "editor-canvas",
- "layoutSwitchMedianMs": 188.20000000298023,
- "loadMedianMs": 111.60000000149012,
- "longestTaskMaxMs": 362,
+ "layoutSwitchMedianMs": 184.39999999850988,
+ "loadMedianMs": 108.5,
+ "longestTaskMaxMs": 363,
"owner": "canvas",
"projectSwitchMedianMs": 0,
"readyMark": "invokeai:ready:widget:center:canvas",
@@ -331,9 +331,9 @@
"largestAssetRawBytes": 746305,
"otherRawBytes": 135938,
"requestCount": 118,
- "scriptRawBytes": 3650371,
+ "scriptRawBytes": 3650869,
"scriptRequestCount": 112,
- "totalRawBytes": 3983921
+ "totalRawBytes": 3984419
},
"resourceLimits": {
"cssRawBytes": 17748,
@@ -342,11 +342,11 @@
"largestAssetRawBytes": 753769,
"otherRawBytes": 137298,
"requestCount": 118,
- "scriptRawBytes": 3686875,
+ "scriptRawBytes": 3687378,
"scriptRequestCount": 112,
- "totalRawBytes": 4023761
+ "totalRawBytes": 4024264
},
- "routeReadyMedianMs": 1241.6999999955297,
+ "routeReadyMedianMs": 1226.2000000029802,
"scriptSourceOwnerSet": "editor-canvas-static",
"stateProfile": "representative"
},
@@ -373,11 +373,11 @@
"scriptRequestCount": 0,
"totalRawBytes": 0
},
- "domContentLoadedMedianMs": 115.79999999701977,
+ "domContentLoadedMedianMs": 111,
"id": "editor-workflow",
- "layoutSwitchMedianMs": 59.70000000298023,
- "loadMedianMs": 115.79999999701977,
- "longestTaskMaxMs": 100,
+ "layoutSwitchMedianMs": 57.5,
+ "loadMedianMs": 111,
+ "longestTaskMaxMs": 94,
"owner": "workflow",
"projectSwitchMedianMs": 0,
"readyMark": "invokeai:ready:widget:center:workflow",
@@ -389,9 +389,9 @@
"largestAssetRawBytes": 746305,
"otherRawBytes": 135938,
"requestCount": 113,
- "scriptRawBytes": 3366465,
+ "scriptRawBytes": 3366963,
"scriptRequestCount": 107,
- "totalRawBytes": 3700015
+ "totalRawBytes": 3700513
},
"resourceLimits": {
"cssRawBytes": 17748,
@@ -400,11 +400,11 @@
"largestAssetRawBytes": 753769,
"otherRawBytes": 137298,
"requestCount": 113,
- "scriptRawBytes": 3400130,
+ "scriptRawBytes": 3400633,
"scriptRequestCount": 107,
- "totalRawBytes": 3737016
+ "totalRawBytes": 3737519
},
- "routeReadyMedianMs": 1084.3999999985099,
+ "routeReadyMedianMs": 1051,
"scriptSourceOwnerSet": "editor-minimal-static",
"stateProfile": "empty"
},
@@ -431,11 +431,11 @@
"scriptRequestCount": 0,
"totalRawBytes": 0
},
- "domContentLoadedMedianMs": 115.5,
+ "domContentLoadedMedianMs": 115.10000000149012,
"id": "editor-workflow",
- "layoutSwitchMedianMs": 111.69999999552965,
- "loadMedianMs": 115.5,
- "longestTaskMaxMs": 369,
+ "layoutSwitchMedianMs": 106.5,
+ "loadMedianMs": 115.10000000149012,
+ "longestTaskMaxMs": 353,
"owner": "workflow",
"projectSwitchMedianMs": 0,
"readyMark": "invokeai:ready:widget:center:workflow",
@@ -447,9 +447,9 @@
"largestAssetRawBytes": 746305,
"otherRawBytes": 135938,
"requestCount": 113,
- "scriptRawBytes": 3366465,
+ "scriptRawBytes": 3366963,
"scriptRequestCount": 107,
- "totalRawBytes": 3700015
+ "totalRawBytes": 3700513
},
"resourceLimits": {
"cssRawBytes": 17748,
@@ -458,11 +458,11 @@
"largestAssetRawBytes": 753769,
"otherRawBytes": 137298,
"requestCount": 113,
- "scriptRawBytes": 3400130,
+ "scriptRawBytes": 3400633,
"scriptRequestCount": 107,
- "totalRawBytes": 3737016
+ "totalRawBytes": 3737519
},
- "routeReadyMedianMs": 1176.7999999970198,
+ "routeReadyMedianMs": 1154.2999999970198,
"scriptSourceOwnerSet": "editor-minimal-static",
"stateProfile": "representative"
},
@@ -489,11 +489,11 @@
"scriptRequestCount": 0,
"totalRawBytes": 0
},
- "domContentLoadedMedianMs": 112.70000000298023,
+ "domContentLoadedMedianMs": 108.60000000149012,
"id": "editor-gallery",
- "layoutSwitchMedianMs": 25.899999998509884,
- "loadMedianMs": 112.70000000298023,
- "longestTaskMaxMs": 109,
+ "layoutSwitchMedianMs": 22.700000002980232,
+ "loadMedianMs": 108.69999999552965,
+ "longestTaskMaxMs": 97,
"owner": "gallery",
"projectSwitchMedianMs": 0,
"readyMark": "invokeai:ready:widget:center:gallery",
@@ -505,9 +505,9 @@
"largestAssetRawBytes": 746305,
"otherRawBytes": 135938,
"requestCount": 113,
- "scriptRawBytes": 3366465,
+ "scriptRawBytes": 3366963,
"scriptRequestCount": 107,
- "totalRawBytes": 3700015
+ "totalRawBytes": 3700513
},
"resourceLimits": {
"cssRawBytes": 17748,
@@ -516,11 +516,11 @@
"largestAssetRawBytes": 753769,
"otherRawBytes": 137298,
"requestCount": 113,
- "scriptRawBytes": 3400130,
+ "scriptRawBytes": 3400633,
"scriptRequestCount": 107,
- "totalRawBytes": 3737016
+ "totalRawBytes": 3737519
},
- "routeReadyMedianMs": 1333.3999999985099,
+ "routeReadyMedianMs": 1301.7999999970198,
"scriptSourceOwnerSet": "editor-minimal-static",
"stateProfile": "empty"
},
@@ -547,11 +547,11 @@
"scriptRequestCount": 0,
"totalRawBytes": 0
},
- "domContentLoadedMedianMs": 113.5,
+ "domContentLoadedMedianMs": 108.20000000298023,
"id": "editor-gallery",
- "layoutSwitchMedianMs": 98,
- "loadMedianMs": 113.5,
- "longestTaskMaxMs": 138,
+ "layoutSwitchMedianMs": 89.60000000149012,
+ "loadMedianMs": 108.20000000298023,
+ "longestTaskMaxMs": 150,
"owner": "gallery",
"projectSwitchMedianMs": 0,
"readyMark": "invokeai:ready:widget:center:gallery",
@@ -563,9 +563,9 @@
"largestAssetRawBytes": 746305,
"otherRawBytes": 135938,
"requestCount": 113,
- "scriptRawBytes": 3366465,
+ "scriptRawBytes": 3366963,
"scriptRequestCount": 107,
- "totalRawBytes": 3700015
+ "totalRawBytes": 3700513
},
"resourceLimits": {
"cssRawBytes": 17748,
@@ -574,11 +574,11 @@
"largestAssetRawBytes": 753769,
"otherRawBytes": 137298,
"requestCount": 113,
- "scriptRawBytes": 3400130,
+ "scriptRawBytes": 3400633,
"scriptRequestCount": 107,
- "totalRawBytes": 3737016
+ "totalRawBytes": 3737519
},
- "routeReadyMedianMs": 1453.8000000044703,
+ "routeReadyMedianMs": 1427.8999999985099,
"scriptSourceOwnerSet": "editor-minimal-static",
"stateProfile": "representative"
}
diff --git a/invokeai/frontend/webv2/src/features/gallery/ui/GalleryImageGrid.browser.test.tsx b/invokeai/frontend/webv2/src/features/gallery/ui/GalleryImageGrid.browser.test.tsx
index bc404b21b1..832b42997f 100644
--- a/invokeai/frontend/webv2/src/features/gallery/ui/GalleryImageGrid.browser.test.tsx
+++ b/invokeai/frontend/webv2/src/features/gallery/ui/GalleryImageGrid.browser.test.tsx
@@ -383,7 +383,6 @@ const Harness = ({
frameHeight={96}
frameWidth={128}
isLive={false}
- liveBadgeLabel="Generating"
shouldAntialiasLiveImage
source={{ itemKey: 'image:shared', kind: 'image', source: previewSource }}
variant="framed"
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFooter.tsx b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFooter.tsx
index 73c9557f93..de65120933 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFooter.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFooter.tsx
@@ -1,5 +1,6 @@
import type { GalleryImage, GalleryItem } from '@features/gallery';
import type { ImageActions } from '@workbench/image-actions';
+import type { ReactNode } from 'react';
import { HStack, Icon, Stack, Text } from '@chakra-ui/react';
import { formatGalleryVideoDuration } from '@features/gallery/contracts';
@@ -19,6 +20,53 @@ export type PreviewFooterMedia =
| { actionImage: GalleryImage | null; actions: ImageActions; item: GalleryItem; kind: 'item' }
| { height: number; kind: 'live'; width: number };
+/**
+ * The opaque island a preview footer sits in.
+ *
+ * Shared rather than restyled per surface: a live session and a finished item
+ * must present the same frame and the same bar, so that the moment generation
+ * ends nothing about the layout moves. Every preview surface that carries a
+ * footer — single, multi-session tile, compare — renders it through this.
+ */
+export const PreviewFooterIsland = ({ children }: { children: ReactNode }) => (
+ <Stack bg="bg.subtle" borderColor="border.subtle" borderWidth="1px" gap="2" minW="0" p="3" rounded="md" shadow="sm">
+ {children}
+ </Stack>
+);
+
+/**
+ * The footer for one tile in the multi-session grid.
+ *
+ * A tile has no board position to report and no prev/next to offer, so it
+ * spends the same row on the two facts that are specific to it: which device is
+ * rendering, and how far along it is. It always names its state — with several
+ * sessions racing, a tile saying nothing reads as a stuck one.
+ */
+export const PreviewTileFooter = ({ deviceLabel, percent }: { deviceLabel: string | null; percent: number | null }) => {
+ const { t } = useTranslation();
+ const statusLabel = percent === null ? t('common.generating') : `${percent}%`;
+
+ return (
+ <PreviewFooterIsland>
+ <HStack align="center" gap="1" minW="0">
+ {deviceLabel === null ? null : (
+ <>
+ <Text color="fg.muted" fontSize="2xs" truncate>
+ {deviceLabel}
+ </Text>
+ <Text color="fg.subtle" flexShrink={0} fontSize="2xs">
+ ·
+ </Text>
+ </>
+ )}
+ <Text color="fg.muted" flexShrink={0} fontSize="2xs" fontVariantNumeric="tabular-nums">
+ {statusLabel}
+ </Text>
+ </HStack>
+ </PreviewFooterIsland>
+ );
+};
+
/**
* The preview's slim status bar: board position and dimensions on one quiet
* row with prev/next, plus the Details expander. Identity (board / image name)
@@ -65,7 +113,7 @@ export const PreviewFooter = ({
const { height, width } = media.kind === 'item' ? media.item : media;
return (
- <Stack bg="bg.subtle" borderColor="border.subtle" borderWidth="1px" gap="2" minW="0" p="3" rounded="md" shadow="sm">
+ <PreviewFooterIsland>
<HStack align="center" justify="space-between">
<HStack gap="1" minW="0">
<Text color="fg.muted" fontSize="2xs" fontVariantNumeric="tabular-nums" truncate>
@@ -122,6 +170,6 @@ export const PreviewFooter = ({
</Text>
</HStack>
)}
- </Stack>
+ </PreviewFooterIsland>
);
};
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFrame.tsx b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFrame.tsx
index 345bb738c2..8ddc3aab68 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFrame.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFrame.tsx
@@ -35,14 +35,13 @@ interface PreviewFrameProps {
frameHeight: number;
frameWidth: number;
isItemCurrent?: (itemKey: GalleryItemKey) => boolean;
- isLive: boolean;
/**
- * Static caption over a live frame — used only by the multi-session tiles to
- * name the GPU. The single live preview carries no badge at all: the frame
- * is styled exactly like a finished item, and progress readouts belong to
- * the footer and the top bar rail.
+ * No live frame carries a caption of any kind. The frame is styled exactly
+ * like a finished item so nothing about it moves when denoising ends, and
+ * every progress readout — including which device is rendering — belongs to
+ * the footer island or the top bar rail.
*/
- liveBadgeLabel?: string;
+ isLive: boolean;
loupeControlsRef?: Ref<PreviewLoupeControls>;
onContextMenu?: (x: number, y: number) => void;
onVideoCopyAvailabilityChange?: (itemKey: GalleryItemKey, isAvailable: boolean) => void;
@@ -81,7 +80,6 @@ const PreviewImageFrame = ({
frameHeight,
frameWidth,
isLive,
- liveBadgeLabel,
loupeControlsRef,
onContextMenu,
padding,
@@ -154,13 +152,6 @@ const PreviewImageFrame = ({
width={frameWidth}
/>
) : null;
- const liveBadge =
- isLive && liveBadgeLabel !== undefined ? (
- <Badge left="2" pointerEvents="none" position="absolute" size="xs" top="2" variant="solid">
- {liveBadgeLabel}
- </Badge>
- ) : null;
-
if (variant === 'inset') {
return (
// Live tiles all reserve the chrome inset, so in a multi-session grid the
@@ -170,7 +161,6 @@ const PreviewImageFrame = ({
{source ? (
<FittedFrame frameHeight={frameHeight} frameWidth={frameWidth}>
{media}
- {liveBadge}
</FittedFrame>
) : (
children
@@ -204,7 +194,6 @@ const PreviewImageFrame = ({
onContextMenu={onContextMenu ? handleContextMenu : undefined}
>
{media}
- {liveBadge}
</FittedFrame>
{loupe.zoomPercent !== null ? (
<Badge
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFrameChromeInset.browser.test.tsx b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFrameChromeInset.browser.test.tsx
index 84f3c7a0f5..c6f1935f4e 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFrameChromeInset.browser.test.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFrameChromeInset.browser.test.tsx
@@ -72,7 +72,6 @@ const render = async (hasFloatingChrome: boolean) => {
frameHeight={128}
frameWidth={128}
isLive={false}
- liveBadgeLabel="Generating"
padding={STAGE_PADDING}
shouldAntialiasLiveImage
source={MEDIA_SOURCE}
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFrameDrag.browser.test.tsx b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFrameDrag.browser.test.tsx
index 300209a6e4..a4fe432d33 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFrameDrag.browser.test.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFrameDrag.browser.test.tsx
@@ -91,7 +91,6 @@ const renderHarness = async () => {
frameHeight={128}
frameWidth={128}
isLive={false}
- liveBadgeLabel="Generating"
shouldAntialiasLiveImage
source={{ itemKey: 'image:preview.png', kind: 'image', source }}
variant="framed"
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFrameVideo.browser.test.tsx b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFrameVideo.browser.test.tsx
index 9748597342..6f0338eec7 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFrameVideo.browser.test.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFrameVideo.browser.test.tsx
@@ -106,7 +106,6 @@ const VideoHarness = ({
frameHeight={1080}
frameWidth={1920}
isLive={false}
- liveBadgeLabel="Generating"
shouldAntialiasLiveImage
source={source}
variant="framed"
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewMediaChrome.browser.test.tsx b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewMediaChrome.browser.test.tsx
index a527e1614f..06ee208ee2 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewMediaChrome.browser.test.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewMediaChrome.browser.test.tsx
@@ -49,7 +49,7 @@ const sharedVideo: GalleryVideoItem = {
const mocks = vi.hoisted(() => ({
itemProgress: null as { device: string | null; percentage: number | null } | null,
progressImage: null,
- deviceLabel: null,
+ deviceLabel: null as { index: number } | null,
}));
vi.mock('@features/queue/react', () => ({
@@ -469,25 +469,62 @@ describe('Multi-session live preview tiles', () => {
width: 512,
};
- it('shows a live badge with percent on session tiles even without a device label', async () => {
+ const renderTile = async () => {
+ await render(
+ <DndContext>
+ <LivePreviewTile placeholder={placeholder} shouldAntialiasProgressImage={false} />
+ </DndContext>
+ );
+
+ return Array.from(host!.querySelectorAll<HTMLElement>('p')).map((element) => element.textContent ?? '');
+ };
+
+ it('reports percent from the footer when no device label is available', async () => {
mocks.itemProgress = { device: null, percentage: 0.4 };
mocks.deviceLabel = null;
+ const footerText = await renderTile();
+
+ expect(footerText).toContain('40%');
+ });
+
+ it('names the device alongside percent once the label resolves', async () => {
+ mocks.itemProgress = { device: 'cuda:1', percentage: 0.4 };
+ mocks.deviceLabel = { index: 1 };
+
+ const footerText = await renderTile();
+
+ expect(footerText).toContain('GPU 1');
+ expect(footerText).toContain('40%');
+ });
+
+ it('still declares itself live before progress is quantified', async () => {
+ // A silent tile reads as a stuck one when several sessions race, so the
+ // footer says "Generating" rather than going blank.
+ mocks.itemProgress = { device: null, percentage: null };
+ mocks.deviceLabel = null;
+
+ const footerText = await renderTile();
+
+ expect(footerText).toContain('Generating');
+ });
+
+ it('carries no caption over the image itself', async () => {
+ // The frame must be indistinguishable from a finished item's, so that
+ // nothing moves at the moment denoising ends.
+ mocks.itemProgress = { device: 'cuda:1', percentage: 0.4 };
+ mocks.deviceLabel = { index: 1 };
+
await render(
<DndContext>
<LivePreviewTile placeholder={placeholder} shouldAntialiasProgressImage={false} />
</DndContext>
);
- const allElements = Array.from(host!.querySelectorAll('*'));
- const badge = allElements.find((el) => {
- const text = el.textContent || '';
- return /Generating · 40%/.test(text);
- });
+ const image = host!.querySelector('img');
+ const captionInsideFrame = image?.closest('div')?.querySelector('p, span');
- expect(badge).not.toBeNull();
- if (badge) {
- expect(badge.textContent || '').toMatch(/Generating · 40%/);
- }
+ expect(image).not.toBeNull();
+ expect(captionInsideFrame).toBeNull();
});
});
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewWidgetView.tsx b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewWidgetView.tsx
index b7c7336fbd..9aa929ec24 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewWidgetView.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewWidgetView.tsx
@@ -70,7 +70,7 @@ import { PreviewCompare } from './PreviewCompare';
import { resolvePreviewCompareDrop } from './previewCompareDnd';
import { usePreviewDensity, type PreviewDensity } from './previewDensity';
import { PreviewFilmstrip } from './PreviewFilmstrip';
-import { PreviewFooter, type PreviewFooterMedia } from './PreviewFooter';
+import { PreviewFooter, type PreviewFooterMedia, PreviewTileFooter } from './PreviewFooter';
import {
PreviewFrame,
type PreviewMediaSource,
@@ -174,6 +174,14 @@ const selectGenerateRecallValues = createGenerateFormValuesSelector();
*/
const PREVIEW_OVERLAY_RESERVE = '5.5rem';
+/**
+ * A tile carries a footer but never a filmstrip, so it reserves the one island
+ * instead of the pair. Its stage padding stays compact for the same reason the
+ * grid exists at all: at four sessions each cell is a quarter of the widget.
+ */
+const PREVIEW_TILE_OVERLAY_RESERVE = '3.25rem';
+const PREVIEW_TILE_STAGE_PADDING = '3';
+
export const PreviewWidgetView = ({ region, runtime }: WidgetViewProps) => {
const galleryValues = useActiveProjectSelector((project) => getProjectWidgetValues(project, 'gallery'));
const queueItems = useActiveProjectSelector((project) => project.queue.items);
@@ -907,24 +915,27 @@ export const LivePreviewTile = ({
);
const percent = getDeterminateProgressPercent(itemProgress?.percentage);
- // Every tile declares itself live: with several sessions racing, a silent
- // tile reads as a stuck one. Device label when known, plain "Generating"
- // otherwise; percent appended once quantified (zero is model-loading).
- const badgeBase = deviceLabel
- ? t('widgets.queue.device.shortLabel', { index: deviceLabel.index })
- : t('common.generating');
- const liveBadgeLabel = percent === null ? badgeBase : `${badgeBase} · ${percent}%`;
+ // Device identity and progress read from the footer, not from a badge over
+ // the image: a tile is the same media card as any other preview surface, and
+ // the one thing that must never differ between them is the frame itself.
+ const tileDeviceLabel = deviceLabel ? t('widgets.queue.device.shortLabel', { index: deviceLabel.index }) : null;
return (
- <PreviewFrame
- frameHeight={previewImage?.height ?? placeholder.height}
- frameWidth={previewImage?.width ?? placeholder.width}
- isLive
- liveBadgeLabel={liveBadgeLabel}
- shouldAntialiasLiveImage={shouldAntialiasProgressImage}
- source={source}
- variant="inset"
- />
+ <PreviewMediaScaffold>
+ <PreviewFrame
+ frameHeight={previewImage?.height ?? placeholder.height}
+ frameWidth={previewImage?.width ?? placeholder.width}
+ isLive
+ padding={PREVIEW_TILE_STAGE_PADDING}
+ paddingBottom={PREVIEW_TILE_OVERLAY_RESERVE}
+ shouldAntialiasLiveImage={shouldAntialiasProgressImage}
+ source={source}
+ variant="framed"
+ />
+ <PreviewOverlayStack>
+ <PreviewTileFooter deviceLabel={tileDeviceLabel} percent={percent} />
+ </PreviewOverlayStack>
+ </PreviewMediaScaffold>
);
};