mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
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`
8 lines
480 B
TypeScript
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);
|