mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Reorganises app file structure
This commit is contained in:
parent
bc46c46835
commit
2ab868314f
@ -1,18 +1,18 @@
|
||||
import ProgressBar from 'features/system/ProgressBar';
|
||||
import SiteHeader from 'features/system/SiteHeader';
|
||||
import Console from 'features/system/Console';
|
||||
import ProgressBar from 'features/system/components/ProgressBar';
|
||||
import SiteHeader from 'features/system/components/SiteHeader';
|
||||
import Console from 'features/system/components/Console';
|
||||
import { keepGUIAlive } from './utils';
|
||||
import InvokeTabs from 'features/tabs/InvokeTabs';
|
||||
import InvokeTabs from 'features/tabs/components/InvokeTabs';
|
||||
import ImageUploader from 'common/components/ImageUploader';
|
||||
import { RootState, useAppSelector } from 'app/store';
|
||||
|
||||
import FloatingGalleryButton from 'features/tabs/FloatingGalleryButton';
|
||||
import FloatingOptionsPanelButtons from 'features/tabs/FloatingOptionsPanelButtons';
|
||||
import FloatingGalleryButton from 'features/tabs/components/FloatingGalleryButton';
|
||||
import FloatingOptionsPanelButtons from 'features/tabs/components/FloatingOptionsPanelButtons';
|
||||
import { createSelector } from '@reduxjs/toolkit';
|
||||
import { GalleryState } from 'features/gallery/gallerySlice';
|
||||
import { OptionsState } from 'features/options/optionsSlice';
|
||||
import { activeTabNameSelector } from 'features/options/optionsSelectors';
|
||||
import { SystemState } from 'features/system/systemSlice';
|
||||
import { GalleryState } from 'features/gallery/store/gallerySlice';
|
||||
import { OptionsState } from 'features/options/store/optionsSlice';
|
||||
import { activeTabNameSelector } from 'features/options/store/optionsSelectors';
|
||||
import { SystemState } from 'features/system/store/systemSlice';
|
||||
import _ from 'lodash';
|
||||
import { Model } from './invokeai';
|
||||
import useToastWatcher from 'features/system/hooks/useToastWatcher';
|
||||
|
@ -1,6 +1,6 @@
|
||||
// TODO: use Enums?
|
||||
|
||||
import { InProgressImageType } from 'features/system/systemSlice';
|
||||
import { InProgressImageType } from 'features/system/store/systemSlice';
|
||||
|
||||
// Valid samplers
|
||||
export const SAMPLERS: Array<string> = [
|
||||
|
4
frontend/src/app/invokeai.d.ts
vendored
4
frontend/src/app/invokeai.d.ts
vendored
@ -12,8 +12,8 @@
|
||||
* 'gfpgan'.
|
||||
*/
|
||||
|
||||
import { Category as GalleryCategory } from 'features/gallery/gallerySlice';
|
||||
import { InvokeTabName } from 'features/tabs/InvokeTabs';
|
||||
import { Category as GalleryCategory } from 'features/gallery/store/gallerySlice';
|
||||
import { InvokeTabName } from 'features/tabs/components/InvokeTabs';
|
||||
import { IRect } from 'konva/lib/types';
|
||||
|
||||
/**
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { createSelector } from '@reduxjs/toolkit';
|
||||
import _ from 'lodash';
|
||||
import { RootState } from 'app/store';
|
||||
import { activeTabNameSelector } from 'features/options/optionsSelectors';
|
||||
import { OptionsState } from 'features/options/optionsSlice';
|
||||
import { SystemState } from 'features/system/systemSlice';
|
||||
import { activeTabNameSelector } from 'features/options/store/optionsSelectors';
|
||||
import { OptionsState } from 'features/options/store/optionsSlice';
|
||||
import { SystemState } from 'features/system/store/systemSlice';
|
||||
import { validateSeedWeights } from 'common/util/seedWeightPairs';
|
||||
import { initialCanvasImageSelector } from 'features/canvas/store/canvasSelectors';
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { createAction } from '@reduxjs/toolkit';
|
||||
import { GalleryCategory } from 'features/gallery/gallerySlice';
|
||||
import { InvokeTabName } from 'features/tabs/InvokeTabs';
|
||||
import { GalleryCategory } from 'features/gallery/store/gallerySlice';
|
||||
import { InvokeTabName } from 'features/tabs/components/InvokeTabs';
|
||||
import * as InvokeAI from 'app/invokeai';
|
||||
|
||||
|
||||
|
@ -9,16 +9,16 @@ import {
|
||||
GalleryCategory,
|
||||
GalleryState,
|
||||
removeImage,
|
||||
} from 'features/gallery/gallerySlice';
|
||||
import { OptionsState } from 'features/options/optionsSlice';
|
||||
} from 'features/gallery/store/gallerySlice';
|
||||
import { OptionsState } from 'features/options/store/optionsSlice';
|
||||
import {
|
||||
addLogEntry,
|
||||
generationRequested,
|
||||
modelChangeRequested,
|
||||
setCurrentStatus,
|
||||
setIsProcessing,
|
||||
} from 'features/system/systemSlice';
|
||||
import { InvokeTabName } from 'features/tabs/InvokeTabs';
|
||||
} from 'features/system/store/systemSlice';
|
||||
import { InvokeTabName } from 'features/tabs/components/InvokeTabs';
|
||||
import * as InvokeAI from 'app/invokeai';
|
||||
import { RootState } from 'app/store';
|
||||
|
||||
|
@ -15,7 +15,7 @@ import {
|
||||
errorOccurred,
|
||||
setModelList,
|
||||
setIsCancelable,
|
||||
} from 'features/system/systemSlice';
|
||||
} from 'features/system/store/systemSlice';
|
||||
|
||||
import {
|
||||
addGalleryImages,
|
||||
@ -24,20 +24,20 @@ import {
|
||||
GalleryState,
|
||||
removeImage,
|
||||
setIntermediateImage,
|
||||
} from 'features/gallery/gallerySlice';
|
||||
} from 'features/gallery/store/gallerySlice';
|
||||
|
||||
import {
|
||||
clearInitialImage,
|
||||
setInitialImage,
|
||||
setMaskPath,
|
||||
} from 'features/options/optionsSlice';
|
||||
} from 'features/options/store/optionsSlice';
|
||||
import {
|
||||
requestImages,
|
||||
requestNewImages,
|
||||
requestSystemConfig,
|
||||
} from './actions';
|
||||
import { addImageToStagingArea } from 'features/canvas/store/canvasSlice';
|
||||
import { tabMap } from 'features/tabs/InvokeTabs';
|
||||
import { tabMap } from 'features/tabs/components/InvokeTabs';
|
||||
|
||||
/**
|
||||
* Returns an object containing listener callbacks for socketio events.
|
||||
|
@ -7,9 +7,9 @@ import storage from 'redux-persist/lib/storage'; // defaults to localStorage for
|
||||
|
||||
import { getPersistConfig } from 'redux-deep-persist';
|
||||
|
||||
import optionsReducer from 'features/options/optionsSlice';
|
||||
import galleryReducer from 'features/gallery/gallerySlice';
|
||||
import systemReducer from 'features/system/systemSlice';
|
||||
import optionsReducer from 'features/options/store/optionsSlice';
|
||||
import galleryReducer from 'features/gallery/store/gallerySlice';
|
||||
import systemReducer from 'features/system/store/systemSlice';
|
||||
import canvasReducer from 'features/canvas/store/canvasSlice';
|
||||
|
||||
import { socketioMiddleware } from './socketio/middleware';
|
||||
|
@ -5,7 +5,7 @@ import {
|
||||
PopoverTrigger,
|
||||
Box,
|
||||
} from '@chakra-ui/react';
|
||||
import { SystemState } from 'features/system/systemSlice';
|
||||
import { SystemState } from 'features/system/store/systemSlice';
|
||||
import { useAppSelector } from 'app/store';
|
||||
import { RootState } from 'app/store';
|
||||
import { createSelector } from '@reduxjs/toolkit';
|
||||
|
@ -11,10 +11,10 @@ import { useToast } from '@chakra-ui/react';
|
||||
// import { uploadImage } from 'app/socketio/actions';
|
||||
import { UploadImagePayload } from 'app/invokeai';
|
||||
import { ImageUploaderTriggerContext } from 'app/contexts/ImageUploaderTriggerContext';
|
||||
import { activeTabNameSelector } from 'features/options/optionsSelectors';
|
||||
import { tabDict } from 'features/tabs/InvokeTabs';
|
||||
import { activeTabNameSelector } from 'features/options/store/optionsSelectors';
|
||||
import { tabDict } from 'features/tabs/components/InvokeTabs';
|
||||
import ImageUploadOverlay from './ImageUploadOverlay';
|
||||
import { uploadImage } from 'features/gallery/util/uploadImage';
|
||||
import { uploadImage } from 'features/gallery/store/thunks/uploadImage';
|
||||
|
||||
type ImageUploaderProps = {
|
||||
children: ReactNode;
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { NUMPY_RAND_MAX, NUMPY_RAND_MIN } from 'app/constants';
|
||||
import { OptionsState } from 'features/options/optionsSlice';
|
||||
import { SystemState } from 'features/system/systemSlice';
|
||||
import { OptionsState } from 'features/options/store/optionsSlice';
|
||||
import { SystemState } from 'features/system/store/systemSlice';
|
||||
|
||||
import { stringToSeedWeightsArray } from './seedWeightPairs';
|
||||
import randomInt from './randomInt';
|
||||
import { InvokeTabName } from 'features/tabs/InvokeTabs';
|
||||
import { InvokeTabName } from 'features/tabs/components/InvokeTabs';
|
||||
import {
|
||||
CanvasState,
|
||||
isCanvasMaskLine,
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { createSelector } from '@reduxjs/toolkit';
|
||||
import { RootState, useAppSelector } from 'app/store';
|
||||
import { GalleryState } from 'features/gallery/gallerySlice';
|
||||
import { GalleryState } from 'features/gallery/store/gallerySlice';
|
||||
import { ImageConfig } from 'konva/lib/shapes/Image';
|
||||
import _ from 'lodash';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Spinner } from '@chakra-ui/react';
|
||||
import { useLayoutEffect, useRef } from 'react';
|
||||
import { useAppDispatch, useAppSelector } from 'app/store';
|
||||
import { activeTabNameSelector } from 'features/options/optionsSelectors';
|
||||
import { activeTabNameSelector } from 'features/options/store/optionsSelectors';
|
||||
import {
|
||||
resizeAndScaleCanvas,
|
||||
resizeCanvas,
|
||||
|
@ -3,7 +3,7 @@ import { useHotkeys } from 'react-hotkeys-hook';
|
||||
import { FaRedo } from 'react-icons/fa';
|
||||
import { useAppDispatch, useAppSelector } from 'app/store';
|
||||
import IAIIconButton from 'common/components/IAIIconButton';
|
||||
import { activeTabNameSelector } from 'features/options/optionsSelectors';
|
||||
import { activeTabNameSelector } from 'features/options/store/optionsSelectors';
|
||||
import { canvasSelector } from 'features/canvas/store/canvasSelectors';
|
||||
|
||||
import _ from 'lodash';
|
||||
|
@ -32,7 +32,7 @@ import {
|
||||
} from 'features/canvas/store/canvasSelectors';
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
import { getCanvasBaseLayer } from 'features/canvas/util/konvaInstanceProvider';
|
||||
import { systemSelector } from 'features/system/systemSelectors';
|
||||
import { systemSelector } from 'features/system/store/systemSelectors';
|
||||
|
||||
export const selector = createSelector(
|
||||
[canvasSelector, isStagingSelector, systemSelector],
|
||||
|
@ -6,7 +6,7 @@ import IAIIconButton from 'common/components/IAIIconButton';
|
||||
import { canvasSelector } from 'features/canvas/store/canvasSelectors';
|
||||
|
||||
import _ from 'lodash';
|
||||
import { activeTabNameSelector } from 'features/options/optionsSelectors';
|
||||
import { activeTabNameSelector } from 'features/options/store/optionsSelectors';
|
||||
import { undo } from 'features/canvas/store/canvasSlice';
|
||||
|
||||
const canvasUndoSelector = createSelector(
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { createSelector } from '@reduxjs/toolkit';
|
||||
import _ from 'lodash';
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
import { activeTabNameSelector } from 'features/options/optionsSelectors';
|
||||
import { activeTabNameSelector } from 'features/options/store/optionsSelectors';
|
||||
import {
|
||||
setShouldShowBoundingBox,
|
||||
setTool,
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { createSelector } from '@reduxjs/toolkit';
|
||||
import { useAppDispatch, useAppSelector } from 'app/store';
|
||||
import { activeTabNameSelector } from 'features/options/optionsSelectors';
|
||||
import { activeTabNameSelector } from 'features/options/store/optionsSelectors';
|
||||
import Konva from 'konva';
|
||||
import { KonvaEventObject } from 'konva/lib/Node';
|
||||
import _ from 'lodash';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { createSelector } from '@reduxjs/toolkit';
|
||||
import { useAppDispatch, useAppSelector } from 'app/store';
|
||||
import { activeTabNameSelector } from 'features/options/optionsSelectors';
|
||||
import { activeTabNameSelector } from 'features/options/store/optionsSelectors';
|
||||
import Konva from 'konva';
|
||||
import { KonvaEventObject } from 'konva/lib/Node';
|
||||
import _ from 'lodash';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { createSelector } from '@reduxjs/toolkit';
|
||||
import { useAppDispatch, useAppSelector } from 'app/store';
|
||||
import { activeTabNameSelector } from 'features/options/optionsSelectors';
|
||||
import { activeTabNameSelector } from 'features/options/store/optionsSelectors';
|
||||
import Konva from 'konva';
|
||||
import { Vector2d } from 'konva/lib/types';
|
||||
import _ from 'lodash';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { createSelector } from '@reduxjs/toolkit';
|
||||
import { useAppDispatch, useAppSelector } from 'app/store';
|
||||
import { activeTabNameSelector } from 'features/options/optionsSelectors';
|
||||
import { activeTabNameSelector } from 'features/options/store/optionsSelectors';
|
||||
import Konva from 'konva';
|
||||
import _ from 'lodash';
|
||||
import { MutableRefObject, useCallback } from 'react';
|
||||
|
@ -6,8 +6,8 @@ import layerToDataURL from '../../util/layerToDataURL';
|
||||
import downloadFile from '../../util/downloadFile';
|
||||
import copyImage from '../../util/copyImage';
|
||||
import { getCanvasBaseLayer } from '../../util/konvaInstanceProvider';
|
||||
import { addToast } from 'features/system/systemSlice';
|
||||
import { addImage } from 'features/gallery/gallerySlice';
|
||||
import { addToast } from 'features/system/store/systemSlice';
|
||||
import { addImage } from 'features/gallery/store/gallerySlice';
|
||||
import { setMergedCanvas } from '../canvasSlice';
|
||||
|
||||
type MergeAndUploadCanvasConfig = {
|
||||
|
@ -12,14 +12,14 @@ import {
|
||||
setPrompt,
|
||||
setSeed,
|
||||
setShouldShowImageDetails,
|
||||
} from 'features/options/optionsSlice';
|
||||
} from 'features/options/store/optionsSlice';
|
||||
import DeleteImageModal from './DeleteImageModal';
|
||||
import { SystemState } from 'features/system/systemSlice';
|
||||
import { SystemState } from 'features/system/store/systemSlice';
|
||||
import IAIButton from 'common/components/IAIButton';
|
||||
import { runESRGAN, runFacetool } from 'app/socketio/actions';
|
||||
import IAIIconButton from 'common/components/IAIIconButton';
|
||||
import UpscaleOptions from 'features/options/AdvancedOptions/Upscale/UpscaleOptions';
|
||||
import FaceRestoreOptions from 'features/options/AdvancedOptions/FaceRestore/FaceRestoreOptions';
|
||||
import UpscaleOptions from 'features/options/components/AdvancedOptions/Upscale/UpscaleOptions';
|
||||
import FaceRestoreOptions from 'features/options/components/AdvancedOptions/FaceRestore/FaceRestoreOptions';
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
import { ButtonGroup, Link, useToast } from '@chakra-ui/react';
|
||||
import {
|
||||
@ -39,8 +39,8 @@ import {
|
||||
setDoesCanvasNeedScaling,
|
||||
setInitialCanvasImage,
|
||||
} from 'features/canvas/store/canvasSlice';
|
||||
import { GalleryState } from './gallerySlice';
|
||||
import { activeTabNameSelector } from 'features/options/optionsSelectors';
|
||||
import { GalleryState } from 'features/gallery/store/gallerySlice';
|
||||
import { activeTabNameSelector } from 'features/options/store/optionsSelectors';
|
||||
import IAIPopover from 'common/components/IAIPopover';
|
||||
|
||||
const systemSelector = createSelector(
|
@ -1,4 +1,4 @@
|
||||
@use '../../styles/Mixins/' as *;
|
||||
@use '../../../styles/Mixins/' as *;
|
||||
|
||||
.current-image-area {
|
||||
display: flex;
|
@ -2,11 +2,11 @@ import { RootState, useAppSelector } from 'app/store';
|
||||
import CurrentImageButtons from './CurrentImageButtons';
|
||||
import { MdPhoto } from 'react-icons/md';
|
||||
import CurrentImagePreview from './CurrentImagePreview';
|
||||
import { GalleryState } from './gallerySlice';
|
||||
import { OptionsState } from 'features/options/optionsSlice';
|
||||
import { GalleryState } from 'features/gallery/store/gallerySlice';
|
||||
import { OptionsState } from 'features/options/store/optionsSlice';
|
||||
import _ from 'lodash';
|
||||
import { createSelector } from '@reduxjs/toolkit';
|
||||
import { activeTabNameSelector } from 'features/options/optionsSelectors';
|
||||
import { activeTabNameSelector } from 'features/options/store/optionsSelectors';
|
||||
|
||||
export const currentImageDisplaySelector = createSelector(
|
||||
[
|
@ -7,10 +7,10 @@ import {
|
||||
GalleryState,
|
||||
selectNextImage,
|
||||
selectPrevImage,
|
||||
} from './gallerySlice';
|
||||
} from 'features/gallery/store/gallerySlice';
|
||||
import { createSelector } from '@reduxjs/toolkit';
|
||||
import _ from 'lodash';
|
||||
import { OptionsState, setIsLightBoxOpen } from 'features/options/optionsSlice';
|
||||
import { OptionsState, setIsLightBoxOpen } from 'features/options/store/optionsSlice';
|
||||
import ImageMetadataViewer from './ImageMetaDataViewer/ImageMetadataViewer';
|
||||
|
||||
export const imagesSelector = createSelector(
|
@ -25,7 +25,7 @@ import {
|
||||
import { useAppDispatch, useAppSelector } from 'app/store';
|
||||
import { deleteImage } from 'app/socketio/actions';
|
||||
import { RootState } from 'app/store';
|
||||
import { setShouldConfirmOnDelete, SystemState } from 'features/system/systemSlice';
|
||||
import { setShouldConfirmOnDelete, SystemState } from 'features/system/store/systemSlice';
|
||||
import * as InvokeAI from 'app/invokeai';
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
import _ from 'lodash';
|
@ -7,7 +7,7 @@ import {
|
||||
useToast,
|
||||
} from '@chakra-ui/react';
|
||||
import { useAppDispatch, useAppSelector } from 'app/store';
|
||||
import { setCurrentImage } from './gallerySlice';
|
||||
import { setCurrentImage } from 'features/gallery/store/gallerySlice';
|
||||
import { FaCheck, FaTrashAlt } from 'react-icons/fa';
|
||||
import DeleteImageModal from './DeleteImageModal';
|
||||
import { memo, useState } from 'react';
|
||||
@ -19,7 +19,7 @@ import {
|
||||
setIsLightBoxOpen,
|
||||
setPrompt,
|
||||
setSeed,
|
||||
} from 'features/options/optionsSlice';
|
||||
} from 'features/options/store/optionsSlice';
|
||||
import * as InvokeAI from 'app/invokeai';
|
||||
import * as ContextMenu from '@radix-ui/react-context-menu';
|
||||
import {
|
||||
@ -28,7 +28,7 @@ import {
|
||||
setDoesCanvasNeedScaling,
|
||||
setInitialCanvasImage,
|
||||
} from 'features/canvas/store/canvasSlice';
|
||||
import { hoverableImageSelector } from './gallerySliceSelectors';
|
||||
import { hoverableImageSelector } from 'features/gallery/store/gallerySliceSelectors';
|
||||
import { getCanvasBaseLayer } from 'features/canvas/util/konvaInstanceProvider';
|
||||
|
||||
interface HoverableImageProps {
|
@ -1,4 +1,4 @@
|
||||
@use '../../styles/Mixins/' as *;
|
||||
@use '../../../styles/Mixins/' as *;
|
||||
|
||||
.image-gallery-wrapper-enter {
|
||||
transform: translateX(150%);
|
@ -25,13 +25,13 @@ import {
|
||||
setShouldAutoSwitchToNewImages,
|
||||
setShouldHoldGalleryOpen,
|
||||
setShouldPinGallery,
|
||||
} from './gallerySlice';
|
||||
} from 'features/gallery/store/gallerySlice';
|
||||
import HoverableImage from './HoverableImage';
|
||||
import { setShouldShowGallery } from 'features/gallery/gallerySlice';
|
||||
import { setShouldShowGallery } from 'features/gallery/store/gallerySlice';
|
||||
import { ButtonGroup, useToast } from '@chakra-ui/react';
|
||||
import { CSSTransition } from 'react-transition-group';
|
||||
import { Direction } from 're-resizable/lib/resizer';
|
||||
import { imageGallerySelector } from './gallerySliceSelectors';
|
||||
import { imageGallerySelector } from 'features/gallery/store/gallerySliceSelectors';
|
||||
import { FaImage, FaUser, FaWrench } from 'react-icons/fa';
|
||||
import IAIPopover from 'common/components/IAIPopover';
|
||||
import IAISlider from 'common/components/IAISlider';
|
@ -1,4 +1,4 @@
|
||||
@use '../../../styles/Mixins/' as *;
|
||||
@use '../../../../styles/Mixins/' as *;
|
||||
|
||||
.image-metadata-viewer {
|
||||
position: absolute;
|
@ -33,7 +33,7 @@ import {
|
||||
setWidth,
|
||||
setInitialImage,
|
||||
setShouldShowImageDetails,
|
||||
} from 'features/options/optionsSlice';
|
||||
} from 'features/options/store/optionsSlice';
|
||||
import promptToString from 'common/util/promptToString';
|
||||
import { seedWeightsToString } from 'common/util/seedWeightPairs';
|
||||
import { FaCopy } from 'react-icons/fa';
|
@ -3,7 +3,7 @@ import type { PayloadAction } from '@reduxjs/toolkit';
|
||||
import _, { clamp } from 'lodash';
|
||||
import * as InvokeAI from 'app/invokeai';
|
||||
import { IRect } from 'konva/lib/types';
|
||||
import { InvokeTabName } from 'features/tabs/InvokeTabs';
|
||||
import { InvokeTabName } from 'features/tabs/components/InvokeTabs';
|
||||
|
||||
export type GalleryCategory = 'user' | 'result';
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { createSelector } from '@reduxjs/toolkit';
|
||||
import { RootState } from 'app/store';
|
||||
import { activeTabNameSelector } from 'features/options/optionsSelectors';
|
||||
import { OptionsState } from 'features/options/optionsSlice';
|
||||
import { SystemState } from 'features/system/systemSlice';
|
||||
import { activeTabNameSelector } from 'features/options/store/optionsSelectors';
|
||||
import { OptionsState } from 'features/options/store/optionsSlice';
|
||||
import { SystemState } from 'features/system/store/systemSlice';
|
||||
import { GalleryState } from './gallerySlice';
|
||||
import _ from 'lodash';
|
||||
|
@ -2,9 +2,9 @@ import { AnyAction, ThunkAction } from '@reduxjs/toolkit';
|
||||
import { RootState } from 'app/store';
|
||||
import * as InvokeAI from 'app/invokeai';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { activeTabNameSelector } from 'features/options/optionsSelectors';
|
||||
import { activeTabNameSelector } from 'features/options/store/optionsSelectors';
|
||||
import { setInitialCanvasImage } from 'features/canvas/store/canvasSlice';
|
||||
import { setInitialImage } from 'features/options/optionsSlice';
|
||||
import { setInitialImage } from 'features/options/store/optionsSlice';
|
||||
import { addImage } from '../gallerySlice';
|
||||
|
||||
type UploadImageConfig = {
|
@ -1,4 +1,4 @@
|
||||
@use '../../styles/Mixins/' as *;
|
||||
@use '../../../styles/Mixins/' as *;
|
||||
|
||||
.lightbox-container {
|
||||
width: 100%;
|
@ -1,15 +1,15 @@
|
||||
import { IconButton } from '@chakra-ui/react';
|
||||
import { RootState, useAppDispatch, useAppSelector } from 'app/store';
|
||||
import IAIIconButton from 'common/components/IAIIconButton';
|
||||
import CurrentImageButtons from 'features/gallery/CurrentImageButtons';
|
||||
import { imagesSelector } from 'features/gallery/CurrentImagePreview';
|
||||
import CurrentImageButtons from 'features/gallery/components/CurrentImageButtons';
|
||||
import { imagesSelector } from 'features/gallery/components/CurrentImagePreview';
|
||||
import {
|
||||
selectNextImage,
|
||||
selectPrevImage,
|
||||
} from 'features/gallery/gallerySlice';
|
||||
import ImageGallery from 'features/gallery/ImageGallery';
|
||||
import ImageMetadataViewer from 'features/gallery/ImageMetaDataViewer/ImageMetadataViewer';
|
||||
import { setIsLightBoxOpen } from 'features/options/optionsSlice';
|
||||
} from 'features/gallery/store/gallerySlice';
|
||||
import ImageGallery from 'features/gallery/components/ImageGallery';
|
||||
import ImageMetadataViewer from 'features/gallery/components/ImageMetaDataViewer/ImageMetadataViewer';
|
||||
import { setIsLightBoxOpen } from 'features/options/store/optionsSlice';
|
||||
import React, { useState } from 'react';
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
import { BiExit } from 'react-icons/bi';
|
@ -1,4 +1,4 @@
|
||||
@use '../../../styles/Mixins/' as *;
|
||||
@use '../../../../styles/Mixins/' as *;
|
||||
|
||||
.advanced-settings {
|
||||
display: grid;
|
@ -6,7 +6,7 @@ import {
|
||||
useAppSelector,
|
||||
} from 'app/store';
|
||||
import IAISwitch from 'common/components/IAISwitch';
|
||||
import { setShouldRunFacetool } from 'features/options/optionsSlice';
|
||||
import { setShouldRunFacetool } from 'features/options/store/optionsSlice';
|
||||
|
||||
export default function FaceRestoreHeader() {
|
||||
const isGFPGANAvailable = useAppSelector(
|
@ -9,11 +9,11 @@ import {
|
||||
setCodeformerFidelity,
|
||||
setFacetoolStrength,
|
||||
setFacetoolType,
|
||||
} from 'features/options/optionsSlice';
|
||||
} from 'features/options/store/optionsSlice';
|
||||
|
||||
import { createSelector } from '@reduxjs/toolkit';
|
||||
import { isEqual } from 'lodash';
|
||||
import { SystemState } from 'features/system/systemSlice';
|
||||
import { SystemState } from 'features/system/store/systemSlice';
|
||||
import IAINumberInput from 'common/components/IAINumberInput';
|
||||
import IAISelect from 'common/components/IAISelect';
|
||||
import { FACETOOL_TYPES } from 'app/constants';
|
@ -5,7 +5,7 @@ import {
|
||||
useAppSelector,
|
||||
} from 'app/store';
|
||||
import IAISwitch from 'common/components/IAISwitch';
|
||||
import { setShouldFitToWidthHeight } from 'features/options/optionsSlice';
|
||||
import { setShouldFitToWidthHeight } from 'features/options/store/optionsSlice';
|
||||
|
||||
export default function ImageFit() {
|
||||
const dispatch = useAppDispatch();
|
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { RootState, useAppDispatch, useAppSelector } from 'app/store';
|
||||
import IAISlider from 'common/components/IAISlider';
|
||||
import { setImg2imgStrength } from 'features/options/optionsSlice';
|
||||
import { setImg2imgStrength } from 'features/options/store/optionsSlice';
|
||||
|
||||
interface ImageToImageStrengthProps {
|
||||
label?: string;
|
@ -1,9 +1,9 @@
|
||||
import React, { ChangeEvent } from 'react';
|
||||
import { useAppDispatch, useAppSelector } from '../../../../app/store';
|
||||
import { useAppDispatch, useAppSelector } from '../../../../../app/store';
|
||||
import _ from 'lodash';
|
||||
import { createSelector } from '@reduxjs/toolkit';
|
||||
import IAISwitch from '../../../../common/components/IAISwitch';
|
||||
import IAISlider from '../../../../common/components/IAISlider';
|
||||
import IAISwitch from '../../../../../common/components/IAISwitch';
|
||||
import IAISlider from '../../../../../common/components/IAISlider';
|
||||
import { Flex } from '@chakra-ui/react';
|
||||
import {
|
||||
setInpaintReplace,
|
@ -6,7 +6,7 @@ import {
|
||||
useAppSelector,
|
||||
} from 'app/store';
|
||||
import IAISwitch from 'common/components/IAISwitch';
|
||||
import { setHiresFix } from 'features/options/optionsSlice';
|
||||
import { setHiresFix } from 'features/options/store/optionsSlice';
|
||||
|
||||
/**
|
||||
* Hires Fix Toggle
|
@ -6,7 +6,7 @@ import {
|
||||
useAppSelector,
|
||||
} from 'app/store';
|
||||
import IAISwitch from 'common/components/IAISwitch';
|
||||
import { setSeamless } from 'features/options/optionsSlice';
|
||||
import { setSeamless } from 'features/options/store/optionsSlice';
|
||||
|
||||
/**
|
||||
* Seamless tiling toggle
|
@ -5,7 +5,7 @@ import {
|
||||
useAppSelector,
|
||||
} from 'app/store';
|
||||
import IAINumberInput from 'common/components/IAINumberInput';
|
||||
import { setPerlin } from 'features/options/optionsSlice';
|
||||
import { setPerlin } from 'features/options/store/optionsSlice';
|
||||
|
||||
export default function Perlin() {
|
||||
const dispatch = useAppDispatch();
|
@ -6,7 +6,7 @@ import {
|
||||
useAppSelector,
|
||||
} from 'app/store';
|
||||
import IAISwitch from 'common/components/IAISwitch';
|
||||
import { setShouldRandomizeSeed } from 'features/options/optionsSlice';
|
||||
import { setShouldRandomizeSeed } from 'features/options/store/optionsSlice';
|
||||
|
||||
export default function RandomizeSeed() {
|
||||
const dispatch = useAppDispatch();
|
@ -6,7 +6,7 @@ import {
|
||||
useAppSelector,
|
||||
} from 'app/store';
|
||||
import IAINumberInput from 'common/components/IAINumberInput';
|
||||
import { setSeed } from 'features/options/optionsSlice';
|
||||
import { setSeed } from 'features/options/store/optionsSlice';
|
||||
|
||||
export default function Seed() {
|
||||
const seed = useAppSelector((state: RootState) => state.options.seed);
|
@ -3,7 +3,7 @@ import React from 'react';
|
||||
import { NUMPY_RAND_MAX, NUMPY_RAND_MIN } from 'app/constants';
|
||||
import { RootState, useAppDispatch, useAppSelector } from 'app/store';
|
||||
import randomInt from 'common/util/randomInt';
|
||||
import { setSeed } from 'features/options/optionsSlice';
|
||||
import { setSeed } from 'features/options/store/optionsSlice';
|
||||
|
||||
export default function ShuffleSeed() {
|
||||
const dispatch = useAppDispatch();
|
@ -5,7 +5,7 @@ import {
|
||||
useAppSelector,
|
||||
} from 'app/store';
|
||||
import IAINumberInput from 'common/components/IAINumberInput';
|
||||
import { setThreshold } from 'features/options/optionsSlice';
|
||||
import { setThreshold } from 'features/options/store/optionsSlice';
|
||||
|
||||
export default function Threshold() {
|
||||
const dispatch = useAppDispatch();
|
@ -6,7 +6,7 @@ import {
|
||||
useAppSelector,
|
||||
} from 'app/store';
|
||||
import IAISwitch from 'common/components/IAISwitch';
|
||||
import { setShouldRunESRGAN } from 'features/options/optionsSlice';
|
||||
import { setShouldRunESRGAN } from 'features/options/store/optionsSlice';
|
||||
|
||||
export default function UpscaleHeader() {
|
||||
const isESRGANAvailable = useAppSelector(
|
@ -6,12 +6,12 @@ import {
|
||||
setUpscalingStrength,
|
||||
UpscalingLevel,
|
||||
OptionsState,
|
||||
} from 'features/options/optionsSlice';
|
||||
} from 'features/options/store/optionsSlice';
|
||||
|
||||
import { UPSCALING_LEVELS } from 'app/constants';
|
||||
import { createSelector } from '@reduxjs/toolkit';
|
||||
import { isEqual } from 'lodash';
|
||||
import { SystemState } from 'features/system/systemSlice';
|
||||
import { SystemState } from 'features/system/store/systemSlice';
|
||||
import { ChangeEvent } from 'react';
|
||||
import IAINumberInput from 'common/components/IAINumberInput';
|
||||
import IAISelect from 'common/components/IAISelect';
|
@ -5,7 +5,7 @@ import {
|
||||
useAppSelector,
|
||||
} from 'app/store';
|
||||
import IAISwitch from 'common/components/IAISwitch';
|
||||
import { setShouldGenerateVariations } from 'features/options/optionsSlice';
|
||||
import { setShouldGenerateVariations } from 'features/options/store/optionsSlice';
|
||||
|
||||
export default function GenerateVariations() {
|
||||
const shouldGenerateVariations = useAppSelector(
|
@ -6,7 +6,7 @@ import {
|
||||
} from 'app/store';
|
||||
import IAIInput from 'common/components/IAIInput';
|
||||
import { validateSeedWeights } from 'common/util/seedWeightPairs';
|
||||
import { setSeedWeights } from 'features/options/optionsSlice';
|
||||
import { setSeedWeights } from 'features/options/store/optionsSlice';
|
||||
|
||||
export default function SeedWeights() {
|
||||
const seedWeights = useAppSelector(
|
@ -5,7 +5,7 @@ import {
|
||||
useAppSelector,
|
||||
} from 'app/store';
|
||||
import IAINumberInput from 'common/components/IAINumberInput';
|
||||
import { setVariationAmount } from 'features/options/optionsSlice';
|
||||
import { setVariationAmount } from 'features/options/store/optionsSlice';
|
||||
|
||||
export default function VariationAmount() {
|
||||
const variationAmount = useAppSelector(
|
@ -1,7 +1,7 @@
|
||||
import React, { ChangeEvent } from 'react';
|
||||
import { RootState, useAppDispatch, useAppSelector } from 'app/store';
|
||||
import IAICheckbox from 'common/components/IAICheckbox';
|
||||
import { setShowAdvancedOptions } from 'features/options/optionsSlice';
|
||||
import { setShowAdvancedOptions } from 'features/options/store/optionsSlice';
|
||||
|
||||
export default function MainAdvancedOptionsCheckbox() {
|
||||
const showAdvancedOptions = useAppSelector(
|
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { RootState, useAppDispatch, useAppSelector } from 'app/store';
|
||||
import IAINumberInput from 'common/components/IAINumberInput';
|
||||
import { setCfgScale } from 'features/options/optionsSlice';
|
||||
import { setCfgScale } from 'features/options/store/optionsSlice';
|
||||
import { inputWidth } from './MainOptions';
|
||||
|
||||
export default function MainCFGScale() {
|
@ -2,8 +2,8 @@ import React, { ChangeEvent } from 'react';
|
||||
import { HEIGHTS } from 'app/constants';
|
||||
import { RootState, useAppDispatch, useAppSelector } from 'app/store';
|
||||
import IAISelect from 'common/components/IAISelect';
|
||||
import { activeTabNameSelector } from 'features/options/optionsSelectors';
|
||||
import { setHeight } from 'features/options/optionsSlice';
|
||||
import { activeTabNameSelector } from 'features/options/store/optionsSelectors';
|
||||
import { setHeight } from 'features/options/store/optionsSlice';
|
||||
|
||||
export default function MainHeight() {
|
||||
const height = useAppSelector((state: RootState) => state.options.height);
|
@ -3,8 +3,8 @@ import _ from 'lodash';
|
||||
import React from 'react';
|
||||
import { RootState, useAppDispatch, useAppSelector } from 'app/store';
|
||||
import IAINumberInput from 'common/components/IAINumberInput';
|
||||
import { mayGenerateMultipleImagesSelector } from 'features/options/optionsSelectors';
|
||||
import { OptionsState, setIterations } from 'features/options/optionsSlice';
|
||||
import { mayGenerateMultipleImagesSelector } from 'features/options/store/optionsSelectors';
|
||||
import { OptionsState, setIterations } from 'features/options/store/optionsSlice';
|
||||
import { inputWidth } from './MainOptions';
|
||||
|
||||
const mainIterationsSelector = createSelector(
|
@ -1,4 +1,4 @@
|
||||
@use '../../../styles/Mixins/' as *;
|
||||
@use '../../../../styles/Mixins/' as *;
|
||||
|
||||
.main-options {
|
||||
display: grid;
|
@ -2,7 +2,7 @@ import React, { ChangeEvent } from 'react';
|
||||
import { SAMPLERS } from 'app/constants';
|
||||
import { RootState, useAppDispatch, useAppSelector } from 'app/store';
|
||||
import IAISelect from 'common/components/IAISelect';
|
||||
import { setSampler } from 'features/options/optionsSlice';
|
||||
import { setSampler } from 'features/options/store/optionsSlice';
|
||||
|
||||
export default function MainSampler() {
|
||||
const sampler = useAppSelector((state: RootState) => state.options.sampler);
|
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { RootState, useAppDispatch, useAppSelector } from 'app/store';
|
||||
import IAINumberInput from 'common/components/IAINumberInput';
|
||||
import { setSteps } from 'features/options/optionsSlice';
|
||||
import { setSteps } from 'features/options/store/optionsSlice';
|
||||
import { inputWidth } from './MainOptions';
|
||||
|
||||
export default function MainSteps() {
|
@ -2,8 +2,8 @@ import React, { ChangeEvent } from 'react';
|
||||
import { WIDTHS } from 'app/constants';
|
||||
import { RootState, useAppDispatch, useAppSelector } from 'app/store';
|
||||
import IAISelect from 'common/components/IAISelect';
|
||||
import { activeTabNameSelector } from 'features/options/optionsSelectors';
|
||||
import { setWidth } from 'features/options/optionsSlice';
|
||||
import { activeTabNameSelector } from 'features/options/store/optionsSelectors';
|
||||
import { setWidth } from 'features/options/store/optionsSlice';
|
||||
|
||||
export default function MainWidth() {
|
||||
const width = useAppSelector((state: RootState) => state.options.width);
|
@ -1,6 +1,6 @@
|
||||
import { Accordion, ExpandedIndex } from '@chakra-ui/react';
|
||||
import { RootState, useAppDispatch, useAppSelector } from 'app/store';
|
||||
import { setOpenAccordions } from 'features/system/systemSlice';
|
||||
import { setOpenAccordions } from 'features/system/store/systemSlice';
|
||||
import InvokeAccordionItem, {
|
||||
InvokeAccordionItemProps,
|
||||
} from './AccordionItems/InvokeAccordionItem';
|
@ -6,7 +6,7 @@ import IAIIconButton, {
|
||||
} from 'common/components/IAIIconButton';
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
import { createSelector } from '@reduxjs/toolkit';
|
||||
import { SystemState } from 'features/system/systemSlice';
|
||||
import { SystemState } from 'features/system/store/systemSlice';
|
||||
import _ from 'lodash';
|
||||
|
||||
const cancelButtonSelector = createSelector(
|
@ -9,7 +9,7 @@ import IAIIconButton, {
|
||||
IAIIconButtonProps,
|
||||
} from 'common/components/IAIIconButton';
|
||||
import IAIPopover from 'common/components/IAIPopover';
|
||||
import { activeTabNameSelector } from 'features/options/optionsSelectors';
|
||||
import { activeTabNameSelector } from 'features/options/store/optionsSelectors';
|
||||
|
||||
interface InvokeButton
|
||||
extends Omit<IAIButtonProps | IAIIconButtonProps, 'aria-label'> {
|
@ -2,7 +2,7 @@ import { createSelector } from '@reduxjs/toolkit';
|
||||
import { FaRecycle } from 'react-icons/fa';
|
||||
import { RootState, useAppDispatch, useAppSelector } from 'app/store';
|
||||
import IAIIconButton from 'common/components/IAIIconButton';
|
||||
import { OptionsState, setShouldLoopback } from 'features/options/optionsSlice';
|
||||
import { OptionsState, setShouldLoopback } from 'features/options/store/optionsSlice';
|
||||
|
||||
const loopbackSelector = createSelector(
|
||||
(state: RootState) => state.options,
|
@ -1,4 +1,4 @@
|
||||
@use '../../../styles/Mixins/' as *;
|
||||
@use '../../../../styles/Mixins/' as *;
|
||||
|
||||
.process-buttons {
|
||||
display: flex;
|
@ -3,11 +3,11 @@ import { ChangeEvent, KeyboardEvent, useRef } from 'react';
|
||||
import { RootState, useAppDispatch, useAppSelector } from 'app/store';
|
||||
import { generateImage } from 'app/socketio/actions';
|
||||
|
||||
import { OptionsState, setPrompt } from 'features/options/optionsSlice';
|
||||
import { OptionsState, setPrompt } from 'features/options/store/optionsSlice';
|
||||
import { createSelector } from '@reduxjs/toolkit';
|
||||
import _ from 'lodash';
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
import { activeTabNameSelector } from 'features/options/optionsSelectors';
|
||||
import { activeTabNameSelector } from 'features/options/store/optionsSelectors';
|
||||
import { readinessSelector } from 'app/selectors/readinessSelector';
|
||||
|
||||
const promptInputSelector = createSelector(
|
@ -1,7 +1,7 @@
|
||||
import { createSelector } from '@reduxjs/toolkit';
|
||||
import _ from 'lodash';
|
||||
import { RootState } from 'app/store';
|
||||
import { tabMap } from 'features/tabs/InvokeTabs';
|
||||
import { tabMap } from 'features/tabs/components/InvokeTabs';
|
||||
import { OptionsState } from './optionsSlice';
|
||||
|
||||
export const activeTabNameSelector = createSelector(
|
@ -4,7 +4,7 @@ import * as InvokeAI from 'app/invokeai';
|
||||
import promptToString from 'common/util/promptToString';
|
||||
import { seedWeightsToString } from 'common/util/seedWeightPairs';
|
||||
import { FACETOOL_TYPES } from 'app/constants';
|
||||
import { InvokeTabName, tabMap } from 'features/tabs/InvokeTabs';
|
||||
import { InvokeTabName, tabMap } from 'features/tabs/components/InvokeTabs';
|
||||
|
||||
export type UpscalingLevel = 2 | 4;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { IconButton, Tooltip } from '@chakra-ui/react';
|
||||
import { useAppDispatch, useAppSelector } from 'app/store';
|
||||
import { RootState } from 'app/store';
|
||||
import { errorSeen, setShouldShowLogViewer, SystemState } from './systemSlice';
|
||||
import { errorSeen, setShouldShowLogViewer, SystemState } from 'features/system/store/systemSlice';
|
||||
import { useLayoutEffect, useRef, useState } from 'react';
|
||||
import { FaAngleDoubleDown, FaCode, FaMinus } from 'react-icons/fa';
|
||||
import { createSelector } from '@reduxjs/toolkit';
|
@ -1,4 +1,4 @@
|
||||
@use '../../../styles/Mixins/' as *;
|
||||
@use '../../../../styles/Mixins/' as *;
|
||||
|
||||
.hotkeys-modal {
|
||||
width: 36rem;
|
@ -1,4 +1,4 @@
|
||||
@use '../../styles/Mixins/' as *;
|
||||
@use '../../../styles/Mixins/' as *;
|
||||
|
||||
.modal {
|
||||
background-color: var(--background-color-secondary);
|
@ -1,4 +1,4 @@
|
||||
@use '../../styles/Mixins/' as *;
|
||||
@use '../../../styles/Mixins/' as *;
|
||||
|
||||
.progress-bar {
|
||||
background-color: var(--root-bg-color);
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user