diff --git a/invokeai/frontend/web/src/app/store.ts b/invokeai/frontend/web/src/app/store.ts index ed9187ca78..3b9ab2eea1 100644 --- a/invokeai/frontend/web/src/app/store.ts +++ b/invokeai/frontend/web/src/app/store.ts @@ -21,15 +21,15 @@ import nodesReducer from 'features/nodes/store/nodesSlice'; import { socketioMiddleware } from './socketio/middleware'; import { socketMiddleware } from 'services/events/middleware'; -import { canvasBlacklist } from 'features/canvas/store/canvasPersistBlacklist'; -import { galleryBlacklist } from 'features/gallery/store/galleryPersistBlacklist'; -import { generationBlacklist } from 'features/parameters/store/generationPersistBlacklist'; -import { lightboxBlacklist } from 'features/lightbox/store/lightboxPersistBlacklist'; -import { modelsBlacklist } from 'features/system/store/modelsPersistBlacklist'; -import { nodesBlacklist } from 'features/nodes/store/nodesPersistBlacklist'; -import { postprocessingBlacklist } from 'features/parameters/store/postprocessingPersistBlacklist'; -import { systemBlacklist } from 'features/system/store/systemPersistsBlacklist'; -import { uiBlacklist } from 'features/ui/store/uiPersistBlacklist'; +import { canvasDenylist } from 'features/canvas/store/canvasPersistDenylist'; +import { galleryDenylist } from 'features/gallery/store/galleryPersistDenylist'; +import { generationDenylist } from 'features/parameters/store/generationPersistDenylist'; +import { lightboxDenylist } from 'features/lightbox/store/lightboxPersistDenylist'; +import { modelsDenylist } from 'features/system/store/modelsPersistDenylist'; +import { nodesDenylist } from 'features/nodes/store/nodesPersistDenylist'; +import { postprocessingDenylist } from 'features/parameters/store/postprocessingPersistDenylist'; +import { systemDenylist } from 'features/system/store/systemPersistsDenylist'; +import { uiDenylist } from 'features/ui/store/uiPersistDenylist'; /** * redux-persist provides an easy and reliable way to persist state across reloads. @@ -40,9 +40,9 @@ import { uiBlacklist } from 'features/ui/store/uiPersistBlacklist'; * - Connection/processing status * - Availability of external libraries like ESRGAN/GFPGAN * - * These can be blacklisted in redux-persist. + * These can be denylisted in redux-persist. * - * The necesssary nested persistors with blacklists are configured below. + * The necesssary nested persistors with denylists are configured below. */ const rootReducer = combineReducers({ @@ -66,18 +66,18 @@ const rootPersistConfig = getPersistConfig({ storage, rootReducer, blacklist: [ - ...canvasBlacklist, - ...galleryBlacklist, - ...generationBlacklist, - ...lightboxBlacklist, - ...modelsBlacklist, - ...nodesBlacklist, - ...postprocessingBlacklist, - // ...resultsBlacklist, + ...canvasDenylist, + ...galleryDenylist, + ...generationDenylist, + ...lightboxDenylist, + ...modelsDenylist, + ...nodesDenylist, + ...postprocessingDenylist, + // ...resultsDenylist, 'results', - ...systemBlacklist, - ...uiBlacklist, - // ...uploadsBlacklist, + ...systemDenylist, + ...uiDenylist, + // ...uploadsDenylist, 'uploads', 'hotkeys', 'config', diff --git a/invokeai/frontend/web/src/features/canvas/store/canvasPersistBlacklist.ts b/invokeai/frontend/web/src/features/canvas/store/canvasPersistBlacklist.ts deleted file mode 100644 index 67754cfc91..0000000000 --- a/invokeai/frontend/web/src/features/canvas/store/canvasPersistBlacklist.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { CanvasState } from './canvasTypes'; - -/** - * Canvas slice persist blacklist - */ -const itemsToBlacklist: (keyof CanvasState)[] = [ - 'cursorPosition', - 'isCanvasInitialized', - 'doesCanvasNeedScaling', -]; - -export const canvasBlacklist = itemsToBlacklist.map( - (blacklistItem) => `canvas.${blacklistItem}` -); diff --git a/invokeai/frontend/web/src/features/canvas/store/canvasPersistDenylist.ts b/invokeai/frontend/web/src/features/canvas/store/canvasPersistDenylist.ts new file mode 100644 index 0000000000..abaefab8b0 --- /dev/null +++ b/invokeai/frontend/web/src/features/canvas/store/canvasPersistDenylist.ts @@ -0,0 +1,14 @@ +import { CanvasState } from './canvasTypes'; + +/** + * Canvas slice persist denylist + */ +const itemsToDenylist: (keyof CanvasState)[] = [ + 'cursorPosition', + 'isCanvasInitialized', + 'doesCanvasNeedScaling', +]; + +export const canvasDenylist = itemsToDenylist.map( + (denylistItem) => `canvas.${denylistItem}` +); diff --git a/invokeai/frontend/web/src/features/gallery/store/galleryPersistBlacklist.ts b/invokeai/frontend/web/src/features/gallery/store/galleryPersistDenylist.ts similarity index 51% rename from invokeai/frontend/web/src/features/gallery/store/galleryPersistBlacklist.ts rename to invokeai/frontend/web/src/features/gallery/store/galleryPersistDenylist.ts index 37f3f48746..243fe26dd4 100644 --- a/invokeai/frontend/web/src/features/gallery/store/galleryPersistBlacklist.ts +++ b/invokeai/frontend/web/src/features/gallery/store/galleryPersistDenylist.ts @@ -1,9 +1,9 @@ import { GalleryState } from './gallerySlice'; /** - * Gallery slice persist blacklist + * Gallery slice persist denylist */ -const itemsToBlacklist: (keyof GalleryState)[] = [ +const itemsToDenylist: (keyof GalleryState)[] = [ 'categories', 'currentCategory', 'currentImage', @@ -12,6 +12,6 @@ const itemsToBlacklist: (keyof GalleryState)[] = [ 'intermediateImage', ]; -export const galleryBlacklist = itemsToBlacklist.map( - (blacklistItem) => `gallery.${blacklistItem}` +export const galleryDenylist = itemsToDenylist.map( + (denylistItem) => `gallery.${denylistItem}` ); diff --git a/invokeai/frontend/web/src/features/gallery/store/resultsPersistBlacklist.ts b/invokeai/frontend/web/src/features/gallery/store/resultsPersistBlacklist.ts deleted file mode 100644 index bd246865fb..0000000000 --- a/invokeai/frontend/web/src/features/gallery/store/resultsPersistBlacklist.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ResultsState } from './resultsSlice'; - -/** - * Results slice persist blacklist - * - * Currently blacklisting results slice entirely, see persist config in store.ts - */ -const itemsToBlacklist: (keyof ResultsState)[] = []; - -export const resultsBlacklist = itemsToBlacklist.map( - (blacklistItem) => `results.${blacklistItem}` -); diff --git a/invokeai/frontend/web/src/features/gallery/store/resultsPersistDenylist.ts b/invokeai/frontend/web/src/features/gallery/store/resultsPersistDenylist.ts new file mode 100644 index 0000000000..ef21f4b7b2 --- /dev/null +++ b/invokeai/frontend/web/src/features/gallery/store/resultsPersistDenylist.ts @@ -0,0 +1,12 @@ +import { ResultsState } from './resultsSlice'; + +/** + * Results slice persist denylist + * + * Currently denylisting results slice entirely, see persist config in store.ts + */ +const itemsToDenylist: (keyof ResultsState)[] = []; + +export const resultsDenylist = itemsToDenylist.map( + (denylistItem) => `results.${denylistItem}` +); diff --git a/invokeai/frontend/web/src/features/gallery/store/uploadsPersistBlacklist.ts b/invokeai/frontend/web/src/features/gallery/store/uploadsPersistBlacklist.ts deleted file mode 100644 index 4159d37184..0000000000 --- a/invokeai/frontend/web/src/features/gallery/store/uploadsPersistBlacklist.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { UploadsState } from './uploadsSlice'; - -/** - * Uploads slice persist blacklist - * - * Currently blacklisting uploads slice entirely, see persist config in store.ts - */ -const itemsToBlacklist: (keyof UploadsState)[] = []; - -export const uploadsBlacklist = itemsToBlacklist.map( - (blacklistItem) => `uploads.${blacklistItem}` -); diff --git a/invokeai/frontend/web/src/features/gallery/store/uploadsPersistDenylist.ts b/invokeai/frontend/web/src/features/gallery/store/uploadsPersistDenylist.ts new file mode 100644 index 0000000000..ec4248e99c --- /dev/null +++ b/invokeai/frontend/web/src/features/gallery/store/uploadsPersistDenylist.ts @@ -0,0 +1,12 @@ +import { UploadsState } from './uploadsSlice'; + +/** + * Uploads slice persist denylist + * + * Currently denylisting uploads slice entirely, see persist config in store.ts + */ +const itemsToDenylist: (keyof UploadsState)[] = []; + +export const uploadsDenylist = itemsToDenylist.map( + (denylistItem) => `uploads.${denylistItem}` +); diff --git a/invokeai/frontend/web/src/features/lightbox/store/lightboxPersistBlacklist.ts b/invokeai/frontend/web/src/features/lightbox/store/lightboxPersistBlacklist.ts deleted file mode 100644 index b7b054cf10..0000000000 --- a/invokeai/frontend/web/src/features/lightbox/store/lightboxPersistBlacklist.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { LightboxState } from './lightboxSlice'; - -/** - * Lightbox slice persist blacklist - */ -const itemsToBlacklist: (keyof LightboxState)[] = ['isLightboxOpen']; - -export const lightboxBlacklist = itemsToBlacklist.map( - (blacklistItem) => `lightbox.${blacklistItem}` -); diff --git a/invokeai/frontend/web/src/features/lightbox/store/lightboxPersistDenylist.ts b/invokeai/frontend/web/src/features/lightbox/store/lightboxPersistDenylist.ts new file mode 100644 index 0000000000..96cf69f373 --- /dev/null +++ b/invokeai/frontend/web/src/features/lightbox/store/lightboxPersistDenylist.ts @@ -0,0 +1,10 @@ +import { LightboxState } from './lightboxSlice'; + +/** + * Lightbox slice persist denylist + */ +const itemsToDenylist: (keyof LightboxState)[] = ['isLightboxOpen']; + +export const lightboxDenylist = itemsToDenylist.map( + (denylistItem) => `lightbox.${denylistItem}` +); diff --git a/invokeai/frontend/web/src/features/nodes/store/nodesPersistBlacklist.ts b/invokeai/frontend/web/src/features/nodes/store/nodesPersistBlacklist.ts deleted file mode 100644 index d9babaa967..0000000000 --- a/invokeai/frontend/web/src/features/nodes/store/nodesPersistBlacklist.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { NodesState } from './nodesSlice'; - -/** - * Nodes slice persist blacklist - */ -const itemsToBlacklist: (keyof NodesState)[] = [ - 'schema', - 'invocationTemplates', -]; - -export const nodesBlacklist = itemsToBlacklist.map( - (blacklistItem) => `nodes.${blacklistItem}` -); diff --git a/invokeai/frontend/web/src/features/nodes/store/nodesPersistDenylist.ts b/invokeai/frontend/web/src/features/nodes/store/nodesPersistDenylist.ts new file mode 100644 index 0000000000..31d859ba8b --- /dev/null +++ b/invokeai/frontend/web/src/features/nodes/store/nodesPersistDenylist.ts @@ -0,0 +1,10 @@ +import { NodesState } from './nodesSlice'; + +/** + * Nodes slice persist denylist + */ +const itemsToDenylist: (keyof NodesState)[] = ['schema', 'invocationTemplates']; + +export const nodesDenylist = itemsToDenylist.map( + (denylistItem) => `nodes.${denylistItem}` +); diff --git a/invokeai/frontend/web/src/features/nodes/util/parseSchema.ts b/invokeai/frontend/web/src/features/nodes/util/parseSchema.ts index 550af295f1..ffdf4710b5 100644 --- a/invokeai/frontend/web/src/features/nodes/util/parseSchema.ts +++ b/invokeai/frontend/web/src/features/nodes/util/parseSchema.ts @@ -13,7 +13,7 @@ import { buildOutputFieldTemplates, } from './fieldTemplateBuilders'; -const invocationBlacklist = ['Graph', 'Collect', 'LoadImage']; +const invocationDenylist = ['Graph', 'Collect', 'LoadImage']; export const parseSchema = (openAPI: OpenAPIV3.Document) => { // filter out non-invocation schemas, plus some tricky invocations for now @@ -22,7 +22,7 @@ export const parseSchema = (openAPI: OpenAPIV3.Document) => { (schema, key) => key.includes('Invocation') && !key.includes('InvocationOutput') && - !invocationBlacklist.some((blacklistItem) => key.includes(blacklistItem)) + !invocationDenylist.some((denylistItem) => key.includes(denylistItem)) ) as (OpenAPIV3.ReferenceObject | InvocationSchemaObject)[]; const invocations = filteredSchemas.reduce< diff --git a/invokeai/frontend/web/src/features/parameters/store/generationPersistBlacklist.ts b/invokeai/frontend/web/src/features/parameters/store/generationPersistBlacklist.ts deleted file mode 100644 index 884ed0e079..0000000000 --- a/invokeai/frontend/web/src/features/parameters/store/generationPersistBlacklist.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { GenerationState } from './generationSlice'; - -/** - * Generation slice persist blacklist - */ -const itemsToBlacklist: (keyof GenerationState)[] = []; - -export const generationBlacklist = itemsToBlacklist.map( - (blacklistItem) => `generation.${blacklistItem}` -); diff --git a/invokeai/frontend/web/src/features/parameters/store/generationPersistDenylist.ts b/invokeai/frontend/web/src/features/parameters/store/generationPersistDenylist.ts new file mode 100644 index 0000000000..70f35aa564 --- /dev/null +++ b/invokeai/frontend/web/src/features/parameters/store/generationPersistDenylist.ts @@ -0,0 +1,10 @@ +import { GenerationState } from './generationSlice'; + +/** + * Generation slice persist denylist + */ +const itemsToDenylist: (keyof GenerationState)[] = []; + +export const generationDenylist = itemsToDenylist.map( + (denylistItem) => `generation.${denylistItem}` +); diff --git a/invokeai/frontend/web/src/features/parameters/store/postprocessingPersistBlacklist.ts b/invokeai/frontend/web/src/features/parameters/store/postprocessingPersistBlacklist.ts deleted file mode 100644 index 9b8b3bb475..0000000000 --- a/invokeai/frontend/web/src/features/parameters/store/postprocessingPersistBlacklist.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { PostprocessingState } from './postprocessingSlice'; - -/** - * Postprocessing slice persist blacklist - */ -const itemsToBlacklist: (keyof PostprocessingState)[] = []; - -export const postprocessingBlacklist = itemsToBlacklist.map( - (blacklistItem) => `postprocessing.${blacklistItem}` -); diff --git a/invokeai/frontend/web/src/features/parameters/store/postprocessingPersistDenylist.ts b/invokeai/frontend/web/src/features/parameters/store/postprocessingPersistDenylist.ts new file mode 100644 index 0000000000..947a136964 --- /dev/null +++ b/invokeai/frontend/web/src/features/parameters/store/postprocessingPersistDenylist.ts @@ -0,0 +1,10 @@ +import { PostprocessingState } from './postprocessingSlice'; + +/** + * Postprocessing slice persist denylist + */ +const itemsToDenylist: (keyof PostprocessingState)[] = []; + +export const postprocessingDenylist = itemsToDenylist.map( + (denylistItem) => `postprocessing.${denylistItem}` +); diff --git a/invokeai/frontend/web/src/features/system/store/modelsPersistBlacklist.ts b/invokeai/frontend/web/src/features/system/store/modelsPersistBlacklist.ts deleted file mode 100644 index 26b61f5a9b..0000000000 --- a/invokeai/frontend/web/src/features/system/store/modelsPersistBlacklist.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { ModelsState } from './modelSlice'; - -/** - * Models slice persist blacklist - */ -const itemsToBlacklist: (keyof ModelsState)[] = ['entities', 'ids']; - -export const modelsBlacklist = itemsToBlacklist.map( - (blacklistItem) => `models.${blacklistItem}` -); diff --git a/invokeai/frontend/web/src/features/system/store/modelsPersistDenylist.ts b/invokeai/frontend/web/src/features/system/store/modelsPersistDenylist.ts new file mode 100644 index 0000000000..f374948e39 --- /dev/null +++ b/invokeai/frontend/web/src/features/system/store/modelsPersistDenylist.ts @@ -0,0 +1,10 @@ +import { ModelsState } from './modelSlice'; + +/** + * Models slice persist denylist + */ +const itemsToDenylist: (keyof ModelsState)[] = ['entities', 'ids']; + +export const modelsDenylist = itemsToDenylist.map( + (denylistItem) => `models.${denylistItem}` +); diff --git a/invokeai/frontend/web/src/features/system/store/systemPersistsBlacklist.ts b/invokeai/frontend/web/src/features/system/store/systemPersistsDenylist.ts similarity index 67% rename from invokeai/frontend/web/src/features/system/store/systemPersistsBlacklist.ts rename to invokeai/frontend/web/src/features/system/store/systemPersistsDenylist.ts index 27ecd65f9e..84dbd0ecc7 100644 --- a/invokeai/frontend/web/src/features/system/store/systemPersistsBlacklist.ts +++ b/invokeai/frontend/web/src/features/system/store/systemPersistsDenylist.ts @@ -1,9 +1,9 @@ import { SystemState } from './systemSlice'; /** - * System slice persist blacklist + * System slice persist denylist */ -const itemsToBlacklist: (keyof SystemState)[] = [ +const itemsToDenylist: (keyof SystemState)[] = [ 'currentIteration', 'currentStatus', 'currentStep', @@ -23,6 +23,6 @@ const itemsToBlacklist: (keyof SystemState)[] = [ 'wasSchemaParsed', ]; -export const systemBlacklist = itemsToBlacklist.map( - (blacklistItem) => `system.${blacklistItem}` +export const systemDenylist = itemsToDenylist.map( + (denylistItem) => `system.${denylistItem}` ); diff --git a/invokeai/frontend/web/src/features/ui/store/uiPersistBlacklist.ts b/invokeai/frontend/web/src/features/ui/store/uiPersistBlacklist.ts deleted file mode 100644 index 64516c6372..0000000000 --- a/invokeai/frontend/web/src/features/ui/store/uiPersistBlacklist.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { UIState } from './uiTypes'; - -/** - * UI slice persist blacklist - */ -const itemsToBlacklist: (keyof UIState)[] = []; - -export const uiBlacklist = itemsToBlacklist.map( - (blacklistItem) => `ui.${blacklistItem}` -); diff --git a/invokeai/frontend/web/src/features/ui/store/uiPersistDenylist.ts b/invokeai/frontend/web/src/features/ui/store/uiPersistDenylist.ts new file mode 100644 index 0000000000..a0ab3d0198 --- /dev/null +++ b/invokeai/frontend/web/src/features/ui/store/uiPersistDenylist.ts @@ -0,0 +1,10 @@ +import { UIState } from './uiTypes'; + +/** + * UI slice persist denylist + */ +const itemsToDenylist: (keyof UIState)[] = []; + +export const uiDenylist = itemsToDenylist.map( + (denylistItem) => `ui.${denylistItem}` +);