mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): refine canvas entity list items & menus
This commit is contained in:
parent
78a59b5b78
commit
ff20dd509a
@ -1667,6 +1667,8 @@
|
|||||||
"controlLayers": "Control Layers",
|
"controlLayers": "Control Layers",
|
||||||
"globalMaskOpacity": "Global Mask Opacity",
|
"globalMaskOpacity": "Global Mask Opacity",
|
||||||
"autoNegative": "Auto Negative",
|
"autoNegative": "Auto Negative",
|
||||||
|
"enableAutoNegative": "Enable Auto Negative",
|
||||||
|
"disableAutoNegative": "Disable Auto Negative",
|
||||||
"deletePrompt": "Delete Prompt",
|
"deletePrompt": "Delete Prompt",
|
||||||
"resetRegion": "Reset Region",
|
"resetRegion": "Reset Region",
|
||||||
"debugLayers": "Debug Layers",
|
"debugLayers": "Debug Layers",
|
||||||
@ -1718,6 +1720,7 @@
|
|||||||
"objects_other": "{{count}} objects",
|
"objects_other": "{{count}} objects",
|
||||||
"convertToControlLayer": "Convert to Control Layer",
|
"convertToControlLayer": "Convert to Control Layer",
|
||||||
"convertToRasterLayer": "Convert to Raster Layer",
|
"convertToRasterLayer": "Convert to Raster Layer",
|
||||||
|
"transparency": "Transparency",
|
||||||
"enableTransparencyEffect": "Enable Transparency Effect",
|
"enableTransparencyEffect": "Enable Transparency Effect",
|
||||||
"disableTransparencyEffect": "Disable Transparency Effect",
|
"disableTransparencyEffect": "Disable Transparency Effect",
|
||||||
"hidingType": "Hiding {{type}}",
|
"hidingType": "Hiding {{type}}",
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import { Spacer } from '@invoke-ai/ui-library';
|
import { Spacer } from '@invoke-ai/ui-library';
|
||||||
import { CanvasEntityContainer } from 'features/controlLayers/components/common/CanvasEntityContainer';
|
import { CanvasEntityContainer } from 'features/controlLayers/components/common/CanvasEntityContainer';
|
||||||
import { CanvasEntityDeleteButton } from 'features/controlLayers/components/common/CanvasEntityDeleteButton';
|
|
||||||
import { CanvasEntityEnabledToggle } from 'features/controlLayers/components/common/CanvasEntityEnabledToggle';
|
import { CanvasEntityEnabledToggle } from 'features/controlLayers/components/common/CanvasEntityEnabledToggle';
|
||||||
import { CanvasEntityHeader } from 'features/controlLayers/components/common/CanvasEntityHeader';
|
import { CanvasEntityHeader } from 'features/controlLayers/components/common/CanvasEntityHeader';
|
||||||
import { CanvasEntityPreviewImage } from 'features/controlLayers/components/common/CanvasEntityPreviewImage';
|
import { CanvasEntityPreviewImage } from 'features/controlLayers/components/common/CanvasEntityPreviewImage';
|
||||||
import { CanvasEntitySettingsWrapper } from 'features/controlLayers/components/common/CanvasEntitySettingsWrapper';
|
import { CanvasEntitySettingsWrapper } from 'features/controlLayers/components/common/CanvasEntitySettingsWrapper';
|
||||||
import { CanvasEntityEditableTitle } from 'features/controlLayers/components/common/CanvasEntityTitleEdit';
|
import { CanvasEntityEditableTitle } from 'features/controlLayers/components/common/CanvasEntityTitleEdit';
|
||||||
|
import { ControlLayerBadges } from 'features/controlLayers/components/ControlLayer/ControlLayerBadges';
|
||||||
import { ControlLayerControlAdapter } from 'features/controlLayers/components/ControlLayer/ControlLayerControlAdapter';
|
import { ControlLayerControlAdapter } from 'features/controlLayers/components/ControlLayer/ControlLayerControlAdapter';
|
||||||
import { EntityLayerAdapterGate } from 'features/controlLayers/contexts/EntityAdapterContext';
|
import { EntityLayerAdapterGate } from 'features/controlLayers/contexts/EntityAdapterContext';
|
||||||
import { EntityIdentifierContext } from 'features/controlLayers/contexts/EntityIdentifierContext';
|
import { EntityIdentifierContext } from 'features/controlLayers/contexts/EntityIdentifierContext';
|
||||||
@ -25,10 +25,10 @@ export const ControlLayer = memo(({ id }: Props) => {
|
|||||||
<CanvasEntityContainer>
|
<CanvasEntityContainer>
|
||||||
<CanvasEntityHeader>
|
<CanvasEntityHeader>
|
||||||
<CanvasEntityPreviewImage />
|
<CanvasEntityPreviewImage />
|
||||||
<CanvasEntityEnabledToggle />
|
|
||||||
<CanvasEntityEditableTitle />
|
<CanvasEntityEditableTitle />
|
||||||
<Spacer />
|
<Spacer />
|
||||||
<CanvasEntityDeleteButton />
|
<ControlLayerBadges />
|
||||||
|
<CanvasEntityEnabledToggle />
|
||||||
</CanvasEntityHeader>
|
</CanvasEntityHeader>
|
||||||
<CanvasEntitySettingsWrapper>
|
<CanvasEntitySettingsWrapper>
|
||||||
<ControlLayerControlAdapter />
|
<ControlLayerControlAdapter />
|
||||||
|
@ -0,0 +1,26 @@
|
|||||||
|
import { Badge } from '@invoke-ai/ui-library';
|
||||||
|
import { useAppSelector } from 'app/store/storeHooks';
|
||||||
|
import { useEntityIdentifierContext } from 'features/controlLayers/contexts/EntityIdentifierContext';
|
||||||
|
import { selectControlLayerOrThrow } from 'features/controlLayers/store/controlLayersReducers';
|
||||||
|
import { memo } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
|
export const ControlLayerBadges = memo(() => {
|
||||||
|
const { id } = useEntityIdentifierContext();
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const withTransparencyEffect = useAppSelector(
|
||||||
|
(s) => selectControlLayerOrThrow(s.canvasV2, id).withTransparencyEffect
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{withTransparencyEffect && (
|
||||||
|
<Badge color="base.300" bg="transparent" borderWidth={1} userSelect="none">
|
||||||
|
{t('controlLayers.transparency')}
|
||||||
|
</Badge>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
ControlLayerBadges.displayName = 'ControlLayerBadges';
|
@ -2,7 +2,7 @@ import { MenuDivider } from '@invoke-ai/ui-library';
|
|||||||
import { CanvasEntityMenuItemsArrange } from 'features/controlLayers/components/common/CanvasEntityMenuItemsArrange';
|
import { CanvasEntityMenuItemsArrange } from 'features/controlLayers/components/common/CanvasEntityMenuItemsArrange';
|
||||||
import { CanvasEntityMenuItemsDelete } from 'features/controlLayers/components/common/CanvasEntityMenuItemsDelete';
|
import { CanvasEntityMenuItemsDelete } from 'features/controlLayers/components/common/CanvasEntityMenuItemsDelete';
|
||||||
import { CanvasEntityMenuItemsFilter } from 'features/controlLayers/components/common/CanvasEntityMenuItemsFilter';
|
import { CanvasEntityMenuItemsFilter } from 'features/controlLayers/components/common/CanvasEntityMenuItemsFilter';
|
||||||
import { CanvasEntityMenuItemsReset } from 'features/controlLayers/components/common/CanvasEntityMenuItemsReset';
|
import { CanvasEntityMenuItemsTransform } from 'features/controlLayers/components/common/CanvasEntityMenuItemsTransform';
|
||||||
import { ControlLayerMenuItemsControlToRaster } from 'features/controlLayers/components/ControlLayer/ControlLayerMenuItemsControlToRaster';
|
import { ControlLayerMenuItemsControlToRaster } from 'features/controlLayers/components/ControlLayer/ControlLayerMenuItemsControlToRaster';
|
||||||
import { ControlLayerMenuItemsTransparencyEffect } from 'features/controlLayers/components/ControlLayer/ControlLayerMenuItemsTransparencyEffect';
|
import { ControlLayerMenuItemsTransparencyEffect } from 'features/controlLayers/components/ControlLayer/ControlLayerMenuItemsTransparencyEffect';
|
||||||
import { memo } from 'react';
|
import { memo } from 'react';
|
||||||
@ -10,13 +10,13 @@ import { memo } from 'react';
|
|||||||
export const ControlLayerMenuItems = memo(() => {
|
export const ControlLayerMenuItems = memo(() => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<CanvasEntityMenuItemsTransform />
|
||||||
<CanvasEntityMenuItemsFilter />
|
<CanvasEntityMenuItemsFilter />
|
||||||
<ControlLayerMenuItemsControlToRaster />
|
<ControlLayerMenuItemsControlToRaster />
|
||||||
<ControlLayerMenuItemsTransparencyEffect />
|
<ControlLayerMenuItemsTransparencyEffect />
|
||||||
<MenuDivider />
|
<MenuDivider />
|
||||||
<CanvasEntityMenuItemsArrange />
|
<CanvasEntityMenuItemsArrange />
|
||||||
<MenuDivider />
|
<MenuDivider />
|
||||||
<CanvasEntityMenuItemsReset />
|
|
||||||
<CanvasEntityMenuItemsDelete />
|
<CanvasEntityMenuItemsDelete />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { Spacer } from '@invoke-ai/ui-library';
|
import { Spacer } from '@invoke-ai/ui-library';
|
||||||
import { CanvasEntityContainer } from 'features/controlLayers/components/common/CanvasEntityContainer';
|
import { CanvasEntityContainer } from 'features/controlLayers/components/common/CanvasEntityContainer';
|
||||||
import { CanvasEntityDeleteButton } from 'features/controlLayers/components/common/CanvasEntityDeleteButton';
|
|
||||||
import { CanvasEntityEnabledToggle } from 'features/controlLayers/components/common/CanvasEntityEnabledToggle';
|
import { CanvasEntityEnabledToggle } from 'features/controlLayers/components/common/CanvasEntityEnabledToggle';
|
||||||
import { CanvasEntityHeader } from 'features/controlLayers/components/common/CanvasEntityHeader';
|
import { CanvasEntityHeader } from 'features/controlLayers/components/common/CanvasEntityHeader';
|
||||||
import { CanvasEntityEditableTitle } from 'features/controlLayers/components/common/CanvasEntityTitleEdit';
|
import { CanvasEntityEditableTitle } from 'features/controlLayers/components/common/CanvasEntityTitleEdit';
|
||||||
@ -19,11 +18,10 @@ export const IPAdapter = memo(({ id }: Props) => {
|
|||||||
return (
|
return (
|
||||||
<EntityIdentifierContext.Provider value={entityIdentifier}>
|
<EntityIdentifierContext.Provider value={entityIdentifier}>
|
||||||
<CanvasEntityContainer>
|
<CanvasEntityContainer>
|
||||||
<CanvasEntityHeader>
|
<CanvasEntityHeader ps={4}>
|
||||||
<CanvasEntityEnabledToggle />
|
|
||||||
<CanvasEntityEditableTitle />
|
<CanvasEntityEditableTitle />
|
||||||
<Spacer />
|
<Spacer />
|
||||||
<CanvasEntityDeleteButton />
|
<CanvasEntityEnabledToggle />
|
||||||
</CanvasEntityHeader>
|
</CanvasEntityHeader>
|
||||||
<IPAdapterSettings />
|
<IPAdapterSettings />
|
||||||
</CanvasEntityContainer>
|
</CanvasEntityContainer>
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
import { MenuDivider } from '@invoke-ai/ui-library';
|
||||||
|
import { CanvasEntityMenuItemsArrange } from 'features/controlLayers/components/common/CanvasEntityMenuItemsArrange';
|
||||||
|
import { CanvasEntityMenuItemsDelete } from 'features/controlLayers/components/common/CanvasEntityMenuItemsDelete';
|
||||||
|
import { memo } from 'react';
|
||||||
|
|
||||||
|
export const IPAdapterMenuItems = memo(() => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<CanvasEntityMenuItemsArrange />
|
||||||
|
<MenuDivider />
|
||||||
|
<CanvasEntityMenuItemsDelete />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
IPAdapterMenuItems.displayName = 'IPAdapterMenuItems';
|
@ -1,6 +1,5 @@
|
|||||||
import { Spacer } from '@invoke-ai/ui-library';
|
import { Spacer } from '@invoke-ai/ui-library';
|
||||||
import { CanvasEntityContainer } from 'features/controlLayers/components/common/CanvasEntityContainer';
|
import { CanvasEntityContainer } from 'features/controlLayers/components/common/CanvasEntityContainer';
|
||||||
import { CanvasEntityDeleteButton } from 'features/controlLayers/components/common/CanvasEntityDeleteButton';
|
|
||||||
import { CanvasEntityEnabledToggle } from 'features/controlLayers/components/common/CanvasEntityEnabledToggle';
|
import { CanvasEntityEnabledToggle } from 'features/controlLayers/components/common/CanvasEntityEnabledToggle';
|
||||||
import { CanvasEntityHeader } from 'features/controlLayers/components/common/CanvasEntityHeader';
|
import { CanvasEntityHeader } from 'features/controlLayers/components/common/CanvasEntityHeader';
|
||||||
import { CanvasEntityPreviewImage } from 'features/controlLayers/components/common/CanvasEntityPreviewImage';
|
import { CanvasEntityPreviewImage } from 'features/controlLayers/components/common/CanvasEntityPreviewImage';
|
||||||
@ -25,11 +24,10 @@ export const InpaintMask = memo(({ id }: Props) => {
|
|||||||
<CanvasEntityContainer>
|
<CanvasEntityContainer>
|
||||||
<CanvasEntityHeader>
|
<CanvasEntityHeader>
|
||||||
<CanvasEntityPreviewImage />
|
<CanvasEntityPreviewImage />
|
||||||
<CanvasEntityEnabledToggle />
|
|
||||||
<CanvasEntityEditableTitle />
|
<CanvasEntityEditableTitle />
|
||||||
<Spacer />
|
<Spacer />
|
||||||
<InpaintMaskMaskFillColorPicker />
|
<InpaintMaskMaskFillColorPicker />
|
||||||
<CanvasEntityDeleteButton />
|
<CanvasEntityEnabledToggle />
|
||||||
</CanvasEntityHeader>
|
</CanvasEntityHeader>
|
||||||
</CanvasEntityContainer>
|
</CanvasEntityContainer>
|
||||||
</EntityMaskAdapterGate>
|
</EntityMaskAdapterGate>
|
||||||
|
@ -2,7 +2,6 @@ import { Flex, Popover, PopoverBody, PopoverContent, PopoverTrigger } from '@inv
|
|||||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||||
import RgbColorPicker from 'common/components/RgbColorPicker';
|
import RgbColorPicker from 'common/components/RgbColorPicker';
|
||||||
import { rgbColorToString } from 'common/util/colorCodeTransformers';
|
import { rgbColorToString } from 'common/util/colorCodeTransformers';
|
||||||
import { stopPropagation } from 'common/util/stopPropagation';
|
|
||||||
import { MaskFillStyle } from 'features/controlLayers/components/common/MaskFillStyle';
|
import { MaskFillStyle } from 'features/controlLayers/components/common/MaskFillStyle';
|
||||||
import { useEntityIdentifierContext } from 'features/controlLayers/contexts/EntityIdentifierContext';
|
import { useEntityIdentifierContext } from 'features/controlLayers/contexts/EntityIdentifierContext';
|
||||||
import { inpaintMaskFillColorChanged, inpaintMaskFillStyleChanged } from 'features/controlLayers/store/canvasV2Slice';
|
import { inpaintMaskFillColorChanged, inpaintMaskFillStyleChanged } from 'features/controlLayers/store/canvasV2Slice';
|
||||||
@ -38,10 +37,9 @@ export const InpaintMaskMaskFillColorPicker = memo(() => {
|
|||||||
borderRadius="full"
|
borderRadius="full"
|
||||||
borderWidth={1}
|
borderWidth={1}
|
||||||
bg={rgbColorToString(fill.color)}
|
bg={rgbColorToString(fill.color)}
|
||||||
w={8}
|
w="22px"
|
||||||
h={8}
|
h="22px"
|
||||||
tabIndex={-1}
|
tabIndex={-1}
|
||||||
onDoubleClick={stopPropagation} // double click expands the layer
|
|
||||||
/>
|
/>
|
||||||
</PopoverTrigger>
|
</PopoverTrigger>
|
||||||
<PopoverContent>
|
<PopoverContent>
|
||||||
|
@ -1,10 +1,17 @@
|
|||||||
import { CanvasEntityMenuItemsReset } from 'features/controlLayers/components/common/CanvasEntityMenuItemsReset';
|
import { MenuDivider } from '@invoke-ai/ui-library';
|
||||||
|
import { CanvasEntityMenuItemsArrange } from 'features/controlLayers/components/common/CanvasEntityMenuItemsArrange';
|
||||||
|
import { CanvasEntityMenuItemsDelete } from 'features/controlLayers/components/common/CanvasEntityMenuItemsDelete';
|
||||||
|
import { CanvasEntityMenuItemsTransform } from 'features/controlLayers/components/common/CanvasEntityMenuItemsTransform';
|
||||||
import { memo } from 'react';
|
import { memo } from 'react';
|
||||||
|
|
||||||
export const InpaintMaskMenuItems = memo(() => {
|
export const InpaintMaskMenuItems = memo(() => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<CanvasEntityMenuItemsReset />
|
<CanvasEntityMenuItemsTransform />
|
||||||
|
<MenuDivider />
|
||||||
|
<CanvasEntityMenuItemsArrange />
|
||||||
|
<MenuDivider />
|
||||||
|
<CanvasEntityMenuItemsDelete />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { Spacer } from '@invoke-ai/ui-library';
|
import { Spacer } from '@invoke-ai/ui-library';
|
||||||
import { CanvasEntityContainer } from 'features/controlLayers/components/common/CanvasEntityContainer';
|
import { CanvasEntityContainer } from 'features/controlLayers/components/common/CanvasEntityContainer';
|
||||||
import { CanvasEntityDeleteButton } from 'features/controlLayers/components/common/CanvasEntityDeleteButton';
|
|
||||||
import { CanvasEntityEnabledToggle } from 'features/controlLayers/components/common/CanvasEntityEnabledToggle';
|
import { CanvasEntityEnabledToggle } from 'features/controlLayers/components/common/CanvasEntityEnabledToggle';
|
||||||
import { CanvasEntityHeader } from 'features/controlLayers/components/common/CanvasEntityHeader';
|
import { CanvasEntityHeader } from 'features/controlLayers/components/common/CanvasEntityHeader';
|
||||||
import { CanvasEntityPreviewImage } from 'features/controlLayers/components/common/CanvasEntityPreviewImage';
|
import { CanvasEntityPreviewImage } from 'features/controlLayers/components/common/CanvasEntityPreviewImage';
|
||||||
@ -23,10 +22,9 @@ export const RasterLayer = memo(({ id }: Props) => {
|
|||||||
<CanvasEntityContainer>
|
<CanvasEntityContainer>
|
||||||
<CanvasEntityHeader>
|
<CanvasEntityHeader>
|
||||||
<CanvasEntityPreviewImage />
|
<CanvasEntityPreviewImage />
|
||||||
<CanvasEntityEnabledToggle />
|
|
||||||
<CanvasEntityEditableTitle />
|
<CanvasEntityEditableTitle />
|
||||||
<Spacer />
|
<Spacer />
|
||||||
<CanvasEntityDeleteButton />
|
<CanvasEntityEnabledToggle />
|
||||||
</CanvasEntityHeader>
|
</CanvasEntityHeader>
|
||||||
</CanvasEntityContainer>
|
</CanvasEntityContainer>
|
||||||
</EntityLayerAdapterGate>
|
</EntityLayerAdapterGate>
|
||||||
|
@ -2,7 +2,6 @@ import { MenuDivider } from '@invoke-ai/ui-library';
|
|||||||
import { CanvasEntityMenuItemsArrange } from 'features/controlLayers/components/common/CanvasEntityMenuItemsArrange';
|
import { CanvasEntityMenuItemsArrange } from 'features/controlLayers/components/common/CanvasEntityMenuItemsArrange';
|
||||||
import { CanvasEntityMenuItemsDelete } from 'features/controlLayers/components/common/CanvasEntityMenuItemsDelete';
|
import { CanvasEntityMenuItemsDelete } from 'features/controlLayers/components/common/CanvasEntityMenuItemsDelete';
|
||||||
import { CanvasEntityMenuItemsFilter } from 'features/controlLayers/components/common/CanvasEntityMenuItemsFilter';
|
import { CanvasEntityMenuItemsFilter } from 'features/controlLayers/components/common/CanvasEntityMenuItemsFilter';
|
||||||
import { CanvasEntityMenuItemsReset } from 'features/controlLayers/components/common/CanvasEntityMenuItemsReset';
|
|
||||||
import { CanvasEntityMenuItemsTransform } from 'features/controlLayers/components/common/CanvasEntityMenuItemsTransform';
|
import { CanvasEntityMenuItemsTransform } from 'features/controlLayers/components/common/CanvasEntityMenuItemsTransform';
|
||||||
import { RasterLayerMenuItemsRasterToControl } from 'features/controlLayers/components/RasterLayer/RasterLayerMenuItemsRasterToControl';
|
import { RasterLayerMenuItemsRasterToControl } from 'features/controlLayers/components/RasterLayer/RasterLayerMenuItemsRasterToControl';
|
||||||
import { memo } from 'react';
|
import { memo } from 'react';
|
||||||
@ -10,13 +9,12 @@ import { memo } from 'react';
|
|||||||
export const RasterLayerMenuItems = memo(() => {
|
export const RasterLayerMenuItems = memo(() => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<CanvasEntityMenuItemsTransform />
|
||||||
<CanvasEntityMenuItemsFilter />
|
<CanvasEntityMenuItemsFilter />
|
||||||
<RasterLayerMenuItemsRasterToControl />
|
<RasterLayerMenuItemsRasterToControl />
|
||||||
<CanvasEntityMenuItemsTransform />
|
|
||||||
<MenuDivider />
|
<MenuDivider />
|
||||||
<CanvasEntityMenuItemsArrange />
|
<CanvasEntityMenuItemsArrange />
|
||||||
<MenuDivider />
|
<MenuDivider />
|
||||||
<CanvasEntityMenuItemsReset />
|
|
||||||
<CanvasEntityMenuItemsDelete />
|
<CanvasEntityMenuItemsDelete />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { Spacer } from '@invoke-ai/ui-library';
|
import { Spacer } from '@invoke-ai/ui-library';
|
||||||
import { CanvasEntityContainer } from 'features/controlLayers/components/common/CanvasEntityContainer';
|
import { CanvasEntityContainer } from 'features/controlLayers/components/common/CanvasEntityContainer';
|
||||||
import { CanvasEntityDeleteButton } from 'features/controlLayers/components/common/CanvasEntityDeleteButton';
|
|
||||||
import { CanvasEntityEnabledToggle } from 'features/controlLayers/components/common/CanvasEntityEnabledToggle';
|
import { CanvasEntityEnabledToggle } from 'features/controlLayers/components/common/CanvasEntityEnabledToggle';
|
||||||
import { CanvasEntityHeader } from 'features/controlLayers/components/common/CanvasEntityHeader';
|
import { CanvasEntityHeader } from 'features/controlLayers/components/common/CanvasEntityHeader';
|
||||||
import { CanvasEntityPreviewImage } from 'features/controlLayers/components/common/CanvasEntityPreviewImage';
|
import { CanvasEntityPreviewImage } from 'features/controlLayers/components/common/CanvasEntityPreviewImage';
|
||||||
@ -13,7 +12,6 @@ import type { CanvasEntityIdentifier } from 'features/controlLayers/store/types'
|
|||||||
import { memo, useMemo } from 'react';
|
import { memo, useMemo } from 'react';
|
||||||
|
|
||||||
import { RegionalGuidanceMaskFillColorPicker } from './RegionalGuidanceMaskFillColorPicker';
|
import { RegionalGuidanceMaskFillColorPicker } from './RegionalGuidanceMaskFillColorPicker';
|
||||||
import { RegionalGuidanceSettingsPopover } from './RegionalGuidanceSettingsPopover';
|
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
id: string;
|
id: string;
|
||||||
@ -28,13 +26,11 @@ export const RegionalGuidance = memo(({ id }: Props) => {
|
|||||||
<CanvasEntityContainer>
|
<CanvasEntityContainer>
|
||||||
<CanvasEntityHeader>
|
<CanvasEntityHeader>
|
||||||
<CanvasEntityPreviewImage />
|
<CanvasEntityPreviewImage />
|
||||||
<CanvasEntityEnabledToggle />
|
|
||||||
<CanvasEntityEditableTitle />
|
<CanvasEntityEditableTitle />
|
||||||
<Spacer />
|
<Spacer />
|
||||||
<RegionalGuidanceBadges />
|
<RegionalGuidanceBadges />
|
||||||
<RegionalGuidanceMaskFillColorPicker />
|
<RegionalGuidanceMaskFillColorPicker />
|
||||||
<RegionalGuidanceSettingsPopover />
|
<CanvasEntityEnabledToggle />
|
||||||
<CanvasEntityDeleteButton />
|
|
||||||
</CanvasEntityHeader>
|
</CanvasEntityHeader>
|
||||||
<RegionalGuidanceSettings />
|
<RegionalGuidanceSettings />
|
||||||
</CanvasEntityContainer>
|
</CanvasEntityContainer>
|
||||||
|
@ -12,7 +12,7 @@ export const RegionalGuidanceBadges = memo(() => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{autoNegative === 'invert' && (
|
{autoNegative && (
|
||||||
<Badge color="base.300" bg="transparent" borderWidth={1} userSelect="none">
|
<Badge color="base.300" bg="transparent" borderWidth={1} userSelect="none">
|
||||||
{t('controlLayers.autoNegative')}
|
{t('controlLayers.autoNegative')}
|
||||||
</Badge>
|
</Badge>
|
||||||
|
@ -2,7 +2,6 @@ import { Flex, Popover, PopoverBody, PopoverContent, PopoverTrigger } from '@inv
|
|||||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||||
import RgbColorPicker from 'common/components/RgbColorPicker';
|
import RgbColorPicker from 'common/components/RgbColorPicker';
|
||||||
import { rgbColorToString } from 'common/util/colorCodeTransformers';
|
import { rgbColorToString } from 'common/util/colorCodeTransformers';
|
||||||
import { stopPropagation } from 'common/util/stopPropagation';
|
|
||||||
import { MaskFillStyle } from 'features/controlLayers/components/common/MaskFillStyle';
|
import { MaskFillStyle } from 'features/controlLayers/components/common/MaskFillStyle';
|
||||||
import { useEntityIdentifierContext } from 'features/controlLayers/contexts/EntityIdentifierContext';
|
import { useEntityIdentifierContext } from 'features/controlLayers/contexts/EntityIdentifierContext';
|
||||||
import { rgFillColorChanged, rgFillStyleChanged } from 'features/controlLayers/store/canvasV2Slice';
|
import { rgFillColorChanged, rgFillStyleChanged } from 'features/controlLayers/store/canvasV2Slice';
|
||||||
@ -37,10 +36,9 @@ export const RegionalGuidanceMaskFillColorPicker = memo(() => {
|
|||||||
borderRadius="full"
|
borderRadius="full"
|
||||||
borderWidth={1}
|
borderWidth={1}
|
||||||
bg={rgbColorToString(fill.color)}
|
bg={rgbColorToString(fill.color)}
|
||||||
w={8}
|
w="22px"
|
||||||
h={8}
|
h="22px"
|
||||||
tabIndex={-1}
|
tabIndex={-1}
|
||||||
onDoubleClick={stopPropagation} // double click expands the layer
|
|
||||||
/>
|
/>
|
||||||
</PopoverTrigger>
|
</PopoverTrigger>
|
||||||
<PopoverContent>
|
<PopoverContent>
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { MenuDivider } from '@invoke-ai/ui-library';
|
import { MenuDivider } from '@invoke-ai/ui-library';
|
||||||
import { CanvasEntityMenuItemsArrange } from 'features/controlLayers/components/common/CanvasEntityMenuItemsArrange';
|
import { CanvasEntityMenuItemsArrange } from 'features/controlLayers/components/common/CanvasEntityMenuItemsArrange';
|
||||||
import { CanvasEntityMenuItemsDelete } from 'features/controlLayers/components/common/CanvasEntityMenuItemsDelete';
|
import { CanvasEntityMenuItemsDelete } from 'features/controlLayers/components/common/CanvasEntityMenuItemsDelete';
|
||||||
import { CanvasEntityMenuItemsReset } from 'features/controlLayers/components/common/CanvasEntityMenuItemsReset';
|
import { CanvasEntityMenuItemsTransform } from 'features/controlLayers/components/common/CanvasEntityMenuItemsTransform';
|
||||||
import { RegionalGuidanceMenuItemsAddPromptsAndIPAdapter } from 'features/controlLayers/components/RegionalGuidance/RegionalGuidanceMenuItemsAddPromptsAndIPAdapter';
|
import { RegionalGuidanceMenuItemsAddPromptsAndIPAdapter } from 'features/controlLayers/components/RegionalGuidance/RegionalGuidanceMenuItemsAddPromptsAndIPAdapter';
|
||||||
|
import { RegionalGuidanceMenuItemsAutoNegative } from 'features/controlLayers/components/RegionalGuidance/RegionalGuidanceMenuItemsAutoNegative';
|
||||||
import { memo } from 'react';
|
import { memo } from 'react';
|
||||||
|
|
||||||
export const RegionalGuidanceMenuItems = memo(() => {
|
export const RegionalGuidanceMenuItems = memo(() => {
|
||||||
@ -10,9 +11,11 @@ export const RegionalGuidanceMenuItems = memo(() => {
|
|||||||
<>
|
<>
|
||||||
<RegionalGuidanceMenuItemsAddPromptsAndIPAdapter />
|
<RegionalGuidanceMenuItemsAddPromptsAndIPAdapter />
|
||||||
<MenuDivider />
|
<MenuDivider />
|
||||||
|
<CanvasEntityMenuItemsTransform />
|
||||||
|
<RegionalGuidanceMenuItemsAutoNegative />
|
||||||
|
<MenuDivider />
|
||||||
<CanvasEntityMenuItemsArrange />
|
<CanvasEntityMenuItemsArrange />
|
||||||
<MenuDivider />
|
<MenuDivider />
|
||||||
<CanvasEntityMenuItemsReset />
|
|
||||||
<CanvasEntityMenuItemsDelete />
|
<CanvasEntityMenuItemsDelete />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
@ -0,0 +1,26 @@
|
|||||||
|
import { MenuItem } from '@invoke-ai/ui-library';
|
||||||
|
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||||
|
import { useEntityIdentifierContext } from 'features/controlLayers/contexts/EntityIdentifierContext';
|
||||||
|
import { rgAutoNegativeToggled } from 'features/controlLayers/store/canvasV2Slice';
|
||||||
|
import { selectRegionalGuidanceEntityOrThrow } from 'features/controlLayers/store/regionsReducers';
|
||||||
|
import { memo, useCallback } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { PiSelectionInverseBold } from 'react-icons/pi';
|
||||||
|
|
||||||
|
export const RegionalGuidanceMenuItemsAutoNegative = memo(() => {
|
||||||
|
const { id } = useEntityIdentifierContext();
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const dispatch = useAppDispatch();
|
||||||
|
const autoNegative = useAppSelector((s) => selectRegionalGuidanceEntityOrThrow(s.canvasV2, id).autoNegative);
|
||||||
|
const onClick = useCallback(() => {
|
||||||
|
dispatch(rgAutoNegativeToggled({ id }));
|
||||||
|
}, [dispatch, id]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<MenuItem icon={<PiSelectionInverseBold />} onClick={onClick}>
|
||||||
|
{autoNegative ? t('controlLayers.disableAutoNegative') : t('controlLayers.enableAutoNegative')}
|
||||||
|
</MenuItem>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
RegionalGuidanceMenuItemsAutoNegative.displayName = 'RegionalGuidanceMenuItemsAutoNegative';
|
@ -1,63 +0,0 @@
|
|||||||
import {
|
|
||||||
Checkbox,
|
|
||||||
Flex,
|
|
||||||
FormControl,
|
|
||||||
FormLabel,
|
|
||||||
IconButton,
|
|
||||||
Popover,
|
|
||||||
PopoverArrow,
|
|
||||||
PopoverBody,
|
|
||||||
PopoverContent,
|
|
||||||
PopoverTrigger,
|
|
||||||
} from '@invoke-ai/ui-library';
|
|
||||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
|
||||||
import { stopPropagation } from 'common/util/stopPropagation';
|
|
||||||
import { useEntityIdentifierContext } from 'features/controlLayers/contexts/EntityIdentifierContext';
|
|
||||||
import { rgAutoNegativeChanged } from 'features/controlLayers/store/canvasV2Slice';
|
|
||||||
import { selectRegionalGuidanceEntityOrThrow } from 'features/controlLayers/store/regionsReducers';
|
|
||||||
import type { ChangeEvent } from 'react';
|
|
||||||
import { memo, useCallback } from 'react';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
|
||||||
import { PiGearSixBold } from 'react-icons/pi';
|
|
||||||
|
|
||||||
export const RegionalGuidanceSettingsPopover = memo(() => {
|
|
||||||
const entityIdentifier = useEntityIdentifierContext();
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const dispatch = useAppDispatch();
|
|
||||||
const autoNegative = useAppSelector((s) => selectRegionalGuidanceEntityOrThrow(s.canvasV2, entityIdentifier.id).autoNegative);
|
|
||||||
const onChange = useCallback(
|
|
||||||
(e: ChangeEvent<HTMLInputElement>) => {
|
|
||||||
dispatch(rgAutoNegativeChanged({ id: entityIdentifier.id, autoNegative: e.target.checked ? 'invert' : 'off' }));
|
|
||||||
},
|
|
||||||
[dispatch, entityIdentifier.id]
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Popover isLazy>
|
|
||||||
<PopoverTrigger>
|
|
||||||
<IconButton
|
|
||||||
tooltip={t('common.settingsLabel')}
|
|
||||||
aria-label={t('common.settingsLabel')}
|
|
||||||
size="sm"
|
|
||||||
icon={<PiGearSixBold />}
|
|
||||||
onDoubleClick={stopPropagation} // double click expands the layer
|
|
||||||
/>
|
|
||||||
</PopoverTrigger>
|
|
||||||
<PopoverContent>
|
|
||||||
<PopoverArrow />
|
|
||||||
<PopoverBody>
|
|
||||||
<Flex direction="column" gap={2}>
|
|
||||||
<FormControl gap={2}>
|
|
||||||
<FormLabel flexGrow={1} minW={32} m={0}>
|
|
||||||
{t('controlLayers.autoNegative')}
|
|
||||||
</FormLabel>
|
|
||||||
<Checkbox size="md" isChecked={autoNegative === 'invert'} onChange={onChange} />
|
|
||||||
</FormControl>
|
|
||||||
</Flex>
|
|
||||||
</PopoverBody>
|
|
||||||
</PopoverContent>
|
|
||||||
</Popover>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
RegionalGuidanceSettingsPopover.displayName = 'RegionalGuidanceSettingsPopover';
|
|
@ -18,7 +18,7 @@ export const BeginEndStepPct = memo(({ beginEndStepPct, onChange }: Props) => {
|
|||||||
}, [onChange]);
|
}, [onChange]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FormControl orientation="horizontal">
|
<FormControl orientation="horizontal" pe={1}>
|
||||||
<InformationalPopover feature="controlNetBeginEnd">
|
<InformationalPopover feature="controlNetBeginEnd">
|
||||||
<FormLabel m={0}>{t('controlnet.beginEndStepPercentShort')}</FormLabel>
|
<FormLabel m={0}>{t('controlnet.beginEndStepPercentShort')}</FormLabel>
|
||||||
</InformationalPopover>
|
</InformationalPopover>
|
||||||
|
@ -26,7 +26,6 @@ export const CanvasEntityEnabledToggle = memo(() => {
|
|||||||
variant="outline"
|
variant="outline"
|
||||||
icon={isEnabled ? <PiCheckBold /> : undefined}
|
icon={isEnabled ? <PiCheckBold /> : undefined}
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
colorScheme={isEnabled ? 'invokeBlue' : 'base'}
|
|
||||||
onDoubleClick={stopPropagation} // double click expands the layer
|
onDoubleClick={stopPropagation} // double click expands the layer
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
@ -2,6 +2,7 @@ import type { FlexProps } from '@invoke-ai/ui-library';
|
|||||||
import { ContextMenu, Flex, MenuList } from '@invoke-ai/ui-library';
|
import { ContextMenu, Flex, MenuList } from '@invoke-ai/ui-library';
|
||||||
import { ControlLayerMenuItems } from 'features/controlLayers/components/ControlLayer/ControlLayerMenuItems';
|
import { ControlLayerMenuItems } from 'features/controlLayers/components/ControlLayer/ControlLayerMenuItems';
|
||||||
import { InpaintMaskMenuItems } from 'features/controlLayers/components/InpaintMask/InpaintMaskMenuItems';
|
import { InpaintMaskMenuItems } from 'features/controlLayers/components/InpaintMask/InpaintMaskMenuItems';
|
||||||
|
import { IPAdapterMenuItems } from 'features/controlLayers/components/IPAdapter/IPAdapterMenuItems';
|
||||||
import { RasterLayerMenuItems } from 'features/controlLayers/components/RasterLayer/RasterLayerMenuItems';
|
import { RasterLayerMenuItems } from 'features/controlLayers/components/RasterLayer/RasterLayerMenuItems';
|
||||||
import { RegionalGuidanceMenuItems } from 'features/controlLayers/components/RegionalGuidance/RegionalGuidanceMenuItems';
|
import { RegionalGuidanceMenuItems } from 'features/controlLayers/components/RegionalGuidance/RegionalGuidanceMenuItems';
|
||||||
import { useEntityIdentifierContext } from 'features/controlLayers/contexts/EntityIdentifierContext';
|
import { useEntityIdentifierContext } from 'features/controlLayers/contexts/EntityIdentifierContext';
|
||||||
@ -44,7 +45,11 @@ export const CanvasEntityHeader = memo(({ children, ...rest }: FlexProps) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (entityIdentifier.type === 'ip_adapter') {
|
if (entityIdentifier.type === 'ip_adapter') {
|
||||||
return <MenuList>{/* no items for IP adapter yet */}</MenuList>;
|
return (
|
||||||
|
<MenuList>
|
||||||
|
<IPAdapterMenuItems />
|
||||||
|
</MenuList>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(false, 'Unhandled entity type');
|
assert(false, 'Unhandled entity type');
|
||||||
@ -53,7 +58,7 @@ export const CanvasEntityHeader = memo(({ children, ...rest }: FlexProps) => {
|
|||||||
return (
|
return (
|
||||||
<ContextMenu renderMenu={renderMenu}>
|
<ContextMenu renderMenu={renderMenu}>
|
||||||
{(ref) => (
|
{(ref) => (
|
||||||
<Flex ref={ref} h={16} gap={2} alignItems="center" p={2} {...rest}>
|
<Flex ref={ref} gap={2} alignItems="center" p={2} {...rest}>
|
||||||
{children}
|
{children}
|
||||||
</Flex>
|
</Flex>
|
||||||
)}
|
)}
|
||||||
|
@ -33,6 +33,16 @@ const getIndexAndCount = (
|
|||||||
index: canvasV2.regions.entities.findIndex((entity) => entity.id === id),
|
index: canvasV2.regions.entities.findIndex((entity) => entity.id === id),
|
||||||
count: canvasV2.regions.entities.length,
|
count: canvasV2.regions.entities.length,
|
||||||
};
|
};
|
||||||
|
} else if (type === 'inpaint_mask') {
|
||||||
|
return {
|
||||||
|
index: canvasV2.inpaintMasks.entities.findIndex((entity) => entity.id === id),
|
||||||
|
count: canvasV2.inpaintMasks.entities.length,
|
||||||
|
};
|
||||||
|
} else if (type === 'ip_adapter') {
|
||||||
|
return {
|
||||||
|
index: canvasV2.ipAdapters.entities.findIndex((entity) => entity.id === id),
|
||||||
|
count: canvasV2.ipAdapters.entities.length,
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
index: -1,
|
index: -1,
|
||||||
|
@ -4,7 +4,7 @@ import { memo } from 'react';
|
|||||||
|
|
||||||
export const CanvasEntitySettingsWrapper = memo(({ children }: PropsWithChildren) => {
|
export const CanvasEntitySettingsWrapper = memo(({ children }: PropsWithChildren) => {
|
||||||
return (
|
return (
|
||||||
<Flex flexDir="column" gap={3} px={3} pb={3}>
|
<Flex flexDir="column" gap={2} px={2} pb={2}>
|
||||||
{children}
|
{children}
|
||||||
</Flex>
|
</Flex>
|
||||||
);
|
);
|
||||||
|
@ -341,15 +341,7 @@ export const canvasV2Slice = createSlice({
|
|||||||
if (!entity) {
|
if (!entity) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (entity.type === 'raster_layer') {
|
moveOneToEnd(selectAllEntitiesOfType(state, entity.type), entity);
|
||||||
moveOneToEnd(state.rasterLayers.entities, entity);
|
|
||||||
} else if (entity.type === 'control_layer') {
|
|
||||||
moveOneToEnd(state.controlLayers.entities, entity);
|
|
||||||
} else if (entity.type === 'regional_guidance') {
|
|
||||||
moveOneToEnd(state.regions.entities, entity);
|
|
||||||
} else if (entity.type === 'inpaint_mask') {
|
|
||||||
moveOneToEnd(state.inpaintMasks.entities, entity);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
entityArrangedToFront: (state, action: PayloadAction<EntityIdentifierPayload>) => {
|
entityArrangedToFront: (state, action: PayloadAction<EntityIdentifierPayload>) => {
|
||||||
const { entityIdentifier } = action.payload;
|
const { entityIdentifier } = action.payload;
|
||||||
@ -357,15 +349,7 @@ export const canvasV2Slice = createSlice({
|
|||||||
if (!entity) {
|
if (!entity) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (entity.type === 'raster_layer') {
|
moveToEnd(selectAllEntitiesOfType(state, entity.type), entity);
|
||||||
moveToEnd(state.rasterLayers.entities, entity);
|
|
||||||
} else if (entity.type === 'control_layer') {
|
|
||||||
moveToEnd(state.controlLayers.entities, entity);
|
|
||||||
} else if (entity.type === 'regional_guidance') {
|
|
||||||
moveToEnd(state.regions.entities, entity);
|
|
||||||
} else if (entity.type === 'inpaint_mask') {
|
|
||||||
moveToEnd(state.inpaintMasks.entities, entity);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
entityArrangedBackwardOne: (state, action: PayloadAction<EntityIdentifierPayload>) => {
|
entityArrangedBackwardOne: (state, action: PayloadAction<EntityIdentifierPayload>) => {
|
||||||
const { entityIdentifier } = action.payload;
|
const { entityIdentifier } = action.payload;
|
||||||
@ -373,15 +357,7 @@ export const canvasV2Slice = createSlice({
|
|||||||
if (!entity) {
|
if (!entity) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (entity.type === 'raster_layer') {
|
moveOneToStart(selectAllEntitiesOfType(state, entity.type), entity);
|
||||||
moveOneToStart(state.rasterLayers.entities, entity);
|
|
||||||
} else if (entity.type === 'control_layer') {
|
|
||||||
moveOneToStart(state.controlLayers.entities, entity);
|
|
||||||
} else if (entity.type === 'regional_guidance') {
|
|
||||||
moveOneToStart(state.regions.entities, entity);
|
|
||||||
} else if (entity.type === 'inpaint_mask') {
|
|
||||||
moveOneToStart(state.inpaintMasks.entities, entity);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
entityArrangedToBack: (state, action: PayloadAction<EntityIdentifierPayload>) => {
|
entityArrangedToBack: (state, action: PayloadAction<EntityIdentifierPayload>) => {
|
||||||
const { entityIdentifier } = action.payload;
|
const { entityIdentifier } = action.payload;
|
||||||
@ -389,15 +365,7 @@ export const canvasV2Slice = createSlice({
|
|||||||
if (!entity) {
|
if (!entity) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (entity.type === 'raster_layer') {
|
moveToStart(selectAllEntitiesOfType(state, entity.type), entity);
|
||||||
moveToStart(state.rasterLayers.entities, entity);
|
|
||||||
} else if (entity.type === 'control_layer') {
|
|
||||||
moveToStart(state.controlLayers.entities, entity);
|
|
||||||
} else if (entity.type === 'regional_guidance') {
|
|
||||||
moveToStart(state.regions.entities, entity);
|
|
||||||
} else if (entity.type === 'inpaint_mask') {
|
|
||||||
moveToStart(state.inpaintMasks.entities, entity);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
entityOpacityChanged: (state, action: PayloadAction<EntityIdentifierPayload<{ opacity: number }>>) => {
|
entityOpacityChanged: (state, action: PayloadAction<EntityIdentifierPayload<{ opacity: number }>>) => {
|
||||||
const { entityIdentifier, opacity } = action.payload;
|
const { entityIdentifier, opacity } = action.payload;
|
||||||
@ -538,7 +506,7 @@ export const {
|
|||||||
rgNegativePromptChanged,
|
rgNegativePromptChanged,
|
||||||
rgFillColorChanged,
|
rgFillColorChanged,
|
||||||
rgFillStyleChanged,
|
rgFillStyleChanged,
|
||||||
rgAutoNegativeChanged,
|
rgAutoNegativeToggled,
|
||||||
rgIPAdapterAdded,
|
rgIPAdapterAdded,
|
||||||
rgIPAdapterDeleted,
|
rgIPAdapterDeleted,
|
||||||
rgIPAdapterImageChanged,
|
rgIPAdapterImageChanged,
|
||||||
|
@ -10,7 +10,6 @@ import type {
|
|||||||
} from 'features/controlLayers/store/types';
|
} from 'features/controlLayers/store/types';
|
||||||
import { imageDTOToImageWithDims } from 'features/controlLayers/store/types';
|
import { imageDTOToImageWithDims } from 'features/controlLayers/store/types';
|
||||||
import { zModelIdentifierField } from 'features/nodes/types/common';
|
import { zModelIdentifierField } from 'features/nodes/types/common';
|
||||||
import type { ParameterAutoNegative } from 'features/parameters/types/parameterSchemas';
|
|
||||||
import { isEqual } from 'lodash-es';
|
import { isEqual } from 'lodash-es';
|
||||||
import type { ImageDTO, IPAdapterModelConfig } from 'services/api/types';
|
import type { ImageDTO, IPAdapterModelConfig } from 'services/api/types';
|
||||||
import { assert } from 'tsafe';
|
import { assert } from 'tsafe';
|
||||||
@ -71,7 +70,7 @@ export const regionsReducers = {
|
|||||||
},
|
},
|
||||||
opacity: 0.5,
|
opacity: 0.5,
|
||||||
position: { x: 0, y: 0 },
|
position: { x: 0, y: 0 },
|
||||||
autoNegative: 'invert',
|
autoNegative: true,
|
||||||
positivePrompt: '',
|
positivePrompt: '',
|
||||||
negativePrompt: null,
|
negativePrompt: null,
|
||||||
ipAdapters: [],
|
ipAdapters: [],
|
||||||
@ -122,13 +121,13 @@ export const regionsReducers = {
|
|||||||
entity.fill.style = style;
|
entity.fill.style = style;
|
||||||
},
|
},
|
||||||
|
|
||||||
rgAutoNegativeChanged: (state, action: PayloadAction<{ id: string; autoNegative: ParameterAutoNegative }>) => {
|
rgAutoNegativeToggled: (state, action: PayloadAction<{ id: string }>) => {
|
||||||
const { id, autoNegative } = action.payload;
|
const { id } = action.payload;
|
||||||
const rg = selectRegionalGuidanceEntity(state, id);
|
const rg = selectRegionalGuidanceEntity(state, id);
|
||||||
if (!rg) {
|
if (!rg) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
rg.autoNegative = autoNegative;
|
rg.autoNegative = !rg.autoNegative;
|
||||||
},
|
},
|
||||||
rgIPAdapterAdded: (state, action: PayloadAction<{ id: string; ipAdapter: RegionalGuidanceIPAdapterConfig }>) => {
|
rgIPAdapterAdded: (state, action: PayloadAction<{ id: string; ipAdapter: RegionalGuidanceIPAdapterConfig }>) => {
|
||||||
const { id, ipAdapter } = action.payload;
|
const { id, ipAdapter } = action.payload;
|
||||||
|
@ -26,7 +26,6 @@ import type {
|
|||||||
ParameterWidth,
|
ParameterWidth,
|
||||||
} from 'features/parameters/types/parameterSchemas';
|
} from 'features/parameters/types/parameterSchemas';
|
||||||
import {
|
import {
|
||||||
zAutoNegative,
|
|
||||||
zParameterNegativePrompt,
|
zParameterNegativePrompt,
|
||||||
zParameterPositivePrompt,
|
zParameterPositivePrompt,
|
||||||
} from 'features/parameters/types/parameterSchemas';
|
} from 'features/parameters/types/parameterSchemas';
|
||||||
@ -671,7 +670,7 @@ export const zCanvasRegionalGuidanceState = z.object({
|
|||||||
positivePrompt: zParameterPositivePrompt.nullable(),
|
positivePrompt: zParameterPositivePrompt.nullable(),
|
||||||
negativePrompt: zParameterNegativePrompt.nullable(),
|
negativePrompt: zParameterNegativePrompt.nullable(),
|
||||||
ipAdapters: z.array(zRegionalGuidanceIPAdapterConfig),
|
ipAdapters: z.array(zRegionalGuidanceIPAdapterConfig),
|
||||||
autoNegative: zAutoNegative,
|
autoNegative: z.boolean(),
|
||||||
});
|
});
|
||||||
export type CanvasRegionalGuidanceState = z.infer<typeof zCanvasRegionalGuidanceState>;
|
export type CanvasRegionalGuidanceState = z.infer<typeof zCanvasRegionalGuidanceState>;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user