mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): create all scheduler constants up-front
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { SCHEDULER_ITEMS, Scheduler } from 'app/constants';
|
||||
import { SCHEDULER_NAMES, Scheduler } from 'app/constants';
|
||||
import { RootState } from 'app/store/store';
|
||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||
import IAIMantineSelect from 'common/components/IAIMantineSelect';
|
||||
@ -25,7 +25,7 @@ const ParamScheduler = () => {
|
||||
|
||||
useEffect(() => {
|
||||
if (selectedSchedulers.length === 0) {
|
||||
dispatch(setSelectedSchedulers([...SCHEDULER_ITEMS]));
|
||||
dispatch(setSelectedSchedulers(SCHEDULER_NAMES));
|
||||
}
|
||||
|
||||
const schedulerFound = activeSchedulers.find(
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { NUMPY_RAND_MAX, SCHEDULER_ITEMS } from 'app/constants';
|
||||
import { NUMPY_RAND_MAX, SCHEDULER_NAMES_AS_CONST } from 'app/constants';
|
||||
import { z } from 'zod';
|
||||
|
||||
/**
|
||||
@ -73,7 +73,7 @@ export const isValidCfgScale = (val: unknown): val is CfgScaleParam =>
|
||||
/**
|
||||
* Zod schema for scheduler parameter
|
||||
*/
|
||||
export const zScheduler = z.enum(SCHEDULER_ITEMS);
|
||||
export const zScheduler = z.enum(SCHEDULER_NAMES_AS_CONST);
|
||||
/**
|
||||
* Type alias for scheduler parameter, inferred from its zod schema
|
||||
*/
|
||||
|
Reference in New Issue
Block a user