diff --git a/invokeai/frontend/web/src/features/controlNet/components/parameters/IAISelectableImage.tsx b/invokeai/frontend/web/src/features/controlNet/components/parameters/IAISelectableImage.tsx index 62cd4603e5..25277269ed 100644 --- a/invokeai/frontend/web/src/features/controlNet/components/parameters/IAISelectableImage.tsx +++ b/invokeai/frontend/web/src/features/controlNet/components/parameters/IAISelectableImage.tsx @@ -4,13 +4,13 @@ import { Icon, IconButtonProps, Image, + Spinner, Text, } from '@chakra-ui/react'; import { useDroppable } from '@dnd-kit/core'; import IAIIconButton from 'common/components/IAIIconButton'; import ImageMetadataOverlay from 'common/components/ImageMetadataOverlay'; import { useGetUrl } from 'common/util/getUrl'; -import ImageFallbackSpinner from 'features/gallery/components/ImageFallbackSpinner'; import { AnimatePresence, motion } from 'framer-motion'; import { SyntheticEvent } from 'react'; import { memo, useRef } from 'react'; @@ -18,6 +18,8 @@ import { FaImage, FaUndo } from 'react-icons/fa'; import { ImageDTO } from 'services/api'; import { v4 as uuidv4 } from 'uuid'; +const PLACEHOLDER_MIN_HEIGHT = 48; + type IAISelectableImageProps = { image: ImageDTO | null | undefined; onChange: (image: ImageDTO) => void; @@ -49,17 +51,42 @@ const IAISelectableImage = (props: IAISelectableImageProps) => { ref={setNodeRef} > {image && ( - + } + fallback={} onError={onError} sx={{ borderRadius: 'base', }} /> + {onReset && ( + + } + onClick={onReset} + /> + + )} {active && } @@ -69,7 +96,7 @@ const IAISelectableImage = (props: IAISelectableImageProps) => { <> { )} - {image && onReset && ( - - } - onClick={onReset} - /> - - )} ); }; @@ -198,3 +208,20 @@ const DropOverlay = (props: DropOverlayProps) => { ); }; + +const ImageFallback = () => ( + + + +); diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageFallbackSpinner.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageFallbackSpinner.tsx index 394ff9db15..3d4a0d6911 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageFallbackSpinner.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageFallbackSpinner.tsx @@ -14,6 +14,7 @@ const ImageFallbackSpinner = (props: ImageFallbackSpinnerProps) => { justifyContent: 'center', position: 'absolute', color: 'base.400', + minH: 40, }} >