InvokeAI/invokeai/frontend
psychedelicious 6e869e6038 fix(ui): migrate redux state that has models
With the change to model identifiers from v3 to v4, if a user had persisted redux state with the old format, we could get unexpected runtime errors when rehydrating state if we try to access model attributes that no longer exist.

For example, the CLIP Skip component does this:

```ts
CLIP_SKIP_MAP[model.base].maxClip
```

In v3, models had a `base_type` attribute, but it is renamed to `base` in v4. This code therefore causes a runtime error:
- `model.base` is `undefined`
- `CLIP_SKIP_MAP[undefined]` is also undefined
- `undefined.maxClip` is a runtime error!

Resolved by adding a migration for the redux slices that have model identifiers. The migration simply resets the slice or the part of the slice that is affected, when it's simple to do a partial reset.

Closes #6000
2024-03-22 07:55:13 +11:00
..
cli feat(config): add CLI arg to specify config file 2024-03-20 15:05:25 +11:00
install cleanup: remove unused scripts, cruft 2024-03-20 15:05:25 +11:00
web fix(ui): migrate redux state that has models 2024-03-22 07:55:13 +11:00
__init__.py Run python black 2023-07-28 09:46:44 -04:00