Files
InvokeAI/invokeai/frontend/web/src/features/controlLayers/store/actions.ts
psychedelicious 2d1e745594 feat(ui): add new gallery/canvas session buttons to queue actions menu
A new "session" just means to reset most settings to default values, excluding model.

There are a few things that need to be reset:
- Parameters state, except for models and things dependent on model selection (like VAE precision)
- Canvas state, except for the `modelBase`, which is dependent on the model selection
- Canvas staging area state
- LoRAs state
- HRF state
- Style presets state

We also select the canvas tab.

For new gallery sessions, we:
- Open the image viewer
- Set the right panel tab to `gallery`

And for new canvas sessions, we:
- Close the image viewer
- Set the right panel tab to `layers`
2024-10-03 08:31:00 -04:00

8 lines
480 B
TypeScript

import { createAction, isAnyOf } from '@reduxjs/toolkit';
// Needed to split this from canvasSlice.ts to avoid circular dependencies
export const canvasReset = createAction('canvas/canvasReset');
export const newGallerySessionRequested = createAction('canvas/newGallerySessionRequested');
export const newCanvasSessionRequested = createAction('canvas/newCanvasSessionRequested');
export const newSessionRequested = isAnyOf(newGallerySessionRequested, newCanvasSessionRequested);