diff --git a/backend/invoke_ai_web_server.py b/backend/invoke_ai_web_server.py index 66fda884ea..212f014f5a 100644 --- a/backend/invoke_ai_web_server.py +++ b/backend/invoke_ai_web_server.py @@ -425,7 +425,8 @@ class InvokeAIWebServer: thumbnail_path ), "mtime": os.path.getmtime(path), - "metadata": metadata, + "metadata": metadata.get("sd-metadata"), + "dreamPrompt": metadata.get("Dream"), "width": width, "height": height, "category": category, @@ -496,7 +497,8 @@ class InvokeAIWebServer: thumbnail_path ), "mtime": os.path.getmtime(path), - "metadata": metadata, + "metadata": metadata.get("sd-metadata"), + "dreamPrompt": metadata.get("Dream"), "width": width, "height": height, "category": category, @@ -659,7 +661,8 @@ class InvokeAIWebServer: "url": self.get_url_from_image_path(path), "thumbnail": self.get_url_from_image_path(thumbnail_path), "mtime": os.path.getmtime(path), - "metadata": metadata, + "metadata": metadata.get("sd-metadata"), + "dreamPrompt": metadata.get("Dream"), "width": width, "height": height, }, @@ -1090,6 +1093,7 @@ class InvokeAIWebServer: "thumbnail": self.get_url_from_image_path(thumbnail_path), "mtime": os.path.getmtime(path), "metadata": metadata, + "dreamPrompt": command, "width": width, "height": height, "boundingBox": original_bounding_box, diff --git a/frontend/src/app/invokeai.d.ts b/frontend/src/app/invokeai.d.ts index 02e0b365dc..6c528c36e1 100644 --- a/frontend/src/app/invokeai.d.ts +++ b/frontend/src/app/invokeai.d.ts @@ -120,6 +120,7 @@ export declare type Image = { height: number; category: GalleryCategory; isBase64?: boolean; + dreamPrompt?: 'string'; }; // GalleryImages is an array of Image. diff --git a/frontend/src/features/gallery/components/ImageMetaDataViewer/ImageMetadataViewer.tsx b/frontend/src/features/gallery/components/ImageMetaDataViewer/ImageMetadataViewer.tsx index 695a9da7f2..810458c8cc 100644 --- a/frontend/src/features/gallery/components/ImageMetaDataViewer/ImageMetadataViewer.tsx +++ b/frontend/src/features/gallery/components/ImageMetaDataViewer/ImageMetadataViewer.tsx @@ -45,6 +45,7 @@ type MetadataItemProps = { onClick?: () => void; value: number | string | boolean; labelPosition?: string; + withCopy?: boolean; }; /** @@ -56,6 +57,7 @@ const MetadataItem = ({ onClick, isLink, labelPosition, + withCopy = false, }: MetadataItemProps) => { return ( @@ -71,6 +73,18 @@ const MetadataItem = ({ /> )} + {withCopy && ( + + } + size={'xs'} + variant={'ghost'} + fontSize={14} + onClick={() => navigator.clipboard.writeText(value.toString())} + /> + + )} {label}: @@ -115,6 +129,8 @@ const ImageMetadataViewer = memo( }); const metadata = image?.metadata?.image || {}; + const dreamPrompt = image?.dreamPrompt; + const { type, postprocessing, @@ -381,6 +397,13 @@ const ImageMetadataViewer = memo( )} )} + {dreamPrompt && ( + + )}