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.
TypeScript ai-artartificial-intelligencegenerative-artimage-generationimg2imginpaintinglatent-diffusionlinuxmacosoutpaintingstable-diffusiontxt2imgwindows
feat(webv2): move widget padding into views, add header chrome
joshistoastde37b7999674
diff --git a/invokeai/frontend/webv2/src/workbench/components/WidgetFrames.tsx b/invokeai/frontend/webv2/src/workbench/components/WidgetFrames.tsxindex 710f6da2db..f3fd56a440 100644--- a/invokeai/frontend/webv2/src/workbench/components/WidgetFrames.tsx+++ b/invokeai/frontend/webv2/src/workbench/components/WidgetFrames.tsx@@ -119,7 +119,6 @@ export const WidgetPanelFrame = ({gap="3"overflow="hidden"minW="0"- p="3"{...focusRegionProps}{...(isBottom ? { h: `${displaySizePx}px`, w: 'full' } : { h: 'full', w: `${displaySizePx}px` })}>@@ -161,7 +160,7 @@ export const WidgetHeader = ({const surface = manifest.graphBearing?.surfaces.includes(region) ? createGraphBearingSurface(manifest, region) : null;return (- <HStack justify="space-between">+ <HStack justify="space-between" borderBottomWidth={1} h={10} ps="3" pe="2"><Text fontSize="xs" fontWeight="700">{manifest.labelText}</Text>diff --git a/invokeai/frontend/webv2/src/workbench/components/WidgetRenderer.tsx b/invokeai/frontend/webv2/src/workbench/components/WidgetRenderer.tsxindex 79ce094a1e..5e884bb7ff 100644--- a/invokeai/frontend/webv2/src/workbench/components/WidgetRenderer.tsx+++ b/invokeai/frontend/webv2/src/workbench/components/WidgetRenderer.tsx@@ -53,7 +53,7 @@ const WidgetShellFrame = ({}return (- <Flex bg="bg.canvas" direction="column" gap="3" h="full" minH="0" p="3" w="full">+ <Flex bg="bg.canvas" direction="column" h="full" minH="0" w="full"><HeaderSlot presentation={presentation} region={region} widget={widget} /><Box flex="1" minH="0" overflow="hidden" position="relative">{content}diff --git a/invokeai/frontend/webv2/src/workbench/widgets/gallery/GalleryPanelContent.tsx b/invokeai/frontend/webv2/src/workbench/widgets/gallery/GalleryPanelContent.tsxindex 8df020e3a2..2b9856b98e 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/gallery/GalleryPanelContent.tsx+++ b/invokeai/frontend/webv2/src/workbench/widgets/gallery/GalleryPanelContent.tsx@@ -4,7 +4,7 @@ import { GalleryImageGrid } from './GalleryImageGrid';import { GalleryToolbar } from './GalleryToolbar';export const GalleryPanelContent = ({ layout }: { layout: 'stacked' | 'wide' }) => (- <Stack gap="3" h="full" maxW="full" minH="0" minW="0" w="full">+ <Stack gap="3" p={layout === 'stacked' ? '2' : '3'} h="full" maxW="full" minH="0" minW="0" w="full"><GalleryToolbar layout={layout} /><GalleryImageGrid layout={layout} /></Stack>diff --git a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewWidgetView.tsx b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewWidgetView.tsxindex 6bd40fe61e..2681fa888f 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewWidgetView.tsx+++ b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewWidgetView.tsx@@ -250,44 +250,48 @@ export const PreviewWidgetView = ({ region }: WidgetViewProps) => {const isComparing =selectedImage !== null && compareImage !== null && compareImage.imageName !== selectedImage.imageName;- return selectedImage ? (- <>- {isComparing && compareImage ? (- <PreviewCompare- baseImage={selectedImage}- compareImage={compareImage}- onExit={() => dispatch({ image: null, type: 'setGalleryCompareImage' })}- onSwap={() => {- dispatch({ image: compareImage, type: 'selectGalleryImage' });- dispatch({ image: selectedImage, type: 'setGalleryCompareImage' });- }}- />+ return (+ <Box p="2" h="full">+ {selectedImage ? (+ <>+ {isComparing && compareImage ? (+ <PreviewCompare+ baseImage={selectedImage}+ compareImage={compareImage}+ onExit={() => dispatch({ image: null, type: 'setGalleryCompareImage' })}+ onSwap={() => {+ dispatch({ image: compareImage, type: 'selectGalleryImage' });+ dispatch({ image: selectedImage, type: 'setGalleryCompareImage' });+ }}+ />+ ) : (+ <SelectedImagePreview+ boardImageCount={boardImages.length}+ boardName={boardName}+ image={selectedImage}+ isCompact={isSidePanel}+ isLoadingBoard={isLoadingBoard}+ selectedIndex={selectedIndex}+ onContextMenu={(x, y) => {+ if (contextMenuImage) {+ setContextMenuTarget({ images: [contextMenuImage], x, y });+ }+ }}+ onNext={() => selectByOffset(1)}+ onPrevious={() => selectByOffset(-1)}+ />+ )}+ <ImageContextMenu+ actions={imageActions}+ boards={boards}+ target={contextMenuTarget}+ onClose={() => setContextMenuTarget(null)}+ />+ </>) : (- <SelectedImagePreview- boardImageCount={boardImages.length}- boardName={boardName}- image={selectedImage}- isCompact={isSidePanel}- isLoadingBoard={isLoadingBoard}- selectedIndex={selectedIndex}- onContextMenu={(x, y) => {- if (contextMenuImage) {- setContextMenuTarget({ images: [contextMenuImage], x, y });- }- }}- onNext={() => selectByOffset(1)}- onPrevious={() => selectByOffset(-1)}- />+ <EmptyPreview />)}- <ImageContextMenu- actions={imageActions}- boards={boards}- target={contextMenuTarget}- onClose={() => setContextMenuTarget(null)}- />- </>- ) : (- <EmptyPreview />+ </Box>);};