mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
cleanup(ui): Remove unused vars + minor bug fixes
This commit is contained in:
parent
15e57e3a3d
commit
7bfb5640ad
@ -13,7 +13,7 @@ export const readinessSelector = createSelector(
|
|||||||
initialCanvasImageSelector,
|
initialCanvasImageSelector,
|
||||||
activeTabNameSelector,
|
activeTabNameSelector,
|
||||||
],
|
],
|
||||||
(generation, system, initialCanvasImage, activeTabName) => {
|
(generation, system) => {
|
||||||
const {
|
const {
|
||||||
prompt,
|
prompt,
|
||||||
shouldGenerateVariations,
|
shouldGenerateVariations,
|
||||||
|
@ -1,28 +1,17 @@
|
|||||||
import { canvasPersistDenylist } from 'features/canvas/store/canvasPersistDenylist';
|
|
||||||
import { initialCanvasState } from 'features/canvas/store/canvasSlice';
|
import { initialCanvasState } from 'features/canvas/store/canvasSlice';
|
||||||
import { galleryPersistDenylist } from 'features/gallery/store/galleryPersistDenylist';
|
|
||||||
import { initialGalleryState } from 'features/gallery/store/gallerySlice';
|
import { initialGalleryState } from 'features/gallery/store/gallerySlice';
|
||||||
import { resultsPersistDenylist } from 'features/gallery/store/resultsPersistDenylist';
|
|
||||||
import { initialResultsState } from 'features/gallery/store/resultsSlice';
|
import { initialResultsState } from 'features/gallery/store/resultsSlice';
|
||||||
import { uploadsPersistDenylist } from 'features/gallery/store/uploadsPersistDenylist';
|
|
||||||
import { initialUploadsState } from 'features/gallery/store/uploadsSlice';
|
import { initialUploadsState } from 'features/gallery/store/uploadsSlice';
|
||||||
import { lightboxPersistDenylist } from 'features/lightbox/store/lightboxPersistDenylist';
|
|
||||||
import { initialLightboxState } from 'features/lightbox/store/lightboxSlice';
|
import { initialLightboxState } from 'features/lightbox/store/lightboxSlice';
|
||||||
import { nodesPersistDenylist } from 'features/nodes/store/nodesPersistDenylist';
|
|
||||||
import { initialNodesState } from 'features/nodes/store/nodesSlice';
|
import { initialNodesState } from 'features/nodes/store/nodesSlice';
|
||||||
import { generationPersistDenylist } from 'features/parameters/store/generationPersistDenylist';
|
|
||||||
import { initialGenerationState } from 'features/parameters/store/generationSlice';
|
import { initialGenerationState } from 'features/parameters/store/generationSlice';
|
||||||
import { postprocessingPersistDenylist } from 'features/parameters/store/postprocessingPersistDenylist';
|
|
||||||
import { initialPostprocessingState } from 'features/parameters/store/postprocessingSlice';
|
import { initialPostprocessingState } from 'features/parameters/store/postprocessingSlice';
|
||||||
import { initialConfigState } from 'features/system/store/configSlice';
|
import { initialConfigState } from 'features/system/store/configSlice';
|
||||||
import { initialModelsState } from 'features/system/store/modelSlice';
|
import { initialModelsState } from 'features/system/store/modelSlice';
|
||||||
import { modelsPersistDenylist } from 'features/system/store/modelsPersistDenylist';
|
|
||||||
import { systemPersistDenylist } from 'features/system/store/systemPersistDenylist';
|
|
||||||
import { initialSystemState } from 'features/system/store/systemSlice';
|
import { initialSystemState } from 'features/system/store/systemSlice';
|
||||||
import { initialHotkeysState } from 'features/ui/store/hotkeysSlice';
|
import { initialHotkeysState } from 'features/ui/store/hotkeysSlice';
|
||||||
import { uiPersistDenylist } from 'features/ui/store/uiPersistDenylist';
|
|
||||||
import { initialUIState } from 'features/ui/store/uiSlice';
|
import { initialUIState } from 'features/ui/store/uiSlice';
|
||||||
import { defaultsDeep, merge, omit } from 'lodash-es';
|
import { defaultsDeep } from 'lodash-es';
|
||||||
import { UnserializeFunction } from 'redux-remember';
|
import { UnserializeFunction } from 'redux-remember';
|
||||||
|
|
||||||
const initialStates: {
|
const initialStates: {
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
AnyAction,
|
AnyAction,
|
||||||
Store,
|
|
||||||
ThunkDispatch,
|
ThunkDispatch,
|
||||||
combineReducers,
|
combineReducers,
|
||||||
configureStore,
|
configureStore,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux';
|
import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux';
|
||||||
import { AppDispatch, AppThunkDispatch, RootState } from 'app/store/store';
|
import { AppThunkDispatch, RootState } from 'app/store/store';
|
||||||
|
|
||||||
// Use throughout your app instead of plain `useDispatch` and `useSelector`
|
// Use throughout your app instead of plain `useDispatch` and `useSelector`
|
||||||
export const useAppDispatch = () => useDispatch<AppThunkDispatch>();
|
export const useAppDispatch = () => useDispatch<AppThunkDispatch>();
|
||||||
|
@ -12,13 +12,10 @@
|
|||||||
* 'gfpgan'.
|
* 'gfpgan'.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { GalleryCategory } from 'features/gallery/store/gallerySlice';
|
|
||||||
import { SelectedImage } from 'features/parameters/store/actions';
|
import { SelectedImage } from 'features/parameters/store/actions';
|
||||||
import { FacetoolType } from 'features/parameters/store/postprocessingSlice';
|
|
||||||
import { InvokeTabName } from 'features/ui/store/tabMap';
|
import { InvokeTabName } from 'features/ui/store/tabMap';
|
||||||
import { IRect } from 'konva/lib/types';
|
import { IRect } from 'konva/lib/types';
|
||||||
import { ImageResponseMetadata, ImageType } from 'services/api';
|
import { ImageResponseMetadata, ImageType } from 'services/api';
|
||||||
import { AnyInvocation } from 'services/events/types';
|
|
||||||
import { O } from 'ts-toolbelt';
|
import { O } from 'ts-toolbelt';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -279,7 +276,7 @@ export type FoundModelResponse = {
|
|||||||
|
|
||||||
// export type SystemConfigResponse = SystemConfig;
|
// export type SystemConfigResponse = SystemConfig;
|
||||||
|
|
||||||
export type ImageResultResponse = Omit<_Image, 'uuid'> & {
|
export type ImageResultResponse = Omit<Image, 'uuid'> & {
|
||||||
boundingBox?: IRect;
|
boundingBox?: IRect;
|
||||||
generationMode: InvokeTabName;
|
generationMode: InvokeTabName;
|
||||||
};
|
};
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { ChevronDownIcon, ChevronUpIcon } from '@chakra-ui/icons';
|
import { ChevronUpIcon } from '@chakra-ui/icons';
|
||||||
import { Box, Collapse, Flex, Spacer, Switch } from '@chakra-ui/react';
|
import { Box, Collapse, Flex, Spacer, Switch } from '@chakra-ui/react';
|
||||||
import { PropsWithChildren, memo } from 'react';
|
import { PropsWithChildren, memo } from 'react';
|
||||||
|
|
||||||
|
@ -22,7 +22,6 @@ import {
|
|||||||
CanvasLayer,
|
CanvasLayer,
|
||||||
CanvasLayerState,
|
CanvasLayerState,
|
||||||
CanvasMaskLine,
|
CanvasMaskLine,
|
||||||
CanvasSession,
|
|
||||||
CanvasState,
|
CanvasState,
|
||||||
CanvasTool,
|
CanvasTool,
|
||||||
Dimensions,
|
Dimensions,
|
||||||
@ -30,7 +29,6 @@ import {
|
|||||||
isCanvasBaseImage,
|
isCanvasBaseImage,
|
||||||
isCanvasMaskLine,
|
isCanvasMaskLine,
|
||||||
} from './canvasTypes';
|
} from './canvasTypes';
|
||||||
import { stringToArray } from 'konva/lib/shapes/Text';
|
|
||||||
|
|
||||||
export const initialLayerState: CanvasLayerState = {
|
export const initialLayerState: CanvasLayerState = {
|
||||||
objects: [],
|
objects: [],
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
import { createSelector } from '@reduxjs/toolkit';
|
import { createSelector } from '@reduxjs/toolkit';
|
||||||
import { get, isEqual, isNumber, isString } from 'lodash-es';
|
import { isEqual, isString } from 'lodash-es';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ButtonGroup,
|
ButtonGroup,
|
||||||
Flex,
|
Flex,
|
||||||
FlexProps,
|
FlexProps,
|
||||||
FormControl,
|
|
||||||
Link,
|
Link,
|
||||||
useDisclosure,
|
useDisclosure,
|
||||||
useToast,
|
useToast,
|
||||||
@ -15,19 +14,12 @@ import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
|||||||
import IAIButton from 'common/components/IAIButton';
|
import IAIButton from 'common/components/IAIButton';
|
||||||
import IAIIconButton from 'common/components/IAIIconButton';
|
import IAIIconButton from 'common/components/IAIIconButton';
|
||||||
import IAIPopover from 'common/components/IAIPopover';
|
import IAIPopover from 'common/components/IAIPopover';
|
||||||
import { setInitialCanvasImage } from 'features/canvas/store/canvasSlice';
|
|
||||||
import { GalleryState } from 'features/gallery/store/gallerySlice';
|
|
||||||
import { lightboxSelector } from 'features/lightbox/store/lightboxSelectors';
|
import { lightboxSelector } from 'features/lightbox/store/lightboxSelectors';
|
||||||
import { setIsLightboxOpen } from 'features/lightbox/store/lightboxSlice';
|
import { setIsLightboxOpen } from 'features/lightbox/store/lightboxSlice';
|
||||||
import {
|
|
||||||
initialImageChanged,
|
|
||||||
setAllParameters,
|
|
||||||
// setInitialImage,
|
|
||||||
setSeed,
|
|
||||||
} from 'features/parameters/store/generationSlice';
|
|
||||||
import { postprocessingSelector } from 'features/parameters/store/postprocessingSelectors';
|
import { postprocessingSelector } from 'features/parameters/store/postprocessingSelectors';
|
||||||
import { systemSelector } from 'features/system/store/systemSelectors';
|
import { systemSelector } from 'features/system/store/systemSelectors';
|
||||||
import { SystemState } from 'features/system/store/systemSlice';
|
|
||||||
import {
|
import {
|
||||||
activeTabNameSelector,
|
activeTabNameSelector,
|
||||||
uiSelector,
|
uiSelector,
|
||||||
@ -165,31 +157,31 @@ const CurrentImageButtons = (props: CurrentImageButtonsProps) => {
|
|||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const { recallPrompt, recallSeed, sendToImageToImage } = useParameters();
|
const { recallPrompt, recallSeed } = useParameters();
|
||||||
|
|
||||||
const handleCopyImage = useCallback(async () => {
|
// const handleCopyImage = useCallback(async () => {
|
||||||
if (!image?.url) {
|
// if (!image?.url) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
const url = getUrl(image.url);
|
// const url = getUrl(image.url);
|
||||||
|
|
||||||
if (!url) {
|
// if (!url) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
const blob = await fetch(url).then((res) => res.blob());
|
// const blob = await fetch(url).then((res) => res.blob());
|
||||||
const data = [new ClipboardItem({ [blob.type]: blob })];
|
// const data = [new ClipboardItem({ [blob.type]: blob })];
|
||||||
|
|
||||||
await navigator.clipboard.write(data);
|
// await navigator.clipboard.write(data);
|
||||||
|
|
||||||
toast({
|
// toast({
|
||||||
title: t('toast.imageCopied'),
|
// title: t('toast.imageCopied'),
|
||||||
status: 'success',
|
// status: 'success',
|
||||||
duration: 2500,
|
// duration: 2500,
|
||||||
isClosable: true,
|
// isClosable: true,
|
||||||
});
|
// });
|
||||||
}, [getUrl, t, image?.url, toast]);
|
// }, [getUrl, t, image?.url, toast]);
|
||||||
|
|
||||||
const handleCopyImageLink = useCallback(() => {
|
const handleCopyImageLink = useCallback(() => {
|
||||||
const url = image
|
const url = image
|
||||||
|
@ -5,9 +5,7 @@ import {
|
|||||||
Image,
|
Image,
|
||||||
MenuItem,
|
MenuItem,
|
||||||
MenuList,
|
MenuList,
|
||||||
Skeleton,
|
|
||||||
useDisclosure,
|
useDisclosure,
|
||||||
useTheme,
|
|
||||||
useToast,
|
useToast,
|
||||||
} from '@chakra-ui/react';
|
} from '@chakra-ui/react';
|
||||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||||
@ -98,17 +96,16 @@ const HoverableImage = memo((props: HoverableImageProps) => {
|
|||||||
} = useDisclosure();
|
} = useDisclosure();
|
||||||
|
|
||||||
const { image, isSelected } = props;
|
const { image, isSelected } = props;
|
||||||
const { url, thumbnail, name, metadata } = image;
|
const { url, thumbnail, name } = image;
|
||||||
const { getUrl } = useGetUrl();
|
const { getUrl } = useGetUrl();
|
||||||
|
|
||||||
const [isHovered, setIsHovered] = useState<boolean>(false);
|
const [isHovered, setIsHovered] = useState<boolean>(false);
|
||||||
|
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const { direction } = useTheme();
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { isFeatureEnabled: isLightboxEnabled } = useFeatureStatus('lightbox');
|
const { isFeatureEnabled: isLightboxEnabled } = useFeatureStatus('lightbox');
|
||||||
const { recallSeed, recallPrompt, sendToImageToImage, recallInitialImage } =
|
const { recallSeed, recallPrompt, recallInitialImage } = useParameters();
|
||||||
useParameters();
|
|
||||||
|
|
||||||
const handleMouseOver = () => setIsHovered(true);
|
const handleMouseOver = () => setIsHovered(true);
|
||||||
const handleMouseOut = () => setIsHovered(false);
|
const handleMouseOut = () => setIsHovered(false);
|
||||||
|
@ -5,7 +5,6 @@ import {
|
|||||||
// selectPrevImage,
|
// selectPrevImage,
|
||||||
setGalleryImageMinimumWidth,
|
setGalleryImageMinimumWidth,
|
||||||
} from 'features/gallery/store/gallerySlice';
|
} from 'features/gallery/store/gallerySlice';
|
||||||
import { InvokeTabName } from 'features/ui/store/tabMap';
|
|
||||||
|
|
||||||
import { clamp, isEqual } from 'lodash-es';
|
import { clamp, isEqual } from 'lodash-es';
|
||||||
import { useHotkeys } from 'react-hotkeys-hook';
|
import { useHotkeys } from 'react-hotkeys-hook';
|
||||||
@ -13,11 +12,7 @@ import { useHotkeys } from 'react-hotkeys-hook';
|
|||||||
import './ImageGallery.css';
|
import './ImageGallery.css';
|
||||||
import ImageGalleryContent from './ImageGalleryContent';
|
import ImageGalleryContent from './ImageGalleryContent';
|
||||||
import ResizableDrawer from 'features/ui/components/common/ResizableDrawer/ResizableDrawer';
|
import ResizableDrawer from 'features/ui/components/common/ResizableDrawer/ResizableDrawer';
|
||||||
import {
|
import { setShouldShowGallery } from 'features/ui/store/uiSlice';
|
||||||
setShouldShowGallery,
|
|
||||||
toggleGalleryPanel,
|
|
||||||
togglePinGalleryPanel,
|
|
||||||
} from 'features/ui/store/uiSlice';
|
|
||||||
import { createSelector } from '@reduxjs/toolkit';
|
import { createSelector } from '@reduxjs/toolkit';
|
||||||
import {
|
import {
|
||||||
activeTabNameSelector,
|
activeTabNameSelector,
|
||||||
@ -26,8 +21,6 @@ import {
|
|||||||
import { isStagingSelector } from 'features/canvas/store/canvasSelectors';
|
import { isStagingSelector } from 'features/canvas/store/canvasSelectors';
|
||||||
import { requestCanvasRescale } from 'features/canvas/store/thunks/requestCanvasScale';
|
import { requestCanvasRescale } from 'features/canvas/store/thunks/requestCanvasScale';
|
||||||
import { lightboxSelector } from 'features/lightbox/store/lightboxSelectors';
|
import { lightboxSelector } from 'features/lightbox/store/lightboxSelectors';
|
||||||
import useResolution from 'common/hooks/useResolution';
|
|
||||||
import { Flex } from '@chakra-ui/react';
|
|
||||||
import { memo } from 'react';
|
import { memo } from 'react';
|
||||||
|
|
||||||
// const GALLERY_TAB_WIDTHS: Record<
|
// const GALLERY_TAB_WIDTHS: Record<
|
||||||
|
@ -3,7 +3,6 @@ import {
|
|||||||
Box,
|
Box,
|
||||||
Center,
|
Center,
|
||||||
Flex,
|
Flex,
|
||||||
Heading,
|
|
||||||
IconButton,
|
IconButton,
|
||||||
Link,
|
Link,
|
||||||
Text,
|
Text,
|
||||||
@ -19,8 +18,6 @@ import {
|
|||||||
setCfgScale,
|
setCfgScale,
|
||||||
setHeight,
|
setHeight,
|
||||||
setImg2imgStrength,
|
setImg2imgStrength,
|
||||||
// setInitialImage,
|
|
||||||
setMaskPath,
|
|
||||||
setPerlin,
|
setPerlin,
|
||||||
setSampler,
|
setSampler,
|
||||||
setSeamless,
|
setSeamless,
|
||||||
@ -31,15 +28,7 @@ import {
|
|||||||
setThreshold,
|
setThreshold,
|
||||||
setWidth,
|
setWidth,
|
||||||
} from 'features/parameters/store/generationSlice';
|
} from 'features/parameters/store/generationSlice';
|
||||||
import {
|
import { setHiresFix } from 'features/parameters/store/postprocessingSlice';
|
||||||
setCodeformerFidelity,
|
|
||||||
setFacetoolStrength,
|
|
||||||
setFacetoolType,
|
|
||||||
setHiresFix,
|
|
||||||
setUpscalingDenoising,
|
|
||||||
setUpscalingLevel,
|
|
||||||
setUpscalingStrength,
|
|
||||||
} from 'features/parameters/store/postprocessingSlice';
|
|
||||||
import { setShouldShowImageDetails } from 'features/ui/store/uiSlice';
|
import { setShouldShowImageDetails } from 'features/ui/store/uiSlice';
|
||||||
import { memo } from 'react';
|
import { memo } from 'react';
|
||||||
import { useHotkeys } from 'react-hotkeys-hook';
|
import { useHotkeys } from 'react-hotkeys-hook';
|
||||||
|
@ -1,23 +1,14 @@
|
|||||||
import { createSelector } from '@reduxjs/toolkit';
|
import { createSelector } from '@reduxjs/toolkit';
|
||||||
import { RootState } from 'app/store/store';
|
import { RootState } from 'app/store/store';
|
||||||
import { lightboxSelector } from 'features/lightbox/store/lightboxSelectors';
|
import { lightboxSelector } from 'features/lightbox/store/lightboxSelectors';
|
||||||
import { configSelector } from 'features/system/store/configSelectors';
|
|
||||||
import { systemSelector } from 'features/system/store/systemSelectors';
|
|
||||||
import {
|
import {
|
||||||
activeTabNameSelector,
|
activeTabNameSelector,
|
||||||
uiSelector,
|
uiSelector,
|
||||||
} from 'features/ui/store/uiSelectors';
|
} from 'features/ui/store/uiSelectors';
|
||||||
import { isEqual } from 'lodash-es';
|
import { isEqual } from 'lodash-es';
|
||||||
import {
|
import { selectResultsById, selectResultsEntities } from './resultsSlice';
|
||||||
selectResultsAll,
|
import { selectUploadsAll, selectUploadsById } from './uploadsSlice';
|
||||||
selectResultsById,
|
|
||||||
selectResultsEntities,
|
|
||||||
} from './resultsSlice';
|
|
||||||
import {
|
|
||||||
selectUploadsAll,
|
|
||||||
selectUploadsById,
|
|
||||||
selectUploadsEntities,
|
|
||||||
} from './uploadsSlice';
|
|
||||||
|
|
||||||
export const gallerySelector = (state: RootState) => state.gallery;
|
export const gallerySelector = (state: RootState) => state.gallery;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import {
|
|||||||
receivedUploadImagesPage,
|
receivedUploadImagesPage,
|
||||||
IMAGES_PER_PAGE,
|
IMAGES_PER_PAGE,
|
||||||
} from 'services/thunks/gallery';
|
} from 'services/thunks/gallery';
|
||||||
import { imageDeleted, imageUploaded } from 'services/thunks/image';
|
import { imageDeleted } from 'services/thunks/image';
|
||||||
import { deserializeImageResponse } from 'services/util/deserializeImageResponse';
|
import { deserializeImageResponse } from 'services/util/deserializeImageResponse';
|
||||||
|
|
||||||
export const uploadsAdapter = createEntityAdapter<Image>({
|
export const uploadsAdapter = createEntityAdapter<Image>({
|
||||||
|
@ -4,7 +4,7 @@ import * as InvokeAI from 'app/types/invokeai';
|
|||||||
import { useGetUrl } from 'common/util/getUrl';
|
import { useGetUrl } from 'common/util/getUrl';
|
||||||
|
|
||||||
type ReactPanZoomProps = {
|
type ReactPanZoomProps = {
|
||||||
image: InvokeAI._Image;
|
image: InvokeAI.Image;
|
||||||
styleClass?: string;
|
styleClass?: string;
|
||||||
alt?: string;
|
alt?: string;
|
||||||
ref?: React.Ref<HTMLImageElement>;
|
ref?: React.Ref<HTMLImageElement>;
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
import { v4 as uuidv4 } from 'uuid';
|
|
||||||
|
|
||||||
import 'reactflow/dist/style.css';
|
import 'reactflow/dist/style.css';
|
||||||
import { memo, useCallback } from 'react';
|
import { memo, useCallback } from 'react';
|
||||||
import {
|
import {
|
||||||
@ -8,12 +6,11 @@ import {
|
|||||||
MenuButton,
|
MenuButton,
|
||||||
MenuList,
|
MenuList,
|
||||||
MenuItem,
|
MenuItem,
|
||||||
IconButton,
|
|
||||||
} from '@chakra-ui/react';
|
} from '@chakra-ui/react';
|
||||||
import { FaEllipsisV, FaPlus } from 'react-icons/fa';
|
import { FaEllipsisV } from 'react-icons/fa';
|
||||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||||
import { nodeAdded } from '../store/nodesSlice';
|
import { nodeAdded } from '../store/nodesSlice';
|
||||||
import { cloneDeep, map } from 'lodash-es';
|
import { map } from 'lodash-es';
|
||||||
import { RootState } from 'app/store/store';
|
import { RootState } from 'app/store/store';
|
||||||
import { useBuildInvocation } from '../hooks/useBuildInvocation';
|
import { useBuildInvocation } from '../hooks/useBuildInvocation';
|
||||||
import { addToast } from 'features/system/store/systemSlice';
|
import { addToast } from 'features/system/store/systemSlice';
|
||||||
|
@ -1,12 +1,6 @@
|
|||||||
import { Tooltip } from '@chakra-ui/react';
|
import { Tooltip } from '@chakra-ui/react';
|
||||||
import { CSSProperties, memo, useMemo } from 'react';
|
import { CSSProperties, memo } from 'react';
|
||||||
import {
|
import { Handle, Position, Connection, HandleType } from 'reactflow';
|
||||||
Handle,
|
|
||||||
Position,
|
|
||||||
Connection,
|
|
||||||
HandleType,
|
|
||||||
useReactFlow,
|
|
||||||
} from 'reactflow';
|
|
||||||
import { FIELDS, HANDLE_TOOLTIP_OPEN_DELAY } from '../types/constants';
|
import { FIELDS, HANDLE_TOOLTIP_OPEN_DELAY } from '../types/constants';
|
||||||
// import { useConnectionEventStyles } from '../hooks/useConnectionEventStyles';
|
// import { useConnectionEventStyles } from '../hooks/useConnectionEventStyles';
|
||||||
import { InputFieldTemplate, OutputFieldTemplate } from '../types/types';
|
import { InputFieldTemplate, OutputFieldTemplate } from '../types/types';
|
||||||
@ -26,9 +20,9 @@ const outputHandleStyles: CSSProperties = {
|
|||||||
right: '-0.5rem',
|
right: '-0.5rem',
|
||||||
};
|
};
|
||||||
|
|
||||||
const requiredConnectionStyles: CSSProperties = {
|
// const requiredConnectionStyles: CSSProperties = {
|
||||||
boxShadow: '0 0 0.5rem 0.5rem var(--invokeai-colors-error-400)',
|
// boxShadow: '0 0 0.5rem 0.5rem var(--invokeai-colors-error-400)',
|
||||||
};
|
// };
|
||||||
|
|
||||||
type FieldHandleProps = {
|
type FieldHandleProps = {
|
||||||
nodeId: string;
|
nodeId: string;
|
||||||
@ -39,8 +33,8 @@ type FieldHandleProps = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const FieldHandle = (props: FieldHandleProps) => {
|
const FieldHandle = (props: FieldHandleProps) => {
|
||||||
const { nodeId, field, isValidConnection, handleType, styles } = props;
|
const { field, isValidConnection, handleType, styles } = props;
|
||||||
const { name, title, type, description } = field;
|
const { name, type } = field;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tooltip
|
<Tooltip
|
||||||
|
@ -23,7 +23,6 @@ import TopRightPanel from './panels/TopRightPanel';
|
|||||||
import TopCenterPanel from './panels/TopCenterPanel';
|
import TopCenterPanel from './panels/TopCenterPanel';
|
||||||
import BottomLeftPanel from './panels/BottomLeftPanel.tsx';
|
import BottomLeftPanel from './panels/BottomLeftPanel.tsx';
|
||||||
import MinimapPanel from './panels/MinimapPanel';
|
import MinimapPanel from './panels/MinimapPanel';
|
||||||
import NodeSearch from './search/NodeSearch';
|
|
||||||
|
|
||||||
const nodeTypes = { invocation: InvocationComponent };
|
const nodeTypes = { invocation: InvocationComponent };
|
||||||
|
|
||||||
@ -78,8 +77,7 @@ export const Flow = () => {
|
|||||||
style: { strokeWidth: 2 },
|
style: { strokeWidth: 2 },
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<NodeSearch />
|
<TopLeftPanel />
|
||||||
{/* <TopLeftPanel /> */}
|
|
||||||
<TopCenterPanel />
|
<TopCenterPanel />
|
||||||
<TopRightPanel />
|
<TopRightPanel />
|
||||||
<BottomLeftPanel />
|
<BottomLeftPanel />
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Flex, Heading, Tooltip, Icon } from '@chakra-ui/react';
|
import { Flex, Heading, Tooltip, Icon } from '@chakra-ui/react';
|
||||||
import { InvocationTemplate } from 'features/nodes/types/types';
|
import { InvocationTemplate } from 'features/nodes/types/types';
|
||||||
import { memo, MutableRefObject } from 'react';
|
import { memo } from 'react';
|
||||||
import { FaInfoCircle } from 'react-icons/fa';
|
import { FaInfoCircle } from 'react-icons/fa';
|
||||||
|
|
||||||
interface IAINodeHeaderProps {
|
interface IAINodeHeaderProps {
|
||||||
|
@ -22,7 +22,7 @@ type InputFieldComponentProps = {
|
|||||||
// build an individual input element based on the schema
|
// build an individual input element based on the schema
|
||||||
const InputFieldComponent = (props: InputFieldComponentProps) => {
|
const InputFieldComponent = (props: InputFieldComponentProps) => {
|
||||||
const { nodeId, field, template } = props;
|
const { nodeId, field, template } = props;
|
||||||
const { type, value } = field;
|
const { type } = field;
|
||||||
|
|
||||||
if (type === 'string' && template.type === 'string') {
|
if (type === 'string' && template.type === 'string') {
|
||||||
return (
|
return (
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
import { Box, Image, Icon, Flex } from '@chakra-ui/react';
|
import { Box, Image } from '@chakra-ui/react';
|
||||||
import { useAppDispatch } from 'app/store/storeHooks';
|
import { useAppDispatch } from 'app/store/storeHooks';
|
||||||
import SelectImagePlaceholder from 'common/components/SelectImagePlaceholder';
|
import SelectImagePlaceholder from 'common/components/SelectImagePlaceholder';
|
||||||
import { useGetUrl } from 'common/util/getUrl';
|
import { useGetUrl } from 'common/util/getUrl';
|
||||||
import useGetImageByNameAndType from 'features/gallery/hooks/useGetImageByName';
|
import useGetImageByNameAndType from 'features/gallery/hooks/useGetImageByName';
|
||||||
import useGetImageByUuid from 'features/gallery/hooks/useGetImageByUuid';
|
|
||||||
import { fieldValueChanged } from 'features/nodes/store/nodesSlice';
|
import { fieldValueChanged } from 'features/nodes/store/nodesSlice';
|
||||||
import {
|
import {
|
||||||
ImageInputFieldTemplate,
|
ImageInputFieldTemplate,
|
||||||
ImageInputFieldValue,
|
ImageInputFieldValue,
|
||||||
} from 'features/nodes/types/types';
|
} from 'features/nodes/types/types';
|
||||||
import { DragEvent, memo, useCallback, useState } from 'react';
|
import { DragEvent, memo, useCallback, useState } from 'react';
|
||||||
import { FaImage } from 'react-icons/fa';
|
|
||||||
import { ImageType } from 'services/api';
|
import { ImageType } from 'services/api';
|
||||||
import { FieldComponentProps } from './types';
|
import { FieldComponentProps } from './types';
|
||||||
|
|
||||||
@ -18,7 +18,6 @@ const ImageInputFieldComponent = (
|
|||||||
props: FieldComponentProps<ImageInputFieldValue, ImageInputFieldTemplate>
|
props: FieldComponentProps<ImageInputFieldValue, ImageInputFieldTemplate>
|
||||||
) => {
|
) => {
|
||||||
const { nodeId, field } = props;
|
const { nodeId, field } = props;
|
||||||
const { value } = field;
|
|
||||||
|
|
||||||
const getImageByNameAndType = useGetImageByNameAndType();
|
const getImageByNameAndType = useGetImageByNameAndType();
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
|
@ -3,7 +3,7 @@ import {
|
|||||||
ItemInputFieldValue,
|
ItemInputFieldValue,
|
||||||
} from 'features/nodes/types/types';
|
} from 'features/nodes/types/types';
|
||||||
import { memo } from 'react';
|
import { memo } from 'react';
|
||||||
import { FaAddressCard, FaList } from 'react-icons/fa';
|
import { FaAddressCard } from 'react-icons/fa';
|
||||||
import { FieldComponentProps } from './types';
|
import { FieldComponentProps } from './types';
|
||||||
|
|
||||||
const ItemInputFieldComponent = (
|
const ItemInputFieldComponent = (
|
||||||
|
@ -1,17 +1,13 @@
|
|||||||
import { Select } from '@chakra-ui/react';
|
import { Select } from '@chakra-ui/react';
|
||||||
import { createSelector } from '@reduxjs/toolkit';
|
import { createSelector } from '@reduxjs/toolkit';
|
||||||
import { RootState } from 'app/store/store';
|
|
||||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||||
import { fieldValueChanged } from 'features/nodes/store/nodesSlice';
|
import { fieldValueChanged } from 'features/nodes/store/nodesSlice';
|
||||||
import {
|
import {
|
||||||
ModelInputFieldTemplate,
|
ModelInputFieldTemplate,
|
||||||
ModelInputFieldValue,
|
ModelInputFieldValue,
|
||||||
} from 'features/nodes/types/types';
|
} from 'features/nodes/types/types';
|
||||||
import {
|
import { selectModelsIds } from 'features/system/store/modelSlice';
|
||||||
selectModelsById,
|
import { isEqual } from 'lodash-es';
|
||||||
selectModelsIds,
|
|
||||||
} from 'features/system/store/modelSlice';
|
|
||||||
import { isEqual, map } from 'lodash-es';
|
|
||||||
import { ChangeEvent, memo } from 'react';
|
import { ChangeEvent, memo } from 'react';
|
||||||
import { FieldComponentProps } from './types';
|
import { FieldComponentProps } from './types';
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { memo } from 'react';
|
import { memo } from 'react';
|
||||||
import { Panel } from 'reactflow';
|
import { Panel } from 'reactflow';
|
||||||
import AddNodeMenu from '../AddNodeMenu';
|
import NodeSearch from '../search/NodeSearch';
|
||||||
|
|
||||||
const TopLeftPanel = () => (
|
const TopLeftPanel = () => (
|
||||||
<Panel position="top-left">
|
<Panel position="top-left">
|
||||||
<AddNodeMenu />
|
<NodeSearch />
|
||||||
</Panel>
|
</Panel>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@ import { Box, Flex } from '@chakra-ui/layout';
|
|||||||
import { RootState } from 'app/store/store';
|
import { RootState } from 'app/store/store';
|
||||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||||
import IAIInput from 'common/components/IAIInput';
|
import IAIInput from 'common/components/IAIInput';
|
||||||
import { Panel } from 'reactflow';
|
|
||||||
import { map } from 'lodash-es';
|
import { map } from 'lodash-es';
|
||||||
import {
|
import {
|
||||||
ChangeEvent,
|
ChangeEvent,
|
||||||
@ -192,19 +191,17 @@ const NodeSearch = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Panel position="top-left">
|
<Flex
|
||||||
<Flex
|
flexDirection="column"
|
||||||
flexDirection="column"
|
tabIndex={1}
|
||||||
tabIndex={1}
|
onKeyDown={searchKeyHandler}
|
||||||
onKeyDown={searchKeyHandler}
|
onFocus={() => setShowNodeList(true)}
|
||||||
onFocus={() => setShowNodeList(true)}
|
onBlur={searchInputBlurHandler}
|
||||||
onBlur={searchInputBlurHandler}
|
ref={nodeSearchRef}
|
||||||
ref={nodeSearchRef}
|
>
|
||||||
>
|
<IAIInput value={searchText} onChange={findNode} />
|
||||||
<IAIInput value={searchText} onChange={findNode} />
|
{showNodeList && renderNodeList()}
|
||||||
{showNodeList && renderNodeList()}
|
</Flex>
|
||||||
</Flex>
|
|
||||||
</Panel>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ import {
|
|||||||
NodeChange,
|
NodeChange,
|
||||||
OnConnectStartParams,
|
OnConnectStartParams,
|
||||||
} from 'reactflow';
|
} from 'reactflow';
|
||||||
import { ColorField, Graph, ImageField } from 'services/api';
|
import { ImageField } from 'services/api';
|
||||||
import { receivedOpenAPISchema } from 'services/thunks/schema';
|
import { receivedOpenAPISchema } from 'services/thunks/schema';
|
||||||
import { InvocationTemplate, InvocationValue } from '../types/types';
|
import { InvocationTemplate, InvocationValue } from '../types/types';
|
||||||
import { parseSchema } from '../util/parseSchema';
|
import { parseSchema } from '../util/parseSchema';
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import { getCSSVar } from '@chakra-ui/utils';
|
|
||||||
import { FieldType, FieldUIConfig } from './types';
|
import { FieldType, FieldUIConfig } from './types';
|
||||||
|
|
||||||
export const HANDLE_TOOLTIP_OPEN_DELAY = 500;
|
export const HANDLE_TOOLTIP_OPEN_DELAY = 500;
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
import { Image } from 'app/types/invokeai';
|
|
||||||
import { OpenAPIV3 } from 'openapi-types';
|
import { OpenAPIV3 } from 'openapi-types';
|
||||||
import { RgbaColor } from 'react-colorful';
|
import { RgbaColor } from 'react-colorful';
|
||||||
import { ImageField } from 'services/api';
|
import { ImageField } from 'services/api';
|
||||||
import { AnyInvocationType } from 'services/events/types';
|
import { AnyInvocationType } from 'services/events/types';
|
||||||
import { O } from 'ts-toolbelt';
|
|
||||||
|
|
||||||
export type InvocationValue = {
|
export type InvocationValue = {
|
||||||
id: string;
|
id: string;
|
||||||
|
@ -234,7 +234,6 @@ const buildEnumInputFieldTemplate = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const buildArrayInputFieldTemplate = ({
|
const buildArrayInputFieldTemplate = ({
|
||||||
schemaObject,
|
|
||||||
baseField,
|
baseField,
|
||||||
}: BuildInputFieldArg): ArrayInputFieldTemplate => {
|
}: BuildInputFieldArg): ArrayInputFieldTemplate => {
|
||||||
const template: ArrayInputFieldTemplate = {
|
const template: ArrayInputFieldTemplate = {
|
||||||
@ -249,7 +248,6 @@ const buildArrayInputFieldTemplate = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const buildItemInputFieldTemplate = ({
|
const buildItemInputFieldTemplate = ({
|
||||||
schemaObject,
|
|
||||||
baseField,
|
baseField,
|
||||||
}: BuildInputFieldArg): ItemInputFieldTemplate => {
|
}: BuildInputFieldArg): ItemInputFieldTemplate => {
|
||||||
const template: ItemInputFieldTemplate = {
|
const template: ItemInputFieldTemplate = {
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
import { RootState } from 'app/store/store';
|
import { RootState } from 'app/store/store';
|
||||||
import {
|
import {
|
||||||
DataURLToImageInvocation,
|
|
||||||
Edge,
|
Edge,
|
||||||
Graph,
|
|
||||||
ImageToImageInvocation,
|
ImageToImageInvocation,
|
||||||
InpaintInvocation,
|
InpaintInvocation,
|
||||||
IterateInvocation,
|
IterateInvocation,
|
||||||
@ -15,10 +13,8 @@ import { buildTxt2ImgNode } from '../nodeBuilders/buildTextToImageNode';
|
|||||||
import { buildRangeNode } from '../nodeBuilders/buildRangeNode';
|
import { buildRangeNode } from '../nodeBuilders/buildRangeNode';
|
||||||
import { buildIterateNode } from '../nodeBuilders/buildIterateNode';
|
import { buildIterateNode } from '../nodeBuilders/buildIterateNode';
|
||||||
import { buildEdges } from '../edgeBuilders/buildEdges';
|
import { buildEdges } from '../edgeBuilders/buildEdges';
|
||||||
import { getCanvasBaseLayer } from 'features/canvas/util/konvaInstanceProvider';
|
|
||||||
import { getCanvasData } from 'features/canvas/util/getCanvasData';
|
import { getCanvasData } from 'features/canvas/util/getCanvasData';
|
||||||
import { getGenerationMode } from '../getGenerationMode';
|
import { getGenerationMode } from '../getGenerationMode';
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
|
||||||
import { log } from 'app/logging/useLogger';
|
import { log } from 'app/logging/useLogger';
|
||||||
import { buildInpaintNode } from '../nodeBuilders/buildInpaintNode';
|
import { buildInpaintNode } from '../nodeBuilders/buildInpaintNode';
|
||||||
|
|
||||||
@ -73,9 +69,7 @@ export const buildCanvasGraphAndBlobs = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
const {
|
const {
|
||||||
baseDataURL,
|
|
||||||
baseBlob,
|
baseBlob,
|
||||||
maskDataURL,
|
|
||||||
maskBlob,
|
maskBlob,
|
||||||
baseIsPartiallyTransparent,
|
baseIsPartiallyTransparent,
|
||||||
baseIsFullyTransparent,
|
baseIsFullyTransparent,
|
||||||
@ -112,14 +106,8 @@ export const buildCanvasGraphAndBlobs = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (baseNode.type === 'inpaint') {
|
if (baseNode.type === 'inpaint') {
|
||||||
const {
|
const { seamSize, seamBlur, seamSteps, seamStrength, tileSize } =
|
||||||
seamSize,
|
state.generation;
|
||||||
seamBlur,
|
|
||||||
seamSteps,
|
|
||||||
seamStrength,
|
|
||||||
tileSize,
|
|
||||||
infillMethod,
|
|
||||||
} = state.generation;
|
|
||||||
|
|
||||||
// generationParameters.invert_mask = shouldPreserveMaskedArea;
|
// generationParameters.invert_mask = shouldPreserveMaskedArea;
|
||||||
// if (boundingBoxScale !== 'none') {
|
// if (boundingBoxScale !== 'none') {
|
||||||
|
@ -13,7 +13,7 @@ export const buildImg2ImgNode = (
|
|||||||
overrides: O.Partial<ImageToImageInvocation, 'deep'> = {}
|
overrides: O.Partial<ImageToImageInvocation, 'deep'> = {}
|
||||||
): ImageToImageInvocation => {
|
): ImageToImageInvocation => {
|
||||||
const nodeId = uuidv4();
|
const nodeId = uuidv4();
|
||||||
const { generation, system, models } = state;
|
const { generation } = state;
|
||||||
|
|
||||||
const {
|
const {
|
||||||
prompt,
|
prompt,
|
||||||
@ -28,9 +28,6 @@ export const buildImg2ImgNode = (
|
|||||||
img2imgStrength: strength,
|
img2imgStrength: strength,
|
||||||
shouldFitToWidthHeight: fit,
|
shouldFitToWidthHeight: fit,
|
||||||
shouldRandomizeSeed,
|
shouldRandomizeSeed,
|
||||||
shouldUseSeamless,
|
|
||||||
seamlessXAxis,
|
|
||||||
seamlessYAxis,
|
|
||||||
} = generation;
|
} = generation;
|
||||||
|
|
||||||
const initialImage = initialImageSelector(state);
|
const initialImage = initialImageSelector(state);
|
||||||
|
@ -1,11 +1,6 @@
|
|||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
import { RootState } from 'app/store/store';
|
import { RootState } from 'app/store/store';
|
||||||
import {
|
import { InpaintInvocation } from 'services/api';
|
||||||
Edge,
|
|
||||||
ImageToImageInvocation,
|
|
||||||
InpaintInvocation,
|
|
||||||
TextToImageInvocation,
|
|
||||||
} from 'services/api';
|
|
||||||
import { initialImageSelector } from 'features/parameters/store/generationSelectors';
|
import { initialImageSelector } from 'features/parameters/store/generationSelectors';
|
||||||
import { O } from 'ts-toolbelt';
|
import { O } from 'ts-toolbelt';
|
||||||
|
|
||||||
@ -14,7 +9,7 @@ export const buildInpaintNode = (
|
|||||||
overrides: O.Partial<InpaintInvocation, 'deep'> = {}
|
overrides: O.Partial<InpaintInvocation, 'deep'> = {}
|
||||||
): InpaintInvocation => {
|
): InpaintInvocation => {
|
||||||
const nodeId = uuidv4();
|
const nodeId = uuidv4();
|
||||||
const { generation, system, models } = state;
|
const { generation, models } = state;
|
||||||
|
|
||||||
const { selectedModelName } = models;
|
const { selectedModelName } = models;
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ export const buildTxt2ImgNode = (
|
|||||||
overrides: O.Partial<TextToImageInvocation, 'deep'> = {}
|
overrides: O.Partial<TextToImageInvocation, 'deep'> = {}
|
||||||
): TextToImageInvocation => {
|
): TextToImageInvocation => {
|
||||||
const nodeId = uuidv4();
|
const nodeId = uuidv4();
|
||||||
const { generation, models } = state;
|
const { generation } = state;
|
||||||
|
|
||||||
const {
|
const {
|
||||||
prompt,
|
prompt,
|
||||||
|
@ -1,27 +1,11 @@
|
|||||||
import {
|
import { VStack } from '@chakra-ui/react';
|
||||||
Box,
|
|
||||||
ButtonGroup,
|
|
||||||
Collapse,
|
|
||||||
Flex,
|
|
||||||
Heading,
|
|
||||||
HStack,
|
|
||||||
Image,
|
|
||||||
Spacer,
|
|
||||||
useDisclosure,
|
|
||||||
VStack,
|
|
||||||
} from '@chakra-ui/react';
|
|
||||||
import { motion } from 'framer-motion';
|
|
||||||
|
|
||||||
import IAIButton from 'common/components/IAIButton';
|
|
||||||
import ImageToImageFit from 'features/parameters/components/AdvancedParameters/ImageToImage/ImageToImageFit';
|
import ImageToImageFit from 'features/parameters/components/AdvancedParameters/ImageToImage/ImageToImageFit';
|
||||||
import ImageToImageStrength from 'features/parameters/components/AdvancedParameters/ImageToImage/ImageToImageStrength';
|
import ImageToImageStrength from 'features/parameters/components/AdvancedParameters/ImageToImage/ImageToImageStrength';
|
||||||
import IAIIconButton from 'common/components/IAIIconButton';
|
|
||||||
|
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import InitialImagePreview from './InitialImagePreview';
|
import InitialImagePreview from './InitialImagePreview';
|
||||||
import { useState } from 'react';
|
import InitialImageButtons from 'common/components/ImageToImageButtons';
|
||||||
import { FaUndo, FaUpload } from 'react-icons/fa';
|
|
||||||
import InitialImageButtons from 'common/components/ImageToImageSettingsHeader';
|
|
||||||
|
|
||||||
export default function ImageToImageSettings() {
|
export default function ImageToImageSettings() {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
import { Flex } from '@chakra-ui/react';
|
import { Flex } from '@chakra-ui/react';
|
||||||
import { createSelector } from '@reduxjs/toolkit';
|
import { createSelector } from '@reduxjs/toolkit';
|
||||||
import { RootState } from 'app/store/store';
|
|
||||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||||
import { defaultSelectorOptions } from 'app/store/util/defaultMemoizeOptions';
|
import { defaultSelectorOptions } from 'app/store/util/defaultMemoizeOptions';
|
||||||
import IAISwitch from 'common/components/IAISwitch';
|
import IAISwitch from 'common/components/IAISwitch';
|
||||||
import { generationSelector } from 'features/parameters/store/generationSelectors';
|
import { generationSelector } from 'features/parameters/store/generationSelectors';
|
||||||
import { isImageToImageEnabledChanged } from 'features/parameters/store/generationSlice';
|
|
||||||
import { uiSelector } from 'features/ui/store/uiSelectors';
|
import { uiSelector } from 'features/ui/store/uiSelectors';
|
||||||
import { shouldShowImageParametersChanged } from 'features/ui/store/uiSlice';
|
import { shouldShowImageParametersChanged } from 'features/ui/store/uiSlice';
|
||||||
import { ChangeEvent } from 'react';
|
import { ChangeEvent } from 'react';
|
||||||
@ -25,8 +23,7 @@ const selector = createSelector(
|
|||||||
);
|
);
|
||||||
|
|
||||||
export default function ImageToImageToggle() {
|
export default function ImageToImageToggle() {
|
||||||
const { isImageToImageEnabled, shouldShowImageParameters } =
|
const { shouldShowImageParameters } = useAppSelector(selector);
|
||||||
useAppSelector(selector);
|
|
||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
@ -1,24 +1,16 @@
|
|||||||
import { Box, Flex, Image, Spinner, Text } from '@chakra-ui/react';
|
import { Flex, Image, Spinner } from '@chakra-ui/react';
|
||||||
import { createSelector } from '@reduxjs/toolkit';
|
import { createSelector } from '@reduxjs/toolkit';
|
||||||
import { RootState } from 'app/store/store';
|
|
||||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||||
import SelectImagePlaceholder from 'common/components/SelectImagePlaceholder';
|
import SelectImagePlaceholder from 'common/components/SelectImagePlaceholder';
|
||||||
import { useGetUrl } from 'common/util/getUrl';
|
import { useGetUrl } from 'common/util/getUrl';
|
||||||
import useGetImageByNameAndType from 'features/gallery/hooks/useGetImageByName';
|
import { clearInitialImage } from 'features/parameters/store/generationSlice';
|
||||||
import generationSlice, {
|
|
||||||
clearInitialImage,
|
|
||||||
initialImageChanged,
|
|
||||||
} from 'features/parameters/store/generationSlice';
|
|
||||||
import { addToast } from 'features/system/store/systemSlice';
|
import { addToast } from 'features/system/store/systemSlice';
|
||||||
import { isEqual } from 'lodash-es';
|
import { isEqual } from 'lodash-es';
|
||||||
import { DragEvent, useCallback, useState } from 'react';
|
import { DragEvent, useCallback, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { ImageType } from 'services/api';
|
import { ImageType } from 'services/api';
|
||||||
import ImageToImageOverlay from 'common/components/ImageToImageOverlay';
|
import ImageToImageOverlay from 'common/components/ImageToImageOverlay';
|
||||||
import {
|
import { generationSelector } from 'features/parameters/store/generationSelectors';
|
||||||
generationSelector,
|
|
||||||
initialImageSelector,
|
|
||||||
} from 'features/parameters/store/generationSelectors';
|
|
||||||
import { initialImageSelected } from 'features/parameters/store/actions';
|
import { initialImageSelected } from 'features/parameters/store/actions';
|
||||||
|
|
||||||
const selector = createSelector(
|
const selector = createSelector(
|
||||||
@ -40,7 +32,6 @@ const InitialImagePreview = () => {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const [isLoaded, setIsLoaded] = useState(false);
|
const [isLoaded, setIsLoaded] = useState(false);
|
||||||
const getImageByNameAndType = useGetImageByNameAndType();
|
|
||||||
|
|
||||||
const onError = () => {
|
const onError = () => {
|
||||||
dispatch(
|
dispatch(
|
||||||
|
@ -22,8 +22,7 @@ const selector = createSelector(
|
|||||||
|
|
||||||
const ParamSeamlessCollapse = () => {
|
const ParamSeamlessCollapse = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { shouldUseSeamless, seamlessXAxis, seamlessYAxis } =
|
const { shouldUseSeamless } = useAppSelector(selector);
|
||||||
useAppSelector(selector);
|
|
||||||
|
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
|
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
import { Flex, HStack } from '@chakra-ui/react';
|
|
||||||
import { NUMPY_RAND_MAX, NUMPY_RAND_MIN } from 'app/constants';
|
import { NUMPY_RAND_MAX, NUMPY_RAND_MIN } from 'app/constants';
|
||||||
import { RootState } from 'app/store/store';
|
import { RootState } from 'app/store/store';
|
||||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||||
import IAINumberInput from 'common/components/IAINumberInput';
|
import IAINumberInput from 'common/components/IAINumberInput';
|
||||||
import { setSeed } from 'features/parameters/store/generationSlice';
|
import { setSeed } from 'features/parameters/store/generationSlice';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import ParamSeedShuffle from './ParamSeedShuffle';
|
|
||||||
import ParamSeedRandomize from './ParamSeedRandomize';
|
|
||||||
|
|
||||||
export default function ParamSeed() {
|
export default function ParamSeed() {
|
||||||
const seed = useAppSelector((state: RootState) => state.generation.seed);
|
const seed = useAppSelector((state: RootState) => state.generation.seed);
|
||||||
|
@ -3,11 +3,9 @@ import { NUMPY_RAND_MAX, NUMPY_RAND_MIN } from 'app/constants';
|
|||||||
import { RootState } from 'app/store/store';
|
import { RootState } from 'app/store/store';
|
||||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||||
import IAIButton from 'common/components/IAIButton';
|
import IAIButton from 'common/components/IAIButton';
|
||||||
import IAIIconButton from 'common/components/IAIIconButton';
|
|
||||||
import randomInt from 'common/util/randomInt';
|
import randomInt from 'common/util/randomInt';
|
||||||
import { setSeed } from 'features/parameters/store/generationSlice';
|
import { setSeed } from 'features/parameters/store/generationSlice';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { FaRandom } from 'react-icons/fa';
|
|
||||||
|
|
||||||
export default function ParamSeedShuffle() {
|
export default function ParamSeedShuffle() {
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
|
@ -20,7 +20,6 @@ import {
|
|||||||
MenuList,
|
MenuList,
|
||||||
MenuOptionGroup,
|
MenuOptionGroup,
|
||||||
MenuItemOption,
|
MenuItemOption,
|
||||||
IconButton,
|
|
||||||
} from '@chakra-ui/react';
|
} from '@chakra-ui/react';
|
||||||
|
|
||||||
import { useHotkeys } from 'react-hotkeys-hook';
|
import { useHotkeys } from 'react-hotkeys-hook';
|
||||||
@ -28,8 +27,6 @@ import { useTranslation } from 'react-i18next';
|
|||||||
import { MdCancel, MdCancelScheduleSend } from 'react-icons/md';
|
import { MdCancel, MdCancelScheduleSend } from 'react-icons/md';
|
||||||
|
|
||||||
import { sessionCanceled } from 'services/thunks/session';
|
import { sessionCanceled } from 'services/thunks/session';
|
||||||
import { BiChevronDown } from 'react-icons/bi';
|
|
||||||
import { FaChevronDown } from 'react-icons/fa';
|
|
||||||
import { ChevronDownIcon } from '@chakra-ui/icons';
|
import { ChevronDownIcon } from '@chakra-ui/icons';
|
||||||
|
|
||||||
const cancelButtonSelector = createSelector(
|
const cancelButtonSelector = createSelector(
|
||||||
|
@ -1,18 +1,11 @@
|
|||||||
import { Flex } from '@chakra-ui/react';
|
import { Flex } from '@chakra-ui/react';
|
||||||
import { useAppSelector } from 'app/store/storeHooks';
|
|
||||||
import { activeTabNameSelector } from 'features/ui/store/uiSelectors';
|
|
||||||
import CancelButton from './CancelButton';
|
import CancelButton from './CancelButton';
|
||||||
import InvokeButton from './InvokeButton';
|
import InvokeButton from './InvokeButton';
|
||||||
import LoopbackButton from './Loopback';
|
|
||||||
import IAICheckbox from 'common/components/IAICheckbox';
|
|
||||||
import IAISwitch from 'common/components/IAISwitch';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Buttons to start and cancel image generation.
|
* Buttons to start and cancel image generation.
|
||||||
*/
|
*/
|
||||||
const ProcessButtons = () => {
|
const ProcessButtons = () => {
|
||||||
const activeTabName = useAppSelector(activeTabNameSelector);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex gap={2}>
|
<Flex gap={2}>
|
||||||
<InvokeButton />
|
<InvokeButton />
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import { UseToastOptions, useToast } from '@chakra-ui/react';
|
import { useToast } from '@chakra-ui/react';
|
||||||
import { useAppDispatch } from 'app/store/storeHooks';
|
import { useAppDispatch } from 'app/store/storeHooks';
|
||||||
import { isFinite, isString } from 'lodash-es';
|
import { isFinite, isString } from 'lodash-es';
|
||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import useSetBothPrompts from './usePrompt';
|
import useSetBothPrompts from './usePrompt';
|
||||||
import { initialImageChanged, setSeed } from '../store/generationSlice';
|
import { setSeed } from '../store/generationSlice';
|
||||||
import { isImage, isImageField } from 'services/types/guards';
|
import { isImageField } from 'services/types/guards';
|
||||||
import { NUMPY_RAND_MAX } from 'app/constants';
|
import { NUMPY_RAND_MAX } from 'app/constants';
|
||||||
import { initialImageSelected } from '../store/actions';
|
import { initialImageSelected } from '../store/actions';
|
||||||
import { Image } from 'app/types/invokeai';
|
import { Image } from 'app/types/invokeai';
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
import type { PayloadAction } from '@reduxjs/toolkit';
|
import type { PayloadAction } from '@reduxjs/toolkit';
|
||||||
import { createSlice } from '@reduxjs/toolkit';
|
import { createSlice } from '@reduxjs/toolkit';
|
||||||
import * as InvokeAI from 'app/types/invokeai';
|
import * as InvokeAI from 'app/types/invokeai';
|
||||||
import { getPromptAndNegative } from 'common/util/getPromptAndNegative';
|
|
||||||
import promptToString from 'common/util/promptToString';
|
import promptToString from 'common/util/promptToString';
|
||||||
import { seedWeightsToString } from 'common/util/seedWeightPairs';
|
|
||||||
import { clamp } from 'lodash-es';
|
import { clamp } from 'lodash-es';
|
||||||
import { ImageField, ImageType } from 'services/api';
|
|
||||||
|
|
||||||
export interface GenerationState {
|
export interface GenerationState {
|
||||||
cfgScale: number;
|
cfgScale: number;
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import type { PayloadAction } from '@reduxjs/toolkit';
|
import type { PayloadAction } from '@reduxjs/toolkit';
|
||||||
import { createSlice } from '@reduxjs/toolkit';
|
import { createSlice } from '@reduxjs/toolkit';
|
||||||
import { FACETOOL_TYPES } from 'app/constants';
|
|
||||||
|
|
||||||
export interface HiresState {
|
export interface HiresState {
|
||||||
codeformerFidelity: number;
|
codeformerFidelity: number;
|
||||||
|
@ -5,16 +5,9 @@ import { useTranslation } from 'react-i18next';
|
|||||||
|
|
||||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||||
import IAISelect from 'common/components/IAISelect';
|
import IAISelect from 'common/components/IAISelect';
|
||||||
import {
|
import { selectModelsById, selectModelsIds } from '../store/modelSlice';
|
||||||
// modelSelected,
|
|
||||||
selectedModelSelector,
|
|
||||||
selectModelsById,
|
|
||||||
selectModelsIds,
|
|
||||||
} from '../store/modelSlice';
|
|
||||||
import { RootState } from 'app/store/store';
|
import { RootState } from 'app/store/store';
|
||||||
import generationSlice, {
|
import { modelSelected } from 'features/parameters/store/generationSlice';
|
||||||
modelSelected,
|
|
||||||
} from 'features/parameters/store/generationSlice';
|
|
||||||
import { generationSelector } from 'features/parameters/store/generationSelectors';
|
import { generationSelector } from 'features/parameters/store/generationSelectors';
|
||||||
|
|
||||||
const selector = createSelector(
|
const selector = createSelector(
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { Flex, Grid } from '@chakra-ui/react';
|
import { Flex, Grid } from '@chakra-ui/react';
|
||||||
import { memo, useState } from 'react';
|
import { memo, useState } from 'react';
|
||||||
import ModelSelect from './ModelSelect';
|
|
||||||
import StatusIndicator from './StatusIndicator';
|
import StatusIndicator from './StatusIndicator';
|
||||||
|
|
||||||
import InvokeAILogoComponent from './InvokeAILogoComponent';
|
import InvokeAILogoComponent from './InvokeAILogoComponent';
|
||||||
|
@ -43,7 +43,6 @@ const StatusIndicator = () => {
|
|||||||
currentIteration,
|
currentIteration,
|
||||||
totalIterations,
|
totalIterations,
|
||||||
statusTranslationKey,
|
statusTranslationKey,
|
||||||
currentStatusHasSteps,
|
|
||||||
} = useAppSelector(statusIndicatorSelector);
|
} = useAppSelector(statusIndicatorSelector);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const ref = useRef(null);
|
const ref = useRef(null);
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { createSelector } from '@reduxjs/toolkit';
|
import { createSelector } from '@reduxjs/toolkit';
|
||||||
import { RootState } from 'app/store/store';
|
|
||||||
import { useAppSelector } from 'app/store/storeHooks';
|
import { useAppSelector } from 'app/store/storeHooks';
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import { configSelector } from '../store/configSelectors';
|
import { configSelector } from '../store/configSelectors';
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
import { createSelector } from '@reduxjs/toolkit';
|
|
||||||
import { RootState } from 'app/store/store';
|
import { RootState } from 'app/store/store';
|
||||||
import { reduce } from 'lodash-es';
|
|
||||||
|
|
||||||
export const modelSelector = (state: RootState) => state.models;
|
export const modelSelector = (state: RootState) => state.models;
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { createEntityAdapter, PayloadAction } from '@reduxjs/toolkit';
|
import { createEntityAdapter } from '@reduxjs/toolkit';
|
||||||
import { createSlice } from '@reduxjs/toolkit';
|
import { createSlice } from '@reduxjs/toolkit';
|
||||||
import { RootState } from 'app/store/store';
|
import { RootState } from 'app/store/store';
|
||||||
import { keys, sample } from 'lodash-es';
|
|
||||||
import { CkptModelInfo, DiffusersModelInfo } from 'services/api';
|
import { CkptModelInfo, DiffusersModelInfo } from 'services/api';
|
||||||
import { receivedModels } from 'services/thunks/model';
|
import { receivedModels } from 'services/thunks/model';
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@ import {
|
|||||||
} from 'services/events/actions';
|
} from 'services/events/actions';
|
||||||
|
|
||||||
import { ProgressImage } from 'services/events/types';
|
import { ProgressImage } from 'services/events/types';
|
||||||
import { initialImageChanged } from 'features/parameters/store/generationSlice';
|
|
||||||
import { makeToast } from '../hooks/useToastWatcher';
|
import { makeToast } from '../hooks/useToastWatcher';
|
||||||
import { sessionCanceled, sessionInvoked } from 'services/thunks/session';
|
import { sessionCanceled, sessionInvoked } from 'services/thunks/session';
|
||||||
import { receivedModels } from 'services/thunks/model';
|
import { receivedModels } from 'services/thunks/model';
|
||||||
@ -284,8 +283,7 @@ export const systemSlice = createSlice({
|
|||||||
/**
|
/**
|
||||||
* Socket Connected
|
* Socket Connected
|
||||||
*/
|
*/
|
||||||
builder.addCase(socketConnected, (state, action) => {
|
builder.addCase(socketConnected, (state) => {
|
||||||
const { timestamp } = action.payload;
|
|
||||||
state.isConnected = true;
|
state.isConnected = true;
|
||||||
state.isCancelable = true;
|
state.isCancelable = true;
|
||||||
state.isProcessing = false;
|
state.isProcessing = false;
|
||||||
@ -300,9 +298,7 @@ export const systemSlice = createSlice({
|
|||||||
/**
|
/**
|
||||||
* Socket Disconnected
|
* Socket Disconnected
|
||||||
*/
|
*/
|
||||||
builder.addCase(socketDisconnected, (state, action) => {
|
builder.addCase(socketDisconnected, (state) => {
|
||||||
const { timestamp } = action.payload;
|
|
||||||
|
|
||||||
state.isConnected = false;
|
state.isConnected = false;
|
||||||
state.isProcessing = false;
|
state.isProcessing = false;
|
||||||
state.isCancelable = true;
|
state.isCancelable = true;
|
||||||
@ -317,7 +313,7 @@ export const systemSlice = createSlice({
|
|||||||
/**
|
/**
|
||||||
* Invocation Started
|
* Invocation Started
|
||||||
*/
|
*/
|
||||||
builder.addCase(invocationStarted, (state, action) => {
|
builder.addCase(invocationStarted, (state) => {
|
||||||
state.isCancelable = true;
|
state.isCancelable = true;
|
||||||
state.isProcessing = true;
|
state.isProcessing = true;
|
||||||
state.currentStatusHasSteps = false;
|
state.currentStatusHasSteps = false;
|
||||||
@ -332,14 +328,7 @@ export const systemSlice = createSlice({
|
|||||||
* Generator Progress
|
* Generator Progress
|
||||||
*/
|
*/
|
||||||
builder.addCase(generatorProgress, (state, action) => {
|
builder.addCase(generatorProgress, (state, action) => {
|
||||||
const {
|
const { step, total_steps, progress_image } = action.payload.data;
|
||||||
step,
|
|
||||||
total_steps,
|
|
||||||
progress_image,
|
|
||||||
node,
|
|
||||||
source_node_id,
|
|
||||||
graph_execution_state_id,
|
|
||||||
} = action.payload.data;
|
|
||||||
|
|
||||||
state.isProcessing = true;
|
state.isProcessing = true;
|
||||||
state.isCancelable = true;
|
state.isCancelable = true;
|
||||||
@ -356,7 +345,7 @@ export const systemSlice = createSlice({
|
|||||||
* Invocation Complete
|
* Invocation Complete
|
||||||
*/
|
*/
|
||||||
builder.addCase(invocationComplete, (state, action) => {
|
builder.addCase(invocationComplete, (state, action) => {
|
||||||
const { data, timestamp } = action.payload;
|
const { data } = action.payload;
|
||||||
|
|
||||||
// state.currentIteration = 0;
|
// state.currentIteration = 0;
|
||||||
// state.totalIterations = 0;
|
// state.totalIterations = 0;
|
||||||
@ -374,9 +363,7 @@ export const systemSlice = createSlice({
|
|||||||
/**
|
/**
|
||||||
* Invocation Error
|
* Invocation Error
|
||||||
*/
|
*/
|
||||||
builder.addCase(invocationError, (state, action) => {
|
builder.addCase(invocationError, (state) => {
|
||||||
const { data, timestamp } = action.payload;
|
|
||||||
|
|
||||||
state.isProcessing = false;
|
state.isProcessing = false;
|
||||||
state.isCancelable = true;
|
state.isCancelable = true;
|
||||||
// state.currentIteration = 0;
|
// state.currentIteration = 0;
|
||||||
@ -410,8 +397,6 @@ export const systemSlice = createSlice({
|
|||||||
* Session Canceled
|
* Session Canceled
|
||||||
*/
|
*/
|
||||||
builder.addCase(sessionCanceled.fulfilled, (state, action) => {
|
builder.addCase(sessionCanceled.fulfilled, (state, action) => {
|
||||||
const { timestamp } = action.payload;
|
|
||||||
|
|
||||||
state.canceledSession = action.meta.arg.sessionId;
|
state.canceledSession = action.meta.arg.sessionId;
|
||||||
state.isProcessing = false;
|
state.isProcessing = false;
|
||||||
state.isCancelable = false;
|
state.isCancelable = false;
|
||||||
@ -428,9 +413,7 @@ export const systemSlice = createSlice({
|
|||||||
/**
|
/**
|
||||||
* Session Canceled
|
* Session Canceled
|
||||||
*/
|
*/
|
||||||
builder.addCase(graphExecutionStateComplete, (state, action) => {
|
builder.addCase(graphExecutionStateComplete, (state) => {
|
||||||
const { timestamp } = action.payload;
|
|
||||||
|
|
||||||
state.isProcessing = false;
|
state.isProcessing = false;
|
||||||
state.isCancelable = false;
|
state.isCancelable = false;
|
||||||
state.isCancelScheduled = false;
|
state.isCancelScheduled = false;
|
||||||
|
@ -81,12 +81,8 @@ const InvokeTabs = () => {
|
|||||||
(state: RootState) => state.lightbox.isLightboxOpen
|
(state: RootState) => state.lightbox.isLightboxOpen
|
||||||
);
|
);
|
||||||
|
|
||||||
const {
|
const { shouldPinGallery, shouldPinParametersPanel, shouldShowGallery } =
|
||||||
shouldPinGallery,
|
useAppSelector((state: RootState) => state.ui);
|
||||||
shouldPinParametersPanel,
|
|
||||||
shouldShowGallery,
|
|
||||||
shouldShowParametersPanel,
|
|
||||||
} = useAppSelector((state: RootState) => state.ui);
|
|
||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
import { isEqual } from 'lodash-es';
|
|
||||||
import { createSelector } from '@reduxjs/toolkit';
|
import { createSelector } from '@reduxjs/toolkit';
|
||||||
import { lightboxSelector } from 'features/lightbox/store/lightboxSelectors';
|
import { lightboxSelector } from 'features/lightbox/store/lightboxSelectors';
|
||||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||||
import { PropsWithChildren, memo, useMemo } from 'react';
|
import { memo, useMemo } from 'react';
|
||||||
import { Box, Flex } from '@chakra-ui/react';
|
import { Box, Flex } from '@chakra-ui/react';
|
||||||
import InvokeAILogoComponent from 'features/system/components/InvokeAILogoComponent';
|
import InvokeAILogoComponent from 'features/system/components/InvokeAILogoComponent';
|
||||||
import OverlayScrollable from './common/OverlayScrollable';
|
import OverlayScrollable from './common/OverlayScrollable';
|
||||||
|
@ -1,19 +1,10 @@
|
|||||||
import { Box, Flex } from '@chakra-ui/react';
|
|
||||||
import { useAppSelector } from 'app/store/storeHooks';
|
import { useAppSelector } from 'app/store/storeHooks';
|
||||||
import { memo } from 'react';
|
import { memo } from 'react';
|
||||||
import PinParametersPanelButton from '../../PinParametersPanelButton';
|
|
||||||
import { RootState } from 'app/store/store';
|
import { RootState } from 'app/store/store';
|
||||||
import Scrollable from '../../common/Scrollable';
|
|
||||||
import ParametersSlide from '../../ParametersDrawer';
|
|
||||||
import UnifiedCanvasParameters from './UnifiedCanvasParameters';
|
|
||||||
import UnifiedCanvasContentBeta from './UnifiedCanvasBeta/UnifiedCanvasContentBeta';
|
import UnifiedCanvasContentBeta from './UnifiedCanvasBeta/UnifiedCanvasContentBeta';
|
||||||
import UnifiedCanvasContent from './UnifiedCanvasContent';
|
import UnifiedCanvasContent from './UnifiedCanvasContent';
|
||||||
|
|
||||||
const CanvasWorkspace = () => {
|
const CanvasWorkspace = () => {
|
||||||
const shouldPinParametersPanel = useAppSelector(
|
|
||||||
(state: RootState) => state.ui.shouldPinParametersPanel
|
|
||||||
);
|
|
||||||
|
|
||||||
const shouldUseCanvasBetaLayout = useAppSelector(
|
const shouldUseCanvasBetaLayout = useAppSelector(
|
||||||
(state: RootState) => state.ui.shouldUseCanvasBetaLayout
|
(state: RootState) => state.ui.shouldUseCanvasBetaLayout
|
||||||
);
|
);
|
||||||
@ -23,35 +14,6 @@ const CanvasWorkspace = () => {
|
|||||||
) : (
|
) : (
|
||||||
<UnifiedCanvasContent />
|
<UnifiedCanvasContent />
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
|
||||||
<Flex
|
|
||||||
flexDirection={{ base: 'column-reverse', xl: 'row' }}
|
|
||||||
w="full"
|
|
||||||
h="full"
|
|
||||||
gap={4}
|
|
||||||
>
|
|
||||||
{/* {shouldPinParametersPanel ? (
|
|
||||||
<Box width="28rem" flexShrink={0} position="relative">
|
|
||||||
<Scrollable>
|
|
||||||
<UnifiedCanvasParameters />
|
|
||||||
</Scrollable>
|
|
||||||
<PinParametersPanelButton
|
|
||||||
sx={{ position: 'absolute', top: 0, insetInlineEnd: 0 }}
|
|
||||||
/>
|
|
||||||
</Box>
|
|
||||||
) : (
|
|
||||||
<ParametersSlide>
|
|
||||||
<UnifiedCanvasParameters />
|
|
||||||
</ParametersSlide>
|
|
||||||
)} */}
|
|
||||||
{shouldUseCanvasBetaLayout ? (
|
|
||||||
<UnifiedCanvasContentBeta />
|
|
||||||
) : (
|
|
||||||
<UnifiedCanvasContent />
|
|
||||||
)}
|
|
||||||
</Flex>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default memo(CanvasWorkspace);
|
export default memo(CanvasWorkspace);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { AnyAction, createAction } from '@reduxjs/toolkit';
|
import { createAction } from '@reduxjs/toolkit';
|
||||||
import {
|
import {
|
||||||
GeneratorProgressEvent,
|
GeneratorProgressEvent,
|
||||||
GraphExecutionStateCompleteEvent,
|
GraphExecutionStateCompleteEvent,
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
import { Image } from 'app/types/invokeai';
|
import { ImageType } from 'services/api';
|
||||||
import { ImageField, ImageType } from 'services/api';
|
|
||||||
import { AnyInvocation } from 'services/events/types';
|
|
||||||
|
|
||||||
export const buildImageUrls = (
|
export const buildImageUrls = (
|
||||||
imageType: ImageType,
|
imageType: ImageType,
|
||||||
|
@ -12,12 +12,12 @@ export const makeGraphOfXImages = (numberOfImages: string) =>
|
|||||||
prompt: 'pizza',
|
prompt: 'pizza',
|
||||||
steps: 50,
|
steps: 50,
|
||||||
seed: 123,
|
seed: 123,
|
||||||
sampler_name: 'ddim',
|
scheduler: 'ddim',
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
.reduce(
|
.reduce(
|
||||||
(acc, val: TextToImageInvocation) => {
|
(acc, val: TextToImageInvocation) => {
|
||||||
acc.nodes![val.id] = val;
|
if (acc.nodes) acc.nodes[val.id] = val;
|
||||||
return acc;
|
return acc;
|
||||||
},
|
},
|
||||||
{ nodes: {} } as Graph
|
{ nodes: {} } as Graph
|
||||||
|
@ -20,4 +20,4 @@ export const APP_TEXT_TO_IMAGE_HEIGHT =
|
|||||||
// option bar
|
// option bar
|
||||||
export const OPTIONS_BAR_MAX_WIDTH = '22.5rem';
|
export const OPTIONS_BAR_MAX_WIDTH = '22.5rem';
|
||||||
|
|
||||||
export const PARAMETERS_PANEL_WIDTH = '30rem';
|
export const PARAMETERS_PANEL_WIDTH = '28rem';
|
||||||
|
Loading…
Reference in New Issue
Block a user