mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
tidy(ui): isRegionalPromptLayer
-> isRPLayer
This commit is contained in:
parent
eb781272f7
commit
9b5c47748d
@ -11,7 +11,7 @@ import {
|
|||||||
PROMPT_REGION_POSITIVE_COND_INVERTED_PREFIX,
|
PROMPT_REGION_POSITIVE_COND_INVERTED_PREFIX,
|
||||||
PROMPT_REGION_POSITIVE_COND_PREFIX,
|
PROMPT_REGION_POSITIVE_COND_PREFIX,
|
||||||
} from 'features/nodes/util/graph/constants';
|
} from 'features/nodes/util/graph/constants';
|
||||||
import { isRegionalPromptLayer } from 'features/regionalPrompts/store/regionalPromptsSlice';
|
import { isRPLayer } from 'features/regionalPrompts/store/regionalPromptsSlice';
|
||||||
import { getRegionalPromptLayerBlobs } from 'features/regionalPrompts/util/getLayerBlobs';
|
import { getRegionalPromptLayerBlobs } from 'features/regionalPrompts/util/getLayerBlobs';
|
||||||
import { size } from 'lodash-es';
|
import { size } from 'lodash-es';
|
||||||
import { imagesApi } from 'services/api/endpoints/images';
|
import { imagesApi } from 'services/api/endpoints/images';
|
||||||
@ -23,7 +23,7 @@ export const addRegionalPromptsToGraph = async (state: RootState, graph: NonNull
|
|||||||
// TODO: Handle non-SDXL
|
// TODO: Handle non-SDXL
|
||||||
// const isSDXL = state.generation.model?.base === 'sdxl';
|
// const isSDXL = state.generation.model?.base === 'sdxl';
|
||||||
const layers = state.regionalPrompts.present.layers
|
const layers = state.regionalPrompts.present.layers
|
||||||
.filter(isRegionalPromptLayer) // We only want the prompt region layers
|
.filter(isRPLayer) // We only want the prompt region layers
|
||||||
.filter((l) => l.isVisible) // Only visible layers are rendered on the canvas
|
.filter((l) => l.isVisible) // Only visible layers are rendered on the canvas
|
||||||
.filter((l) => l.negativePrompt || l.positivePrompt); // Only layers with prompts get added to the graph
|
.filter((l) => l.negativePrompt || l.positivePrompt); // Only layers with prompts get added to the graph
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import { createSelector } from '@reduxjs/toolkit';
|
|||||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||||
import { isParameterAutoNegative } from 'features/parameters/types/parameterSchemas';
|
import { isParameterAutoNegative } from 'features/parameters/types/parameterSchemas';
|
||||||
import {
|
import {
|
||||||
isRegionalPromptLayer,
|
isRPLayer,
|
||||||
rpLayerAutoNegativeChanged,
|
rpLayerAutoNegativeChanged,
|
||||||
selectRegionalPromptsSlice,
|
selectRegionalPromptsSlice,
|
||||||
} from 'features/regionalPrompts/store/regionalPromptsSlice';
|
} from 'features/regionalPrompts/store/regionalPromptsSlice';
|
||||||
@ -26,7 +26,7 @@ const useAutoNegative = (layerId: string) => {
|
|||||||
() =>
|
() =>
|
||||||
createSelector(selectRegionalPromptsSlice, (regionalPrompts) => {
|
createSelector(selectRegionalPromptsSlice, (regionalPrompts) => {
|
||||||
const layer = regionalPrompts.present.layers.find((l) => l.id === layerId);
|
const layer = regionalPrompts.present.layers.find((l) => l.id === layerId);
|
||||||
assert(isRegionalPromptLayer(layer), `Layer ${layerId} not found or not an RP layer`);
|
assert(isRPLayer(layer), `Layer ${layerId} not found or not an RP layer`);
|
||||||
return layer.autoNegative;
|
return layer.autoNegative;
|
||||||
}),
|
}),
|
||||||
[layerId]
|
[layerId]
|
||||||
|
@ -3,7 +3,7 @@ import { createMemoizedSelector } from 'app/store/createMemoizedSelector';
|
|||||||
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 {
|
import {
|
||||||
isRegionalPromptLayer,
|
isRPLayer,
|
||||||
rpLayerColorChanged,
|
rpLayerColorChanged,
|
||||||
selectRegionalPromptsSlice,
|
selectRegionalPromptsSlice,
|
||||||
} from 'features/regionalPrompts/store/regionalPromptsSlice';
|
} from 'features/regionalPrompts/store/regionalPromptsSlice';
|
||||||
@ -21,7 +21,7 @@ export const RPLayerColorPicker = memo(({ layerId }: Props) => {
|
|||||||
() =>
|
() =>
|
||||||
createMemoizedSelector(selectRegionalPromptsSlice, (regionalPrompts) => {
|
createMemoizedSelector(selectRegionalPromptsSlice, (regionalPrompts) => {
|
||||||
const layer = regionalPrompts.present.layers.find((l) => l.id === layerId);
|
const layer = regionalPrompts.present.layers.find((l) => l.id === layerId);
|
||||||
assert(isRegionalPromptLayer(layer), `Layer ${layerId} not found or not an RP layer`);
|
assert(isRPLayer(layer), `Layer ${layerId} not found or not an RP layer`);
|
||||||
return layer.color;
|
return layer.color;
|
||||||
}),
|
}),
|
||||||
[layerId]
|
[layerId]
|
||||||
|
@ -7,7 +7,7 @@ import { RPLayerMenu } from 'features/regionalPrompts/components/RPLayerMenu';
|
|||||||
import { RPLayerNegativePrompt } from 'features/regionalPrompts/components/RPLayerNegativePrompt';
|
import { RPLayerNegativePrompt } from 'features/regionalPrompts/components/RPLayerNegativePrompt';
|
||||||
import { RPLayerPositivePrompt } from 'features/regionalPrompts/components/RPLayerPositivePrompt';
|
import { RPLayerPositivePrompt } from 'features/regionalPrompts/components/RPLayerPositivePrompt';
|
||||||
import { RPLayerVisibilityToggle } from 'features/regionalPrompts/components/RPLayerVisibilityToggle';
|
import { RPLayerVisibilityToggle } from 'features/regionalPrompts/components/RPLayerVisibilityToggle';
|
||||||
import { isRegionalPromptLayer, rpLayerSelected } from 'features/regionalPrompts/store/regionalPromptsSlice';
|
import { isRPLayer, rpLayerSelected } from 'features/regionalPrompts/store/regionalPromptsSlice';
|
||||||
import { memo, useCallback } from 'react';
|
import { memo, useCallback } from 'react';
|
||||||
import { assert } from 'tsafe';
|
import { assert } from 'tsafe';
|
||||||
|
|
||||||
@ -20,7 +20,7 @@ export const RPLayerListItem = memo(({ layerId }: Props) => {
|
|||||||
const selectedLayer = useAppSelector((s) => s.regionalPrompts.present.selectedLayer);
|
const selectedLayer = useAppSelector((s) => s.regionalPrompts.present.selectedLayer);
|
||||||
const color = useAppSelector((s) => {
|
const color = useAppSelector((s) => {
|
||||||
const layer = s.regionalPrompts.present.layers.find((l) => l.id === layerId);
|
const layer = s.regionalPrompts.present.layers.find((l) => l.id === layerId);
|
||||||
assert(isRegionalPromptLayer(layer), `Layer ${layerId} not found or not an RP layer`);
|
assert(isRPLayer(layer), `Layer ${layerId} not found or not an RP layer`);
|
||||||
return rgbaColorToString({ ...layer.color, a: selectedLayer === layerId ? 1 : 0.35 });
|
return rgbaColorToString({ ...layer.color, a: selectedLayer === layerId ? 1 : 0.35 });
|
||||||
});
|
});
|
||||||
const onClickCapture = useCallback(() => {
|
const onClickCapture = useCallback(() => {
|
||||||
|
@ -2,7 +2,7 @@ import { IconButton, Menu, MenuButton, MenuDivider, MenuItem, MenuList } from '@
|
|||||||
import { createMemoizedSelector } from 'app/store/createMemoizedSelector';
|
import { createMemoizedSelector } from 'app/store/createMemoizedSelector';
|
||||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||||
import {
|
import {
|
||||||
isRegionalPromptLayer,
|
isRPLayer,
|
||||||
layerDeleted,
|
layerDeleted,
|
||||||
layerMovedBackward,
|
layerMovedBackward,
|
||||||
layerMovedForward,
|
layerMovedForward,
|
||||||
@ -33,7 +33,7 @@ export const RPLayerMenu = memo(({ layerId }: Props) => {
|
|||||||
() =>
|
() =>
|
||||||
createMemoizedSelector(selectRegionalPromptsSlice, (regionalPrompts) => {
|
createMemoizedSelector(selectRegionalPromptsSlice, (regionalPrompts) => {
|
||||||
const layer = regionalPrompts.present.layers.find((l) => l.id === layerId);
|
const layer = regionalPrompts.present.layers.find((l) => l.id === layerId);
|
||||||
assert(isRegionalPromptLayer(layer), `Layer ${layerId} not found or not an RP layer`);
|
assert(isRPLayer(layer), `Layer ${layerId} not found or not an RP layer`);
|
||||||
const layerIndex = regionalPrompts.present.layers.findIndex((l) => l.id === layerId);
|
const layerIndex = regionalPrompts.present.layers.findIndex((l) => l.id === layerId);
|
||||||
const layerCount = regionalPrompts.present.layers.length;
|
const layerCount = regionalPrompts.present.layers.length;
|
||||||
return {
|
return {
|
||||||
|
@ -10,13 +10,13 @@ import { RPLayerListItem } from 'features/regionalPrompts/components/RPLayerList
|
|||||||
import { StageComponent } from 'features/regionalPrompts/components/StageComponent';
|
import { StageComponent } from 'features/regionalPrompts/components/StageComponent';
|
||||||
import { ToolChooser } from 'features/regionalPrompts/components/ToolChooser';
|
import { ToolChooser } from 'features/regionalPrompts/components/ToolChooser';
|
||||||
import { UndoRedoButtonGroup } from 'features/regionalPrompts/components/UndoRedoButtonGroup';
|
import { UndoRedoButtonGroup } from 'features/regionalPrompts/components/UndoRedoButtonGroup';
|
||||||
import { isRegionalPromptLayer, selectRegionalPromptsSlice } from 'features/regionalPrompts/store/regionalPromptsSlice';
|
import { isRPLayer, selectRegionalPromptsSlice } from 'features/regionalPrompts/store/regionalPromptsSlice';
|
||||||
import { getRegionalPromptLayerBlobs } from 'features/regionalPrompts/util/getLayerBlobs';
|
import { getRegionalPromptLayerBlobs } from 'features/regionalPrompts/util/getLayerBlobs';
|
||||||
import { memo } from 'react';
|
import { memo } from 'react';
|
||||||
|
|
||||||
const selectRPLayerIdsReversed = createMemoizedSelector(selectRegionalPromptsSlice, (regionalPrompts) =>
|
const selectRPLayerIdsReversed = createMemoizedSelector(selectRegionalPromptsSlice, (regionalPrompts) =>
|
||||||
regionalPrompts.present.layers
|
regionalPrompts.present.layers
|
||||||
.filter(isRegionalPromptLayer)
|
.filter(isRPLayer)
|
||||||
.map((l) => l.id)
|
.map((l) => l.id)
|
||||||
.reverse()
|
.reverse()
|
||||||
);
|
);
|
||||||
|
@ -6,7 +6,7 @@ import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
|||||||
import { useMouseEvents } from 'features/regionalPrompts/hooks/mouseEventHooks';
|
import { useMouseEvents } from 'features/regionalPrompts/hooks/mouseEventHooks';
|
||||||
import {
|
import {
|
||||||
$cursorPosition,
|
$cursorPosition,
|
||||||
isRegionalPromptLayer,
|
isRPLayer,
|
||||||
rpLayerBboxChanged,
|
rpLayerBboxChanged,
|
||||||
rpLayerTranslated,
|
rpLayerTranslated,
|
||||||
selectRegionalPromptsSlice,
|
selectRegionalPromptsSlice,
|
||||||
@ -25,7 +25,7 @@ const selectSelectedLayerColor = createMemoizedSelector(selectRegionalPromptsSli
|
|||||||
if (!layer) {
|
if (!layer) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
assert(isRegionalPromptLayer(layer), `Layer ${regionalPrompts.present.selectedLayer} is not an RP layer`);
|
assert(isRPLayer(layer), `Layer ${regionalPrompts.present.selectedLayer} is not an RP layer`);
|
||||||
return layer.color;
|
return layer.color;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { createSelector } from '@reduxjs/toolkit';
|
import { createSelector } from '@reduxjs/toolkit';
|
||||||
import { useAppSelector } from 'app/store/storeHooks';
|
import { useAppSelector } from 'app/store/storeHooks';
|
||||||
import { isRegionalPromptLayer, selectRegionalPromptsSlice } from 'features/regionalPrompts/store/regionalPromptsSlice';
|
import { isRPLayer, selectRegionalPromptsSlice } from 'features/regionalPrompts/store/regionalPromptsSlice';
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import { assert } from 'tsafe';
|
import { assert } from 'tsafe';
|
||||||
|
|
||||||
@ -9,7 +9,7 @@ export const useLayerPositivePrompt = (layerId: string) => {
|
|||||||
() =>
|
() =>
|
||||||
createSelector(selectRegionalPromptsSlice, (regionalPrompts) => {
|
createSelector(selectRegionalPromptsSlice, (regionalPrompts) => {
|
||||||
const layer = regionalPrompts.present.layers.find((l) => l.id === layerId);
|
const layer = regionalPrompts.present.layers.find((l) => l.id === layerId);
|
||||||
assert(isRegionalPromptLayer(layer), `Layer ${layerId} not found or not an RP layer`);
|
assert(isRPLayer(layer), `Layer ${layerId} not found or not an RP layer`);
|
||||||
return layer.positivePrompt;
|
return layer.positivePrompt;
|
||||||
}),
|
}),
|
||||||
[layerId]
|
[layerId]
|
||||||
@ -23,7 +23,7 @@ export const useLayerNegativePrompt = (layerId: string) => {
|
|||||||
() =>
|
() =>
|
||||||
createSelector(selectRegionalPromptsSlice, (regionalPrompts) => {
|
createSelector(selectRegionalPromptsSlice, (regionalPrompts) => {
|
||||||
const layer = regionalPrompts.present.layers.find((l) => l.id === layerId);
|
const layer = regionalPrompts.present.layers.find((l) => l.id === layerId);
|
||||||
assert(isRegionalPromptLayer(layer), `Layer ${layerId} not found or not an RP layer`);
|
assert(isRPLayer(layer), `Layer ${layerId} not found or not an RP layer`);
|
||||||
return layer.negativePrompt;
|
return layer.negativePrompt;
|
||||||
}),
|
}),
|
||||||
[layerId]
|
[layerId]
|
||||||
@ -37,7 +37,7 @@ export const useLayerIsVisible = (layerId: string) => {
|
|||||||
() =>
|
() =>
|
||||||
createSelector(selectRegionalPromptsSlice, (regionalPrompts) => {
|
createSelector(selectRegionalPromptsSlice, (regionalPrompts) => {
|
||||||
const layer = regionalPrompts.present.layers.find((l) => l.id === layerId);
|
const layer = regionalPrompts.present.layers.find((l) => l.id === layerId);
|
||||||
assert(isRegionalPromptLayer(layer), `Layer ${layerId} not found or not an RP layer`);
|
assert(isRPLayer(layer), `Layer ${layerId} not found or not an RP layer`);
|
||||||
return layer.isVisible;
|
return layer.isVisible;
|
||||||
}),
|
}),
|
||||||
[layerId]
|
[layerId]
|
||||||
|
@ -80,7 +80,7 @@ export const initialRegionalPromptsState: RegionalPromptsState = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const isLine = (obj: LayerObject): obj is LineObject => obj.kind === 'line';
|
const isLine = (obj: LayerObject): obj is LineObject => obj.kind === 'line';
|
||||||
export const isRegionalPromptLayer = (layer?: Layer): layer is RegionalPromptLayer =>
|
export const isRPLayer = (layer?: Layer): layer is RegionalPromptLayer =>
|
||||||
layer?.kind === 'regionalPromptLayer';
|
layer?.kind === 'regionalPromptLayer';
|
||||||
|
|
||||||
export const regionalPromptsSlice = createSlice({
|
export const regionalPromptsSlice = createSlice({
|
||||||
@ -137,19 +137,19 @@ export const regionalPromptsSlice = createSlice({
|
|||||||
//#region RP Layers
|
//#region RP Layers
|
||||||
rpLayerSelected: (state, action: PayloadAction<string>) => {
|
rpLayerSelected: (state, action: PayloadAction<string>) => {
|
||||||
const layer = state.layers.find((l) => l.id === action.payload);
|
const layer = state.layers.find((l) => l.id === action.payload);
|
||||||
if (isRegionalPromptLayer(layer)) {
|
if (isRPLayer(layer)) {
|
||||||
state.selectedLayer = layer.id;
|
state.selectedLayer = layer.id;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
rpLayerIsVisibleToggled: (state, action: PayloadAction<string>) => {
|
rpLayerIsVisibleToggled: (state, action: PayloadAction<string>) => {
|
||||||
const layer = state.layers.find((l) => l.id === action.payload);
|
const layer = state.layers.find((l) => l.id === action.payload);
|
||||||
if (isRegionalPromptLayer(layer)) {
|
if (isRPLayer(layer)) {
|
||||||
layer.isVisible = !layer.isVisible;
|
layer.isVisible = !layer.isVisible;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
rpLayerReset: (state, action: PayloadAction<string>) => {
|
rpLayerReset: (state, action: PayloadAction<string>) => {
|
||||||
const layer = state.layers.find((l) => l.id === action.payload);
|
const layer = state.layers.find((l) => l.id === action.payload);
|
||||||
if (isRegionalPromptLayer(layer)) {
|
if (isRPLayer(layer)) {
|
||||||
layer.objects = [];
|
layer.objects = [];
|
||||||
layer.bbox = null;
|
layer.bbox = null;
|
||||||
layer.isVisible = true;
|
layer.isVisible = true;
|
||||||
@ -158,7 +158,7 @@ export const regionalPromptsSlice = createSlice({
|
|||||||
rpLayerTranslated: (state, action: PayloadAction<{ layerId: string; x: number; y: number }>) => {
|
rpLayerTranslated: (state, action: PayloadAction<{ layerId: string; x: number; y: number }>) => {
|
||||||
const { layerId, x, y } = action.payload;
|
const { layerId, x, y } = action.payload;
|
||||||
const layer = state.layers.find((l) => l.id === layerId);
|
const layer = state.layers.find((l) => l.id === layerId);
|
||||||
if (isRegionalPromptLayer(layer)) {
|
if (isRPLayer(layer)) {
|
||||||
layer.x = x;
|
layer.x = x;
|
||||||
layer.y = y;
|
layer.y = y;
|
||||||
}
|
}
|
||||||
@ -166,7 +166,7 @@ export const regionalPromptsSlice = createSlice({
|
|||||||
rpLayerBboxChanged: (state, action: PayloadAction<{ layerId: string; bbox: IRect | null }>) => {
|
rpLayerBboxChanged: (state, action: PayloadAction<{ layerId: string; bbox: IRect | null }>) => {
|
||||||
const { layerId, bbox } = action.payload;
|
const { layerId, bbox } = action.payload;
|
||||||
const layer = state.layers.find((l) => l.id === layerId);
|
const layer = state.layers.find((l) => l.id === layerId);
|
||||||
if (isRegionalPromptLayer(layer)) {
|
if (isRPLayer(layer)) {
|
||||||
layer.bbox = bbox;
|
layer.bbox = bbox;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -177,28 +177,28 @@ export const regionalPromptsSlice = createSlice({
|
|||||||
rpLayerPositivePromptChanged: (state, action: PayloadAction<{ layerId: string; prompt: string }>) => {
|
rpLayerPositivePromptChanged: (state, action: PayloadAction<{ layerId: string; prompt: string }>) => {
|
||||||
const { layerId, prompt } = action.payload;
|
const { layerId, prompt } = action.payload;
|
||||||
const layer = state.layers.find((l) => l.id === layerId);
|
const layer = state.layers.find((l) => l.id === layerId);
|
||||||
if (isRegionalPromptLayer(layer)) {
|
if (isRPLayer(layer)) {
|
||||||
layer.positivePrompt = prompt;
|
layer.positivePrompt = prompt;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
rpLayerNegativePromptChanged: (state, action: PayloadAction<{ layerId: string; prompt: string }>) => {
|
rpLayerNegativePromptChanged: (state, action: PayloadAction<{ layerId: string; prompt: string }>) => {
|
||||||
const { layerId, prompt } = action.payload;
|
const { layerId, prompt } = action.payload;
|
||||||
const layer = state.layers.find((l) => l.id === layerId);
|
const layer = state.layers.find((l) => l.id === layerId);
|
||||||
if (isRegionalPromptLayer(layer)) {
|
if (isRPLayer(layer)) {
|
||||||
layer.negativePrompt = prompt;
|
layer.negativePrompt = prompt;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
rpLayerColorChanged: (state, action: PayloadAction<{ layerId: string; color: RgbColor }>) => {
|
rpLayerColorChanged: (state, action: PayloadAction<{ layerId: string; color: RgbColor }>) => {
|
||||||
const { layerId, color } = action.payload;
|
const { layerId, color } = action.payload;
|
||||||
const layer = state.layers.find((l) => l.id === layerId);
|
const layer = state.layers.find((l) => l.id === layerId);
|
||||||
if (isRegionalPromptLayer(layer)) {
|
if (isRPLayer(layer)) {
|
||||||
layer.color = color;
|
layer.color = color;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
rpLayerLineAdded: {
|
rpLayerLineAdded: {
|
||||||
reducer: (state, action: PayloadAction<[number, number, number, number], string, { uuid: string }>) => {
|
reducer: (state, action: PayloadAction<[number, number, number, number], string, { uuid: string }>) => {
|
||||||
const layer = state.layers.find((l) => l.id === state.selectedLayer);
|
const layer = state.layers.find((l) => l.id === state.selectedLayer);
|
||||||
if (isRegionalPromptLayer(layer)) {
|
if (isRPLayer(layer)) {
|
||||||
const lineId = getRPLayerLineId(layer.id, action.meta.uuid);
|
const lineId = getRPLayerLineId(layer.id, action.meta.uuid);
|
||||||
layer.objects.push({
|
layer.objects.push({
|
||||||
kind: 'line',
|
kind: 'line',
|
||||||
@ -218,7 +218,7 @@ export const regionalPromptsSlice = createSlice({
|
|||||||
},
|
},
|
||||||
rpLayerPointsAdded: (state, action: PayloadAction<[number, number]>) => {
|
rpLayerPointsAdded: (state, action: PayloadAction<[number, number]>) => {
|
||||||
const layer = state.layers.find((l) => l.id === state.selectedLayer);
|
const layer = state.layers.find((l) => l.id === state.selectedLayer);
|
||||||
if (isRegionalPromptLayer(layer)) {
|
if (isRPLayer(layer)) {
|
||||||
const lastLine = layer.objects.findLast(isLine);
|
const lastLine = layer.objects.findLast(isLine);
|
||||||
if (!lastLine) {
|
if (!lastLine) {
|
||||||
return;
|
return;
|
||||||
@ -232,7 +232,7 @@ export const regionalPromptsSlice = createSlice({
|
|||||||
) => {
|
) => {
|
||||||
const { layerId, autoNegative } = action.payload;
|
const { layerId, autoNegative } = action.payload;
|
||||||
const layer = state.layers.find((l) => l.id === layerId);
|
const layer = state.layers.find((l) => l.id === layerId);
|
||||||
if (isRegionalPromptLayer(layer)) {
|
if (isRPLayer(layer)) {
|
||||||
layer.autoNegative = autoNegative;
|
layer.autoNegative = autoNegative;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user