From c57c6a6cfc5ae2132d90cd553affec4862ffc43e Mon Sep 17 00:00:00 2001
From: psychedelicious <4822129+psychedelicious@users.noreply.github.com>
Date: Wed, 18 Sep 2024 10:14:49 +1000
Subject: [PATCH] tidy(ui): update image usage names to match canvas v2
- "isControlAdapterImage" -> "isControlLayerImage"
- "isIPAdapterImage" -> "isReferenceImage"
---
.../listenerMiddleware/listeners/imageToDeleteSelected.ts | 4 ++--
.../deleteImageModal/components/DeleteImageModal.tsx | 4 ++--
.../deleteImageModal/components/ImageUsageMessage.tsx | 4 ++--
.../web/src/features/deleteImageModal/store/selectors.ts | 8 ++++----
.../web/src/features/deleteImageModal/store/types.ts | 4 ++--
.../gallery/components/Boards/DeleteBoardModal.tsx | 4 ++--
6 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageToDeleteSelected.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageToDeleteSelected.ts
index c29b1d3de7b..c8f80ef451e 100644
--- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageToDeleteSelected.ts
+++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageToDeleteSelected.ts
@@ -14,8 +14,8 @@ export const addImageToDeleteSelectedListener = (startAppListening: AppStartList
const isImageInUse =
imagesUsage.some((i) => i.isRasterLayerImage) ||
- imagesUsage.some((i) => i.isControlAdapterImage) ||
- imagesUsage.some((i) => i.isIPAdapterImage) ||
+ imagesUsage.some((i) => i.isControlLayerImage) ||
+ imagesUsage.some((i) => i.isReferenceImage) ||
imagesUsage.some((i) => i.isInpaintMaskImage) ||
imagesUsage.some((i) => i.isUpscaleImage) ||
imagesUsage.some((i) => i.isNodesImage) ||
diff --git a/invokeai/frontend/web/src/features/deleteImageModal/components/DeleteImageModal.tsx b/invokeai/frontend/web/src/features/deleteImageModal/components/DeleteImageModal.tsx
index 53ee9e37314..e2df5e59cae 100644
--- a/invokeai/frontend/web/src/features/deleteImageModal/components/DeleteImageModal.tsx
+++ b/invokeai/frontend/web/src/features/deleteImageModal/components/DeleteImageModal.tsx
@@ -36,8 +36,8 @@ const selectImageUsages = createMemoizedSelector(
isInpaintMaskImage: some(allImageUsage, (i) => i.isInpaintMaskImage),
isRegionalGuidanceImage: some(allImageUsage, (i) => i.isRegionalGuidanceImage),
isNodesImage: some(allImageUsage, (i) => i.isNodesImage),
- isControlAdapterImage: some(allImageUsage, (i) => i.isControlAdapterImage),
- isIPAdapterImage: some(allImageUsage, (i) => i.isIPAdapterImage),
+ isControlLayerImage: some(allImageUsage, (i) => i.isControlLayerImage),
+ isReferenceImage: some(allImageUsage, (i) => i.isReferenceImage),
};
return {
diff --git a/invokeai/frontend/web/src/features/deleteImageModal/components/ImageUsageMessage.tsx b/invokeai/frontend/web/src/features/deleteImageModal/components/ImageUsageMessage.tsx
index 8077afd3d89..0401ac30117 100644
--- a/invokeai/frontend/web/src/features/deleteImageModal/components/ImageUsageMessage.tsx
+++ b/invokeai/frontend/web/src/features/deleteImageModal/components/ImageUsageMessage.tsx
@@ -29,8 +29,8 @@ const ImageUsageMessage = (props: Props) => {
<>
{topMessage}
- {imageUsage.isControlAdapterImage && {t('controlLayers.controlLayer')}}
- {imageUsage.isIPAdapterImage && {t('controlLayers.referenceImage')}}
+ {imageUsage.isControlLayerImage && {t('controlLayers.controlLayer')}}
+ {imageUsage.isReferenceImage && {t('controlLayers.referenceImage')}}
{imageUsage.isInpaintMaskImage && {t('controlLayers.inpaintMask')}}
{imageUsage.isRasterLayerImage && {t('controlLayers.rasterLayer')}}
{imageUsage.isRegionalGuidanceImage && {t('controlLayers.regionalGuidance')}}
diff --git a/invokeai/frontend/web/src/features/deleteImageModal/store/selectors.ts b/invokeai/frontend/web/src/features/deleteImageModal/store/selectors.ts
index 38f509d42d4..935edfefcf7 100644
--- a/invokeai/frontend/web/src/features/deleteImageModal/store/selectors.ts
+++ b/invokeai/frontend/web/src/features/deleteImageModal/store/selectors.ts
@@ -21,7 +21,7 @@ export const getImageUsage = (nodes: NodesState, canvas: CanvasState, upscale: U
const isUpscaleImage = upscale.upscaleInitialImage?.image_name === image_name;
- const isIPAdapterImage = canvas.referenceImages.entities.some(
+ const isReferenceImage = canvas.referenceImages.entities.some(
({ ipAdapter }) => ipAdapter.image?.image_name === image_name
);
@@ -29,7 +29,7 @@ export const getImageUsage = (nodes: NodesState, canvas: CanvasState, upscale: U
objects.some((obj) => isCanvasImageState(obj) && obj.image.image_name === image_name)
);
- const isControlAdapterImage = canvas.controlLayers.entities.some(({ objects }) =>
+ const isControlLayerImage = canvas.controlLayers.entities.some(({ objects }) =>
objects.some((obj) => isCanvasImageState(obj) && obj.image.image_name === image_name)
);
@@ -47,8 +47,8 @@ export const getImageUsage = (nodes: NodesState, canvas: CanvasState, upscale: U
isInpaintMaskImage,
isRegionalGuidanceImage,
isNodesImage,
- isControlAdapterImage,
- isIPAdapterImage,
+ isControlLayerImage,
+ isReferenceImage,
};
return imageUsage;
diff --git a/invokeai/frontend/web/src/features/deleteImageModal/store/types.ts b/invokeai/frontend/web/src/features/deleteImageModal/store/types.ts
index 5f4cf7ec8d5..5e018948a02 100644
--- a/invokeai/frontend/web/src/features/deleteImageModal/store/types.ts
+++ b/invokeai/frontend/web/src/features/deleteImageModal/store/types.ts
@@ -11,6 +11,6 @@ export type ImageUsage = {
isInpaintMaskImage: boolean;
isRegionalGuidanceImage: boolean;
isNodesImage: boolean;
- isControlAdapterImage: boolean;
- isIPAdapterImage: boolean;
+ isControlLayerImage: boolean;
+ isReferenceImage: boolean;
};
diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/DeleteBoardModal.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/DeleteBoardModal.tsx
index 1b89fd5dff5..3097002052e 100644
--- a/invokeai/frontend/web/src/features/gallery/components/Boards/DeleteBoardModal.tsx
+++ b/invokeai/frontend/web/src/features/gallery/components/Boards/DeleteBoardModal.tsx
@@ -50,8 +50,8 @@ const DeleteBoardModal = () => {
isInpaintMaskImage: some(allImageUsage, (i) => i.isInpaintMaskImage),
isRegionalGuidanceImage: some(allImageUsage, (i) => i.isRegionalGuidanceImage),
isNodesImage: some(allImageUsage, (i) => i.isNodesImage),
- isControlAdapterImage: some(allImageUsage, (i) => i.isControlAdapterImage),
- isIPAdapterImage: some(allImageUsage, (i) => i.isIPAdapterImage),
+ isControlLayerImage: some(allImageUsage, (i) => i.isControlLayerImage),
+ isReferenceImage: some(allImageUsage, (i) => i.isReferenceImage),
};
return imageUsageSummary;