mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
dab939f7d1
- Update most model identifiers to be `{key: string}` instead of name/base/type. Doesn't change the model select components yet. - Update model _parameters_, stored in redux, to be `{key: string, base: BaseModel}` - we need to store the base model to be able to check model compatibility. May want to store the whole config? Not sure...
20 lines
686 B
TypeScript
20 lines
686 B
TypeScript
import { PropsWithChildren, memo, useEffect } from 'react';
|
|
import { modelChanged } from '../src/features/parameters/store/generationSlice';
|
|
import { useAppDispatch } from '../src/app/store/storeHooks';
|
|
import { useGlobalModifiersInit } from '@invoke-ai/ui-library';
|
|
/**
|
|
* Initializes some state for storybook. Must be in a different component
|
|
* so that it is run inside the redux context.
|
|
*/
|
|
export const ReduxInit = memo((props: PropsWithChildren) => {
|
|
const dispatch = useAppDispatch();
|
|
useGlobalModifiersInit();
|
|
useEffect(() => {
|
|
dispatch(modelChanged({ key: 'test_model', base: 'sd-1' }));
|
|
}, []);
|
|
|
|
return props.children;
|
|
});
|
|
|
|
ReduxInit.displayName = 'ReduxInit';
|