feat(ui): improve controlnet-related config types

This commit is contained in:
psychedelicious 2023-06-12 17:22:52 +10:00
parent f15a328b80
commit 60a2fbec41
2 changed files with 7 additions and 3 deletions
invokeai/frontend/web/src
app/types
features/controlNet/store

@ -1,3 +1,7 @@
import {
CONTROLNET_MODELS,
CONTROLNET_PROCESSORS,
} from 'features/controlNet/store/constants';
import { InvokeTabName } from 'features/ui/store/tabMap'; import { InvokeTabName } from 'features/ui/store/tabMap';
import { O } from 'ts-toolbelt'; import { O } from 'ts-toolbelt';
@ -117,8 +121,8 @@ export type AppConfig = {
canRestoreDeletedImagesFromBin: boolean; canRestoreDeletedImagesFromBin: boolean;
sd: { sd: {
defaultModel?: string; defaultModel?: string;
disabledControlNetModels: string[]; disabledControlNetModels: (keyof typeof CONTROLNET_MODELS)[];
disabledControlNetProcessors: string[]; disabledControlNetProcessors: (keyof typeof CONTROLNET_PROCESSORS)[];
iterations: { iterations: {
initial: number; initial: number;
min: number; min: number;

@ -181,7 +181,7 @@ type ControlNetModel = {
defaultProcessor?: ControlNetProcessorType; defaultProcessor?: ControlNetProcessorType;
}; };
export const CONTROLNET_MODELS: Record<string, ControlNetModel> = { export const CONTROLNET_MODELS = {
'lllyasviel/control_v11p_sd15_canny': { 'lllyasviel/control_v11p_sd15_canny': {
type: 'lllyasviel/control_v11p_sd15_canny', type: 'lllyasviel/control_v11p_sd15_canny',
label: 'Canny', label: 'Canny',