From fb8f218901ead1658562106c420b7d340fceba88 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Tue, 1 Aug 2023 14:26:02 +1000 Subject: [PATCH 1/2] fix(ui): post-onnx fixes --- invokeai/frontend/web/.husky/pre-commit | 2 - .../listeners/modelSelected.ts | 4 +- .../listeners/modelsLoaded.ts | 7 +- .../util/graphBuilders/addLoRAsToGraph.ts | 4 +- .../nodes/util/graphBuilders/addVAEToGraph.ts | 10 +-- .../buildCanvasTextToImageGraph.ts | 60 ++++++++++----- .../buildLinearTextToImageGraph.ts | 76 +++++++++++++------ .../parameters/hooks/useRecallParameters.ts | 3 +- .../parameters/store/generationSlice.ts | 10 ++- .../parameters/types/parameterSchemas.ts | 64 +++++++++++----- .../util/modelIdToMainModelParam.ts | 7 +- .../util/modelIdToSDXLRefinerModelParam.ts | 31 ++++++++ .../ParamSDXLRefinerModelSelect.tsx | 4 +- .../web/src/features/sdxl/store/sdxlSlice.ts | 7 +- .../subpanels/ModelManagerPanel/ModelList.tsx | 7 ++ .../ModelManagerPanel/ModelListItem.tsx | 12 ++- .../frontend/web/src/services/api/schema.d.ts | 20 ++--- .../frontend/web/src/services/api/types.d.ts | 7 +- 18 files changed, 229 insertions(+), 106 deletions(-) create mode 100644 invokeai/frontend/web/src/features/parameters/util/modelIdToSDXLRefinerModelParam.ts diff --git a/invokeai/frontend/web/.husky/pre-commit b/invokeai/frontend/web/.husky/pre-commit index f7584d86eb..f89f3ad735 100755 --- a/invokeai/frontend/web/.husky/pre-commit +++ b/invokeai/frontend/web/.husky/pre-commit @@ -1,6 +1,4 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -python -m black . --check - cd invokeai/frontend/web/ && npm run lint-staged diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelSelected.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelSelected.ts index 7880386057..e44cbe504a 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelSelected.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelSelected.ts @@ -6,7 +6,7 @@ import { modelChanged, vaeSelected, } from 'features/parameters/store/generationSlice'; -import { zMainModel } from 'features/parameters/types/parameterSchemas'; +import { zMainOrOnnxModel } from 'features/parameters/types/parameterSchemas'; import { addToast } from 'features/system/store/systemSlice'; import { makeToast } from 'features/system/util/makeToast'; import { forEach } from 'lodash-es'; @@ -19,7 +19,7 @@ export const addModelSelectedListener = () => { const log = logger('models'); const state = getState(); - const result = zMainModel.safeParse(action.payload); + const result = zMainOrOnnxModel.safeParse(action.payload); if (!result.success) { log.error( diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelsLoaded.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelsLoaded.ts index 32d512f504..325e843900 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelsLoaded.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelsLoaded.ts @@ -6,7 +6,8 @@ import { vaeSelected, } from 'features/parameters/store/generationSlice'; import { - zMainModel, + zMainOrOnnxModel, + zSDXLRefinerModel, zVaeModel, } from 'features/parameters/types/parameterSchemas'; import { @@ -53,7 +54,7 @@ export const addModelsLoadedListener = () => { return; } - const result = zMainModel.safeParse(firstModel); + const result = zMainOrOnnxModel.safeParse(firstModel); if (!result.success) { log.error( @@ -102,7 +103,7 @@ export const addModelsLoadedListener = () => { return; } - const result = zMainModel.safeParse(firstModel); + const result = zSDXLRefinerModel.safeParse(firstModel); if (!result.success) { log.error( diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addLoRAsToGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addLoRAsToGraph.ts index e4973f0c36..bc0bfee8fd 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addLoRAsToGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addLoRAsToGraph.ts @@ -19,7 +19,7 @@ export const addLoRAsToGraph = ( state: RootState, graph: NonNullableGraph, baseNodeId: string, - modelLoader: string = MAIN_MODEL_LOADER + modelLoaderNodeId: string = MAIN_MODEL_LOADER ): void => { /** * LoRA nodes get the UNet and CLIP models from the main model loader and apply the LoRA to them. @@ -85,7 +85,7 @@ export const addLoRAsToGraph = ( // first lora = start the lora chain, attach directly to model loader graph.edges.push({ source: { - node_id: modelLoader, + node_id: modelLoaderNodeId, field: 'unet', }, destination: { diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addVAEToGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addVAEToGraph.ts index 154bdb60c5..1472b3ea3f 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addVAEToGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addVAEToGraph.ts @@ -17,7 +17,7 @@ import { export const addVAEToGraph = ( state: RootState, graph: NonNullableGraph, - modelLoader: string = MAIN_MODEL_LOADER + modelLoaderNodeId: string = MAIN_MODEL_LOADER ): void => { const { vae } = state.generation; @@ -34,11 +34,11 @@ export const addVAEToGraph = ( vae_model: vae, }; } - const isOnnxModel = modelLoader == ONNX_MODEL_LOADER; + const isOnnxModel = modelLoaderNodeId == ONNX_MODEL_LOADER; if (graph.id === TEXT_TO_IMAGE_GRAPH || graph.id === IMAGE_TO_IMAGE_GRAPH) { graph.edges.push({ source: { - node_id: isAutoVae ? modelLoader : VAE_LOADER, + node_id: isAutoVae ? modelLoaderNodeId : VAE_LOADER, field: isAutoVae && isOnnxModel ? 'vae_decoder' : 'vae', }, destination: { @@ -51,7 +51,7 @@ export const addVAEToGraph = ( if (graph.id === IMAGE_TO_IMAGE_GRAPH) { graph.edges.push({ source: { - node_id: isAutoVae ? modelLoader : VAE_LOADER, + node_id: isAutoVae ? modelLoaderNodeId : VAE_LOADER, field: isAutoVae && isOnnxModel ? 'vae_decoder' : 'vae', }, destination: { @@ -64,7 +64,7 @@ export const addVAEToGraph = ( if (graph.id === INPAINT_GRAPH) { graph.edges.push({ source: { - node_id: isAutoVae ? modelLoader : VAE_LOADER, + node_id: isAutoVae ? modelLoaderNodeId : VAE_LOADER, field: isAutoVae && isOnnxModel ? 'vae_decoder' : 'vae', }, destination: { diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasTextToImageGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasTextToImageGraph.ts index 14a81c4e4d..5b636b482a 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasTextToImageGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasTextToImageGraph.ts @@ -20,6 +20,10 @@ import { TEXT_TO_IMAGE_GRAPH, TEXT_TO_LATENTS, } from './constants'; +import { + ONNXTextToLatentsInvocation, + TextToLatentsInvocation, +} from 'services/api/types'; /** * Builds the Canvas tab's Text to Image graph. @@ -53,8 +57,31 @@ export const buildCanvasTextToImageGraph = ( const use_cpu = shouldUseNoiseSettings ? shouldUseCpuNoise : initialGenerationState.shouldUseCpuNoise; - const onnx_model_type = model.model_type.includes('onnx'); - const model_loader = onnx_model_type ? ONNX_MODEL_LOADER : MAIN_MODEL_LOADER; + const isUsingOnnxModel = model.model_type === 'onnx'; + const modelLoaderNodeId = isUsingOnnxModel + ? ONNX_MODEL_LOADER + : MAIN_MODEL_LOADER; + const modelLoaderNodeType = isUsingOnnxModel + ? 'onnx_model_loader' + : 'main_model_loader'; + const t2lNode: TextToLatentsInvocation | ONNXTextToLatentsInvocation = + isUsingOnnxModel + ? { + type: 't2l_onnx', + id: TEXT_TO_LATENTS, + is_intermediate: true, + cfg_scale, + scheduler, + steps, + } + : { + type: 't2l', + id: TEXT_TO_LATENTS, + is_intermediate: true, + cfg_scale, + scheduler, + steps, + }; /** * The easiest way to build linear graphs is to do it in the node editor, then copy and paste the * full graph here as a template. Then use the parameters from app state and set friendlier node @@ -70,13 +97,13 @@ export const buildCanvasTextToImageGraph = ( id: TEXT_TO_IMAGE_GRAPH, nodes: { [POSITIVE_CONDITIONING]: { - type: onnx_model_type ? 'prompt_onnx' : 'compel', + type: isUsingOnnxModel ? 'prompt_onnx' : 'compel', id: POSITIVE_CONDITIONING, is_intermediate: true, prompt: positivePrompt, }, [NEGATIVE_CONDITIONING]: { - type: onnx_model_type ? 'prompt_onnx' : 'compel', + type: isUsingOnnxModel ? 'prompt_onnx' : 'compel', id: NEGATIVE_CONDITIONING, is_intermediate: true, prompt: negativePrompt, @@ -89,17 +116,10 @@ export const buildCanvasTextToImageGraph = ( height, use_cpu, }, - [TEXT_TO_LATENTS]: { - type: onnx_model_type ? 't2l_onnx' : 't2l', - id: TEXT_TO_LATENTS, - is_intermediate: true, - cfg_scale, - scheduler, - steps, - }, - [model_loader]: { - type: model_loader, - id: model_loader, + [t2lNode.id]: t2lNode, + [modelLoaderNodeId]: { + type: modelLoaderNodeType, + id: modelLoaderNodeId, is_intermediate: true, model, }, @@ -110,7 +130,7 @@ export const buildCanvasTextToImageGraph = ( skipped_layers: clipSkip, }, [LATENTS_TO_IMAGE]: { - type: onnx_model_type ? 'l2i_onnx' : 'l2i', + type: isUsingOnnxModel ? 'l2i_onnx' : 'l2i', id: LATENTS_TO_IMAGE, is_intermediate: !shouldAutoSave, }, @@ -138,7 +158,7 @@ export const buildCanvasTextToImageGraph = ( }, { source: { - node_id: model_loader, + node_id: modelLoaderNodeId, field: 'clip', }, destination: { @@ -168,7 +188,7 @@ export const buildCanvasTextToImageGraph = ( }, { source: { - node_id: model_loader, + node_id: modelLoaderNodeId, field: 'unet', }, destination: { @@ -232,10 +252,10 @@ export const buildCanvasTextToImageGraph = ( }); // add LoRA support - addLoRAsToGraph(state, graph, TEXT_TO_LATENTS, model_loader); + addLoRAsToGraph(state, graph, TEXT_TO_LATENTS, modelLoaderNodeId); // optionally add custom VAE - addVAEToGraph(state, graph, model_loader); + addVAEToGraph(state, graph, modelLoaderNodeId); // add dynamic prompts - also sets up core iteration and seed addDynamicPromptsToGraph(state, graph); diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildLinearTextToImageGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildLinearTextToImageGraph.ts index 3ae6f7650d..9dcc502d14 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildLinearTextToImageGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildLinearTextToImageGraph.ts @@ -20,6 +20,10 @@ import { TEXT_TO_IMAGE_GRAPH, TEXT_TO_LATENTS, } from './constants'; +import { + ONNXTextToLatentsInvocation, + TextToLatentsInvocation, +} from 'services/api/types'; export const buildLinearTextToImageGraph = ( state: RootState @@ -49,8 +53,31 @@ export const buildLinearTextToImageGraph = ( throw new Error('No model found in state'); } - const onnx_model_type = model.model_type.includes('onnx'); - const model_loader = onnx_model_type ? ONNX_MODEL_LOADER : MAIN_MODEL_LOADER; + const isUsingOnnxModel = model.model_type === 'onnx'; + const modelLoaderNodeId = isUsingOnnxModel + ? ONNX_MODEL_LOADER + : MAIN_MODEL_LOADER; + const modelLoaderNodeType = isUsingOnnxModel + ? 'onnx_model_loader' + : 'main_model_loader'; + const t2lNode: TextToLatentsInvocation | ONNXTextToLatentsInvocation = + isUsingOnnxModel + ? { + type: 't2l_onnx', + id: TEXT_TO_LATENTS, + is_intermediate: true, + cfg_scale, + scheduler, + steps, + } + : { + type: 't2l', + id: TEXT_TO_LATENTS, + is_intermediate: true, + cfg_scale, + scheduler, + steps, + }; /** * The easiest way to build linear graphs is to do it in the node editor, then copy and paste the * full graph here as a template. Then use the parameters from app state and set friendlier node @@ -66,25 +93,17 @@ export const buildLinearTextToImageGraph = ( const graph: NonNullableGraph = { id: TEXT_TO_IMAGE_GRAPH, nodes: { - [model_loader]: { - type: model_loader, - id: model_loader, - model, - }, - [CLIP_SKIP]: { - type: 'clip_skip', - id: CLIP_SKIP, - skipped_layers: clipSkip, - }, [POSITIVE_CONDITIONING]: { - type: onnx_model_type ? 'prompt_onnx' : 'compel', + type: isUsingOnnxModel ? 'prompt_onnx' : 'compel', id: POSITIVE_CONDITIONING, prompt: positivePrompt, + is_intermediate: true, }, [NEGATIVE_CONDITIONING]: { - type: onnx_model_type ? 'prompt_onnx' : 'compel', + type: isUsingOnnxModel ? 'prompt_onnx' : 'compel', id: NEGATIVE_CONDITIONING, prompt: negativePrompt, + is_intermediate: true, }, [NOISE]: { type: 'noise', @@ -92,16 +111,23 @@ export const buildLinearTextToImageGraph = ( width, height, use_cpu, + is_intermediate: true, }, - [TEXT_TO_LATENTS]: { - type: onnx_model_type ? 't2l_onnx' : 't2l', - id: TEXT_TO_LATENTS, - cfg_scale, - scheduler, - steps, + [t2lNode.id]: t2lNode, + [modelLoaderNodeId]: { + type: modelLoaderNodeType, + id: modelLoaderNodeId, + is_intermediate: true, + model, + }, + [CLIP_SKIP]: { + type: 'clip_skip', + id: CLIP_SKIP, + skipped_layers: clipSkip, + is_intermediate: true, }, [LATENTS_TO_IMAGE]: { - type: onnx_model_type ? 'l2i_onnx' : 'l2i', + type: isUsingOnnxModel ? 'l2i_onnx' : 'l2i', id: LATENTS_TO_IMAGE, fp32: vaePrecision === 'fp32' ? true : false, }, @@ -109,7 +135,7 @@ export const buildLinearTextToImageGraph = ( edges: [ { source: { - node_id: model_loader, + node_id: modelLoaderNodeId, field: 'clip', }, destination: { @@ -119,7 +145,7 @@ export const buildLinearTextToImageGraph = ( }, { source: { - node_id: model_loader, + node_id: modelLoaderNodeId, field: 'unet', }, destination: { @@ -223,10 +249,10 @@ export const buildLinearTextToImageGraph = ( }); // add LoRA support - addLoRAsToGraph(state, graph, TEXT_TO_LATENTS, model_loader); + addLoRAsToGraph(state, graph, TEXT_TO_LATENTS, modelLoaderNodeId); // optionally add custom VAE - addVAEToGraph(state, graph, model_loader); + addVAEToGraph(state, graph, modelLoaderNodeId); // add dynamic prompts - also sets up core iteration and seed addDynamicPromptsToGraph(state, graph); diff --git a/invokeai/frontend/web/src/features/parameters/hooks/useRecallParameters.ts b/invokeai/frontend/web/src/features/parameters/hooks/useRecallParameters.ts index 0165245bd0..cb2361524d 100644 --- a/invokeai/frontend/web/src/features/parameters/hooks/useRecallParameters.ts +++ b/invokeai/frontend/web/src/features/parameters/hooks/useRecallParameters.ts @@ -35,6 +35,7 @@ import { isValidSDXLNegativeStylePrompt, isValidSDXLPositiveStylePrompt, isValidSDXLRefinerAestheticScore, + isValidSDXLRefinerModel, isValidSDXLRefinerStart, isValidScheduler, isValidSeed, @@ -381,7 +382,7 @@ export const useRecallParameters = () => { dispatch(setNegativeStylePromptSDXL(negative_style_prompt)); } - if (isValidMainModel(refiner_model)) { + if (isValidSDXLRefinerModel(refiner_model)) { dispatch(refinerModelChanged(refiner_model)); } diff --git a/invokeai/frontend/web/src/features/parameters/store/generationSlice.ts b/invokeai/frontend/web/src/features/parameters/store/generationSlice.ts index 8dd22026a9..12f2c3eabf 100644 --- a/invokeai/frontend/web/src/features/parameters/store/generationSlice.ts +++ b/invokeai/frontend/web/src/features/parameters/store/generationSlice.ts @@ -3,13 +3,14 @@ import { createSlice } from '@reduxjs/toolkit'; import { roundToMultiple } from 'common/util/roundDownToMultiple'; import { configChanged } from 'features/system/store/configSlice'; import { clamp } from 'lodash-es'; -import { ImageDTO, MainModelField, OnnxModelField } from 'services/api/types'; +import { ImageDTO } from 'services/api/types'; import { clipSkipMap } from '../types/constants'; import { CfgScaleParam, HeightParam, MainModelParam, NegativePromptParam, + OnnxModelParam, PositivePromptParam, PrecisionParam, SchedulerParam, @@ -50,7 +51,7 @@ export interface GenerationState { shouldUseSymmetry: boolean; horizontalSymmetrySteps: number; verticalSymmetrySteps: number; - model: MainModelField | OnnxModelField | null; + model: MainModelParam | OnnxModelParam | null; vae: VaeModelParam | null; vaePrecision: PrecisionParam; seamlessXAxis: boolean; @@ -229,7 +230,10 @@ export const generationSlice = createSlice({ const { image_name, width, height } = action.payload; state.initialImage = { imageName: image_name, width, height }; }, - modelChanged: (state, action: PayloadAction) => { + modelChanged: ( + state, + action: PayloadAction + ) => { state.model = action.payload; if (state.model === null) { diff --git a/invokeai/frontend/web/src/features/parameters/types/parameterSchemas.ts b/invokeai/frontend/web/src/features/parameters/types/parameterSchemas.ts index cc9df619fb..ac799ac600 100644 --- a/invokeai/frontend/web/src/features/parameters/types/parameterSchemas.ts +++ b/invokeai/frontend/web/src/features/parameters/types/parameterSchemas.ts @@ -210,42 +210,70 @@ export type HeightParam = z.infer; export const isValidHeight = (val: unknown): val is HeightParam => zHeight.safeParse(val).success; -const zModelType = z.enum([ - 'vae', - 'lora', - 'onnx', - 'main', - 'controlnet', - 'embedding', -]); const zBaseModel = z.enum(['sd-1', 'sd-2', 'sdxl', 'sdxl-refiner']); export type BaseModelParam = z.infer; /** - * Zod schema for model parameter + * Zod schema for main model parameter * TODO: Make this a dynamically generated enum? */ export const zMainModel = z.object({ model_name: z.string().min(1), base_model: zBaseModel, - model_type: zModelType, + model_type: z.literal('main'), }); - /** - * Type alias for model parameter, inferred from its zod schema + * Type alias for main model parameter, inferred from its zod schema */ export type MainModelParam = z.infer; - /** - * Type alias for model parameter, inferred from its zod schema - */ -export type OnnxModelParam = z.infer; -/** - * Validates/type-guards a value as a model parameter + * Validates/type-guards a value as a main model parameter */ export const isValidMainModel = (val: unknown): val is MainModelParam => zMainModel.safeParse(val).success; + +/** + * Zod schema for SDXL refiner model parameter + * TODO: Make this a dynamically generated enum? + */ +export const zSDXLRefinerModel = z.object({ + model_name: z.string().min(1), + base_model: z.literal('sdxl-refiner'), + model_type: z.literal('main'), +}); +/** + * Type alias for SDXL refiner model parameter, inferred from its zod schema + */ +export type SDXLRefinerModelParam = z.infer; +/** + * Validates/type-guards a value as a SDXL refiner model parameter + */ +export const isValidSDXLRefinerModel = ( + val: unknown +): val is SDXLRefinerModelParam => zSDXLRefinerModel.safeParse(val).success; + +/** + * Zod schema for Onnx model parameter + * TODO: Make this a dynamically generated enum? + */ +export const zOnnxModel = z.object({ + model_name: z.string().min(1), + base_model: zBaseModel, + model_type: z.literal('onnx'), +}); +/** + * Type alias for Onnx model parameter, inferred from its zod schema + */ +export type OnnxModelParam = z.infer; +/** + * Validates/type-guards a value as a Onnx model parameter + */ +export const isValidOnnxModel = (val: unknown): val is OnnxModelParam => + zOnnxModel.safeParse(val).success; + +export const zMainOrOnnxModel = z.union([zMainModel, zOnnxModel]); + /** * Zod schema for VAE parameter */ diff --git a/invokeai/frontend/web/src/features/parameters/util/modelIdToMainModelParam.ts b/invokeai/frontend/web/src/features/parameters/util/modelIdToMainModelParam.ts index 7d2a606e97..78a3bcc515 100644 --- a/invokeai/frontend/web/src/features/parameters/util/modelIdToMainModelParam.ts +++ b/invokeai/frontend/web/src/features/parameters/util/modelIdToMainModelParam.ts @@ -1,16 +1,17 @@ import { logger } from 'app/logging/logger'; import { MainModelParam, - zMainModel, + OnnxModelParam, + zMainOrOnnxModel, } from 'features/parameters/types/parameterSchemas'; export const modelIdToMainModelParam = ( mainModelId: string -): MainModelParam | undefined => { +): OnnxModelParam | MainModelParam | undefined => { const log = logger('models'); const [base_model, model_type, model_name] = mainModelId.split('/'); - const result = zMainModel.safeParse({ + const result = zMainOrOnnxModel.safeParse({ base_model, model_name, model_type, diff --git a/invokeai/frontend/web/src/features/parameters/util/modelIdToSDXLRefinerModelParam.ts b/invokeai/frontend/web/src/features/parameters/util/modelIdToSDXLRefinerModelParam.ts new file mode 100644 index 0000000000..780ac56459 --- /dev/null +++ b/invokeai/frontend/web/src/features/parameters/util/modelIdToSDXLRefinerModelParam.ts @@ -0,0 +1,31 @@ +import { logger } from 'app/logging/logger'; +import { + SDXLRefinerModelParam, + zSDXLRefinerModel, +} from 'features/parameters/types/parameterSchemas'; + +export const modelIdToSDXLRefinerModelParam = ( + mainModelId: string +): SDXLRefinerModelParam | undefined => { + const log = logger('models'); + const [base_model, model_type, model_name] = mainModelId.split('/'); + + const result = zSDXLRefinerModel.safeParse({ + base_model, + model_name, + model_type, + }); + + if (!result.success) { + log.error( + { + mainModelId, + errors: result.error.format(), + }, + 'Failed to parse main model id' + ); + return; + } + + return result.data; +}; diff --git a/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerModelSelect.tsx b/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerModelSelect.tsx index cae40bbff3..522c6ba8a7 100644 --- a/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerModelSelect.tsx +++ b/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerModelSelect.tsx @@ -6,7 +6,7 @@ import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import { defaultSelectorOptions } from 'app/store/util/defaultMemoizeOptions'; import IAIMantineSearchableSelect from 'common/components/IAIMantineSearchableSelect'; import { MODEL_TYPE_MAP } from 'features/parameters/types/constants'; -import { modelIdToMainModelParam } from 'features/parameters/util/modelIdToMainModelParam'; +import { modelIdToSDXLRefinerModelParam } from 'features/parameters/util/modelIdToSDXLRefinerModelParam'; import { refinerModelChanged } from 'features/sdxl/store/sdxlSlice'; import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus'; import SyncModelsButton from 'features/ui/components/tabs/ModelManager/subpanels/ModelManagerSettingsPanel/SyncModelsButton'; @@ -68,7 +68,7 @@ const ParamSDXLRefinerModelSelect = () => { return; } - const newModel = modelIdToMainModelParam(v); + const newModel = modelIdToSDXLRefinerModelParam(v); if (!newModel) { return; diff --git a/invokeai/frontend/web/src/features/sdxl/store/sdxlSlice.ts b/invokeai/frontend/web/src/features/sdxl/store/sdxlSlice.ts index 7a8ccffa97..7ee3ea1d4f 100644 --- a/invokeai/frontend/web/src/features/sdxl/store/sdxlSlice.ts +++ b/invokeai/frontend/web/src/features/sdxl/store/sdxlSlice.ts @@ -1,11 +1,10 @@ import { PayloadAction, createSlice } from '@reduxjs/toolkit'; import { - MainModelParam, NegativeStylePromptSDXLParam, PositiveStylePromptSDXLParam, + SDXLRefinerModelParam, SchedulerParam, } from 'features/parameters/types/parameterSchemas'; -import { MainModelField } from 'services/api/types'; type SDXLInitialState = { positiveStylePrompt: PositiveStylePromptSDXLParam; @@ -13,7 +12,7 @@ type SDXLInitialState = { shouldConcatSDXLStylePrompt: boolean; shouldUseSDXLRefiner: boolean; sdxlImg2ImgDenoisingStrength: number; - refinerModel: MainModelField | null; + refinerModel: SDXLRefinerModelParam | null; refinerSteps: number; refinerCFGScale: number; refinerScheduler: SchedulerParam; @@ -56,7 +55,7 @@ const sdxlSlice = createSlice({ }, refinerModelChanged: ( state, - action: PayloadAction + action: PayloadAction ) => { state.refinerModel = action.payload; }, diff --git a/invokeai/frontend/web/src/features/ui/components/tabs/ModelManager/subpanels/ModelManagerPanel/ModelList.tsx b/invokeai/frontend/web/src/features/ui/components/tabs/ModelManager/subpanels/ModelManagerPanel/ModelList.tsx index a9810a75ab..3f100d9072 100644 --- a/invokeai/frontend/web/src/features/ui/components/tabs/ModelManager/subpanels/ModelManagerPanel/ModelList.tsx +++ b/invokeai/frontend/web/src/features/ui/components/tabs/ModelManager/subpanels/ModelManagerPanel/ModelList.tsx @@ -97,6 +97,13 @@ const ModelList = (props: ModelListProps) => { > {t('modelManager.diffusersModels')} + setModelFormatFilter('checkpoint')} + isChecked={modelFormatFilter === 'checkpoint'} + > + {t('modelManager.checkpointModels')} + setModelFormatFilter('onnx')} diff --git a/invokeai/frontend/web/src/features/ui/components/tabs/ModelManager/subpanels/ModelManagerPanel/ModelListItem.tsx b/invokeai/frontend/web/src/features/ui/components/tabs/ModelManager/subpanels/ModelManagerPanel/ModelListItem.tsx index 9380eed688..396ece2063 100644 --- a/invokeai/frontend/web/src/features/ui/components/tabs/ModelManager/subpanels/ModelManagerPanel/ModelListItem.tsx +++ b/invokeai/frontend/web/src/features/ui/components/tabs/ModelManager/subpanels/ModelManagerPanel/ModelListItem.tsx @@ -15,10 +15,11 @@ import { LoRAModelConfigEntity, useDeleteMainModelsMutation, useDeleteLoRAModelsMutation, + OnnxModelConfigEntity, } from 'services/api/endpoints/models'; type ModelListItemProps = { - model: MainModelConfigEntity | LoRAModelConfigEntity; + model: MainModelConfigEntity | OnnxModelConfigEntity | LoRAModelConfigEntity; isSelected: boolean; setSelectedModelId: (v: string | undefined) => void; }; @@ -37,9 +38,12 @@ export default function ModelListItem(props: ModelListItemProps) { }, [model.id, setSelectedModelId]); const handleModelDelete = useCallback(() => { - const method = { main: deleteMainModel, lora: deleteLoRAModel }[ - model.model_type - ]; + const method = { + main: deleteMainModel, + lora: deleteLoRAModel, + onnx: deleteMainModel, + }[model.model_type]; + method(model) .unwrap() .then((_) => { diff --git a/invokeai/frontend/web/src/services/api/schema.d.ts b/invokeai/frontend/web/src/services/api/schema.d.ts index 34e0bc70e5..80f0933f37 100644 --- a/invokeai/frontend/web/src/services/api/schema.d.ts +++ b/invokeai/frontend/web/src/services/api/schema.d.ts @@ -1381,7 +1381,7 @@ export type components = { * @description The nodes in this graph */ nodes?: { - [key: string]: (components["schemas"]["ControlNetInvocation"] | components["schemas"]["ImageProcessorInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["LoraLoaderInvocation"] | components["schemas"]["VaeLoaderInvocation"] | components["schemas"]["MetadataAccumulatorInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["AddInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["ParamIntInvocation"] | components["schemas"]["ParamFloatInvocation"] | components["schemas"]["ParamStringInvocation"] | components["schemas"]["ParamPromptInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRawPromptInvocation"] | components["schemas"]["SDXLRefinerRawPromptInvocation"] | components["schemas"]["ClipSkipInvocation"] | components["schemas"]["LoadImageInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["TextToLatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["StepParamEasingInvocation"] | components["schemas"]["ONNXPromptInvocation"] | components["schemas"]["ONNXTextToLatentsInvocation"] | components["schemas"]["ONNXLatentsToImageInvocation"] | components["schemas"]["ONNXSD1ModelLoaderInvocation"] | components["schemas"]["OnnxModelLoaderInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SDXLTextToLatentsInvocation"] | components["schemas"]["SDXLLatentsToLatentsInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["InpaintInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["GraphInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["CannyImageProcessorInvocation"] | components["schemas"]["HedImageProcessorInvocation"] | components["schemas"]["LineartImageProcessorInvocation"] | components["schemas"]["LineartAnimeImageProcessorInvocation"] | components["schemas"]["OpenposeImageProcessorInvocation"] | components["schemas"]["MidasDepthImageProcessorInvocation"] | components["schemas"]["NormalbaeImageProcessorInvocation"] | components["schemas"]["MlsdImageProcessorInvocation"] | components["schemas"]["PidiImageProcessorInvocation"] | components["schemas"]["ContentShuffleImageProcessorInvocation"] | components["schemas"]["ZoeDepthImageProcessorInvocation"] | components["schemas"]["MediapipeFaceProcessorInvocation"] | components["schemas"]["LeresImageProcessorInvocation"] | components["schemas"]["TileResamplerProcessorInvocation"] | components["schemas"]["SegmentAnythingProcessorInvocation"] | components["schemas"]["LatentsToLatentsInvocation"]) | undefined; + [key: string]: (components["schemas"]["ControlNetInvocation"] | components["schemas"]["ImageProcessorInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["LoraLoaderInvocation"] | components["schemas"]["VaeLoaderInvocation"] | components["schemas"]["MetadataAccumulatorInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRawPromptInvocation"] | components["schemas"]["SDXLRefinerRawPromptInvocation"] | components["schemas"]["ClipSkipInvocation"] | components["schemas"]["LoadImageInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["TextToLatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SDXLTextToLatentsInvocation"] | components["schemas"]["SDXLLatentsToLatentsInvocation"] | components["schemas"]["ONNXPromptInvocation"] | components["schemas"]["ONNXTextToLatentsInvocation"] | components["schemas"]["ONNXLatentsToImageInvocation"] | components["schemas"]["ONNXSD1ModelLoaderInvocation"] | components["schemas"]["OnnxModelLoaderInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["AddInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["ParamIntInvocation"] | components["schemas"]["ParamFloatInvocation"] | components["schemas"]["ParamStringInvocation"] | components["schemas"]["ParamPromptInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["StepParamEasingInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["InpaintInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["GraphInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["CannyImageProcessorInvocation"] | components["schemas"]["HedImageProcessorInvocation"] | components["schemas"]["LineartImageProcessorInvocation"] | components["schemas"]["LineartAnimeImageProcessorInvocation"] | components["schemas"]["OpenposeImageProcessorInvocation"] | components["schemas"]["MidasDepthImageProcessorInvocation"] | components["schemas"]["NormalbaeImageProcessorInvocation"] | components["schemas"]["MlsdImageProcessorInvocation"] | components["schemas"]["PidiImageProcessorInvocation"] | components["schemas"]["ContentShuffleImageProcessorInvocation"] | components["schemas"]["ZoeDepthImageProcessorInvocation"] | components["schemas"]["MediapipeFaceProcessorInvocation"] | components["schemas"]["LeresImageProcessorInvocation"] | components["schemas"]["TileResamplerProcessorInvocation"] | components["schemas"]["SegmentAnythingProcessorInvocation"] | components["schemas"]["LatentsToLatentsInvocation"]) | undefined; }; /** * Edges @@ -1424,7 +1424,7 @@ export type components = { * @description The results of node executions */ results: { - [key: string]: (components["schemas"]["ImageOutput"] | components["schemas"]["MaskOutput"] | components["schemas"]["ControlOutput"] | components["schemas"]["ModelLoaderOutput"] | components["schemas"]["LoraLoaderOutput"] | components["schemas"]["VaeLoaderOutput"] | components["schemas"]["MetadataAccumulatorOutput"] | components["schemas"]["PromptOutput"] | components["schemas"]["PromptCollectionOutput"] | components["schemas"]["IntOutput"] | components["schemas"]["FloatOutput"] | components["schemas"]["StringOutput"] | components["schemas"]["CompelOutput"] | components["schemas"]["ClipSkipInvocationOutput"] | components["schemas"]["LatentsOutput"] | components["schemas"]["NoiseOutput"] | components["schemas"]["IntCollectionOutput"] | components["schemas"]["FloatCollectionOutput"] | components["schemas"]["ImageCollectionOutput"] | components["schemas"]["ONNXModelLoaderOutput"] | components["schemas"]["SDXLModelLoaderOutput"] | components["schemas"]["SDXLRefinerModelLoaderOutput"] | components["schemas"]["GraphInvocationOutput"] | components["schemas"]["IterateInvocationOutput"] | components["schemas"]["CollectInvocationOutput"]) | undefined; + [key: string]: (components["schemas"]["ImageOutput"] | components["schemas"]["MaskOutput"] | components["schemas"]["ControlOutput"] | components["schemas"]["ModelLoaderOutput"] | components["schemas"]["LoraLoaderOutput"] | components["schemas"]["VaeLoaderOutput"] | components["schemas"]["MetadataAccumulatorOutput"] | components["schemas"]["CompelOutput"] | components["schemas"]["ClipSkipInvocationOutput"] | components["schemas"]["LatentsOutput"] | components["schemas"]["SDXLModelLoaderOutput"] | components["schemas"]["SDXLRefinerModelLoaderOutput"] | components["schemas"]["ONNXModelLoaderOutput"] | components["schemas"]["PromptOutput"] | components["schemas"]["PromptCollectionOutput"] | components["schemas"]["IntOutput"] | components["schemas"]["FloatOutput"] | components["schemas"]["StringOutput"] | components["schemas"]["IntCollectionOutput"] | components["schemas"]["FloatCollectionOutput"] | components["schemas"]["ImageCollectionOutput"] | components["schemas"]["NoiseOutput"] | components["schemas"]["GraphInvocationOutput"] | components["schemas"]["IterateInvocationOutput"] | components["schemas"]["CollectInvocationOutput"]) | undefined; }; /** * Errors @@ -2562,10 +2562,10 @@ export type components = { /** * Infill Method * @description The method used to infill empty regions (px) - * @default tile + * @default patchmatch * @enum {string} */ - infill_method?: "tile" | "solid"; + infill_method?: "patchmatch" | "tile" | "solid"; /** * Inpaint Width * @description The width of the inpaint region (px) @@ -5892,11 +5892,11 @@ export type components = { image?: components["schemas"]["ImageField"]; }; /** - * StableDiffusionOnnxModelFormat + * ControlNetModelFormat * @description An enumeration. * @enum {string} */ - StableDiffusionOnnxModelFormat: "olive" | "onnx"; + ControlNetModelFormat: "checkpoint" | "diffusers"; /** * StableDiffusionXLModelFormat * @description An enumeration. @@ -5904,11 +5904,11 @@ export type components = { */ StableDiffusionXLModelFormat: "checkpoint" | "diffusers"; /** - * ControlNetModelFormat + * StableDiffusionOnnxModelFormat * @description An enumeration. * @enum {string} */ - ControlNetModelFormat: "checkpoint" | "diffusers"; + StableDiffusionOnnxModelFormat: "olive" | "onnx"; /** * StableDiffusion2ModelFormat * @description An enumeration. @@ -6031,7 +6031,7 @@ export type operations = { }; requestBody: { content: { - "application/json": components["schemas"]["ControlNetInvocation"] | components["schemas"]["ImageProcessorInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["LoraLoaderInvocation"] | components["schemas"]["VaeLoaderInvocation"] | components["schemas"]["MetadataAccumulatorInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["AddInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["ParamIntInvocation"] | components["schemas"]["ParamFloatInvocation"] | components["schemas"]["ParamStringInvocation"] | components["schemas"]["ParamPromptInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRawPromptInvocation"] | components["schemas"]["SDXLRefinerRawPromptInvocation"] | components["schemas"]["ClipSkipInvocation"] | components["schemas"]["LoadImageInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["TextToLatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["StepParamEasingInvocation"] | components["schemas"]["ONNXPromptInvocation"] | components["schemas"]["ONNXTextToLatentsInvocation"] | components["schemas"]["ONNXLatentsToImageInvocation"] | components["schemas"]["ONNXSD1ModelLoaderInvocation"] | components["schemas"]["OnnxModelLoaderInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SDXLTextToLatentsInvocation"] | components["schemas"]["SDXLLatentsToLatentsInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["InpaintInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["GraphInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["CannyImageProcessorInvocation"] | components["schemas"]["HedImageProcessorInvocation"] | components["schemas"]["LineartImageProcessorInvocation"] | components["schemas"]["LineartAnimeImageProcessorInvocation"] | components["schemas"]["OpenposeImageProcessorInvocation"] | components["schemas"]["MidasDepthImageProcessorInvocation"] | components["schemas"]["NormalbaeImageProcessorInvocation"] | components["schemas"]["MlsdImageProcessorInvocation"] | components["schemas"]["PidiImageProcessorInvocation"] | components["schemas"]["ContentShuffleImageProcessorInvocation"] | components["schemas"]["ZoeDepthImageProcessorInvocation"] | components["schemas"]["MediapipeFaceProcessorInvocation"] | components["schemas"]["LeresImageProcessorInvocation"] | components["schemas"]["TileResamplerProcessorInvocation"] | components["schemas"]["SegmentAnythingProcessorInvocation"] | components["schemas"]["LatentsToLatentsInvocation"]; + "application/json": components["schemas"]["ControlNetInvocation"] | components["schemas"]["ImageProcessorInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["LoraLoaderInvocation"] | components["schemas"]["VaeLoaderInvocation"] | components["schemas"]["MetadataAccumulatorInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRawPromptInvocation"] | components["schemas"]["SDXLRefinerRawPromptInvocation"] | components["schemas"]["ClipSkipInvocation"] | components["schemas"]["LoadImageInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["TextToLatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SDXLTextToLatentsInvocation"] | components["schemas"]["SDXLLatentsToLatentsInvocation"] | components["schemas"]["ONNXPromptInvocation"] | components["schemas"]["ONNXTextToLatentsInvocation"] | components["schemas"]["ONNXLatentsToImageInvocation"] | components["schemas"]["ONNXSD1ModelLoaderInvocation"] | components["schemas"]["OnnxModelLoaderInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["AddInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["ParamIntInvocation"] | components["schemas"]["ParamFloatInvocation"] | components["schemas"]["ParamStringInvocation"] | components["schemas"]["ParamPromptInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["StepParamEasingInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["InpaintInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["GraphInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["CannyImageProcessorInvocation"] | components["schemas"]["HedImageProcessorInvocation"] | components["schemas"]["LineartImageProcessorInvocation"] | components["schemas"]["LineartAnimeImageProcessorInvocation"] | components["schemas"]["OpenposeImageProcessorInvocation"] | components["schemas"]["MidasDepthImageProcessorInvocation"] | components["schemas"]["NormalbaeImageProcessorInvocation"] | components["schemas"]["MlsdImageProcessorInvocation"] | components["schemas"]["PidiImageProcessorInvocation"] | components["schemas"]["ContentShuffleImageProcessorInvocation"] | components["schemas"]["ZoeDepthImageProcessorInvocation"] | components["schemas"]["MediapipeFaceProcessorInvocation"] | components["schemas"]["LeresImageProcessorInvocation"] | components["schemas"]["TileResamplerProcessorInvocation"] | components["schemas"]["SegmentAnythingProcessorInvocation"] | components["schemas"]["LatentsToLatentsInvocation"]; }; }; responses: { @@ -6068,7 +6068,7 @@ export type operations = { }; requestBody: { content: { - "application/json": components["schemas"]["ControlNetInvocation"] | components["schemas"]["ImageProcessorInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["LoraLoaderInvocation"] | components["schemas"]["VaeLoaderInvocation"] | components["schemas"]["MetadataAccumulatorInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["AddInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["ParamIntInvocation"] | components["schemas"]["ParamFloatInvocation"] | components["schemas"]["ParamStringInvocation"] | components["schemas"]["ParamPromptInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRawPromptInvocation"] | components["schemas"]["SDXLRefinerRawPromptInvocation"] | components["schemas"]["ClipSkipInvocation"] | components["schemas"]["LoadImageInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["TextToLatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["StepParamEasingInvocation"] | components["schemas"]["ONNXPromptInvocation"] | components["schemas"]["ONNXTextToLatentsInvocation"] | components["schemas"]["ONNXLatentsToImageInvocation"] | components["schemas"]["ONNXSD1ModelLoaderInvocation"] | components["schemas"]["OnnxModelLoaderInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SDXLTextToLatentsInvocation"] | components["schemas"]["SDXLLatentsToLatentsInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["InpaintInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["GraphInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["CannyImageProcessorInvocation"] | components["schemas"]["HedImageProcessorInvocation"] | components["schemas"]["LineartImageProcessorInvocation"] | components["schemas"]["LineartAnimeImageProcessorInvocation"] | components["schemas"]["OpenposeImageProcessorInvocation"] | components["schemas"]["MidasDepthImageProcessorInvocation"] | components["schemas"]["NormalbaeImageProcessorInvocation"] | components["schemas"]["MlsdImageProcessorInvocation"] | components["schemas"]["PidiImageProcessorInvocation"] | components["schemas"]["ContentShuffleImageProcessorInvocation"] | components["schemas"]["ZoeDepthImageProcessorInvocation"] | components["schemas"]["MediapipeFaceProcessorInvocation"] | components["schemas"]["LeresImageProcessorInvocation"] | components["schemas"]["TileResamplerProcessorInvocation"] | components["schemas"]["SegmentAnythingProcessorInvocation"] | components["schemas"]["LatentsToLatentsInvocation"]; + "application/json": components["schemas"]["ControlNetInvocation"] | components["schemas"]["ImageProcessorInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["LoraLoaderInvocation"] | components["schemas"]["VaeLoaderInvocation"] | components["schemas"]["MetadataAccumulatorInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRawPromptInvocation"] | components["schemas"]["SDXLRefinerRawPromptInvocation"] | components["schemas"]["ClipSkipInvocation"] | components["schemas"]["LoadImageInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["TextToLatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SDXLTextToLatentsInvocation"] | components["schemas"]["SDXLLatentsToLatentsInvocation"] | components["schemas"]["ONNXPromptInvocation"] | components["schemas"]["ONNXTextToLatentsInvocation"] | components["schemas"]["ONNXLatentsToImageInvocation"] | components["schemas"]["ONNXSD1ModelLoaderInvocation"] | components["schemas"]["OnnxModelLoaderInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["AddInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["ParamIntInvocation"] | components["schemas"]["ParamFloatInvocation"] | components["schemas"]["ParamStringInvocation"] | components["schemas"]["ParamPromptInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["StepParamEasingInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["InpaintInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["GraphInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["CannyImageProcessorInvocation"] | components["schemas"]["HedImageProcessorInvocation"] | components["schemas"]["LineartImageProcessorInvocation"] | components["schemas"]["LineartAnimeImageProcessorInvocation"] | components["schemas"]["OpenposeImageProcessorInvocation"] | components["schemas"]["MidasDepthImageProcessorInvocation"] | components["schemas"]["NormalbaeImageProcessorInvocation"] | components["schemas"]["MlsdImageProcessorInvocation"] | components["schemas"]["PidiImageProcessorInvocation"] | components["schemas"]["ContentShuffleImageProcessorInvocation"] | components["schemas"]["ZoeDepthImageProcessorInvocation"] | components["schemas"]["MediapipeFaceProcessorInvocation"] | components["schemas"]["LeresImageProcessorInvocation"] | components["schemas"]["TileResamplerProcessorInvocation"] | components["schemas"]["SegmentAnythingProcessorInvocation"] | components["schemas"]["LatentsToLatentsInvocation"]; }; }; responses: { diff --git a/invokeai/frontend/web/src/services/api/types.d.ts b/invokeai/frontend/web/src/services/api/types.d.ts index 14705c9525..2ee508fe48 100644 --- a/invokeai/frontend/web/src/services/api/types.d.ts +++ b/invokeai/frontend/web/src/services/api/types.d.ts @@ -59,9 +59,9 @@ export type DiffusersModelConfig = export type CheckpointModelConfig = | components['schemas']['StableDiffusion1ModelCheckpointConfig'] | components['schemas']['StableDiffusion2ModelCheckpointConfig'] - | components['schemas']['StableDiffusion2ModelDiffusersConfig']; -export type OnnxModelConfig = components['schemas']['ONNXStableDiffusion1ModelConfig'] | components['schemas']['StableDiffusionXLModelCheckpointConfig']; +export type OnnxModelConfig = + components['schemas']['ONNXStableDiffusion1ModelConfig']; export type MainModelConfig = DiffusersModelConfig | CheckpointModelConfig; export type AnyModelConfig = | LoRAModelConfig @@ -116,6 +116,9 @@ export type NoiseInvocation = TypeReq; export type TextToLatentsInvocation = TypeReq< components['schemas']['TextToLatentsInvocation'] >; +export type ONNXTextToLatentsInvocation = TypeReq< + components['schemas']['ONNXTextToLatentsInvocation'] +>; export type LatentsToLatentsInvocation = TypeReq< components['schemas']['LatentsToLatentsInvocation'] >; From 41d6a38690f6c93d481183787f001211313c705a Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Tue, 1 Aug 2023 21:29:16 +1000 Subject: [PATCH 2/2] Update lint-frontend.yml The action should run on every PR. We can make this more efficient in the future. --- .github/workflows/lint-frontend.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/lint-frontend.yml b/.github/workflows/lint-frontend.yml index 1403396359..de1e8866b2 100644 --- a/.github/workflows/lint-frontend.yml +++ b/.github/workflows/lint-frontend.yml @@ -2,8 +2,6 @@ name: Lint frontend on: pull_request: - paths: - - 'invokeai/frontend/web/**' types: - 'ready_for_review' - 'opened' @@ -11,8 +9,6 @@ on: push: branches: - 'main' - paths: - - 'invokeai/frontend/web/**' merge_group: workflow_dispatch: