diff --git a/frontend/src/app/features.ts b/frontend/src/app/features.ts index f31b0dad98..f09effea09 100644 --- a/frontend/src/app/features.ts +++ b/frontend/src/app/features.ts @@ -13,8 +13,8 @@ export enum Feature { UPSCALE, FACE_CORRECTION, IMAGE_TO_IMAGE, - OUTPAINTING, BOUNDING_BOX, + CANVAS_COMPOSITION, } /** For each tooltip in the UI, the below feature definitions & props will pull relevant information into the tooltip. * @@ -61,14 +61,14 @@ export const FEATURES: Record = { href: 'link/to/docs/feature3.html', guideImage: 'asset/path.gif', }, - [Feature.OUTPAINTING]: { - text: 'Outpainting settings control the process used to cleanly manage seams between existing compositions and new invocations, using larger areas of the image for seam guidance, or applying various configurations on the generation process.', - href: 'link/to/docs/feature3.html', - guideImage: 'asset/path.gif', - }, [Feature.BOUNDING_BOX]: { text: 'The Bounding Box is analogous to the Width and Height settings for Text to Image or Image to Image. Only the area in the box will be processed.', href: 'link/to/docs/feature3.html', guideImage: 'asset/path.gif', }, + [Feature.CANVAS_COMPOSITION]: { + text: 'Control the process used to cleanly manage seams between existing compositions and new invocations, using larger areas of the image for seam guidance, or applying various configurations on the generation process.', + href: 'link/to/docs/feature3.html', + guideImage: 'asset/path.gif', + }, }; diff --git a/frontend/src/features/options/components/AccordionItems/InvokeAccordionItem.tsx b/frontend/src/features/options/components/AccordionItems/InvokeAccordionItem.tsx index d11990a6a6..2162b1fa34 100644 --- a/frontend/src/features/options/components/AccordionItems/InvokeAccordionItem.tsx +++ b/frontend/src/features/options/components/AccordionItems/InvokeAccordionItem.tsx @@ -3,31 +3,37 @@ import { AccordionIcon, AccordionItem, AccordionPanel, + Box, + Flex, } from '@chakra-ui/react'; -import React, { ReactElement } from 'react'; +import { ReactNode } from 'react'; import { Feature } from 'app/features'; import GuideIcon from 'common/components/GuideIcon'; export interface InvokeAccordionItemProps { - header: ReactElement; - feature: Feature; - options: ReactElement; + header: string; + content: ReactNode; + feature?: Feature; + additionalHeaderComponents?: ReactNode; } export default function InvokeAccordionItem(props: InvokeAccordionItemProps) { - const { header, feature, options } = props; + const { header, feature, content, additionalHeaderComponents } = props; return ( -

- - {header} - + + + + {header} + + {additionalHeaderComponents} + {feature && } - -

+ + - {options} + {content}
); diff --git a/frontend/src/features/options/components/AdvancedOptions/Inpainting/BoundingBoxSettings/BoundingBoxSettings.scss b/frontend/src/features/options/components/AdvancedOptions/Canvas/BoundingBoxSettings/BoundingBoxSettings.scss similarity index 100% rename from frontend/src/features/options/components/AdvancedOptions/Inpainting/BoundingBoxSettings/BoundingBoxSettings.scss rename to frontend/src/features/options/components/AdvancedOptions/Canvas/BoundingBoxSettings/BoundingBoxSettings.scss diff --git a/frontend/src/features/options/components/AdvancedOptions/Inpainting/BoundingBoxSettings/BoundingBoxSettings.tsx b/frontend/src/features/options/components/AdvancedOptions/Canvas/BoundingBoxSettings/BoundingBoxSettings.tsx similarity index 100% rename from frontend/src/features/options/components/AdvancedOptions/Inpainting/BoundingBoxSettings/BoundingBoxSettings.tsx rename to frontend/src/features/options/components/AdvancedOptions/Canvas/BoundingBoxSettings/BoundingBoxSettings.tsx diff --git a/frontend/src/features/options/components/AdvancedOptions/Inpainting/OutpaintingOptions.tsx b/frontend/src/features/options/components/AdvancedOptions/Canvas/CompositionOptions.tsx similarity index 98% rename from frontend/src/features/options/components/AdvancedOptions/Inpainting/OutpaintingOptions.tsx rename to frontend/src/features/options/components/AdvancedOptions/Canvas/CompositionOptions.tsx index 29c8e2c0ab..bfda099071 100644 --- a/frontend/src/features/options/components/AdvancedOptions/Inpainting/OutpaintingOptions.tsx +++ b/frontend/src/features/options/components/AdvancedOptions/Canvas/CompositionOptions.tsx @@ -51,7 +51,7 @@ const selector = createSelector( } ); -const OutpaintingOptions = () => { +const CompositionOptions = () => { const dispatch = useAppDispatch(); const { seamSize, @@ -171,7 +171,7 @@ const OutpaintingOptions = () => { ); }; -export default OutpaintingOptions; +export default CompositionOptions; export const OutpaintingHeader = () => { return ( diff --git a/frontend/src/features/options/components/AdvancedOptions/Inpainting/InpaintReplace.tsx b/frontend/src/features/options/components/AdvancedOptions/Canvas/InpaintReplace.tsx similarity index 100% rename from frontend/src/features/options/components/AdvancedOptions/Inpainting/InpaintReplace.tsx rename to frontend/src/features/options/components/AdvancedOptions/Canvas/InpaintReplace.tsx diff --git a/frontend/src/features/options/components/AdvancedOptions/FaceRestore/FaceRestoreHeader.tsx b/frontend/src/features/options/components/AdvancedOptions/FaceRestore/FaceRestoreToggle.tsx similarity index 50% rename from frontend/src/features/options/components/AdvancedOptions/FaceRestore/FaceRestoreHeader.tsx rename to frontend/src/features/options/components/AdvancedOptions/FaceRestore/FaceRestoreToggle.tsx index 3949ecb8e7..0867ad0db0 100644 --- a/frontend/src/features/options/components/AdvancedOptions/FaceRestore/FaceRestoreHeader.tsx +++ b/frontend/src/features/options/components/AdvancedOptions/FaceRestore/FaceRestoreToggle.tsx @@ -1,14 +1,9 @@ -import { Flex } from '@chakra-ui/layout'; -import React, { ChangeEvent } from 'react'; -import { - RootState, - useAppDispatch, - useAppSelector, -} from 'app/store'; +import { ChangeEvent } from 'react'; +import { RootState, useAppDispatch, useAppSelector } from 'app/store'; import IAISwitch from 'common/components/IAISwitch'; import { setShouldRunFacetool } from 'features/options/store/optionsSlice'; -export default function FaceRestoreHeader() { +export default function FaceRestoreToggle() { const isGFPGANAvailable = useAppSelector( (state: RootState) => state.system.isGFPGANAvailable ); @@ -23,18 +18,10 @@ export default function FaceRestoreHeader() { dispatch(setShouldRunFacetool(e.target.checked)); return ( - -

Restore Face

- -
+ ); } diff --git a/frontend/src/features/options/components/AdvancedOptions/Output/OutputHeader.tsx b/frontend/src/features/options/components/AdvancedOptions/Output/OutputHeader.tsx deleted file mode 100644 index 6c8603d9f8..0000000000 --- a/frontend/src/features/options/components/AdvancedOptions/Output/OutputHeader.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Box } from '@chakra-ui/react'; - -const OutputHeader = () => { - return ( - - Other Options - - ); -}; - -export default OutputHeader; diff --git a/frontend/src/features/options/components/AdvancedOptions/Seed/SeedHeader.tsx b/frontend/src/features/options/components/AdvancedOptions/Seed/SeedHeader.tsx deleted file mode 100644 index 9c05b96d68..0000000000 --- a/frontend/src/features/options/components/AdvancedOptions/Seed/SeedHeader.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Box } from '@chakra-ui/react'; - -const SeedHeader = () => { - return ( - - Seed - - ); -}; - -export default SeedHeader; diff --git a/frontend/src/features/options/components/AdvancedOptions/Upscale/UpscaleHeader.tsx b/frontend/src/features/options/components/AdvancedOptions/Upscale/UpscaleToggle.tsx similarity index 50% rename from frontend/src/features/options/components/AdvancedOptions/Upscale/UpscaleHeader.tsx rename to frontend/src/features/options/components/AdvancedOptions/Upscale/UpscaleToggle.tsx index 4e9e4d3629..f0a55776c2 100644 --- a/frontend/src/features/options/components/AdvancedOptions/Upscale/UpscaleHeader.tsx +++ b/frontend/src/features/options/components/AdvancedOptions/Upscale/UpscaleToggle.tsx @@ -1,14 +1,9 @@ -import { Flex } from '@chakra-ui/layout'; -import React, { ChangeEvent } from 'react'; -import { - RootState, - useAppDispatch, - useAppSelector, -} from 'app/store'; +import { ChangeEvent } from 'react'; +import { RootState, useAppDispatch, useAppSelector } from 'app/store'; import IAISwitch from 'common/components/IAISwitch'; import { setShouldRunESRGAN } from 'features/options/store/optionsSlice'; -export default function UpscaleHeader() { +export default function UpscaleToggle() { const isESRGANAvailable = useAppSelector( (state: RootState) => state.system.isESRGANAvailable ); @@ -21,18 +16,10 @@ export default function UpscaleHeader() { const handleChangeShouldRunESRGAN = (e: ChangeEvent) => dispatch(setShouldRunESRGAN(e.target.checked)); return ( - -

Upscale

- -
+ ); } diff --git a/frontend/src/features/options/components/AdvancedOptions/Variations/GenerateVariations.tsx b/frontend/src/features/options/components/AdvancedOptions/Variations/GenerateVariations.tsx index dd8d95404a..ca5afd53c4 100644 --- a/frontend/src/features/options/components/AdvancedOptions/Variations/GenerateVariations.tsx +++ b/frontend/src/features/options/components/AdvancedOptions/Variations/GenerateVariations.tsx @@ -7,7 +7,7 @@ import { import IAISwitch from 'common/components/IAISwitch'; import { setShouldGenerateVariations } from 'features/options/store/optionsSlice'; -export default function GenerateVariations() { +export default function GenerateVariationsToggle() { const shouldGenerateVariations = useAppSelector( (state: RootState) => state.options.shouldGenerateVariations ); diff --git a/frontend/src/features/options/components/AdvancedOptions/Variations/VariationsHeader.tsx b/frontend/src/features/options/components/AdvancedOptions/Variations/VariationsHeader.tsx deleted file mode 100644 index ab02fad1f6..0000000000 --- a/frontend/src/features/options/components/AdvancedOptions/Variations/VariationsHeader.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { Flex } from '@chakra-ui/react'; -import React from 'react'; -import GenerateVariations from './GenerateVariations'; - -export default function VariationsHeader() { - return ( - -

Variations

- -
- ); -} diff --git a/frontend/src/features/options/components/OptionsAccordion.tsx b/frontend/src/features/options/components/OptionsAccordion.tsx index 98eb96a999..5520ae2297 100644 --- a/frontend/src/features/options/components/OptionsAccordion.tsx +++ b/frontend/src/features/options/components/OptionsAccordion.tsx @@ -36,12 +36,15 @@ const OptionsAccordion = (props: OptionAccordionsType) => { const accordionsToRender: ReactElement[] = []; if (accordionInfo) { Object.keys(accordionInfo).forEach((key) => { + const { header, feature, content, additionalHeaderComponents } = + accordionInfo[key]; accordionsToRender.push( ); }); diff --git a/frontend/src/features/tabs/components/ImageToImage/ImageToImagePanel.tsx b/frontend/src/features/tabs/components/ImageToImage/ImageToImagePanel.tsx index 8a3629b8c8..3b85b1fbee 100644 --- a/frontend/src/features/tabs/components/ImageToImage/ImageToImagePanel.tsx +++ b/frontend/src/features/tabs/components/ImageToImage/ImageToImagePanel.tsx @@ -1,15 +1,13 @@ import { Feature } from 'app/features'; -import FaceRestoreHeader from 'features/options/components/AdvancedOptions/FaceRestore/FaceRestoreHeader'; import FaceRestoreOptions from 'features/options/components/AdvancedOptions/FaceRestore/FaceRestoreOptions'; +import FaceRestoreToggle from 'features/options/components/AdvancedOptions/FaceRestore/FaceRestoreToggle'; import ImageFit from 'features/options/components/AdvancedOptions/ImageToImage/ImageFit'; import ImageToImageStrength from 'features/options/components/AdvancedOptions/ImageToImage/ImageToImageStrength'; -import OutputHeader from 'features/options/components/AdvancedOptions/Output/OutputHeader'; import OutputOptions from 'features/options/components/AdvancedOptions/Output/OutputOptions'; -import SeedHeader from 'features/options/components/AdvancedOptions/Seed/SeedHeader'; import SeedOptions from 'features/options/components/AdvancedOptions/Seed/SeedOptions'; -import UpscaleHeader from 'features/options/components/AdvancedOptions/Upscale/UpscaleHeader'; import UpscaleOptions from 'features/options/components/AdvancedOptions/Upscale/UpscaleOptions'; -import VariationsHeader from 'features/options/components/AdvancedOptions/Variations/VariationsHeader'; +import UpscaleToggle from 'features/options/components/AdvancedOptions/Upscale/UpscaleToggle'; +import GenerateVariationsToggle from 'features/options/components/AdvancedOptions/Variations/GenerateVariations'; import VariationsOptions from 'features/options/components/AdvancedOptions/Variations/VariationsOptions'; import MainOptions from 'features/options/components/MainOptions/MainOptions'; import OptionsAccordion from 'features/options/components/OptionsAccordion'; @@ -20,29 +18,32 @@ import InvokeOptionsPanel from 'features/tabs/components/InvokeOptionsPanel'; export default function ImageToImagePanel() { const imageToImageAccordions = { seed: { - header: , + header: 'Seed', feature: Feature.SEED, - options: , + content: , }, variations: { - header: , + header: 'Variations', feature: Feature.VARIATIONS, - options: , + content: , + additionalHeaderComponents: , }, face_restore: { - header: , + header: 'Face Restoration', feature: Feature.FACE_CORRECTION, - options: , + content: , + additionalHeaderComponents: , }, upscale: { - header: , + header: 'Upscaling', feature: Feature.UPSCALE, - options: , + content: , + additionalHeaderComponents: , }, other: { - header: , + header: 'Other Options', feature: Feature.OTHER, - options: , + content: , }, }; diff --git a/frontend/src/features/tabs/components/TextToImage/TextToImagePanel.tsx b/frontend/src/features/tabs/components/TextToImage/TextToImagePanel.tsx index 0abcb9ca1c..162bce32b1 100644 --- a/frontend/src/features/tabs/components/TextToImage/TextToImagePanel.tsx +++ b/frontend/src/features/tabs/components/TextToImage/TextToImagePanel.tsx @@ -1,13 +1,11 @@ import { Feature } from 'app/features'; -import FaceRestoreHeader from 'features/options/components/AdvancedOptions/FaceRestore/FaceRestoreHeader'; import FaceRestoreOptions from 'features/options/components/AdvancedOptions/FaceRestore/FaceRestoreOptions'; -import OutputHeader from 'features/options/components/AdvancedOptions/Output/OutputHeader'; +import FaceRestoreToggle from 'features/options/components/AdvancedOptions/FaceRestore/FaceRestoreToggle'; import OutputOptions from 'features/options/components/AdvancedOptions/Output/OutputOptions'; -import SeedHeader from 'features/options/components/AdvancedOptions/Seed/SeedHeader'; import SeedOptions from 'features/options/components/AdvancedOptions/Seed/SeedOptions'; -import UpscaleHeader from 'features/options/components/AdvancedOptions/Upscale/UpscaleHeader'; import UpscaleOptions from 'features/options/components/AdvancedOptions/Upscale/UpscaleOptions'; -import VariationsHeader from 'features/options/components/AdvancedOptions/Variations/VariationsHeader'; +import UpscaleToggle from 'features/options/components/AdvancedOptions/Upscale/UpscaleToggle'; +import GenerateVariationsToggle from 'features/options/components/AdvancedOptions/Variations/GenerateVariations'; import VariationsOptions from 'features/options/components/AdvancedOptions/Variations/VariationsOptions'; import MainOptions from 'features/options/components/MainOptions/MainOptions'; import OptionsAccordion from 'features/options/components/OptionsAccordion'; @@ -18,29 +16,32 @@ import InvokeOptionsPanel from 'features/tabs/components/InvokeOptionsPanel'; export default function TextToImagePanel() { const textToImageAccordions = { seed: { - header: , + header: 'Seed', feature: Feature.SEED, - options: , + content: , }, variations: { - header: , + header: 'Variations', feature: Feature.VARIATIONS, - options: , + content: , + additionalHeaderComponents: , }, face_restore: { - header: , + header: 'Face Restoration', feature: Feature.FACE_CORRECTION, - options: , + content: , + additionalHeaderComponents: , }, upscale: { - header: , + header: 'Upscaling', feature: Feature.UPSCALE, - options: , + content: , + additionalHeaderComponents: , }, other: { - header: , + header: 'Other Options', feature: Feature.OTHER, - options: , + content: , }, }; diff --git a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasPanel.tsx b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasPanel.tsx index f2645560cb..52afd2e187 100644 --- a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasPanel.tsx +++ b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasPanel.tsx @@ -1,15 +1,10 @@ // import { Feature } from 'app/features'; import { Feature } from 'app/features'; import ImageToImageStrength from 'features/options/components/AdvancedOptions/ImageToImage/ImageToImageStrength'; -import BoundingBoxSettings, { - BoundingBoxSettingsHeader, -} from 'features/options/components/AdvancedOptions/Inpainting/BoundingBoxSettings/BoundingBoxSettings'; -import OutpaintingOptions, { - OutpaintingHeader, -} from 'features/options/components/AdvancedOptions/Inpainting/OutpaintingOptions'; -import SeedHeader from 'features/options/components/AdvancedOptions/Seed/SeedHeader'; +import BoundingBoxSettings from 'features/options/components/AdvancedOptions/Canvas/BoundingBoxSettings/BoundingBoxSettings'; +import CompositionOptions from 'features/options/components/AdvancedOptions/Canvas/CompositionOptions'; import SeedOptions from 'features/options/components/AdvancedOptions/Seed/SeedOptions'; -import VariationsHeader from 'features/options/components/AdvancedOptions/Variations/VariationsHeader'; +import GenerateVariationsToggle from 'features/options/components/AdvancedOptions/Variations/GenerateVariations'; import VariationsOptions from 'features/options/components/AdvancedOptions/Variations/VariationsOptions'; import MainOptions from 'features/options/components/MainOptions/MainOptions'; import OptionsAccordion from 'features/options/components/OptionsAccordion'; @@ -20,24 +15,25 @@ import InvokeOptionsPanel from 'features/tabs/components/InvokeOptionsPanel'; export default function UnifiedCanvasPanel() { const unifiedCanvasAccordions = { boundingBox: { - header: , + header: 'Bounding Box', feature: Feature.BOUNDING_BOX, - options: , + content: , }, - outpainting: { - header: , - feature: Feature.OUTPAINTING, - options: , + composition: { + header: 'Composition', + feature: Feature.CANVAS_COMPOSITION, + content: , }, seed: { - header: , + header: 'Seed', feature: Feature.SEED, - options: , + content: , }, variations: { - header: , + header: 'Variations', feature: Feature.VARIATIONS, - options: , + content: , + additionalHeaderComponents: , }, }; diff --git a/frontend/src/styles/index.scss b/frontend/src/styles/index.scss index 44194e6041..250a7ece3e 100644 --- a/frontend/src/styles/index.scss +++ b/frontend/src/styles/index.scss @@ -26,7 +26,7 @@ @use '../features/options/components/MainOptions/MainOptions.scss'; @use '../features/options/components/AccordionItems/AdvancedSettings.scss'; @use '../features/options/components/AdvancedOptions/Upscale/UpscaleOptions.scss'; -@use '../features/options/components/AdvancedOptions/Inpainting/BoundingBoxSettings/BoundingBoxSettings.scss'; +@use '../features/options/components/AdvancedOptions/Canvas/BoundingBoxSettings/BoundingBoxSettings.scss'; @use '../features/system/components/ProgressBar.scss'; // gallery