From ce5b1103ed2e8d5722764a130ce9d38728261bd0 Mon Sep 17 00:00:00 2001 From: Mary Hipp Date: Wed, 17 Jul 2024 12:09:24 -0400 Subject: [PATCH] add send to upscale to context menu --- .../ImageContextMenu/SingleSelectionMenuItems.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/SingleSelectionMenuItems.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/SingleSelectionMenuItems.tsx index 31df113115..3b99a88229 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/SingleSelectionMenuItems.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/SingleSelectionMenuItems.tsx @@ -38,6 +38,7 @@ import { } from 'react-icons/pi'; import { useStarImagesMutation, useUnstarImagesMutation } from 'services/api/endpoints/images'; import type { ImageDTO } from 'services/api/types'; +import { upscaleInitialImageChanged } from '../../../parameters/store/upscaleSlice'; type SingleSelectionMenuItemsProps = { imageDTO: ImageDTO; @@ -124,6 +125,11 @@ const SingleSelectionMenuItems = (props: SingleSelectionMenuItemsProps) => { dispatch(imageToCompareChanged(imageDTO)); }, [dispatch, imageDTO]); + const handleSendToUpscale = useCallback(() => { + dispatch(upscaleInitialImageChanged(imageDTO)); + dispatch(setActiveTab('upscaling')); + }, [dispatch, imageDTO]); + return ( <> }> @@ -185,6 +191,9 @@ const SingleSelectionMenuItems = (props: SingleSelectionMenuItemsProps) => { {t('parameters.sendToUnifiedCanvas')} )} + } onClickCapture={handleSendToUpscale} id="send-to-upscale"> + Send to upscale + } onClickCapture={handleChangeBoard}> {t('boards.changeBoard')}