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:
committed by
psychedelicious
parent
15e57e3a3d
commit
7bfb5640ad
@ -1,27 +1,11 @@
|
||||
import {
|
||||
Box,
|
||||
ButtonGroup,
|
||||
Collapse,
|
||||
Flex,
|
||||
Heading,
|
||||
HStack,
|
||||
Image,
|
||||
Spacer,
|
||||
useDisclosure,
|
||||
VStack,
|
||||
} from '@chakra-ui/react';
|
||||
import { motion } from 'framer-motion';
|
||||
import { VStack } from '@chakra-ui/react';
|
||||
|
||||
import IAIButton from 'common/components/IAIButton';
|
||||
import ImageToImageFit from 'features/parameters/components/AdvancedParameters/ImageToImage/ImageToImageFit';
|
||||
import ImageToImageStrength from 'features/parameters/components/AdvancedParameters/ImageToImage/ImageToImageStrength';
|
||||
import IAIIconButton from 'common/components/IAIIconButton';
|
||||
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import InitialImagePreview from './InitialImagePreview';
|
||||
import { useState } from 'react';
|
||||
import { FaUndo, FaUpload } from 'react-icons/fa';
|
||||
import InitialImageButtons from 'common/components/ImageToImageSettingsHeader';
|
||||
import InitialImageButtons from 'common/components/ImageToImageButtons';
|
||||
|
||||
export default function ImageToImageSettings() {
|
||||
const { t } = useTranslation();
|
||||
|
@ -1,11 +1,9 @@
|
||||
import { Flex } from '@chakra-ui/react';
|
||||
import { createSelector } from '@reduxjs/toolkit';
|
||||
import { RootState } from 'app/store/store';
|
||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||
import { defaultSelectorOptions } from 'app/store/util/defaultMemoizeOptions';
|
||||
import IAISwitch from 'common/components/IAISwitch';
|
||||
import { generationSelector } from 'features/parameters/store/generationSelectors';
|
||||
import { isImageToImageEnabledChanged } from 'features/parameters/store/generationSlice';
|
||||
import { uiSelector } from 'features/ui/store/uiSelectors';
|
||||
import { shouldShowImageParametersChanged } from 'features/ui/store/uiSlice';
|
||||
import { ChangeEvent } from 'react';
|
||||
@ -25,8 +23,7 @@ const selector = createSelector(
|
||||
);
|
||||
|
||||
export default function ImageToImageToggle() {
|
||||
const { isImageToImageEnabled, shouldShowImageParameters } =
|
||||
useAppSelector(selector);
|
||||
const { shouldShowImageParameters } = useAppSelector(selector);
|
||||
|
||||
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 { RootState } from 'app/store/store';
|
||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||
import SelectImagePlaceholder from 'common/components/SelectImagePlaceholder';
|
||||
import { useGetUrl } from 'common/util/getUrl';
|
||||
import useGetImageByNameAndType from 'features/gallery/hooks/useGetImageByName';
|
||||
import generationSlice, {
|
||||
clearInitialImage,
|
||||
initialImageChanged,
|
||||
} from 'features/parameters/store/generationSlice';
|
||||
import { clearInitialImage } from 'features/parameters/store/generationSlice';
|
||||
import { addToast } from 'features/system/store/systemSlice';
|
||||
import { isEqual } from 'lodash-es';
|
||||
import { DragEvent, useCallback, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { ImageType } from 'services/api';
|
||||
import ImageToImageOverlay from 'common/components/ImageToImageOverlay';
|
||||
import {
|
||||
generationSelector,
|
||||
initialImageSelector,
|
||||
} from 'features/parameters/store/generationSelectors';
|
||||
import { generationSelector } from 'features/parameters/store/generationSelectors';
|
||||
import { initialImageSelected } from 'features/parameters/store/actions';
|
||||
|
||||
const selector = createSelector(
|
||||
@ -40,7 +32,6 @@ const InitialImagePreview = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [isLoaded, setIsLoaded] = useState(false);
|
||||
const getImageByNameAndType = useGetImageByNameAndType();
|
||||
|
||||
const onError = () => {
|
||||
dispatch(
|
||||
|
@ -22,8 +22,7 @@ const selector = createSelector(
|
||||
|
||||
const ParamSeamlessCollapse = () => {
|
||||
const { t } = useTranslation();
|
||||
const { shouldUseSeamless, seamlessXAxis, seamlessYAxis } =
|
||||
useAppSelector(selector);
|
||||
const { shouldUseSeamless } = useAppSelector(selector);
|
||||
|
||||
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 { RootState } from 'app/store/store';
|
||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||
import IAINumberInput from 'common/components/IAINumberInput';
|
||||
import { setSeed } from 'features/parameters/store/generationSlice';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import ParamSeedShuffle from './ParamSeedShuffle';
|
||||
import ParamSeedRandomize from './ParamSeedRandomize';
|
||||
|
||||
export default function ParamSeed() {
|
||||
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 { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||
import IAIButton from 'common/components/IAIButton';
|
||||
import IAIIconButton from 'common/components/IAIIconButton';
|
||||
import randomInt from 'common/util/randomInt';
|
||||
import { setSeed } from 'features/parameters/store/generationSlice';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { FaRandom } from 'react-icons/fa';
|
||||
|
||||
export default function ParamSeedShuffle() {
|
||||
const dispatch = useAppDispatch();
|
||||
|
@ -20,7 +20,6 @@ import {
|
||||
MenuList,
|
||||
MenuOptionGroup,
|
||||
MenuItemOption,
|
||||
IconButton,
|
||||
} from '@chakra-ui/react';
|
||||
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
@ -28,8 +27,6 @@ import { useTranslation } from 'react-i18next';
|
||||
import { MdCancel, MdCancelScheduleSend } from 'react-icons/md';
|
||||
|
||||
import { sessionCanceled } from 'services/thunks/session';
|
||||
import { BiChevronDown } from 'react-icons/bi';
|
||||
import { FaChevronDown } from 'react-icons/fa';
|
||||
import { ChevronDownIcon } from '@chakra-ui/icons';
|
||||
|
||||
const cancelButtonSelector = createSelector(
|
||||
|
@ -1,18 +1,11 @@
|
||||
import { Flex } from '@chakra-ui/react';
|
||||
import { useAppSelector } from 'app/store/storeHooks';
|
||||
import { activeTabNameSelector } from 'features/ui/store/uiSelectors';
|
||||
import CancelButton from './CancelButton';
|
||||
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.
|
||||
*/
|
||||
const ProcessButtons = () => {
|
||||
const activeTabName = useAppSelector(activeTabNameSelector);
|
||||
|
||||
return (
|
||||
<Flex gap={2}>
|
||||
<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 { isFinite, isString } from 'lodash-es';
|
||||
import { useCallback } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import useSetBothPrompts from './usePrompt';
|
||||
import { initialImageChanged, setSeed } from '../store/generationSlice';
|
||||
import { isImage, isImageField } from 'services/types/guards';
|
||||
import { setSeed } from '../store/generationSlice';
|
||||
import { isImageField } from 'services/types/guards';
|
||||
import { NUMPY_RAND_MAX } from 'app/constants';
|
||||
import { initialImageSelected } from '../store/actions';
|
||||
import { Image } from 'app/types/invokeai';
|
||||
|
@ -1,11 +1,8 @@
|
||||
import type { PayloadAction } from '@reduxjs/toolkit';
|
||||
import { createSlice } from '@reduxjs/toolkit';
|
||||
import * as InvokeAI from 'app/types/invokeai';
|
||||
import { getPromptAndNegative } from 'common/util/getPromptAndNegative';
|
||||
import promptToString from 'common/util/promptToString';
|
||||
import { seedWeightsToString } from 'common/util/seedWeightPairs';
|
||||
import { clamp } from 'lodash-es';
|
||||
import { ImageField, ImageType } from 'services/api';
|
||||
|
||||
export interface GenerationState {
|
||||
cfgScale: number;
|
||||
|
@ -1,6 +1,5 @@
|
||||
import type { PayloadAction } from '@reduxjs/toolkit';
|
||||
import { createSlice } from '@reduxjs/toolkit';
|
||||
import { FACETOOL_TYPES } from 'app/constants';
|
||||
|
||||
export interface HiresState {
|
||||
codeformerFidelity: number;
|
||||
|
Reference in New Issue
Block a user