From a2777decd482530e09c5d4690ffaefd421fa10ac Mon Sep 17 00:00:00 2001 From: Ryan Dick Date: Wed, 13 Sep 2023 13:40:59 -0400 Subject: [PATCH] Add a IPAdapterModelField for passing passing IP-Adapter models between nodes. --- invokeai/app/invocations/baseinvocation.py | 1 + invokeai/app/invocations/ip_adapter.py | 23 ++-- invokeai/app/invocations/latent.py | 4 +- .../Invocation/fields/InputFieldRenderer.tsx | 14 +++ .../inputs/IPAdapterModelInputField.tsx | 100 ++++++++++++++++++ .../src/features/nodes/store/nodesSlice.ts | 8 ++ .../web/src/features/nodes/types/constants.ts | 6 ++ .../web/src/features/nodes/types/types.ts | 24 ++++- .../nodes/util/fieldTemplateBuilders.ts | 15 +++ .../features/nodes/util/fieldValueBuilders.ts | 1 + .../parameters/types/parameterSchemas.ts | 12 ++- .../util/modelIdToIPAdapterModelParams.ts | 29 +++++ .../web/src/services/api/endpoints/models.ts | 42 ++++++++ .../frontend/web/src/services/api/schema.d.ts | 42 +++++--- .../frontend/web/src/services/api/types.ts | 5 + 15 files changed, 293 insertions(+), 33 deletions(-) create mode 100644 invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/IPAdapterModelInputField.tsx create mode 100644 invokeai/frontend/web/src/features/parameters/util/modelIdToIPAdapterModelParams.ts diff --git a/invokeai/app/invocations/baseinvocation.py b/invokeai/app/invocations/baseinvocation.py index fc132b09ab..495974488d 100644 --- a/invokeai/app/invocations/baseinvocation.py +++ b/invokeai/app/invocations/baseinvocation.py @@ -154,6 +154,7 @@ class UIType(str, Enum): VaeModel = "VaeModelField" LoRAModel = "LoRAModelField" ControlNetModel = "ControlNetModelField" + IPAdapterModel = "IPAdapterModelField" UNet = "UNetField" Vae = "VaeField" CLIP = "ClipField" diff --git a/invokeai/app/invocations/ip_adapter.py b/invokeai/app/invocations/ip_adapter.py index 89d440b6ea..cf667c9b83 100644 --- a/invokeai/app/invocations/ip_adapter.py +++ b/invokeai/app/invocations/ip_adapter.py @@ -6,6 +6,7 @@ from invokeai.app.invocations.baseinvocation import ( BaseInvocation, BaseInvocationOutput, FieldDescriptions, + Input, InputField, InvocationContext, OutputField, @@ -14,24 +15,22 @@ from invokeai.app.invocations.baseinvocation import ( invocation_output, ) from invokeai.app.invocations.primitives import ImageField - -IP_ADAPTER_MODELS = Literal[ - "ip-adapter_sd15", - "ip-adapter-plus_sd15", - "ip-adapter-plus-face_sd15", - "ip-adapter_sdxl", -] +from invokeai.backend.model_management.models.base import BaseModelType IP_ADAPTER_IMAGE_ENCODER_MODELS = Literal[ "models/core/ip_adapters/sd-1/image_encoder/", "models/core/ip_adapters/sdxl/image_encoder" ] +class IPAdapterModelField(BaseModel): + model_name: str = Field(description="Name of the IP-Adapter model") + base_model: BaseModelType = Field(description="Base model") + + class IPAdapterField(BaseModel): image: ImageField = Field(description="The IP-Adapter image prompt.") - # TODO(ryand): Create and use a custom `IpAdapterModelField`. - ip_adapter_model: str = Field(description="The name of the IP-Adapter model.") + ip_adapter_model: IPAdapterModelField = Field(description="The IP-Adapter model to use.") # TODO(ryand): Create and use a `CLIPImageEncoderField` instead that is analogous to the `ClipField` used elsewhere. image_encoder_model: str = Field(description="The name of the CLIP image encoder model.") @@ -51,10 +50,10 @@ class IPAdapterInvocation(BaseInvocation): # Inputs image: ImageField = InputField(description="The IP-Adapter image prompt.") - ip_adapter_model: IP_ADAPTER_MODELS = InputField( - default="ip-adapter_sd15.bin", - description="The name of the IP-Adapter model.", + ip_adapter_model: IPAdapterModelField = InputField( + description="The IP-Adapter model.", title="IP-Adapter Model", + input=Input.Direct, ) image_encoder_model: IP_ADAPTER_IMAGE_ENCODER_MODELS = InputField( default="models/core/ip_adapters/sd-1/image_encoder/", description="The name of the CLIP image encoder model." diff --git a/invokeai/app/invocations/latent.py b/invokeai/app/invocations/latent.py index d63e16df8c..8660f6c353 100644 --- a/invokeai/app/invocations/latent.py +++ b/invokeai/app/invocations/latent.py @@ -412,9 +412,9 @@ class DenoiseLatentsInvocation(BaseInvocation): ip_adapter_model = exit_stack.enter_context( context.services.model_manager.get_model( - model_name=ip_adapter.ip_adapter_model, + model_name=ip_adapter.ip_adapter_model.model_name, model_type=ModelType.IPAdapter, - base_model=BaseModelType.StableDiffusion1, # HACK(ryand): Pass this in properly + base_model=ip_adapter.ip_adapter_model.base_model, context=context, ) ) diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/InputFieldRenderer.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/InputFieldRenderer.tsx index fa5c4533c2..10cde5bf49 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/InputFieldRenderer.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/InputFieldRenderer.tsx @@ -15,6 +15,7 @@ import SDXLMainModelInputField from './inputs/SDXLMainModelInputField'; import SchedulerInputField from './inputs/SchedulerInputField'; import StringInputField from './inputs/StringInputField'; import VaeModelInputField from './inputs/VaeModelInputField'; +import IPAdapterModelInputField from './inputs/IPAdapterModelInputField'; type InputFieldProps = { nodeId: string; @@ -147,6 +148,19 @@ const InputFieldRenderer = ({ nodeId, fieldName }: InputFieldProps) => { ); } + if ( + field?.type === 'IPAdapterModelField' && + fieldTemplate?.type === 'IPAdapterModelField' + ) { + return ( + + ); + } + if (field?.type === 'ColorField' && fieldTemplate?.type === 'ColorField') { return ( +) => { + const { nodeId, field } = props; + const ipAdapterModel = field.value; + const dispatch = useAppDispatch(); + + const { data: ipAdapterModels } = useGetIPAdapterModelsQuery(); + + // grab the full model entity from the RTK Query cache + const selectedModel = useMemo( + () => + ipAdapterModels?.entities[ + `${ipAdapterModel?.base_model}/ip_adapter/${ipAdapterModel?.model_name}` + ] ?? null, + [ + ipAdapterModel?.base_model, + ipAdapterModel?.model_name, + ipAdapterModels?.entities, + ] + ); + + const data = useMemo(() => { + if (!ipAdapterModels) { + return []; + } + + const data: SelectItem[] = []; + + forEach(ipAdapterModels.entities, (model, id) => { + if (!model) { + return; + } + + data.push({ + value: id, + label: model.model_name, + group: MODEL_TYPE_MAP[model.base_model], + }); + }); + + return data; + }, [ipAdapterModels]); + + const handleValueChanged = useCallback( + (v: string | null) => { + if (!v) { + return; + } + + const newIPAdapterModel = modelIdToIPAdapterModelParam(v); + + if (!newIPAdapterModel) { + return; + } + + dispatch( + fieldIPAdapterModelValueChanged({ + nodeId, + fieldName: field.name, + value: newIPAdapterModel, + }) + ); + }, + [dispatch, field.name, nodeId] + ); + + return ( + + ); +}; + +export default memo(IPAdapterModelInputFieldComponent); diff --git a/invokeai/frontend/web/src/features/nodes/store/nodesSlice.ts b/invokeai/frontend/web/src/features/nodes/store/nodesSlice.ts index 2ebed877ac..3e330cf710 100644 --- a/invokeai/frontend/web/src/features/nodes/store/nodesSlice.ts +++ b/invokeai/frontend/web/src/features/nodes/store/nodesSlice.ts @@ -41,6 +41,7 @@ import { IntegerInputFieldValue, InvocationNodeData, InvocationTemplate, + IPAdapterModelInputFieldValue, isInvocationNode, isNotesNode, LoRAModelInputFieldValue, @@ -520,6 +521,12 @@ const nodesSlice = createSlice({ ) => { fieldValueReducer(state, action); }, + fieldIPAdapterModelValueChanged: ( + state, + action: FieldValueAction + ) => { + fieldValueReducer(state, action); + }, fieldEnumModelValueChanged: ( state, action: FieldValueAction @@ -866,6 +873,7 @@ export const { fieldLoRAModelValueChanged, fieldEnumModelValueChanged, fieldControlNetModelValueChanged, + fieldIPAdapterModelValueChanged, fieldRefinerModelValueChanged, fieldSchedulerValueChanged, nodeIsOpenChanged, diff --git a/invokeai/frontend/web/src/features/nodes/types/constants.ts b/invokeai/frontend/web/src/features/nodes/types/constants.ts index cd91607cd6..31d3ac67d3 100644 --- a/invokeai/frontend/web/src/features/nodes/types/constants.ts +++ b/invokeai/frontend/web/src/features/nodes/types/constants.ts @@ -40,6 +40,7 @@ export const POLYMORPHIC_TYPES = [ ]; export const MODEL_TYPES = [ + 'IPAdapterModelField', 'ControlNetModelField', 'LoRAModelField', 'MainModelField', @@ -240,6 +241,11 @@ export const FIELDS: Record = { description: 'IP-Adapter info passed between nodes.', title: 'IP-Adapter', }, + IPAdapterModelField: { + color: 'teal.500', // TODO(ryand): Pick a color + description: 'IP-Adapter model', + title: 'IP-Adapter Model', + }, LatentsCollection: { color: 'pink.500', description: 'Latents may be passed between nodes.', diff --git a/invokeai/frontend/web/src/features/nodes/types/types.ts b/invokeai/frontend/web/src/features/nodes/types/types.ts index 076b0e0aff..c9b5b34956 100644 --- a/invokeai/frontend/web/src/features/nodes/types/types.ts +++ b/invokeai/frontend/web/src/features/nodes/types/types.ts @@ -94,6 +94,7 @@ export const zFieldType = z.enum([ 'IntegerCollection', 'IntegerPolymorphic', 'IPAdapterField', + 'IPAdapterModelField', 'LatentsCollection', 'LatentsField', 'LatentsPolymorphic', @@ -389,9 +390,12 @@ export type ControlCollectionInputFieldValue = z.infer< typeof zControlCollectionInputFieldValue >; +export const zIPAdapterModel = zModelIdentifier; +export type IPAdapterModel = z.infer; + export const zIPAdapterField = z.object({ image: zImageField, - ip_adapter_model: z.string().trim().min(1), + ip_adapter_model: zIPAdapterModel, image_encoder_model: z.string().trim().min(1), weight: z.number(), }); @@ -554,6 +558,17 @@ export type ControlNetModelInputFieldValue = z.infer< typeof zControlNetModelInputFieldValue >; +export const zIPAdapterModelField = zModelIdentifier; +export type IPAdapterModelField = z.infer; + +export const zIPAdapterModelInputFieldValue = zInputFieldValueBase.extend({ + type: z.literal('IPAdapterModelField'), + value: zIPAdapterModelField.optional(), +}); +export type IPAdapterModelInputFieldValue = z.infer< + typeof zIPAdapterModelInputFieldValue +>; + export const zCollectionInputFieldValue = zInputFieldValueBase.extend({ type: z.literal('Collection'), value: z.array(z.any()).optional(), // TODO: should this field ever have a value? @@ -637,6 +652,7 @@ export const zInputFieldValue = z.discriminatedUnion('type', [ zIntegerPolymorphicInputFieldValue, zIntegerInputFieldValue, zIPAdapterInputFieldValue, + zIPAdapterModelInputFieldValue, zLatentsInputFieldValue, zLatentsCollectionInputFieldValue, zLatentsPolymorphicInputFieldValue, @@ -881,6 +897,11 @@ export type ControlNetModelInputFieldTemplate = InputFieldTemplateBase & { type: 'ControlNetModelField'; }; +export type IPAdapterModelInputFieldTemplate = InputFieldTemplateBase & { + default: string; + type: 'IPAdapterModelField'; +}; + export type CollectionInputFieldTemplate = InputFieldTemplateBase & { default: []; type: 'Collection'; @@ -953,6 +974,7 @@ export type InputFieldTemplate = | IntegerPolymorphicInputFieldTemplate | IntegerInputFieldTemplate | IPAdapterInputFieldTemplate + | IPAdapterModelInputFieldTemplate | LatentsInputFieldTemplate | LatentsCollectionInputFieldTemplate | LatentsPolymorphicInputFieldTemplate diff --git a/invokeai/frontend/web/src/features/nodes/util/fieldTemplateBuilders.ts b/invokeai/frontend/web/src/features/nodes/util/fieldTemplateBuilders.ts index ed15aeef5b..31b50da7ff 100644 --- a/invokeai/frontend/web/src/features/nodes/util/fieldTemplateBuilders.ts +++ b/invokeai/frontend/web/src/features/nodes/util/fieldTemplateBuilders.ts @@ -61,6 +61,7 @@ import { LatentsField, ConditioningField, IPAdapterInputFieldTemplate, + IPAdapterModelInputFieldTemplate, } from '../types/types'; import { ControlField } from 'services/api/types'; @@ -436,6 +437,19 @@ const buildControlNetModelInputFieldTemplate = ({ return template; }; +const buildIPAdapterModelInputFieldTemplate = ({ + schemaObject, + baseField, +}: BuildInputFieldArg): IPAdapterModelInputFieldTemplate => { + const template: IPAdapterModelInputFieldTemplate = { + ...baseField, + type: 'IPAdapterModelField', + default: schemaObject.default ?? undefined, + }; + + return template; +}; + const buildImageInputFieldTemplate = ({ schemaObject, baseField, @@ -866,6 +880,7 @@ const TEMPLATE_BUILDER_MAP = { IntegerCollection: buildIntegerCollectionInputFieldTemplate, IntegerPolymorphic: buildIntegerPolymorphicInputFieldTemplate, IPAdapterField: buildIPAdapterInputFieldTemplate, + IPAdapterModelField: buildIPAdapterModelInputFieldTemplate, LatentsCollection: buildLatentsCollectionInputFieldTemplate, LatentsField: buildLatentsInputFieldTemplate, LatentsPolymorphic: buildLatentsPolymorphicInputFieldTemplate, diff --git a/invokeai/frontend/web/src/features/nodes/util/fieldValueBuilders.ts b/invokeai/frontend/web/src/features/nodes/util/fieldValueBuilders.ts index 8ea7ce58ff..34a55a0240 100644 --- a/invokeai/frontend/web/src/features/nodes/util/fieldValueBuilders.ts +++ b/invokeai/frontend/web/src/features/nodes/util/fieldValueBuilders.ts @@ -30,6 +30,7 @@ const FIELD_VALUE_FALLBACK_MAP = { IntegerCollection: [], IntegerPolymorphic: 0, IPAdapterField: undefined, + IPAdapterModelField: undefined, LatentsCollection: [], LatentsField: undefined, LatentsPolymorphic: undefined, diff --git a/invokeai/frontend/web/src/features/parameters/types/parameterSchemas.ts b/invokeai/frontend/web/src/features/parameters/types/parameterSchemas.ts index 5a77231739..63e4883e6b 100644 --- a/invokeai/frontend/web/src/features/parameters/types/parameterSchemas.ts +++ b/invokeai/frontend/web/src/features/parameters/types/parameterSchemas.ts @@ -323,7 +323,17 @@ export type ControlNetModelParam = z.infer; export const isValidControlNetModel = ( val: unknown ): val is ControlNetModelParam => zControlNetModel.safeParse(val).success; - +/** + * Zod schema for IP-Adapter models + */ +export const zIPAdapterModel = z.object({ + model_name: z.string().min(1), + base_model: zBaseModel, +}); +/** + * Type alias for model parameter, inferred from its zod schema + */ +export type zIPAdapterModelParam = z.infer; /** * Zod schema for l2l strength parameter */ diff --git a/invokeai/frontend/web/src/features/parameters/util/modelIdToIPAdapterModelParams.ts b/invokeai/frontend/web/src/features/parameters/util/modelIdToIPAdapterModelParams.ts new file mode 100644 index 0000000000..4d58046545 --- /dev/null +++ b/invokeai/frontend/web/src/features/parameters/util/modelIdToIPAdapterModelParams.ts @@ -0,0 +1,29 @@ +import { logger } from 'app/logging/logger'; +import { zIPAdapterModel } from 'features/parameters/types/parameterSchemas'; +import { IPAdapterModelField } from 'services/api/types'; + +export const modelIdToIPAdapterModelParam = ( + ipAdapterModelId: string +): IPAdapterModelField | undefined => { + const log = logger('models'); + const [base_model, _model_type, model_name] = ipAdapterModelId.split('/'); + + const result = zIPAdapterModel.safeParse({ + base_model, + model_name, + }); + + if (!result.success) { + log.error( + { + ipAdapterModelId, + errors: result.error.format(), + }, + 'Failed to parse IP-Adapter model id' + ); + + return; + } + + return result.data; +}; diff --git a/invokeai/frontend/web/src/services/api/endpoints/models.ts b/invokeai/frontend/web/src/services/api/endpoints/models.ts index 9be8bd13f6..8b910e56e8 100644 --- a/invokeai/frontend/web/src/services/api/endpoints/models.ts +++ b/invokeai/frontend/web/src/services/api/endpoints/models.ts @@ -5,6 +5,7 @@ import { BaseModelType, CheckpointModelConfig, ControlNetModelConfig, + IPAdapterModelConfig, DiffusersModelConfig, ImportModelConfig, LoRAModelConfig, @@ -36,6 +37,10 @@ export type ControlNetModelConfigEntity = ControlNetModelConfig & { id: string; }; +export type IPAdapterModelConfigEntity = IPAdapterModelConfig & { + id: string; +}; + export type TextualInversionModelConfigEntity = TextualInversionModelConfig & { id: string; }; @@ -47,6 +52,7 @@ type AnyModelConfigEntity = | OnnxModelConfigEntity | LoRAModelConfigEntity | ControlNetModelConfigEntity + | IPAdapterModelConfigEntity | TextualInversionModelConfigEntity | VaeModelConfigEntity; @@ -135,6 +141,10 @@ export const controlNetModelsAdapter = createEntityAdapter({ sortComparer: (a, b) => a.model_name.localeCompare(b.model_name), }); +export const ipAdapterModelsAdapter = + createEntityAdapter({ + sortComparer: (a, b) => a.model_name.localeCompare(b.model_name), + }); export const textualInversionModelsAdapter = createEntityAdapter({ sortComparer: (a, b) => a.model_name.localeCompare(b.model_name), @@ -435,6 +445,37 @@ export const modelsApi = api.injectEndpoints({ ); }, }), + getIPAdapterModels: build.query< + EntityState, + void + >({ + query: () => ({ url: 'models/', params: { model_type: 'ip_adapter' } }), + providesTags: (result) => { + const tags: ApiFullTagDescription[] = [ + { type: 'IPAdapterModel', id: LIST_TAG }, + ]; + + if (result) { + tags.push( + ...result.ids.map((id) => ({ + type: 'IPAdapterModel' as const, + id, + })) + ); + } + + return tags; + }, + transformResponse: (response: { models: IPAdapterModelConfig[] }) => { + const entities = createModelEntities( + response.models + ); + return ipAdapterModelsAdapter.setAll( + ipAdapterModelsAdapter.getInitialState(), + entities + ); + }, + }), getVaeModels: build.query, void>({ query: () => ({ url: 'models/', params: { model_type: 'vae' } }), providesTags: (result) => { @@ -533,6 +574,7 @@ export const { useGetMainModelsQuery, useGetOnnxModelsQuery, useGetControlNetModelsQuery, + useGetIPAdapterModelsQuery, useGetLoRAModelsQuery, useGetTextualInversionModelsQuery, useGetVaeModelsQuery, diff --git a/invokeai/frontend/web/src/services/api/schema.d.ts b/invokeai/frontend/web/src/services/api/schema.d.ts index 3c8ce1e761..324e49a4b3 100644 --- a/invokeai/frontend/web/src/services/api/schema.d.ts +++ b/invokeai/frontend/web/src/services/api/schema.d.ts @@ -2429,9 +2429,9 @@ export type components = { image: components["schemas"]["ImageField"]; /** * Ip Adapter Model - * @description The name of the IP-Adapter model. + * @description The IP-Adapter model to use. */ - ip_adapter_model: string; + ip_adapter_model: components["schemas"]["IPAdapterModelField"]; /** * Image Encoder Model * @description The name of the CLIP image encoder model. @@ -2472,11 +2472,9 @@ export type components = { image?: components["schemas"]["ImageField"]; /** * IP-Adapter Model - * @description The name of the IP-Adapter model. - * @default ip-adapter_sd15.bin - * @enum {string} + * @description The IP-Adapter model. */ - ip_adapter_model?: "ip-adapter_sd15" | "ip-adapter-plus_sd15" | "ip-adapter-plus-face_sd15" | "ip-adapter_sdxl"; + ip_adapter_model: components["schemas"]["IPAdapterModelField"]; /** * Image Encoder Model * @description The name of the CLIP image encoder model. @@ -2518,6 +2516,16 @@ export type components = { model_format: "checkpoint"; error?: components["schemas"]["ModelError"]; }; + /** IPAdapterModelField */ + IPAdapterModelField: { + /** + * Model Name + * @description Name of the IP-Adapter model + */ + model_name: string; + /** @description Base model */ + base_model: components["schemas"]["BaseModelType"]; + }; /** * IPAdapterOutput * @description Base class for all invocation outputs. @@ -7188,7 +7196,7 @@ export type components = { * If a field should be provided a data type that does not exactly match the python type of the field, use this to provide the type that should be used instead. See the node development docs for detail on adding a new field type, which involves client-side changes. * @enum {string} */ - UIType: "boolean" | "ColorField" | "ConditioningField" | "ControlField" | "float" | "ImageField" | "integer" | "LatentsField" | "string" | "BooleanCollection" | "ColorCollection" | "ConditioningCollection" | "ControlCollection" | "FloatCollection" | "ImageCollection" | "IntegerCollection" | "LatentsCollection" | "StringCollection" | "BooleanPolymorphic" | "ColorPolymorphic" | "ConditioningPolymorphic" | "ControlPolymorphic" | "FloatPolymorphic" | "ImagePolymorphic" | "IntegerPolymorphic" | "LatentsPolymorphic" | "StringPolymorphic" | "MainModelField" | "SDXLMainModelField" | "SDXLRefinerModelField" | "ONNXModelField" | "VaeModelField" | "LoRAModelField" | "ControlNetModelField" | "UNetField" | "VaeField" | "ClipField" | "Collection" | "CollectionItem" | "enum" | "Scheduler" | "WorkflowField" | "IsIntermediate" | "MetadataField"; + UIType: "boolean" | "ColorField" | "ConditioningField" | "ControlField" | "float" | "ImageField" | "integer" | "LatentsField" | "string" | "BooleanCollection" | "ColorCollection" | "ConditioningCollection" | "ControlCollection" | "FloatCollection" | "ImageCollection" | "IntegerCollection" | "LatentsCollection" | "StringCollection" | "BooleanPolymorphic" | "ColorPolymorphic" | "ConditioningPolymorphic" | "ControlPolymorphic" | "FloatPolymorphic" | "ImagePolymorphic" | "IntegerPolymorphic" | "LatentsPolymorphic" | "StringPolymorphic" | "MainModelField" | "SDXLMainModelField" | "SDXLRefinerModelField" | "ONNXModelField" | "VaeModelField" | "LoRAModelField" | "ControlNetModelField" | "IPAdapterModelField" | "UNetField" | "VaeField" | "ClipField" | "Collection" | "CollectionItem" | "enum" | "Scheduler" | "WorkflowField" | "IsIntermediate" | "MetadataField"; /** * UIComponent * @description The type of UI component to use for a field, used to override the default components, which are inferred from the field type. @@ -7227,12 +7235,6 @@ export type components = { /** Ui Order */ ui_order?: number; }; - /** - * StableDiffusion2ModelFormat - * @description An enumeration. - * @enum {string} - */ - StableDiffusion2ModelFormat: "checkpoint" | "diffusers"; /** * ControlNetModelFormat * @description An enumeration. @@ -7246,11 +7248,17 @@ export type components = { */ IPAdapterModelFormat: "checkpoint"; /** - * StableDiffusionXLModelFormat + * StableDiffusion2ModelFormat * @description An enumeration. * @enum {string} */ - StableDiffusionXLModelFormat: "checkpoint" | "diffusers"; + StableDiffusion2ModelFormat: "checkpoint" | "diffusers"; + /** + * StableDiffusionOnnxModelFormat + * @description An enumeration. + * @enum {string} + */ + StableDiffusionOnnxModelFormat: "olive" | "onnx"; /** * StableDiffusion1ModelFormat * @description An enumeration. @@ -7258,11 +7266,11 @@ export type components = { */ StableDiffusion1ModelFormat: "checkpoint" | "diffusers"; /** - * StableDiffusionOnnxModelFormat + * StableDiffusionXLModelFormat * @description An enumeration. * @enum {string} */ - StableDiffusionOnnxModelFormat: "olive" | "onnx"; + StableDiffusionXLModelFormat: "checkpoint" | "diffusers"; }; responses: never; parameters: never; diff --git a/invokeai/frontend/web/src/services/api/types.ts b/invokeai/frontend/web/src/services/api/types.ts index bae60ff701..23db4dae66 100644 --- a/invokeai/frontend/web/src/services/api/types.ts +++ b/invokeai/frontend/web/src/services/api/types.ts @@ -60,6 +60,7 @@ export type OnnxModelField = s['OnnxModelField']; export type VAEModelField = s['VAEModelField']; export type LoRAModelField = s['LoRAModelField']; export type ControlNetModelField = s['ControlNetModelField']; +export type IPAdapterModelField = s['IPAdapterModelField']; export type ModelsList = s['ModelsList']; export type ControlField = s['ControlField']; @@ -73,6 +74,9 @@ export type ControlNetModelDiffusersConfig = export type ControlNetModelConfig = | ControlNetModelCheckpointConfig | ControlNetModelDiffusersConfig; +export type IPAdapterModelCheckpointConfig = + s['IPAdapterModelCheckpointConfig']; +export type IPAdapterModelConfig = IPAdapterModelCheckpointConfig; export type TextualInversionModelConfig = s['TextualInversionModelConfig']; export type DiffusersModelConfig = | s['StableDiffusion1ModelDiffusersConfig'] @@ -88,6 +92,7 @@ export type AnyModelConfig = | LoRAModelConfig | VaeModelConfig | ControlNetModelConfig + | IPAdapterModelConfig | TextualInversionModelConfig | MainModelConfig | OnnxModelConfig;