diff --git a/invokeai/frontend/web/config/vite.app.config.ts b/invokeai/frontend/web/config/vite.app.config.ts index 9897b28118..e6c4df79fd 100644 --- a/invokeai/frontend/web/config/vite.app.config.ts +++ b/invokeai/frontend/web/config/vite.app.config.ts @@ -5,10 +5,36 @@ import eslint from 'vite-plugin-eslint'; import tsconfigPaths from 'vite-tsconfig-paths'; export const appConfig: UserConfig = { + base: './', plugins: [ react(), eslint(), tsconfigPaths(), visualizer() as unknown as PluginOption, ], + build: { + chunkSizeWarningLimit: 1500, + }, + server: { + // Proxy HTTP requests to the flask server + proxy: { + // Proxy socket.io to the nodes socketio server + '/ws/socket.io': { + target: 'ws://127.0.0.1:9090', + ws: true, + }, + // Proxy openapi schema definiton + '/openapi.json': { + target: 'http://127.0.0.1:9090/openapi.json', + rewrite: (path) => path.replace(/^\/openapi.json/, ''), + changeOrigin: true, + }, + // proxy nodes api + '/api/v1': { + target: 'http://127.0.0.1:9090/api/v1', + rewrite: (path) => path.replace(/^\/api\/v1/, ''), + changeOrigin: true, + }, + }, + }, }; diff --git a/invokeai/frontend/web/config/vite.common.config.ts b/invokeai/frontend/web/config/vite.common.config.ts deleted file mode 100644 index 8955a5a3d0..0000000000 --- a/invokeai/frontend/web/config/vite.common.config.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { UserConfig } from 'vite'; - -export const commonConfig: UserConfig = { - base: './', - server: { - // Proxy HTTP requests to the flask server - proxy: { - '/outputs': { - target: 'http://127.0.0.1:9090/outputs', - changeOrigin: true, - rewrite: (path) => path.replace(/^\/outputs/, ''), - }, - '/upload': { - target: 'http://127.0.0.1:9090/upload', - changeOrigin: true, - rewrite: (path) => path.replace(/^\/upload/, ''), - }, - '/flaskwebgui-keep-server-alive': { - target: 'http://127.0.0.1:9090/flaskwebgui-keep-server-alive', - changeOrigin: true, - rewrite: (path) => path.replace(/^\/flaskwebgui-keep-server-alive/, ''), - }, - // Proxy socket.io to the flask-socketio server - '/socket.io': { - target: 'ws://127.0.0.1:9090', - ws: true, - }, - // Proxy socket.io to the nodes socketio server - '/ws/socket.io': { - target: 'ws://127.0.0.1:9090', - ws: true, - }, - // Proxy openapi schema definiton - '/openapi.json': { - target: 'http://127.0.0.1:9090/openapi.json', - rewrite: (path) => path.replace(/^\/openapi.json/, ''), - changeOrigin: true, - }, - // proxy nodes api - '/api/v1': { - target: 'http://127.0.0.1:9090/api/v1', - rewrite: (path) => path.replace(/^\/api\/v1/, ''), - changeOrigin: true, - }, - }, - }, - build: { - chunkSizeWarningLimit: 1500, - }, -}; diff --git a/invokeai/frontend/web/config/vite.package.config.ts b/invokeai/frontend/web/config/vite.package.config.ts index d4b902d54b..5865461b06 100644 --- a/invokeai/frontend/web/config/vite.package.config.ts +++ b/invokeai/frontend/web/config/vite.package.config.ts @@ -2,11 +2,12 @@ import react from '@vitejs/plugin-react-swc'; import path from 'path'; import { visualizer } from 'rollup-plugin-visualizer'; import { PluginOption, UserConfig } from 'vite'; +import dts from 'vite-plugin-dts'; import eslint from 'vite-plugin-eslint'; import tsconfigPaths from 'vite-tsconfig-paths'; -import dts from 'vite-plugin-dts'; export const packageConfig: UserConfig = { + base: './', plugins: [ react(), eslint(), @@ -17,6 +18,7 @@ export const packageConfig: UserConfig = { }), ], build: { + chunkSizeWarningLimit: 1500, lib: { entry: path.resolve(__dirname, '../src/index.ts'), name: 'InvokeAIUI', diff --git a/invokeai/frontend/web/package.json b/invokeai/frontend/web/package.json index 4be29d1c25..3b16766bb1 100644 --- a/invokeai/frontend/web/package.json +++ b/invokeai/frontend/web/package.json @@ -72,7 +72,7 @@ "i18next-browser-languagedetector": "^7.0.1", "i18next-http-backend": "^2.2.0", "konva": "^9.0.1", - "lodash": "^4.17.21", + "lodash-es": "^4.17.21", "patch-package": "^7.0.0", "re-resizable": "^6.9.9", "react": "^18.2.0", @@ -101,7 +101,7 @@ }, "devDependencies": { "@types/dateformat": "^5.0.0", - "@types/lodash": "^4.14.194", + "@types/lodash-es": "^4.14.194", "@types/node": "^18.16.2", "@types/react": "^18.2.0", "@types/react-dom": "^18.2.1", diff --git a/invokeai/frontend/web/src/app/selectors/readinessSelector.ts b/invokeai/frontend/web/src/app/selectors/readinessSelector.ts index 82672756c8..d70043e545 100644 --- a/invokeai/frontend/web/src/app/selectors/readinessSelector.ts +++ b/invokeai/frontend/web/src/app/selectors/readinessSelector.ts @@ -4,7 +4,7 @@ import { initialCanvasImageSelector } from 'features/canvas/store/canvasSelector import { generationSelector } from 'features/parameters/store/generationSelectors'; import { systemSelector } from 'features/system/store/systemSelectors'; import { activeTabNameSelector } from 'features/ui/store/uiSelectors'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; export const readinessSelector = createSelector( [ diff --git a/invokeai/frontend/web/src/common/components/IAINumberInput.tsx b/invokeai/frontend/web/src/common/components/IAINumberInput.tsx index 4f468eb354..762182eb47 100644 --- a/invokeai/frontend/web/src/common/components/IAINumberInput.tsx +++ b/invokeai/frontend/web/src/common/components/IAINumberInput.tsx @@ -14,7 +14,7 @@ import { Tooltip, TooltipProps, } from '@chakra-ui/react'; -import { clamp } from 'lodash'; +import { clamp } from 'lodash-es'; import { FocusEvent, memo, useEffect, useState } from 'react'; diff --git a/invokeai/frontend/web/src/common/components/IAISlider.tsx b/invokeai/frontend/web/src/common/components/IAISlider.tsx index 643c5616c2..44f039c433 100644 --- a/invokeai/frontend/web/src/common/components/IAISlider.tsx +++ b/invokeai/frontend/web/src/common/components/IAISlider.tsx @@ -23,7 +23,7 @@ import { Tooltip, TooltipProps, } from '@chakra-ui/react'; -import { clamp } from 'lodash'; +import { clamp } from 'lodash-es'; import { useTranslation } from 'react-i18next'; import { diff --git a/invokeai/frontend/web/src/common/hooks/useGlobalHotkeys.ts b/invokeai/frontend/web/src/common/hooks/useGlobalHotkeys.ts index 46dff1f933..5078c8d358 100644 --- a/invokeai/frontend/web/src/common/hooks/useGlobalHotkeys.ts +++ b/invokeai/frontend/web/src/common/hooks/useGlobalHotkeys.ts @@ -2,7 +2,7 @@ import { createSelector } from '@reduxjs/toolkit'; import { RootState } from 'app/store/store'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import { shiftKeyPressed } from 'features/ui/store/hotkeysSlice'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { isHotkeyPressed, useHotkeys } from 'react-hotkeys-hook'; const globalHotkeysSelector = createSelector( diff --git a/invokeai/frontend/web/src/common/util/parseMetadata.ts b/invokeai/frontend/web/src/common/util/parseMetadata.ts index 433aa9b2a1..210c1f85ab 100644 --- a/invokeai/frontend/web/src/common/util/parseMetadata.ts +++ b/invokeai/frontend/web/src/common/util/parseMetadata.ts @@ -1,4 +1,4 @@ -import { forEach, size } from 'lodash'; +import { forEach, size } from 'lodash-es'; import { ImageField, LatentsField } from 'services/api'; const OBJECT_TYPESTRING = '[object Object]'; diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvas.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvas.tsx index 634a72f81c..1850b4bfe4 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvas.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvas.tsx @@ -8,7 +8,7 @@ import { import Konva from 'konva'; import { KonvaEventObject } from 'konva/lib/Node'; import { Vector2d } from 'konva/lib/types'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { useCallback, useRef } from 'react'; import { Layer, Stage } from 'react-konva'; diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasBoundingBoxOverlay.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasBoundingBoxOverlay.tsx index b6406a1945..e90d2c4d25 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasBoundingBoxOverlay.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasBoundingBoxOverlay.tsx @@ -1,6 +1,6 @@ import { createSelector } from '@reduxjs/toolkit'; import { useAppSelector } from 'app/store/storeHooks'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { Group, Rect } from 'react-konva'; import { canvasSelector } from '../store/canvasSelectors'; diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasGrid.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasGrid.tsx index 6bd926f852..ad47b77041 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasGrid.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasGrid.tsx @@ -5,7 +5,7 @@ import { createSelector } from '@reduxjs/toolkit'; import { RootState } from 'app/store/store'; import { useAppSelector } from 'app/store/storeHooks'; import { canvasSelector } from 'features/canvas/store/canvasSelectors'; -import { isEqual, range } from 'lodash'; +import { isEqual, range } from 'lodash-es'; import { ReactNode, useCallback, useLayoutEffect, useState } from 'react'; import { Group, Line as KonvaLine } from 'react-konva'; diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasIntermediateImage.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasIntermediateImage.tsx index 071d303939..745825a975 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasIntermediateImage.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasIntermediateImage.tsx @@ -4,7 +4,7 @@ import { useAppSelector } from 'app/store/storeHooks'; import { useGetUrl } from 'common/util/getUrl'; import { GalleryState } from 'features/gallery/store/gallerySlice'; import { ImageConfig } from 'konva/lib/shapes/Image'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { useEffect, useState } from 'react'; import { Image as KonvaImage } from 'react-konva'; diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasMaskCompositer.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasMaskCompositer.tsx index 1c2a15c600..e374d2aa7b 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasMaskCompositer.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasMaskCompositer.tsx @@ -6,7 +6,7 @@ import { Rect } from 'react-konva'; import { rgbaColorToString } from 'features/canvas/util/colorToString'; import Konva from 'konva'; -import { isNumber } from 'lodash'; +import { isNumber } from 'lodash-es'; import { useCallback, useEffect, useRef, useState } from 'react'; export const canvasMaskCompositerSelector = createSelector( diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasMaskLines.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasMaskLines.tsx index e1bf26f4ba..a553653901 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasMaskLines.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasMaskLines.tsx @@ -2,7 +2,7 @@ import { createSelector } from '@reduxjs/toolkit'; import { useAppSelector } from 'app/store/storeHooks'; import { canvasSelector } from 'features/canvas/store/canvasSelectors'; import { GroupConfig } from 'konva/lib/Group'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { Group, Line } from 'react-konva'; import { isCanvasMaskLine } from '../store/canvasTypes'; diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasObjectRenderer.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasObjectRenderer.tsx index 6d1598a21b..32d2b36324 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasObjectRenderer.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasObjectRenderer.tsx @@ -3,7 +3,7 @@ import { useAppSelector } from 'app/store/storeHooks'; import { useGetUrl } from 'common/util/getUrl'; import { canvasSelector } from 'features/canvas/store/canvasSelectors'; import { rgbaColorToString } from 'features/canvas/util/colorToString'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { Group, Line, Rect } from 'react-konva'; import { diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasStagingArea.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasStagingArea.tsx index c373141f6f..7bd4782840 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasStagingArea.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasStagingArea.tsx @@ -3,7 +3,7 @@ import { useAppSelector } from 'app/store/storeHooks'; import { useGetUrl } from 'common/util/getUrl'; import { canvasSelector } from 'features/canvas/store/canvasSelectors'; import { GroupConfig } from 'konva/lib/Group'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { Group, Rect } from 'react-konva'; import IAICanvasImage from './IAICanvasImage'; diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasStagingAreaToolbar.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasStagingAreaToolbar.tsx index e74081b2f4..cbcd86d8d6 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasStagingAreaToolbar.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasStagingAreaToolbar.tsx @@ -12,7 +12,7 @@ import { setShouldShowStagingImage, setShouldShowStagingOutline, } from 'features/canvas/store/canvasSlice'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { useCallback } from 'react'; import { useHotkeys } from 'react-hotkeys-hook'; diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasStatusText.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasStatusText.tsx index a6d32081c4..8e3edadd01 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasStatusText.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasStatusText.tsx @@ -2,7 +2,7 @@ import { Box, Flex } from '@chakra-ui/react'; import { createSelector } from '@reduxjs/toolkit'; import { useAppSelector } from 'app/store/storeHooks'; import { canvasSelector } from 'features/canvas/store/canvasSelectors'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { useTranslation } from 'react-i18next'; import roundToHundreth from '../util/roundToHundreth'; diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasStatusText/IAICanvasStatusTextCursorPos.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasStatusText/IAICanvasStatusTextCursorPos.tsx index b5d6e068e2..8c37be85bd 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasStatusText/IAICanvasStatusTextCursorPos.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasStatusText/IAICanvasStatusTextCursorPos.tsx @@ -3,7 +3,7 @@ import { createSelector } from '@reduxjs/toolkit'; import { useAppSelector } from 'app/store/storeHooks'; import { canvasSelector } from 'features/canvas/store/canvasSelectors'; import roundToHundreth from 'features/canvas/util/roundToHundreth'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { useTranslation } from 'react-i18next'; diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolPreview.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolPreview.tsx index 9aeab9b211..8ad58e020c 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolPreview.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolPreview.tsx @@ -3,7 +3,7 @@ import { useAppSelector } from 'app/store/storeHooks'; import { canvasSelector } from 'features/canvas/store/canvasSelectors'; import { rgbaColorToString } from 'features/canvas/util/colorToString'; import { GroupConfig } from 'konva/lib/Group'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { Circle, Group } from 'react-konva'; import { diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasBoundingBox.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasBoundingBox.tsx index 7e648ae6f3..0241f3eb55 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasBoundingBox.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasBoundingBox.tsx @@ -16,7 +16,7 @@ import Konva from 'konva'; import { GroupConfig } from 'konva/lib/Group'; import { KonvaEventObject } from 'konva/lib/Node'; import { Vector2d } from 'konva/lib/types'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { useCallback, useEffect, useRef, useState } from 'react'; import { Group, Rect, Transformer } from 'react-konva'; diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasMaskOptions.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasMaskOptions.tsx index 639733722d..b345f2cda0 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasMaskOptions.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasMaskOptions.tsx @@ -18,7 +18,7 @@ import { setShouldPreserveMaskedArea, } from 'features/canvas/store/canvasSlice'; import { rgbaColorToString } from 'features/canvas/util/colorToString'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { useHotkeys } from 'react-hotkeys-hook'; import { useTranslation } from 'react-i18next'; diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasRedoButton.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasRedoButton.tsx index 31d60bf455..72f4a19479 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasRedoButton.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasRedoButton.tsx @@ -9,7 +9,7 @@ import { FaRedo } from 'react-icons/fa'; import { redo } from 'features/canvas/store/canvasSlice'; import { systemSelector } from 'features/system/store/systemSelectors'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { useTranslation } from 'react-i18next'; const canvasRedoSelector = createSelector( diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasSettingsButtonPopover.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasSettingsButtonPopover.tsx index 6d2bd64afc..87e3435127 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasSettingsButtonPopover.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasSettingsButtonPopover.tsx @@ -16,7 +16,7 @@ import { setShouldSnapToGrid, } from 'features/canvas/store/canvasSlice'; import EmptyTempFolderButtonModal from 'features/system/components/ClearTempFolderButtonModal'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { ChangeEvent } from 'react'; import { useHotkeys } from 'react-hotkeys-hook'; diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasToolChooserOptions.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasToolChooserOptions.tsx index a6c059b28d..eee462dd2d 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasToolChooserOptions.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasToolChooserOptions.tsx @@ -17,7 +17,7 @@ import { setTool, } from 'features/canvas/store/canvasSlice'; import { systemSelector } from 'features/system/store/systemSelectors'; -import { clamp, isEqual } from 'lodash'; +import { clamp, isEqual } from 'lodash-es'; import { useHotkeys } from 'react-hotkeys-hook'; import { useTranslation } from 'react-i18next'; diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasToolbar.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasToolbar.tsx index 1fc9a699d5..dd8963de7b 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasToolbar.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasToolbar.tsx @@ -24,7 +24,7 @@ import { import { mergeAndUploadCanvas } from 'features/canvas/store/thunks/mergeAndUploadCanvas'; import { getCanvasBaseLayer } from 'features/canvas/util/konvaInstanceProvider'; import { systemSelector } from 'features/system/store/systemSelectors'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { ChangeEvent } from 'react'; import { useHotkeys } from 'react-hotkeys-hook'; diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasUndoButton.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasUndoButton.tsx index 9642e5fb86..9feb2dfcb5 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasUndoButton.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasUndoButton.tsx @@ -9,7 +9,7 @@ import { undo } from 'features/canvas/store/canvasSlice'; import { systemSelector } from 'features/system/store/systemSelectors'; import { activeTabNameSelector } from 'features/ui/store/uiSelectors'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { useTranslation } from 'react-i18next'; const canvasUndoSelector = createSelector( diff --git a/invokeai/frontend/web/src/features/canvas/hooks/useCanvasDragMove.ts b/invokeai/frontend/web/src/features/canvas/hooks/useCanvasDragMove.ts index 35342d5279..6861c25842 100644 --- a/invokeai/frontend/web/src/features/canvas/hooks/useCanvasDragMove.ts +++ b/invokeai/frontend/web/src/features/canvas/hooks/useCanvasDragMove.ts @@ -9,7 +9,7 @@ import { setStageCoordinates, } from 'features/canvas/store/canvasSlice'; import { KonvaEventObject } from 'konva/lib/Node'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { useCallback } from 'react'; diff --git a/invokeai/frontend/web/src/features/canvas/hooks/useCanvasHotkeys.ts b/invokeai/frontend/web/src/features/canvas/hooks/useCanvasHotkeys.ts index 9816be91cb..6f4669a42a 100644 --- a/invokeai/frontend/web/src/features/canvas/hooks/useCanvasHotkeys.ts +++ b/invokeai/frontend/web/src/features/canvas/hooks/useCanvasHotkeys.ts @@ -13,7 +13,7 @@ import { setTool, } from 'features/canvas/store/canvasSlice'; import { activeTabNameSelector } from 'features/ui/store/uiSelectors'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { useRef } from 'react'; import { useHotkeys } from 'react-hotkeys-hook'; diff --git a/invokeai/frontend/web/src/features/canvas/hooks/useCanvasMouseDown.ts b/invokeai/frontend/web/src/features/canvas/hooks/useCanvasMouseDown.ts index 0c0e95a569..67bf7a8539 100644 --- a/invokeai/frontend/web/src/features/canvas/hooks/useCanvasMouseDown.ts +++ b/invokeai/frontend/web/src/features/canvas/hooks/useCanvasMouseDown.ts @@ -12,7 +12,7 @@ import { import { activeTabNameSelector } from 'features/ui/store/uiSelectors'; import Konva from 'konva'; import { KonvaEventObject } from 'konva/lib/Node'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { MutableRefObject, useCallback } from 'react'; import getScaledCursorPosition from '../util/getScaledCursorPosition'; diff --git a/invokeai/frontend/web/src/features/canvas/hooks/useCanvasMouseMove.ts b/invokeai/frontend/web/src/features/canvas/hooks/useCanvasMouseMove.ts index cd083020ad..abeab825e4 100644 --- a/invokeai/frontend/web/src/features/canvas/hooks/useCanvasMouseMove.ts +++ b/invokeai/frontend/web/src/features/canvas/hooks/useCanvasMouseMove.ts @@ -11,7 +11,7 @@ import { import { activeTabNameSelector } from 'features/ui/store/uiSelectors'; import Konva from 'konva'; import { Vector2d } from 'konva/lib/types'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { MutableRefObject, useCallback } from 'react'; import getScaledCursorPosition from '../util/getScaledCursorPosition'; diff --git a/invokeai/frontend/web/src/features/canvas/hooks/useCanvasMouseUp.ts b/invokeai/frontend/web/src/features/canvas/hooks/useCanvasMouseUp.ts index 6ca47ac126..8e70543c6f 100644 --- a/invokeai/frontend/web/src/features/canvas/hooks/useCanvasMouseUp.ts +++ b/invokeai/frontend/web/src/features/canvas/hooks/useCanvasMouseUp.ts @@ -12,7 +12,7 @@ import { } from 'features/canvas/store/canvasSlice'; import { activeTabNameSelector } from 'features/ui/store/uiSelectors'; import Konva from 'konva'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { MutableRefObject, useCallback } from 'react'; import getScaledCursorPosition from '../util/getScaledCursorPosition'; diff --git a/invokeai/frontend/web/src/features/canvas/hooks/useCanvasZoom.ts b/invokeai/frontend/web/src/features/canvas/hooks/useCanvasZoom.ts index 3861b2151b..3d6a1d7804 100644 --- a/invokeai/frontend/web/src/features/canvas/hooks/useCanvasZoom.ts +++ b/invokeai/frontend/web/src/features/canvas/hooks/useCanvasZoom.ts @@ -7,7 +7,7 @@ import { } from 'features/canvas/store/canvasSlice'; import Konva from 'konva'; import { KonvaEventObject } from 'konva/lib/Node'; -import { clamp, isEqual } from 'lodash'; +import { clamp, isEqual } from 'lodash-es'; import { MutableRefObject, useCallback } from 'react'; import { diff --git a/invokeai/frontend/web/src/features/canvas/store/canvasSlice.ts b/invokeai/frontend/web/src/features/canvas/store/canvasSlice.ts index e277ccdef2..ab3ab0c4e9 100644 --- a/invokeai/frontend/web/src/features/canvas/store/canvasSlice.ts +++ b/invokeai/frontend/web/src/features/canvas/store/canvasSlice.ts @@ -6,7 +6,7 @@ import { roundToMultiple, } from 'common/util/roundDownToMultiple'; import { IRect, Vector2d } from 'konva/lib/types'; -import { clamp, cloneDeep } from 'lodash'; +import { clamp, cloneDeep } from 'lodash-es'; // import { RgbaColor } from 'react-colorful'; import calculateCoordinates from '../util/calculateCoordinates'; diff --git a/invokeai/frontend/web/src/features/canvas/store/thunks/requestCanvasScale.ts b/invokeai/frontend/web/src/features/canvas/store/thunks/requestCanvasScale.ts index e6efbb979b..f16c92651a 100644 --- a/invokeai/frontend/web/src/features/canvas/store/thunks/requestCanvasScale.ts +++ b/invokeai/frontend/web/src/features/canvas/store/thunks/requestCanvasScale.ts @@ -1,6 +1,6 @@ import { AppDispatch, AppGetState } from 'app/store/store'; import { activeTabNameSelector } from 'features/ui/store/uiSelectors'; -import { debounce } from 'lodash'; +import { debounce } from 'lodash-es'; import { setDoesCanvasNeedScaling } from '../canvasSlice'; const debouncedCanvasScale = debounce((dispatch: AppDispatch) => { diff --git a/invokeai/frontend/web/src/features/gallery/components/CurrentImageButtons.tsx b/invokeai/frontend/web/src/features/gallery/components/CurrentImageButtons.tsx index 10b6d55ec7..6d247c7ed4 100644 --- a/invokeai/frontend/web/src/features/gallery/components/CurrentImageButtons.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/CurrentImageButtons.tsx @@ -1,5 +1,5 @@ import { createSelector } from '@reduxjs/toolkit'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { ButtonGroup, diff --git a/invokeai/frontend/web/src/features/gallery/components/CurrentImageDisplay.tsx b/invokeai/frontend/web/src/features/gallery/components/CurrentImageDisplay.tsx index ee849a95d2..36451cfb2c 100644 --- a/invokeai/frontend/web/src/features/gallery/components/CurrentImageDisplay.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/CurrentImageDisplay.tsx @@ -2,7 +2,7 @@ import { Flex, Icon } from '@chakra-ui/react'; import { createSelector } from '@reduxjs/toolkit'; import { useAppSelector } from 'app/store/storeHooks'; import { systemSelector } from 'features/system/store/systemSelectors'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { MdPhoto } from 'react-icons/md'; import { selectedImageSelector } from '../store/gallerySelectors'; diff --git a/invokeai/frontend/web/src/features/gallery/components/CurrentImagePreview.tsx b/invokeai/frontend/web/src/features/gallery/components/CurrentImagePreview.tsx index 8ee0829190..54d69b9e5b 100644 --- a/invokeai/frontend/web/src/features/gallery/components/CurrentImagePreview.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/CurrentImagePreview.tsx @@ -4,7 +4,7 @@ import { useAppSelector } from 'app/store/storeHooks'; import { useGetUrl } from 'common/util/getUrl'; import { systemSelector } from 'features/system/store/systemSelectors'; import { uiSelector } from 'features/ui/store/uiSelectors'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { selectedImageSelector } from '../store/gallerySelectors'; import CurrentImageFallback from './CurrentImageFallback'; diff --git a/invokeai/frontend/web/src/features/gallery/components/DeleteImageModal.tsx b/invokeai/frontend/web/src/features/gallery/components/DeleteImageModal.tsx index 1f74706ede..12038f4179 100644 --- a/invokeai/frontend/web/src/features/gallery/components/DeleteImageModal.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/DeleteImageModal.tsx @@ -15,7 +15,7 @@ import IAISwitch from 'common/components/IAISwitch'; import { configSelector } from 'features/system/store/configSelectors'; import { systemSelector } from 'features/system/store/systemSelectors'; import { setShouldConfirmOnDelete } from 'features/system/store/systemSlice'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { ChangeEvent, memo, useCallback, useRef } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/invokeai/frontend/web/src/features/gallery/components/HoverableImage.tsx b/invokeai/frontend/web/src/features/gallery/components/HoverableImage.tsx index 491ca371d3..6ad8e87642 100644 --- a/invokeai/frontend/web/src/features/gallery/components/HoverableImage.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/HoverableImage.tsx @@ -53,7 +53,7 @@ import { systemSelector } from 'features/system/store/systemSelectors'; import { configSelector } from 'features/system/store/configSelectors'; import { lightboxSelector } from 'features/lightbox/store/lightboxSelectors'; import { activeTabNameSelector } from 'features/ui/store/uiSelectors'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; export const selector = createSelector( [ @@ -151,8 +151,8 @@ const HoverableImage = memo((props: HoverableImageProps) => { }; const handleUsePrompt = () => { - if (image.metadata?.sd_metadata?.prompt) { - setBothPrompts(image.metadata?.sd_metadata?.prompt); + if (typeof image.metadata?.invokeai?.node?.prompt === 'string') { + setBothPrompts(image.metadata?.invokeai?.node?.prompt); } toast({ title: t('toast.promptSet'), @@ -163,8 +163,8 @@ const HoverableImage = memo((props: HoverableImageProps) => { }; const handleUseSeed = () => { - image.metadata.sd_metadata && - dispatch(setSeed(image.metadata.sd_metadata.image.seed)); + typeof image.metadata.invokeai?.node?.seed === 'number' && + dispatch(setSeed(image.metadata.invokeai?.node?.seed)); toast({ title: t('toast.seedSet'), status: 'success', @@ -195,38 +195,39 @@ const HoverableImage = memo((props: HoverableImageProps) => { }; const handleUseAllParameters = () => { - metadata.sd_metadata && dispatch(setAllParameters(metadata.sd_metadata)); - toast({ - title: t('toast.parametersSet'), - status: 'success', - duration: 2500, - isClosable: true, - }); + // metadata.invokeai?.node && + // dispatch(setAllParameters(metadata.invokeai?.node)); + // toast({ + // title: t('toast.parametersSet'), + // status: 'success', + // duration: 2500, + // isClosable: true, + // }); }; const handleUseInitialImage = async () => { - if (metadata.sd_metadata?.image?.init_image_path) { - const response = await fetch( - metadata.sd_metadata?.image?.init_image_path - ); - if (response.ok) { - dispatch(setAllImageToImageParameters(metadata?.sd_metadata)); - toast({ - title: t('toast.initialImageSet'), - status: 'success', - duration: 2500, - isClosable: true, - }); - return; - } - } - toast({ - title: t('toast.initialImageNotSet'), - description: t('toast.initialImageNotSetDesc'), - status: 'error', - duration: 2500, - isClosable: true, - }); + // if (metadata.invokeai?.node?.image?.init_image_path) { + // const response = await fetch( + // metadata.invokeai?.node?.image?.init_image_path + // ); + // if (response.ok) { + // dispatch(setAllImageToImageParameters(metadata?.invokeai?.node)); + // toast({ + // title: t('toast.initialImageSet'), + // status: 'success', + // duration: 2500, + // isClosable: true, + // }); + // return; + // } + // } + // toast({ + // title: t('toast.initialImageNotSet'), + // description: t('toast.initialImageNotSetDesc'), + // status: 'error', + // duration: 2500, + // isClosable: true, + // }); }; const handleSelectImage = () => { @@ -268,7 +269,7 @@ const HoverableImage = memo((props: HoverableImageProps) => { } onClickCapture={handleUsePrompt} - isDisabled={image?.metadata?.sd_metadata?.prompt === undefined} + isDisabled={image?.metadata?.invokeai?.node?.prompt === undefined} > {t('parameters.usePrompt')} @@ -276,14 +277,14 @@ const HoverableImage = memo((props: HoverableImageProps) => { } onClickCapture={handleUseSeed} - isDisabled={image?.metadata?.sd_metadata?.seed === undefined} + isDisabled={image?.metadata?.invokeai?.node?.seed === undefined} > {t('parameters.useSeed')} } onClickCapture={handleUseInitialImage} - isDisabled={image?.metadata?.sd_metadata?.type !== 'img2img'} + isDisabled={image?.metadata?.invokeai?.node?.type !== 'img2img'} > {t('parameters.useInitImg')} @@ -292,7 +293,7 @@ const HoverableImage = memo((props: HoverableImageProps) => { onClickCapture={handleUseAllParameters} isDisabled={ !['txt2img', 'img2img'].includes( - image?.metadata?.sd_metadata?.type + String(image?.metadata?.invokeai?.node?.type) ) } > diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageGallery.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageGallery.tsx index b3998649a5..706ff215dc 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageGallery.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageGallery.tsx @@ -35,7 +35,7 @@ // } from 'features/ui/store/uiSlice'; // import { InvokeTabName } from 'features/ui/store/tabMap'; -// import { clamp } from 'lodash'; +// import { clamp } from 'lodash-es'; // import { Direction } from 're-resizable/lib/resizer'; // import React, { // ChangeEvent, diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageGalleryPanel.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageGalleryPanel.tsx index 2a48a7a5dc..37ed69d4da 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageGalleryPanel.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageGalleryPanel.tsx @@ -7,7 +7,7 @@ import { } from 'features/gallery/store/gallerySlice'; import { InvokeTabName } from 'features/ui/store/tabMap'; -import { clamp, isEqual } from 'lodash'; +import { clamp, isEqual } from 'lodash-es'; import { useHotkeys } from 'react-hotkeys-hook'; import './ImageGallery.css'; diff --git a/invokeai/frontend/web/src/features/gallery/components/NextPrevImageButtons.tsx b/invokeai/frontend/web/src/features/gallery/components/NextPrevImageButtons.tsx index eb94a5b25e..7c878a9485 100644 --- a/invokeai/frontend/web/src/features/gallery/components/NextPrevImageButtons.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/NextPrevImageButtons.tsx @@ -1,7 +1,7 @@ import { ChakraProps, Flex, Grid, IconButton } from '@chakra-ui/react'; import { createSelector } from '@reduxjs/toolkit'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { useState } from 'react'; import { useTranslation } from 'react-i18next'; import { FaAngleLeft, FaAngleRight } from 'react-icons/fa'; diff --git a/invokeai/frontend/web/src/features/gallery/store/gallerySelectors.ts b/invokeai/frontend/web/src/features/gallery/store/gallerySelectors.ts index 73b0a2ef0b..ebb27e12d9 100644 --- a/invokeai/frontend/web/src/features/gallery/store/gallerySelectors.ts +++ b/invokeai/frontend/web/src/features/gallery/store/gallerySelectors.ts @@ -7,7 +7,7 @@ import { activeTabNameSelector, uiSelector, } from 'features/ui/store/uiSelectors'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { selectResultsAll, selectResultsById, diff --git a/invokeai/frontend/web/src/features/gallery/store/gallerySlice.ts b/invokeai/frontend/web/src/features/gallery/store/gallerySlice.ts index 5cecf778b6..4d752a151b 100644 --- a/invokeai/frontend/web/src/features/gallery/store/gallerySlice.ts +++ b/invokeai/frontend/web/src/features/gallery/store/gallerySlice.ts @@ -4,7 +4,7 @@ import * as InvokeAI from 'app/types/invokeai'; import { invocationComplete } from 'services/events/actions'; import { InvokeTabName } from 'features/ui/store/tabMap'; import { IRect } from 'konva/lib/types'; -import { clamp } from 'lodash'; +import { clamp } from 'lodash-es'; import { isImageOutput } from 'services/types/guards'; import { deserializeImageResponse } from 'services/util/deserializeImageResponse'; import { imageUploaded } from 'services/thunks/image'; diff --git a/invokeai/frontend/web/src/features/lightbox/components/Lightbox.tsx b/invokeai/frontend/web/src/features/lightbox/components/Lightbox.tsx index 4fa70e4a53..cd0ce55b1e 100644 --- a/invokeai/frontend/web/src/features/lightbox/components/Lightbox.tsx +++ b/invokeai/frontend/web/src/features/lightbox/components/Lightbox.tsx @@ -10,7 +10,7 @@ import { gallerySelector } from 'features/gallery/store/gallerySelectors'; import { setIsLightboxOpen } from 'features/lightbox/store/lightboxSlice'; import { uiSelector } from 'features/ui/store/uiSelectors'; import { AnimatePresence, motion } from 'framer-motion'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { useHotkeys } from 'react-hotkeys-hook'; import { BiExit } from 'react-icons/bi'; import { TransformWrapper } from 'react-zoom-pan-pinch'; diff --git a/invokeai/frontend/web/src/features/lightbox/store/lightboxSelectors.ts b/invokeai/frontend/web/src/features/lightbox/store/lightboxSelectors.ts index afaf1ae398..f7d7e0129a 100644 --- a/invokeai/frontend/web/src/features/lightbox/store/lightboxSelectors.ts +++ b/invokeai/frontend/web/src/features/lightbox/store/lightboxSelectors.ts @@ -1,6 +1,6 @@ import { createSelector } from '@reduxjs/toolkit'; import { RootState } from 'app/store/store'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; export const lightboxSelector = createSelector( (state: RootState) => state.lightbox, diff --git a/invokeai/frontend/web/src/features/nodes/components/AddNodeMenu.tsx b/invokeai/frontend/web/src/features/nodes/components/AddNodeMenu.tsx index 8fb14c7a23..3265a2620f 100644 --- a/invokeai/frontend/web/src/features/nodes/components/AddNodeMenu.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/AddNodeMenu.tsx @@ -13,7 +13,7 @@ import { import { FaEllipsisV, FaPlus } from 'react-icons/fa'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import { nodeAdded } from '../store/nodesSlice'; -import { cloneDeep, map } from 'lodash'; +import { cloneDeep, map } from 'lodash-es'; import { RootState } from 'app/store/store'; import { useBuildInvocation } from '../hooks/useBuildInvocation'; import { addToast } from 'features/system/store/systemSlice'; diff --git a/invokeai/frontend/web/src/features/nodes/components/FieldTypeLegend.tsx b/invokeai/frontend/web/src/features/nodes/components/FieldTypeLegend.tsx index 1e86ebfd97..c14c7ebccf 100644 --- a/invokeai/frontend/web/src/features/nodes/components/FieldTypeLegend.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/FieldTypeLegend.tsx @@ -1,6 +1,6 @@ import 'reactflow/dist/style.css'; import { Tooltip, Badge, Flex } from '@chakra-ui/react'; -import { map } from 'lodash'; +import { map } from 'lodash-es'; import { FIELDS } from '../types/constants'; import { memo } from 'react'; diff --git a/invokeai/frontend/web/src/features/nodes/components/IAINode/IAINodeInputs.tsx b/invokeai/frontend/web/src/features/nodes/components/IAINode/IAINodeInputs.tsx index ee8a21ec86..9ea383c09d 100644 --- a/invokeai/frontend/web/src/features/nodes/components/IAINode/IAINodeInputs.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/IAINode/IAINodeInputs.tsx @@ -4,7 +4,7 @@ import { InvocationTemplate, } from 'features/nodes/types/types'; import { memo, ReactNode, useCallback } from 'react'; -import { map } from 'lodash'; +import { map } from 'lodash-es'; import { useAppSelector } from 'app/store/storeHooks'; import { RootState } from 'app/store/store'; import { diff --git a/invokeai/frontend/web/src/features/nodes/components/IAINode/IAINodeOutputs.tsx b/invokeai/frontend/web/src/features/nodes/components/IAINode/IAINodeOutputs.tsx index e4eaa27bc9..2cb0bcde8d 100644 --- a/invokeai/frontend/web/src/features/nodes/components/IAINode/IAINodeOutputs.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/IAINode/IAINodeOutputs.tsx @@ -4,7 +4,7 @@ import { OutputFieldValue, } from 'features/nodes/types/types'; import { memo, ReactNode, useCallback } from 'react'; -import { map } from 'lodash'; +import { map } from 'lodash-es'; import { useAppSelector } from 'app/store/storeHooks'; import { RootState } from 'app/store/store'; import { Box, Flex, FormControl, FormLabel, HStack } from '@chakra-ui/react'; diff --git a/invokeai/frontend/web/src/features/nodes/components/fields/ModelInputFieldComponent.tsx b/invokeai/frontend/web/src/features/nodes/components/fields/ModelInputFieldComponent.tsx index 6861520eb5..3ce790171a 100644 --- a/invokeai/frontend/web/src/features/nodes/components/fields/ModelInputFieldComponent.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/fields/ModelInputFieldComponent.tsx @@ -11,7 +11,7 @@ import { selectModelsById, selectModelsIds, } from 'features/system/store/modelSlice'; -import { isEqual, map } from 'lodash'; +import { isEqual, map } from 'lodash-es'; import { ChangeEvent, memo } from 'react'; import { FieldComponentProps } from './types'; diff --git a/invokeai/frontend/web/src/features/nodes/components/search/NodeSearch.tsx b/invokeai/frontend/web/src/features/nodes/components/search/NodeSearch.tsx index eaf665f0ec..66b1d72014 100644 --- a/invokeai/frontend/web/src/features/nodes/components/search/NodeSearch.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/search/NodeSearch.tsx @@ -3,7 +3,7 @@ import { RootState } from 'app/store/store'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import IAIInput from 'common/components/IAIInput'; import { Panel } from 'reactflow'; -import { map } from 'lodash'; +import { map } from 'lodash-es'; import { ChangeEvent, FocusEvent, diff --git a/invokeai/frontend/web/src/features/nodes/hooks/useBuildInvocation.ts b/invokeai/frontend/web/src/features/nodes/hooks/useBuildInvocation.ts index 7620113829..0526eee969 100644 --- a/invokeai/frontend/web/src/features/nodes/hooks/useBuildInvocation.ts +++ b/invokeai/frontend/web/src/features/nodes/hooks/useBuildInvocation.ts @@ -1,7 +1,7 @@ import { createSelector } from '@reduxjs/toolkit'; import { RootState } from 'app/store/store'; import { useAppSelector } from 'app/store/storeHooks'; -import { reduce } from 'lodash'; +import { reduce } from 'lodash-es'; import { useCallback } from 'react'; import { Node, useReactFlow } from 'reactflow'; import { AnyInvocationType } from 'services/events/types'; diff --git a/invokeai/frontend/web/src/features/nodes/hooks/useIsValidConnection.ts b/invokeai/frontend/web/src/features/nodes/hooks/useIsValidConnection.ts index dec9120d08..a24267d9d9 100644 --- a/invokeai/frontend/web/src/features/nodes/hooks/useIsValidConnection.ts +++ b/invokeai/frontend/web/src/features/nodes/hooks/useIsValidConnection.ts @@ -14,77 +14,77 @@ export const useIsValidConnection = () => { return true; - // Connection must have valid targets - if (!(source && sourceHandle && target && targetHandle)) { - return false; - } + // // Connection must have valid targets + // if (!(source && sourceHandle && target && targetHandle)) { + // return false; + // } - // Connection is invalid if target already has a connection - if ( - edges.find((edge) => { - return edge.target === target && edge.targetHandle === targetHandle; - }) - ) { - return false; - } + // // Connection is invalid if target already has a connection + // if ( + // edges.find((edge) => { + // return edge.target === target && edge.targetHandle === targetHandle; + // }) + // ) { + // return false; + // } - // Find the source and target nodes - const sourceNode = flow.getNode(source) as Node; + // // Find the source and target nodes + // const sourceNode = flow.getNode(source) as Node; - const targetNode = flow.getNode(target) as Node; + // const targetNode = flow.getNode(target) as Node; - // Conditional guards against undefined nodes/handles - if (!(sourceNode && targetNode && sourceNode.data && targetNode.data)) { - return false; - } + // // Conditional guards against undefined nodes/handles + // if (!(sourceNode && targetNode && sourceNode.data && targetNode.data)) { + // return false; + // } - // Connection types must be the same for a connection - if ( - sourceNode.data.outputs[sourceHandle].type !== - targetNode.data.inputs[targetHandle].type - ) { - return false; - } + // // Connection types must be the same for a connection + // if ( + // sourceNode.data.outputs[sourceHandle].type !== + // targetNode.data.inputs[targetHandle].type + // ) { + // return false; + // } - // Graphs much be acyclic (no loops!) + // // Graphs much be acyclic (no loops!) - /** - * TODO: use `graphlib.alg.findCycles()` to identify strong connections - * - * this validation func only runs when the cursor hits the second handle of the connection, - * and only on that second handle - so it cannot tell us exhaustively which connections - * are valid. - * - * ideally, we check when the connection starts to calculate all invalid handles at once. - * - * requires making a new graphlib graph - and calling `findCycles()` - for each potential - * handle. instead of using the `isValidConnection` prop, it would use the `onConnectStart` - * prop. - * - * the strong connections should be stored in global state. - * - * then, `isValidConnection` would simple loop through the strong connections and if the - * source and target are in a single strong connection, return false. - * - * and also, we can use this knowledge to style every handle when a connection starts, - * which is otherwise not possible. - */ + // /** + // * TODO: use `graphlib.alg.findCycles()` to identify strong connections + // * + // * this validation func only runs when the cursor hits the second handle of the connection, + // * and only on that second handle - so it cannot tell us exhaustively which connections + // * are valid. + // * + // * ideally, we check when the connection starts to calculate all invalid handles at once. + // * + // * requires making a new graphlib graph - and calling `findCycles()` - for each potential + // * handle. instead of using the `isValidConnection` prop, it would use the `onConnectStart` + // * prop. + // * + // * the strong connections should be stored in global state. + // * + // * then, `isValidConnection` would simple loop through the strong connections and if the + // * source and target are in a single strong connection, return false. + // * + // * and also, we can use this knowledge to style every handle when a connection starts, + // * which is otherwise not possible. + // */ - // build a graphlib graph - const g = new graphlib.Graph(); + // // build a graphlib graph + // const g = new graphlib.Graph(); - nodes.forEach((n) => { - g.setNode(n.id); - }); + // nodes.forEach((n) => { + // g.setNode(n.id); + // }); - edges.forEach((e) => { - g.setEdge(e.source, e.target); - }); + // edges.forEach((e) => { + // g.setEdge(e.source, e.target); + // }); - // Add the candidate edge to the graph - g.setEdge(source, target); + // // Add the candidate edge to the graph + // g.setEdge(source, target); - return graphlib.alg.isAcyclic(g); + // return graphlib.alg.isAcyclic(g); }, [flow] ); diff --git a/invokeai/frontend/web/src/features/nodes/util/fieldTemplateBuilders.ts b/invokeai/frontend/web/src/features/nodes/util/fieldTemplateBuilders.ts index e37f446e00..df895ba4af 100644 --- a/invokeai/frontend/web/src/features/nodes/util/fieldTemplateBuilders.ts +++ b/invokeai/frontend/web/src/features/nodes/util/fieldTemplateBuilders.ts @@ -1,4 +1,4 @@ -import { reduce } from 'lodash'; +import { reduce } from 'lodash-es'; import { OpenAPIV3 } from 'openapi-types'; import { FIELD_TYPE_MAP } from '../types/constants'; import { isSchemaObject } from '../types/typeGuards'; diff --git a/invokeai/frontend/web/src/features/nodes/util/nodesGraphBuilder/buildNodesGraph.ts b/invokeai/frontend/web/src/features/nodes/util/nodesGraphBuilder/buildNodesGraph.ts index c473695ade..f12b141e09 100644 --- a/invokeai/frontend/web/src/features/nodes/util/nodesGraphBuilder/buildNodesGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/nodesGraphBuilder/buildNodesGraph.ts @@ -1,6 +1,6 @@ import { Graph } from 'services/api'; import { v4 as uuidv4 } from 'uuid'; -import { reduce } from 'lodash'; +import { reduce } from 'lodash-es'; import { RootState } from 'app/store/store'; import { AnyInvocation } from 'services/events/types'; diff --git a/invokeai/frontend/web/src/features/nodes/util/parseSchema.ts b/invokeai/frontend/web/src/features/nodes/util/parseSchema.ts index ffdf4710b5..7cb8132b65 100644 --- a/invokeai/frontend/web/src/features/nodes/util/parseSchema.ts +++ b/invokeai/frontend/web/src/features/nodes/util/parseSchema.ts @@ -1,4 +1,4 @@ -import { filter, reduce } from 'lodash'; +import { filter, reduce } from 'lodash-es'; import { OpenAPIV3 } from 'openapi-types'; import { isSchemaObject } from '../types/typeGuards'; import { diff --git a/invokeai/frontend/web/src/features/parameters/components/AdvancedParameters/Canvas/BoundingBox/BoundingBoxSettings.tsx b/invokeai/frontend/web/src/features/parameters/components/AdvancedParameters/Canvas/BoundingBox/BoundingBoxSettings.tsx index 6e753b002a..35a325e74e 100644 --- a/invokeai/frontend/web/src/features/parameters/components/AdvancedParameters/Canvas/BoundingBox/BoundingBoxSettings.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/AdvancedParameters/Canvas/BoundingBox/BoundingBoxSettings.tsx @@ -4,7 +4,7 @@ import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import IAISlider from 'common/components/IAISlider'; import { canvasSelector } from 'features/canvas/store/canvasSelectors'; import { setBoundingBoxDimensions } from 'features/canvas/store/canvasSlice'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { useTranslation } from 'react-i18next'; diff --git a/invokeai/frontend/web/src/features/parameters/components/AdvancedParameters/Canvas/InfillAndScalingSettings.tsx b/invokeai/frontend/web/src/features/parameters/components/AdvancedParameters/Canvas/InfillAndScalingSettings.tsx index d58ff4746b..c18934e22b 100644 --- a/invokeai/frontend/web/src/features/parameters/components/AdvancedParameters/Canvas/InfillAndScalingSettings.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/AdvancedParameters/Canvas/InfillAndScalingSettings.tsx @@ -18,7 +18,7 @@ import { setTileSize, } from 'features/parameters/store/generationSlice'; import { systemSelector } from 'features/system/store/systemSelectors'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { ChangeEvent } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/invokeai/frontend/web/src/features/parameters/components/AdvancedParameters/ImageToImage/ImageToImageSettings.tsx b/invokeai/frontend/web/src/features/parameters/components/AdvancedParameters/ImageToImage/ImageToImageSettings.tsx index 95d6272408..71b853f162 100644 --- a/invokeai/frontend/web/src/features/parameters/components/AdvancedParameters/ImageToImage/ImageToImageSettings.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/AdvancedParameters/ImageToImage/ImageToImageSettings.tsx @@ -29,7 +29,7 @@ export default function ImageToImageSettings() { - + ); diff --git a/invokeai/frontend/web/src/features/parameters/components/AdvancedParameters/ImageToImage/InitialImagePreview.tsx b/invokeai/frontend/web/src/features/parameters/components/AdvancedParameters/ImageToImage/InitialImagePreview.tsx index d8d79edc7f..2082c2a015 100644 --- a/invokeai/frontend/web/src/features/parameters/components/AdvancedParameters/ImageToImage/InitialImagePreview.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/AdvancedParameters/ImageToImage/InitialImagePreview.tsx @@ -11,7 +11,7 @@ import { initialImageSelected, } from 'features/parameters/store/generationSlice'; import { addToast } from 'features/system/store/systemSlice'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { DragEvent, useCallback, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { ImageType } from 'services/api'; diff --git a/invokeai/frontend/web/src/features/parameters/components/AdvancedParameters/Output/HiresSettings.tsx b/invokeai/frontend/web/src/features/parameters/components/AdvancedParameters/Output/HiresSettings.tsx index 35b1e9d044..7f20a1d6c3 100644 --- a/invokeai/frontend/web/src/features/parameters/components/AdvancedParameters/Output/HiresSettings.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/AdvancedParameters/Output/HiresSettings.tsx @@ -8,7 +8,7 @@ import { setHiresFix, setHiresStrength, } from 'features/parameters/store/postprocessingSlice'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { ChangeEvent } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/invokeai/frontend/web/src/features/parameters/components/ParametersAccordion.tsx b/invokeai/frontend/web/src/features/parameters/components/ParametersAccordion.tsx index 50c5bb62e9..22d7a6228e 100644 --- a/invokeai/frontend/web/src/features/parameters/components/ParametersAccordion.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/ParametersAccordion.tsx @@ -5,7 +5,7 @@ import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import { tabMap } from 'features/ui/store/tabMap'; import { uiSelector } from 'features/ui/store/uiSelectors'; import { openAccordionItemsChanged } from 'features/ui/store/uiSlice'; -import { map } from 'lodash'; +import { map } from 'lodash-es'; import { ReactNode, useCallback } from 'react'; import InvokeAccordionItem from './AccordionItems/InvokeAccordionItem'; diff --git a/invokeai/frontend/web/src/features/parameters/components/ProcessButtons/CancelButton.tsx b/invokeai/frontend/web/src/features/parameters/components/ProcessButtons/CancelButton.tsx index 69567e5e1e..2500081925 100644 --- a/invokeai/frontend/web/src/features/parameters/components/ProcessButtons/CancelButton.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/ProcessButtons/CancelButton.tsx @@ -12,7 +12,7 @@ import { cancelTypeChanged, CancelType, } from 'features/system/store/systemSlice'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { useEffect, useCallback, memo } from 'react'; import { ButtonSpinner, @@ -170,7 +170,7 @@ const CancelButton = ( } diff --git a/invokeai/frontend/web/src/features/parameters/components/ProcessButtons/ProcessButtons.tsx b/invokeai/frontend/web/src/features/parameters/components/ProcessButtons/ProcessButtons.tsx index e0ebba9f0d..ba8522f0bf 100644 --- a/invokeai/frontend/web/src/features/parameters/components/ProcessButtons/ProcessButtons.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/ProcessButtons/ProcessButtons.tsx @@ -14,7 +14,7 @@ const ProcessButtons = () => { return ( - {activeTabName === 'img2img' && } + {/* {activeTabName === 'img2img' && } */} ); diff --git a/invokeai/frontend/web/src/features/parameters/components/PromptInput/PromptInput.tsx b/invokeai/frontend/web/src/features/parameters/components/PromptInput/PromptInput.tsx index a04a073986..13095ffefa 100644 --- a/invokeai/frontend/web/src/features/parameters/components/PromptInput/PromptInput.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/PromptInput/PromptInput.tsx @@ -12,7 +12,7 @@ import { } from 'features/parameters/store/generationSlice'; import { activeTabNameSelector } from 'features/ui/store/uiSelectors'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { useHotkeys } from 'react-hotkeys-hook'; import { useTranslation } from 'react-i18next'; diff --git a/invokeai/frontend/web/src/features/parameters/store/generationSelectors.ts b/invokeai/frontend/web/src/features/parameters/store/generationSelectors.ts index eb3cb7a7d8..ce3c9c4e1e 100644 --- a/invokeai/frontend/web/src/features/parameters/store/generationSelectors.ts +++ b/invokeai/frontend/web/src/features/parameters/store/generationSelectors.ts @@ -6,7 +6,7 @@ import { selectResultsEntities, } from 'features/gallery/store/resultsSlice'; import { selectUploadsById } from 'features/gallery/store/uploadsSlice'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; export const generationSelector = (state: RootState) => state.generation; diff --git a/invokeai/frontend/web/src/features/parameters/store/generationSlice.ts b/invokeai/frontend/web/src/features/parameters/store/generationSlice.ts index 7dabfae07f..f303491b2b 100644 --- a/invokeai/frontend/web/src/features/parameters/store/generationSlice.ts +++ b/invokeai/frontend/web/src/features/parameters/store/generationSlice.ts @@ -4,7 +4,7 @@ import * as InvokeAI from 'app/types/invokeai'; import { getPromptAndNegative } from 'common/util/getPromptAndNegative'; import promptToString from 'common/util/promptToString'; import { seedWeightsToString } from 'common/util/seedWeightPairs'; -import { clamp } from 'lodash'; +import { clamp } from 'lodash-es'; export interface GenerationState { cfgScale: number; @@ -179,136 +179,126 @@ export const generationSlice = createSlice({ state, action: PayloadAction ) => { - const { - sampler, - prompt, - seed, - variations, - steps, - cfg_scale, - threshold, - perlin, - seamless, - _hires_fix, - width, - height, - } = action.payload.image; - - if (variations && variations.length > 0) { - state.seedWeights = seedWeightsToString(variations); - state.shouldGenerateVariations = true; - state.variationAmount = 0; - } else { - state.shouldGenerateVariations = false; - } - - if (seed) { - state.seed = seed; - state.shouldRandomizeSeed = false; - } - - if (prompt) state.prompt = promptToString(prompt); - if (sampler) state.sampler = sampler; - if (steps) state.steps = steps; - if (cfg_scale) state.cfgScale = cfg_scale; - if (typeof threshold === 'undefined') { - state.threshold = 0; - } else { - state.threshold = threshold; - } - if (typeof perlin === 'undefined') { - state.perlin = 0; - } else { - state.perlin = perlin; - } - if (typeof seamless === 'boolean') state.seamless = seamless; - // if (typeof hires_fix === 'boolean') state.hiresFix = hires_fix; // TODO: Needs to be fixed after reorg - if (width) state.width = width; - if (height) state.height = height; + // const { + // sampler, + // prompt, + // seed, + // variations, + // steps, + // cfg_scale, + // threshold, + // perlin, + // seamless, + // _hires_fix, + // width, + // height, + // } = action.payload.image; + // if (variations && variations.length > 0) { + // state.seedWeights = seedWeightsToString(variations); + // state.shouldGenerateVariations = true; + // state.variationAmount = 0; + // } else { + // state.shouldGenerateVariations = false; + // } + // if (seed) { + // state.seed = seed; + // state.shouldRandomizeSeed = false; + // } + // if (prompt) state.prompt = promptToString(prompt); + // if (sampler) state.sampler = sampler; + // if (steps) state.steps = steps; + // if (cfg_scale) state.cfgScale = cfg_scale; + // if (typeof threshold === 'undefined') { + // state.threshold = 0; + // } else { + // state.threshold = threshold; + // } + // if (typeof perlin === 'undefined') { + // state.perlin = 0; + // } else { + // state.perlin = perlin; + // } + // if (typeof seamless === 'boolean') state.seamless = seamless; + // // if (typeof hires_fix === 'boolean') state.hiresFix = hires_fix; // TODO: Needs to be fixed after reorg + // if (width) state.width = width; + // if (height) state.height = height; }, setAllImageToImageParameters: ( state, action: PayloadAction ) => { - const { type, strength, fit, init_image_path, mask_image_path } = - action.payload.image; - - if (type === 'img2img') { - if (init_image_path) state.initialImage = init_image_path; - if (mask_image_path) state.maskPath = mask_image_path; - if (strength) state.img2imgStrength = strength; - if (typeof fit === 'boolean') state.shouldFitToWidthHeight = fit; - } + // const { type, strength, fit, init_image_path, mask_image_path } = + // action.payload.image; + // if (type === 'img2img') { + // if (init_image_path) state.initialImage = init_image_path; + // if (mask_image_path) state.maskPath = mask_image_path; + // if (strength) state.img2imgStrength = strength; + // if (typeof fit === 'boolean') state.shouldFitToWidthHeight = fit; + // } }, setAllParameters: (state, action: PayloadAction) => { - const { - type, - sampler, - prompt, - seed, - variations, - steps, - cfg_scale, - threshold, - perlin, - seamless, - _hires_fix, - width, - height, - strength, - fit, - init_image_path, - mask_image_path, - } = action.payload.image; - - if (type === 'img2img') { - if (init_image_path) state.initialImage = init_image_path; - if (mask_image_path) state.maskPath = mask_image_path; - if (strength) state.img2imgStrength = strength; - if (typeof fit === 'boolean') state.shouldFitToWidthHeight = fit; - } - - if (variations && variations.length > 0) { - state.seedWeights = seedWeightsToString(variations); - state.shouldGenerateVariations = true; - state.variationAmount = 0; - } else { - state.shouldGenerateVariations = false; - } - - if (seed) { - state.seed = seed; - state.shouldRandomizeSeed = false; - } - - if (prompt) { - const [promptOnly, negativePrompt] = getPromptAndNegative(prompt); - if (promptOnly) state.prompt = promptOnly; - negativePrompt - ? (state.negativePrompt = negativePrompt) - : (state.negativePrompt = ''); - } - - if (sampler) state.sampler = sampler; - if (steps) state.steps = steps; - if (cfg_scale) state.cfgScale = cfg_scale; - if (typeof threshold === 'undefined') { - state.threshold = 0; - } else { - state.threshold = threshold; - } - if (typeof perlin === 'undefined') { - state.perlin = 0; - } else { - state.perlin = perlin; - } - if (typeof seamless === 'boolean') state.seamless = seamless; - // if (typeof hires_fix === 'boolean') state.hiresFix = hires_fix; // TODO: Needs to be fixed after reorg - if (width) state.width = width; - if (height) state.height = height; - - // state.shouldRunESRGAN = false; // TODO: Needs to be fixed after reorg - // state.shouldRunFacetool = false; // TODO: Needs to be fixed after reorg + // const { + // type, + // sampler, + // prompt, + // seed, + // variations, + // steps, + // cfg_scale, + // threshold, + // perlin, + // seamless, + // _hires_fix, + // width, + // height, + // strength, + // fit, + // init_image_path, + // mask_image_path, + // } = action.payload.image; + // if (type === 'img2img') { + // if (init_image_path) state.initialImage = init_image_path; + // if (mask_image_path) state.maskPath = mask_image_path; + // if (strength) state.img2imgStrength = strength; + // if (typeof fit === 'boolean') state.shouldFitToWidthHeight = fit; + // } + // if (variations && variations.length > 0) { + // state.seedWeights = seedWeightsToString(variations); + // state.shouldGenerateVariations = true; + // state.variationAmount = 0; + // } else { + // state.shouldGenerateVariations = false; + // } + // if (seed) { + // state.seed = seed; + // state.shouldRandomizeSeed = false; + // } + // if (prompt) { + // const [promptOnly, negativePrompt] = getPromptAndNegative(prompt); + // if (promptOnly) state.prompt = promptOnly; + // negativePrompt + // ? (state.negativePrompt = negativePrompt) + // : (state.negativePrompt = ''); + // } + // if (sampler) state.sampler = sampler; + // if (steps) state.steps = steps; + // if (cfg_scale) state.cfgScale = cfg_scale; + // if (typeof threshold === 'undefined') { + // state.threshold = 0; + // } else { + // state.threshold = threshold; + // } + // if (typeof perlin === 'undefined') { + // state.perlin = 0; + // } else { + // state.perlin = perlin; + // } + // if (typeof seamless === 'boolean') state.seamless = seamless; + // // if (typeof hires_fix === 'boolean') state.hiresFix = hires_fix; // TODO: Needs to be fixed after reorg + // if (width) state.width = width; + // if (height) state.height = height; + // // state.shouldRunESRGAN = false; // TODO: Needs to be fixed after reorg + // // state.shouldRunFacetool = false; // TODO: Needs to be fixed after reorg }, resetParametersState: (state) => { return { diff --git a/invokeai/frontend/web/src/features/system/components/Console.tsx b/invokeai/frontend/web/src/features/system/components/Console.tsx index 6df54be3a5..338e5b1382 100644 --- a/invokeai/frontend/web/src/features/system/components/Console.tsx +++ b/invokeai/frontend/web/src/features/system/components/Console.tsx @@ -7,7 +7,7 @@ import { setShouldShowLogViewer, SystemState, } from 'features/system/store/systemSlice'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { Resizable } from 're-resizable'; import { useLayoutEffect, useRef, useState } from 'react'; import { useHotkeys } from 'react-hotkeys-hook'; diff --git a/invokeai/frontend/web/src/features/system/components/ModelManager/CheckpointModelEdit.tsx b/invokeai/frontend/web/src/features/system/components/ModelManager/CheckpointModelEdit.tsx index 00f7a8cee8..3523e6fab7 100644 --- a/invokeai/frontend/web/src/features/system/components/ModelManager/CheckpointModelEdit.tsx +++ b/invokeai/frontend/web/src/features/system/components/ModelManager/CheckpointModelEdit.tsx @@ -24,7 +24,7 @@ import { useTranslation } from 'react-i18next'; import type { InvokeModelConfigProps } from 'app/types/invokeai'; import type { RootState } from 'app/store/store'; import type { FieldInputProps, FormikProps } from 'formik'; -import { isEqual, pickBy } from 'lodash'; +import { isEqual, pickBy } from 'lodash-es'; import ModelConvert from './ModelConvert'; import IAIFormHelperText from 'common/components/IAIForms/IAIFormHelperText'; import IAIFormErrorMessage from 'common/components/IAIForms/IAIFormErrorMessage'; diff --git a/invokeai/frontend/web/src/features/system/components/ModelManager/DiffusersModelEdit.tsx b/invokeai/frontend/web/src/features/system/components/ModelManager/DiffusersModelEdit.tsx index 39765a1dd5..f996d5a5d6 100644 --- a/invokeai/frontend/web/src/features/system/components/ModelManager/DiffusersModelEdit.tsx +++ b/invokeai/frontend/web/src/features/system/components/ModelManager/DiffusersModelEdit.tsx @@ -15,7 +15,7 @@ import { useTranslation } from 'react-i18next'; import type { InvokeDiffusersModelConfigProps } from 'app/types/invokeai'; import type { RootState } from 'app/store/store'; -import { isEqual, pickBy } from 'lodash'; +import { isEqual, pickBy } from 'lodash-es'; import IAIFormHelperText from 'common/components/IAIForms/IAIFormHelperText'; import IAIFormErrorMessage from 'common/components/IAIForms/IAIFormErrorMessage'; import IAIForm from 'common/components/IAIForm'; diff --git a/invokeai/frontend/web/src/features/system/components/ModelManager/ModelList.tsx b/invokeai/frontend/web/src/features/system/components/ModelManager/ModelList.tsx index b22cbc7548..4ef311e1d4 100644 --- a/invokeai/frontend/web/src/features/system/components/ModelManager/ModelList.tsx +++ b/invokeai/frontend/web/src/features/system/components/ModelManager/ModelList.tsx @@ -12,7 +12,7 @@ import { useTranslation } from 'react-i18next'; import { createSelector } from '@reduxjs/toolkit'; import { systemSelector } from 'features/system/store/systemSelectors'; import type { SystemState } from 'features/system/store/systemSlice'; -import { isEqual, map } from 'lodash'; +import { isEqual, map } from 'lodash-es'; import React, { useMemo, useState, useTransition } from 'react'; import type { ChangeEvent, ReactNode } from 'react'; diff --git a/invokeai/frontend/web/src/features/system/components/ModelManager/SearchModels.tsx b/invokeai/frontend/web/src/features/system/components/ModelManager/SearchModels.tsx index b791aae339..a7867efd5b 100644 --- a/invokeai/frontend/web/src/features/system/components/ModelManager/SearchModels.tsx +++ b/invokeai/frontend/web/src/features/system/components/ModelManager/SearchModels.tsx @@ -31,7 +31,7 @@ import type { FoundModel } from 'app/types/invokeai'; import type { RootState } from 'app/store/store'; import IAIInput from 'common/components/IAIInput'; import { Field, Formik } from 'formik'; -import { forEach, remove } from 'lodash'; +import { forEach, remove } from 'lodash-es'; import type { ChangeEvent, ReactNode } from 'react'; import IAIForm from 'common/components/IAIForm'; diff --git a/invokeai/frontend/web/src/features/system/components/ModelSelect.tsx b/invokeai/frontend/web/src/features/system/components/ModelSelect.tsx index 704a075474..d0ad89ba36 100644 --- a/invokeai/frontend/web/src/features/system/components/ModelSelect.tsx +++ b/invokeai/frontend/web/src/features/system/components/ModelSelect.tsx @@ -1,6 +1,6 @@ import { createSelector } from '@reduxjs/toolkit'; import { ChangeEvent, memo } from 'react'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { useTranslation } from 'react-i18next'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; diff --git a/invokeai/frontend/web/src/features/system/components/ProgressBar.tsx b/invokeai/frontend/web/src/features/system/components/ProgressBar.tsx index 0687b3f39f..35699c632c 100644 --- a/invokeai/frontend/web/src/features/system/components/ProgressBar.tsx +++ b/invokeai/frontend/web/src/features/system/components/ProgressBar.tsx @@ -2,7 +2,7 @@ import { Progress } from '@chakra-ui/react'; import { createSelector } from '@reduxjs/toolkit'; import { useAppSelector } from 'app/store/storeHooks'; import { SystemState } from 'features/system/store/systemSlice'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { useTranslation } from 'react-i18next'; import { PROGRESS_BAR_THICKNESS } from 'theme/util/constants'; import { systemSelector } from '../store/systemSelectors'; diff --git a/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsModal.tsx b/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsModal.tsx index 53b0463208..3edd6229a4 100644 --- a/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsModal.tsx +++ b/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsModal.tsx @@ -37,7 +37,7 @@ import { setShouldUseSliders, } from 'features/ui/store/uiSlice'; import { UIState } from 'features/ui/store/uiTypes'; -import { isEqual, map } from 'lodash'; +import { isEqual, map } from 'lodash-es'; import { persistor } from 'app/store/persistor'; import { ChangeEvent, cloneElement, ReactElement } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/invokeai/frontend/web/src/features/system/components/StatusIndicator.tsx b/invokeai/frontend/web/src/features/system/components/StatusIndicator.tsx index 9820eb7345..03d8934f45 100644 --- a/invokeai/frontend/web/src/features/system/components/StatusIndicator.tsx +++ b/invokeai/frontend/web/src/features/system/components/StatusIndicator.tsx @@ -2,7 +2,7 @@ import { Text, Tooltip } from '@chakra-ui/react'; import { createSelector } from '@reduxjs/toolkit'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import { errorSeen, SystemState } from 'features/system/store/systemSlice'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { useTranslation } from 'react-i18next'; import { systemSelector } from '../store/systemSelectors'; diff --git a/invokeai/frontend/web/src/features/system/store/configSlice.ts b/invokeai/frontend/web/src/features/system/store/configSlice.ts index e38d554603..d668a59574 100644 --- a/invokeai/frontend/web/src/features/system/store/configSlice.ts +++ b/invokeai/frontend/web/src/features/system/store/configSlice.ts @@ -1,7 +1,7 @@ import type { PayloadAction } from '@reduxjs/toolkit'; import { createSlice } from '@reduxjs/toolkit'; import { AppConfig, PartialAppConfig } from 'app/types/invokeai'; -import { merge } from 'lodash'; +import { merge } from 'lodash-es'; const initialConfigState: AppConfig = { shouldTransformUrls: false, diff --git a/invokeai/frontend/web/src/features/system/store/modelSelectors.ts b/invokeai/frontend/web/src/features/system/store/modelSelectors.ts index 5695ae8556..8b502fb3b6 100644 --- a/invokeai/frontend/web/src/features/system/store/modelSelectors.ts +++ b/invokeai/frontend/web/src/features/system/store/modelSelectors.ts @@ -1,5 +1,5 @@ import { createSelector } from '@reduxjs/toolkit'; import { RootState } from 'app/store/store'; -import { reduce } from 'lodash'; +import { reduce } from 'lodash-es'; export const modelSelector = (state: RootState) => state.models; diff --git a/invokeai/frontend/web/src/features/system/store/modelSlice.ts b/invokeai/frontend/web/src/features/system/store/modelSlice.ts index f858fafd8b..cb1cf05328 100644 --- a/invokeai/frontend/web/src/features/system/store/modelSlice.ts +++ b/invokeai/frontend/web/src/features/system/store/modelSlice.ts @@ -1,7 +1,7 @@ import { createEntityAdapter, PayloadAction } from '@reduxjs/toolkit'; import { createSlice } from '@reduxjs/toolkit'; import { RootState } from 'app/store/store'; -import { keys, sample } from 'lodash'; +import { keys, sample } from 'lodash-es'; import { CkptModelInfo, DiffusersModelInfo } from 'services/api'; import { receivedModels } from 'services/thunks/model'; diff --git a/invokeai/frontend/web/src/features/system/store/systemSelectors.ts b/invokeai/frontend/web/src/features/system/store/systemSelectors.ts index 876d40e862..68265aa2dc 100644 --- a/invokeai/frontend/web/src/features/system/store/systemSelectors.ts +++ b/invokeai/frontend/web/src/features/system/store/systemSelectors.ts @@ -1,6 +1,6 @@ import { createSelector } from '@reduxjs/toolkit'; import { RootState } from 'app/store/store'; -import { isEqual, reduce, pickBy } from 'lodash'; +import { isEqual, reduce, pickBy } from 'lodash-es'; export const systemSelector = (state: RootState) => state.system; diff --git a/invokeai/frontend/web/src/features/ui/components/FloatingGalleryButton.tsx b/invokeai/frontend/web/src/features/ui/components/FloatingGalleryButton.tsx index ea13842f23..38cada229f 100644 --- a/invokeai/frontend/web/src/features/ui/components/FloatingGalleryButton.tsx +++ b/invokeai/frontend/web/src/features/ui/components/FloatingGalleryButton.tsx @@ -4,7 +4,7 @@ import IAIIconButton from 'common/components/IAIIconButton'; import { useTranslation } from 'react-i18next'; import { requestCanvasRescale } from 'features/canvas/store/thunks/requestCanvasScale'; import { setShouldShowGallery } from 'features/ui/store/uiSlice'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { MdPhotoLibrary } from 'react-icons/md'; import { activeTabNameSelector, uiSelector } from '../store/uiSelectors'; diff --git a/invokeai/frontend/web/src/features/ui/components/FloatingParametersPanelButtons.tsx b/invokeai/frontend/web/src/features/ui/components/FloatingParametersPanelButtons.tsx index 6b47ee1c97..c671c0dd02 100644 --- a/invokeai/frontend/web/src/features/ui/components/FloatingParametersPanelButtons.tsx +++ b/invokeai/frontend/web/src/features/ui/components/FloatingParametersPanelButtons.tsx @@ -10,7 +10,7 @@ import { uiSelector, } from 'features/ui/store/uiSelectors'; import { setShouldShowParametersPanel } from 'features/ui/store/uiSlice'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { useTranslation } from 'react-i18next'; import { FaSlidersH } from 'react-icons/fa'; diff --git a/invokeai/frontend/web/src/features/ui/components/InvokeWorkarea.tsx b/invokeai/frontend/web/src/features/ui/components/InvokeWorkarea.tsx index 691ce5f703..f59028c8ca 100644 --- a/invokeai/frontend/web/src/features/ui/components/InvokeWorkarea.tsx +++ b/invokeai/frontend/web/src/features/ui/components/InvokeWorkarea.tsx @@ -10,7 +10,7 @@ import { DragEvent, ReactNode } from 'react'; import { setInitialCanvasImage } from 'features/canvas/store/canvasSlice'; import useGetImageByUuid from 'features/gallery/hooks/useGetImageByUuid'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { APP_CONTENT_HEIGHT } from 'theme/util/constants'; import ParametersPanel from './ParametersPanel'; diff --git a/invokeai/frontend/web/src/features/ui/components/ParametersPanel.tsx b/invokeai/frontend/web/src/features/ui/components/ParametersPanel.tsx index 116aa7bcc4..b36199e263 100644 --- a/invokeai/frontend/web/src/features/ui/components/ParametersPanel.tsx +++ b/invokeai/frontend/web/src/features/ui/components/ParametersPanel.tsx @@ -17,7 +17,7 @@ import PinParametersPanelButton from './PinParametersPanelButton'; import { requestCanvasRescale } from 'features/canvas/store/thunks/requestCanvasScale'; import { createSelector } from '@reduxjs/toolkit'; import { activeTabNameSelector, uiSelector } from '../store/uiSelectors'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { lightboxSelector } from 'features/lightbox/store/lightboxSelectors'; import useResolution from 'common/hooks/useResolution'; diff --git a/invokeai/frontend/web/src/features/ui/components/common/ParametersSlide.tsx b/invokeai/frontend/web/src/features/ui/components/common/ParametersSlide.tsx index 4dcc8dc06e..3342a9338b 100644 --- a/invokeai/frontend/web/src/features/ui/components/common/ParametersSlide.tsx +++ b/invokeai/frontend/web/src/features/ui/components/common/ParametersSlide.tsx @@ -3,7 +3,7 @@ import { Slide } from '@chakra-ui/react'; import { createSelector } from '@reduxjs/toolkit'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import { uiSelector } from 'features/ui/store/uiSelectors'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { memo, PropsWithChildren, useRef } from 'react'; import PinParametersPanelButton from 'features/ui/components/PinParametersPanelButton'; import { diff --git a/invokeai/frontend/web/src/features/ui/components/common/Scrollable.tsx b/invokeai/frontend/web/src/features/ui/components/common/Scrollable.tsx index 0fdcff742f..91a9b14e31 100644 --- a/invokeai/frontend/web/src/features/ui/components/common/Scrollable.tsx +++ b/invokeai/frontend/web/src/features/ui/components/common/Scrollable.tsx @@ -1,5 +1,5 @@ import { Box, ChakraProps } from '@chakra-ui/react'; -import { throttle } from 'lodash'; +import { throttle } from 'lodash-es'; import { ReactNode, useEffect, useRef } from 'react'; const scrollShadowBaseStyles: ChakraProps['sx'] = { diff --git a/invokeai/frontend/web/src/features/ui/components/tabs/Generate/GenerateParameters.tsx b/invokeai/frontend/web/src/features/ui/components/tabs/Generate/GenerateParameters.tsx index 46cf07d088..5b56fa5b0c 100644 --- a/invokeai/frontend/web/src/features/ui/components/tabs/Generate/GenerateParameters.tsx +++ b/invokeai/frontend/web/src/features/ui/components/tabs/Generate/GenerateParameters.tsx @@ -29,7 +29,7 @@ import ParametersAccordion, { import ProcessButtons from 'features/parameters/components/ProcessButtons/ProcessButtons'; import NegativePromptInput from 'features/parameters/components/PromptInput/NegativePromptInput'; import PromptInput from 'features/parameters/components/PromptInput/PromptInput'; -import { findIndex } from 'lodash'; +import { findIndex } from 'lodash-es'; import { memo, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { PARAMETERS_PANEL_WIDTH } from 'theme/util/constants'; diff --git a/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasContentBeta.tsx b/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasContentBeta.tsx index ff3736d3b6..601c36b9e2 100644 --- a/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasContentBeta.tsx +++ b/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasContentBeta.tsx @@ -6,7 +6,7 @@ import IAICanvas from 'features/canvas/components/IAICanvas'; import IAICanvasResizer from 'features/canvas/components/IAICanvasResizer'; import { canvasSelector } from 'features/canvas/store/canvasSelectors'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { useLayoutEffect } from 'react'; import UnifiedCanvasToolbarBeta from './UnifiedCanvasToolbarBeta'; import UnifiedCanvasToolSettingsBeta from './UnifiedCanvasToolSettingsBeta'; diff --git a/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasColorPicker.tsx b/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasColorPicker.tsx index 32f82d48f4..c83bb6934e 100644 --- a/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasColorPicker.tsx +++ b/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasColorPicker.tsx @@ -8,7 +8,7 @@ import { isStagingSelector, } from 'features/canvas/store/canvasSelectors'; import { setBrushColor, setMaskColor } from 'features/canvas/store/canvasSlice'; -import { clamp, isEqual } from 'lodash'; +import { clamp, isEqual } from 'lodash-es'; import { useHotkeys } from 'react-hotkeys-hook'; diff --git a/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasSettings.tsx b/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasSettings.tsx index eed8f73433..a2b21368d4 100644 --- a/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasSettings.tsx +++ b/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasSettings.tsx @@ -16,7 +16,7 @@ import EmptyTempFolderButtonModal from 'features/system/components/ClearTempFold import { FaWrench } from 'react-icons/fa'; import ClearCanvasHistoryButtonModal from 'features/canvas/components/ClearCanvasHistoryButtonModal'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { useTranslation } from 'react-i18next'; export const canvasControlsSelector = createSelector( diff --git a/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettingsBeta.tsx b/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettingsBeta.tsx index e3382c39a7..e5503ac203 100644 --- a/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettingsBeta.tsx +++ b/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettingsBeta.tsx @@ -3,7 +3,7 @@ import { useAppSelector } from 'app/store/storeHooks'; import { canvasSelector } from 'features/canvas/store/canvasSelectors'; import { Flex } from '@chakra-ui/react'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import UnifiedCanvasBaseBrushSettings from './UnifiedCanvasToolSettings/UnifiedCanvasBaseBrushSettings'; import UnifiedCanvasMaskBrushSettings from './UnifiedCanvasToolSettings/UnifiedCanvasMaskBrushSettings'; import UnifiedCanvasMoveSettings from './UnifiedCanvasToolSettings/UnifiedCanvasMoveSettings'; diff --git a/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasLayerSelect.tsx b/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasLayerSelect.tsx index 8655a344b4..780744b045 100644 --- a/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasLayerSelect.tsx +++ b/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasLayerSelect.tsx @@ -10,7 +10,7 @@ import { CanvasLayer, LAYER_NAMES_DICT, } from 'features/canvas/store/canvasTypes'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { ChangeEvent } from 'react'; import { useHotkeys } from 'react-hotkeys-hook'; diff --git a/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasToolSelect.tsx b/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasToolSelect.tsx index deb9bfd144..a6c4ec7c40 100644 --- a/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasToolSelect.tsx +++ b/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasToolSelect.tsx @@ -12,7 +12,7 @@ import { setTool, } from 'features/canvas/store/canvasSlice'; import { systemSelector } from 'features/system/store/systemSelectors'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { useHotkeys } from 'react-hotkeys-hook'; import { useTranslation } from 'react-i18next'; diff --git a/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasContent.tsx b/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasContent.tsx index 00c0245af5..6cc63a8446 100644 --- a/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasContent.tsx +++ b/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasContent.tsx @@ -7,7 +7,7 @@ import IAICanvasResizer from 'features/canvas/components/IAICanvasResizer'; import IAICanvasToolbar from 'features/canvas/components/IAICanvasToolbar/IAICanvasToolbar'; import { canvasSelector } from 'features/canvas/store/canvasSelectors'; import { requestCanvasRescale } from 'features/canvas/store/thunks/requestCanvasScale'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { useLayoutEffect } from 'react'; diff --git a/invokeai/frontend/web/src/features/ui/store/uiSelectors.ts b/invokeai/frontend/web/src/features/ui/store/uiSelectors.ts index 88edd76786..fa152e9ce5 100644 --- a/invokeai/frontend/web/src/features/ui/store/uiSelectors.ts +++ b/invokeai/frontend/web/src/features/ui/store/uiSelectors.ts @@ -1,6 +1,6 @@ import { createSelector } from '@reduxjs/toolkit'; import { RootState } from 'app/store/store'; -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { tabMap } from './tabMap'; import { UIState } from './uiTypes'; diff --git a/invokeai/frontend/web/src/services/thunks/image.ts b/invokeai/frontend/web/src/services/thunks/image.ts index 6b902f6e26..d9fdd1c589 100644 --- a/invokeai/frontend/web/src/services/thunks/image.ts +++ b/invokeai/frontend/web/src/services/thunks/image.ts @@ -1,7 +1,7 @@ import { isFulfilled, isRejected } from '@reduxjs/toolkit'; import { createAppAsyncThunk } from 'app/store/storeUtils'; import { imageSelected } from 'features/gallery/store/gallerySlice'; -import { clamp } from 'lodash'; +import { clamp } from 'lodash-es'; import { ImagesService } from 'services/api'; import { getHeaders } from 'services/util/getHeaders'; diff --git a/invokeai/frontend/web/src/services/thunks/model.ts b/invokeai/frontend/web/src/services/thunks/model.ts index b8017b562d..a4aac7563d 100644 --- a/invokeai/frontend/web/src/services/thunks/model.ts +++ b/invokeai/frontend/web/src/services/thunks/model.ts @@ -1,6 +1,6 @@ import { createAppAsyncThunk } from 'app/store/storeUtils'; import { Model } from 'features/system/store/modelSlice'; -import { reduce } from 'lodash'; +import { reduce } from 'lodash-es'; import { ModelsService } from 'services/api'; export const IMAGES_PER_PAGE = 20; diff --git a/invokeai/frontend/web/vite.config.ts b/invokeai/frontend/web/vite.config.ts index a8fc0c39af..6491eb72e7 100644 --- a/invokeai/frontend/web/vite.config.ts +++ b/invokeai/frontend/web/vite.config.ts @@ -1,13 +1,11 @@ import { defineConfig } from 'vite'; -import { commonConfig } from './config/vite.common.config'; import { appConfig } from './config/vite.app.config'; import { packageConfig } from './config/vite.package.config'; -import { defaultsDeep } from 'lodash'; export default defineConfig(({ mode }) => { if (mode === 'package') { - return defaultsDeep(packageConfig, commonConfig); + return packageConfig; } - return defaultsDeep(appConfig, commonConfig); + return appConfig; }); diff --git a/invokeai/frontend/web/yarn.lock b/invokeai/frontend/web/yarn.lock index 1a003eecc2..b0811ad877 100644 --- a/invokeai/frontend/web/yarn.lock +++ b/invokeai/frontend/web/yarn.lock @@ -930,10 +930,10 @@ gonzales-pe "^4.3.0" node-source-walk "^5.0.1" -"@emotion/babel-plugin@^11.10.6": - version "11.10.6" - resolved "https://registry.yarnpkg.com/@emotion/babel-plugin/-/babel-plugin-11.10.6.tgz#a68ee4b019d661d6f37dec4b8903255766925ead" - integrity sha512-p2dAqtVrkhSa7xz1u/m9eHYdLi+en8NowrmXeF/dKtJpU8lCWli8RUAati7NcSl0afsBott48pdnANuD0wh9QQ== +"@emotion/babel-plugin@^11.10.8": + version "11.10.8" + resolved "https://registry.yarnpkg.com/@emotion/babel-plugin/-/babel-plugin-11.10.8.tgz#bae325c902937665d00684038fd5294223ef9e1d" + integrity sha512-gxNky50AJL3AlkbjvTARiwAqei6/tNUxDZPSKd+3jqWVM3AmdVTTdpjHorR/an/M0VJqdsuq5oGcFH+rjtyujQ== dependencies: "@babel/helper-module-imports" "^7.16.7" "@babel/runtime" "^7.18.3" @@ -945,18 +945,18 @@ escape-string-regexp "^4.0.0" find-root "^1.1.0" source-map "^0.5.7" - stylis "4.1.3" + stylis "4.1.4" -"@emotion/cache@^11.10.5": - version "11.10.7" - resolved "https://registry.yarnpkg.com/@emotion/cache/-/cache-11.10.7.tgz#2e3b12d3c7c74db0a020ae79eefc52a1b03a6908" - integrity sha512-VLl1/2D6LOjH57Y8Vem1RoZ9haWF4jesHDGiHtKozDQuBIkJm2gimVo0I02sWCuzZtVACeixTVB4jeE8qvCBoQ== +"@emotion/cache@^11.10.8": + version "11.10.8" + resolved "https://registry.yarnpkg.com/@emotion/cache/-/cache-11.10.8.tgz#3b39b4761bea0ae2f4f07f0a425eec8b6977c03e" + integrity sha512-5fyqGHi51LU95o7qQ/vD1jyvC4uCY5GcBT+UgP4LHdpO9jPDlXqhrRr9/wCKmfoAvh5G/F7aOh4MwQa+8uEqhA== dependencies: "@emotion/memoize" "^0.8.0" "@emotion/sheet" "^1.2.1" "@emotion/utils" "^1.2.0" "@emotion/weak-memoize" "^0.3.0" - stylis "4.1.3" + stylis "4.1.4" "@emotion/hash@^0.9.0": version "0.9.0" @@ -988,13 +988,13 @@ integrity sha512-G/YwXTkv7Den9mXDO7AhLWkE3q+I92B+VqAE+dYG4NGPaHZGvt3G8Q0p9vmE+sq7rTGphUbAvmQ9YpbfMQGGlA== "@emotion/react@^11.10.6": - version "11.10.6" - resolved "https://registry.yarnpkg.com/@emotion/react/-/react-11.10.6.tgz#dbe5e650ab0f3b1d2e592e6ab1e006e75fd9ac11" - integrity sha512-6HT8jBmcSkfzO7mc+N1L9uwvOnlcGoix8Zn7srt+9ga0MjREo6lRpuVX0kzo6Jp6oTqDhREOFsygN6Ew4fEQbw== + version "11.10.8" + resolved "https://registry.yarnpkg.com/@emotion/react/-/react-11.10.8.tgz#02e274ecb45e03ab9d7a8eb9f0f0c064613eaf7b" + integrity sha512-ZfGfiABtJ1P1OXqOBsW08EgCDp5fK6C5I8hUJauc/VcJBGSzqAirMnFslhFWnZJ/w5HxPI36XbvMV0l4KZHl+w== dependencies: "@babel/runtime" "^7.18.3" - "@emotion/babel-plugin" "^11.10.6" - "@emotion/cache" "^11.10.5" + "@emotion/babel-plugin" "^11.10.8" + "@emotion/cache" "^11.10.8" "@emotion/serialize" "^1.1.1" "@emotion/use-insertion-effect-with-fallbacks" "^1.0.0" "@emotion/utils" "^1.2.0" @@ -1018,12 +1018,12 @@ integrity sha512-zxRBwl93sHMsOj4zs+OslQKg/uhF38MB+OMKoCrVuS0nyTkqnau+BM3WGEoOptg9Oz45T/aIGs1qbVAsEFo3nA== "@emotion/styled@^11.10.6": - version "11.10.6" - resolved "https://registry.yarnpkg.com/@emotion/styled/-/styled-11.10.6.tgz#d886afdc51ef4d66c787ebde848f3cc8b117ebba" - integrity sha512-OXtBzOmDSJo5Q0AFemHCfl+bUueT8BIcPSxu0EGTpGk6DmI5dnhSzQANm1e1ze0YZL7TDyAyy6s/b/zmGOS3Og== + version "11.10.8" + resolved "https://registry.yarnpkg.com/@emotion/styled/-/styled-11.10.8.tgz#a3fd68efd90bd7e8a06b82b95adec643d386fa69" + integrity sha512-gow0lF4Uw/QEdX2REMhI8v6wLOabPKJ+4HKNF0xdJ2DJdznN6fxaXpQOx6sNkyBhSUL558Rmcu1Lq/MYlVo4vw== dependencies: "@babel/runtime" "^7.18.3" - "@emotion/babel-plugin" "^11.10.6" + "@emotion/babel-plugin" "^11.10.8" "@emotion/is-prop-valid" "^1.2.0" "@emotion/serialize" "^1.1.1" "@emotion/use-insertion-effect-with-fallbacks" "^1.0.0" @@ -1838,6 +1838,13 @@ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== +"@types/lodash-es@^4.14.194": + version "4.17.7" + resolved "https://registry.yarnpkg.com/@types/lodash-es/-/lodash-es-4.17.7.tgz#22edcae9f44aff08546e71db8925f05b33c7cc40" + integrity sha512-z0ptr6UI10VlU6l5MYhGwS4mC8DZyYer2mCoyysZtSF7p26zOX8UpbrV0YpNYLGS8K4PUFIyEr62IMFFjveSiQ== + dependencies: + "@types/lodash" "*" + "@types/lodash.mergewith@4.6.7": version "4.6.7" resolved "https://registry.yarnpkg.com/@types/lodash.mergewith/-/lodash.mergewith-4.6.7.tgz#eaa65aa5872abdd282f271eae447b115b2757212" @@ -1845,7 +1852,7 @@ dependencies: "@types/lodash" "*" -"@types/lodash@*", "@types/lodash@^4.14.194": +"@types/lodash@*": version "4.14.194" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.194.tgz#b71eb6f7a0ff11bff59fc987134a093029258a76" integrity sha512-r22s9tAS7imvBt2lyHC9B8AGwWnXaYb1tY09oyLkXDs4vArpYJzw09nj8MLx5VfciBPGIb+ZwG0ssYnEPJxn/g== @@ -5912,10 +5919,10 @@ strip-json-comments@~2.0.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ== -stylis@4.1.3: - version "4.1.3" - resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.1.3.tgz#fd2fbe79f5fed17c55269e16ed8da14c84d069f7" - integrity sha512-GP6WDNWf+o403jrEp9c5jibKavrtLW+/qYGhFxFrG8maXhwTBI7gLLhiBb0o7uFccWN+EOS9aMO6cGHWAO07OA== +stylis@4.1.4: + version "4.1.4" + resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.1.4.tgz#9cb60e7153d8ac6d02d773552bf51c7a0344535b" + integrity sha512-USf5pszRYwuE6hg9by0OkKChkQYEXfkeTtm0xKw+jqQhwyjCVLdYyMBK7R+n7dhzsblAWJnGxju4vxq5eH20GQ== stylus-lookup@^3.0.1: version "3.0.2"