Skip to content

Commit

Permalink
feat(ui): allow setting isEnabled, isLocked and name in createNewCanv…
Browse files Browse the repository at this point in the history
…asEntityFromImage util
  • Loading branch information
psychedelicious committed Dec 2, 2024
1 parent 8d97fe6 commit df84903
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion invokeai/frontend/web/src/features/imageActions/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { selectBboxModelBase, selectBboxRect } from 'features/controlLayers/stor
import type {
CanvasControlLayerState,
CanvasEntityIdentifier,
CanvasEntityState,
CanvasEntityType,
CanvasInpaintMaskState,
CanvasRasterLayerState,
Expand Down Expand Up @@ -134,14 +135,16 @@ export const createNewCanvasEntityFromImage = (arg: {
type: CanvasEntityType | 'regional_guidance_with_reference_image';
dispatch: AppDispatch;
getState: () => RootState;
overrides?: Partial<Pick<CanvasEntityState, 'isEnabled' | 'isLocked' | 'name'>>;
}) => {
const { type, imageDTO, dispatch, getState } = arg;
const { type, imageDTO, dispatch, getState, overrides: _overrides } = arg;
const state = getState();
const imageObject = imageDTOToImageObject(imageDTO);
const { x, y } = selectBboxRect(state);
const overrides = {
objects: [imageObject],
position: { x, y },
..._overrides,
};
switch (type) {
case 'raster_layer': {
Expand Down

0 comments on commit df84903

Please sign in to comment.