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(workbench): add diagnostic metadata to error producers
joshistoastd90b53c3ce63
diff --git a/invokeai/frontend/webv2/src/workbench/WorkbenchContext.tsx b/invokeai/frontend/webv2/src/workbench/WorkbenchContext.tsxindex dfc6404517..e255b9ae65 100644--- a/invokeai/frontend/webv2/src/workbench/WorkbenchContext.tsx+++ b/invokeai/frontend/webv2/src/workbench/WorkbenchContext.tsx@@ -120,7 +120,9 @@ export const WorkbenchProvider = ({}} catch (error) {dispatch({+ area: 'persistence-load',message: error instanceof Error ? error.message : 'Failed to load persisted workbench.',+ namespace: 'system',type: 'recordError',});} finally {diff --git a/invokeai/frontend/webv2/src/workbench/image-actions/executeImageRecall.ts b/invokeai/frontend/webv2/src/workbench/image-actions/executeImageRecall.tsindex 9773e22948..49ab18d057 100644--- a/invokeai/frontend/webv2/src/workbench/image-actions/executeImageRecall.ts+++ b/invokeai/frontend/webv2/src/workbench/image-actions/executeImageRecall.ts@@ -127,7 +127,13 @@ export const executeImageRecall = async ({});return true;} catch (error: unknown) {- dispatch({ message: toErrorMessage(error), type: 'recordError' });+ dispatch({+ area: 'image-recall',+ message: toErrorMessage(error),+ namespace: 'generation',+ projectId,+ type: 'recordError',+ });return false;}};diff --git a/invokeai/frontend/webv2/src/workbench/image-actions/useImageActions.ts b/invokeai/frontend/webv2/src/workbench/image-actions/useImageActions.tsindex eb9b1ca838..7786d43b17 100644--- a/invokeai/frontend/webv2/src/workbench/image-actions/useImageActions.ts+++ b/invokeai/frontend/webv2/src/workbench/image-actions/useImageActions.ts@@ -105,7 +105,14 @@ export const useImageActions = ({}, []);return useMemo<ImageActions>(() => {- const recordError = (error: unknown) => dispatch({ message: toErrorMessage(error), type: 'recordError' });+ const recordError = (error: unknown) =>+ dispatch({+ area: 'image-actions',+ message: toErrorMessage(error),+ namespace: 'gallery',+ projectId,+ type: 'recordError',+ });const recordSuccess = (title: string, message?: string) =>dispatch({ kind: 'success', message, title, type: 'recordNotice' });const refreshGallery = () => dispatch({ projectId, type: 'touchGalleryRefresh' });diff --git a/invokeai/frontend/webv2/src/workbench/widgets/gallery/GalleryWidgetView.tsx b/invokeai/frontend/webv2/src/workbench/widgets/gallery/GalleryWidgetView.tsxindex 9f42531bba..efa8a19152 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/gallery/GalleryWidgetView.tsx+++ b/invokeai/frontend/webv2/src/workbench/widgets/gallery/GalleryWidgetView.tsx@@ -131,7 +131,11 @@ export const GalleryWidgetView = ({ presentation, region, runtime }: WidgetViewPconst page = getGalleryPage(galleryValues);const knownTotalImages = getGalleryTotalImages(galleryValues);const settings = getGallerySettings(galleryValues);- const onError = useCallback((message: string) => dispatch({ message, type: 'recordError' }), [dispatch]);+ const onError = useCallback(+ (message: string) =>+ dispatch({ area: 'gallery-data', message, namespace: 'gallery', projectId, type: 'recordError' }),+ [dispatch, projectId]+ );const data = useGalleryData({galleryView,diff --git a/invokeai/frontend/webv2/src/workbench/widgets/gallery/useGalleryActions.ts b/invokeai/frontend/webv2/src/workbench/widgets/gallery/useGalleryActions.tsindex 92932df03d..3666a778c2 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/gallery/useGalleryActions.ts+++ b/invokeai/frontend/webv2/src/workbench/widgets/gallery/useGalleryActions.ts@@ -33,7 +33,8 @@ export const useGalleryActions = ({selectedBoardId: string;}): GalleryActions => {return useMemo<GalleryActions>(() => {- const recordError = (error: unknown) => dispatch({ message: toErrorMessage(error), type: 'recordError' });+ const recordError = (error: unknown) =>+ dispatch({ area: 'gallery-actions', message: toErrorMessage(error), namespace: 'gallery', type: 'recordError' });const recordSuccess = (title: string, message?: string) =>dispatch({ kind: 'success', message, title, type: 'recordNotice' });const refresh = () => dispatch({ type: 'touchGalleryRefresh' });@@ -145,7 +146,12 @@ export const useGalleryActions = ({const accepted = files.filter((file) => ACCEPTED_UPLOAD_TYPES.has(file.type));if (accepted.length === 0) {- dispatch({ message: 'No supported image files to upload (PNG, JPEG, or WebP).', type: 'recordError' });+ dispatch({+ area: 'gallery-upload',+ message: 'No supported image files to upload (PNG, JPEG, or WebP).',+ namespace: 'gallery',+ type: 'recordError',+ });return;}diff --git a/invokeai/frontend/webv2/src/workbench/widgets/generate/promptFields/PositivePromptActions.tsx b/invokeai/frontend/webv2/src/workbench/widgets/generate/promptFields/PositivePromptActions.tsxindex 35b40f444d..dd55093d73 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/generate/promptFields/PositivePromptActions.tsx+++ b/invokeai/frontend/webv2/src/workbench/widgets/generate/promptFields/PositivePromptActions.tsx@@ -349,7 +349,13 @@ const ExpandPromptButton = ({setIsOpen(false);} catch (error) {- dispatch({ message: getApiErrorMessage(error, 'Could not expand the prompt.'), type: 'recordError' });+ dispatch({+ area: 'expand-prompt',+ message: getApiErrorMessage(error, 'Could not expand the prompt.'),+ namespace: 'generation',+ projectId,+ type: 'recordError',+ });} finally {setIsLoading(false);}@@ -463,7 +469,10 @@ const ImageToPromptButton = ({setIsOpen(false);} catch (error) {dispatch({+ area: 'image-to-prompt',message: getApiErrorMessage(error, 'Could not generate a prompt from the selected image.'),+ namespace: 'generation',+ projectId,type: 'recordError',});} finally {diff --git a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewWidgetView.tsx b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewWidgetView.tsxindex a5196deaba..902a19cd23 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewWidgetView.tsx+++ b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewWidgetView.tsx@@ -230,7 +230,12 @@ export const PreviewWidgetView = ({ region, runtime }: WidgetViewProps) => {}).catch((error: unknown) => {if (!isStale) {- dispatch({ message: error instanceof Error ? error.message : String(error), type: 'recordError' });+ dispatch({+ area: 'preview-board-images',+ message: error instanceof Error ? error.message : String(error),+ namespace: 'gallery',+ type: 'recordError',+ });const fallbackImage = selectedImageRef.current;