Merge branch 'main' into refactor/cleanup-root-detection

This commit is contained in:
psychedelicious 2023-08-01 22:14:56 +10:00 committed by GitHub
commit 7292d89108
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 229 additions and 110 deletions

View File

@ -2,8 +2,6 @@ name: Lint frontend
on: on:
pull_request: pull_request:
paths:
- 'invokeai/frontend/web/**'
types: types:
- 'ready_for_review' - 'ready_for_review'
- 'opened' - 'opened'
@ -11,8 +9,6 @@ on:
push: push:
branches: branches:
- 'main' - 'main'
paths:
- 'invokeai/frontend/web/**'
merge_group: merge_group:
workflow_dispatch: workflow_dispatch:

View File

@ -1,6 +1,4 @@
#!/usr/bin/env sh #!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh" . "$(dirname -- "$0")/_/husky.sh"
python -m black . --check
cd invokeai/frontend/web/ && npm run lint-staged cd invokeai/frontend/web/ && npm run lint-staged

View File

@ -6,7 +6,7 @@ import {
modelChanged, modelChanged,
vaeSelected, vaeSelected,
} from 'features/parameters/store/generationSlice'; } 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 { addToast } from 'features/system/store/systemSlice';
import { makeToast } from 'features/system/util/makeToast'; import { makeToast } from 'features/system/util/makeToast';
import { forEach } from 'lodash-es'; import { forEach } from 'lodash-es';
@ -19,7 +19,7 @@ export const addModelSelectedListener = () => {
const log = logger('models'); const log = logger('models');
const state = getState(); const state = getState();
const result = zMainModel.safeParse(action.payload); const result = zMainOrOnnxModel.safeParse(action.payload);
if (!result.success) { if (!result.success) {
log.error( log.error(

View File

@ -6,7 +6,8 @@ import {
vaeSelected, vaeSelected,
} from 'features/parameters/store/generationSlice'; } from 'features/parameters/store/generationSlice';
import { import {
zMainModel, zMainOrOnnxModel,
zSDXLRefinerModel,
zVaeModel, zVaeModel,
} from 'features/parameters/types/parameterSchemas'; } from 'features/parameters/types/parameterSchemas';
import { import {
@ -53,7 +54,7 @@ export const addModelsLoadedListener = () => {
return; return;
} }
const result = zMainModel.safeParse(firstModel); const result = zMainOrOnnxModel.safeParse(firstModel);
if (!result.success) { if (!result.success) {
log.error( log.error(
@ -102,7 +103,7 @@ export const addModelsLoadedListener = () => {
return; return;
} }
const result = zMainModel.safeParse(firstModel); const result = zSDXLRefinerModel.safeParse(firstModel);
if (!result.success) { if (!result.success) {
log.error( log.error(

View File

@ -19,7 +19,7 @@ export const addLoRAsToGraph = (
state: RootState, state: RootState,
graph: NonNullableGraph, graph: NonNullableGraph,
baseNodeId: string, baseNodeId: string,
modelLoader: string = MAIN_MODEL_LOADER modelLoaderNodeId: string = MAIN_MODEL_LOADER
): void => { ): void => {
/** /**
* LoRA nodes get the UNet and CLIP models from the main model loader and apply the LoRA to them. * 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 // first lora = start the lora chain, attach directly to model loader
graph.edges.push({ graph.edges.push({
source: { source: {
node_id: modelLoader, node_id: modelLoaderNodeId,
field: 'unet', field: 'unet',
}, },
destination: { destination: {

View File

@ -17,7 +17,7 @@ import {
export const addVAEToGraph = ( export const addVAEToGraph = (
state: RootState, state: RootState,
graph: NonNullableGraph, graph: NonNullableGraph,
modelLoader: string = MAIN_MODEL_LOADER modelLoaderNodeId: string = MAIN_MODEL_LOADER
): void => { ): void => {
const { vae } = state.generation; const { vae } = state.generation;
@ -34,11 +34,11 @@ export const addVAEToGraph = (
vae_model: vae, 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) { if (graph.id === TEXT_TO_IMAGE_GRAPH || graph.id === IMAGE_TO_IMAGE_GRAPH) {
graph.edges.push({ graph.edges.push({
source: { source: {
node_id: isAutoVae ? modelLoader : VAE_LOADER, node_id: isAutoVae ? modelLoaderNodeId : VAE_LOADER,
field: isAutoVae && isOnnxModel ? 'vae_decoder' : 'vae', field: isAutoVae && isOnnxModel ? 'vae_decoder' : 'vae',
}, },
destination: { destination: {
@ -51,7 +51,7 @@ export const addVAEToGraph = (
if (graph.id === IMAGE_TO_IMAGE_GRAPH) { if (graph.id === IMAGE_TO_IMAGE_GRAPH) {
graph.edges.push({ graph.edges.push({
source: { source: {
node_id: isAutoVae ? modelLoader : VAE_LOADER, node_id: isAutoVae ? modelLoaderNodeId : VAE_LOADER,
field: isAutoVae && isOnnxModel ? 'vae_decoder' : 'vae', field: isAutoVae && isOnnxModel ? 'vae_decoder' : 'vae',
}, },
destination: { destination: {
@ -64,7 +64,7 @@ export const addVAEToGraph = (
if (graph.id === INPAINT_GRAPH) { if (graph.id === INPAINT_GRAPH) {
graph.edges.push({ graph.edges.push({
source: { source: {
node_id: isAutoVae ? modelLoader : VAE_LOADER, node_id: isAutoVae ? modelLoaderNodeId : VAE_LOADER,
field: isAutoVae && isOnnxModel ? 'vae_decoder' : 'vae', field: isAutoVae && isOnnxModel ? 'vae_decoder' : 'vae',
}, },
destination: { destination: {

View File

@ -20,6 +20,10 @@ import {
TEXT_TO_IMAGE_GRAPH, TEXT_TO_IMAGE_GRAPH,
TEXT_TO_LATENTS, TEXT_TO_LATENTS,
} from './constants'; } from './constants';
import {
ONNXTextToLatentsInvocation,
TextToLatentsInvocation,
} from 'services/api/types';
/** /**
* Builds the Canvas tab's Text to Image graph. * Builds the Canvas tab's Text to Image graph.
@ -53,8 +57,31 @@ export const buildCanvasTextToImageGraph = (
const use_cpu = shouldUseNoiseSettings const use_cpu = shouldUseNoiseSettings
? shouldUseCpuNoise ? shouldUseCpuNoise
: initialGenerationState.shouldUseCpuNoise; : initialGenerationState.shouldUseCpuNoise;
const onnx_model_type = model.model_type.includes('onnx'); const isUsingOnnxModel = model.model_type === 'onnx';
const model_loader = onnx_model_type ? ONNX_MODEL_LOADER : MAIN_MODEL_LOADER; 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 * 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 * 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, id: TEXT_TO_IMAGE_GRAPH,
nodes: { nodes: {
[POSITIVE_CONDITIONING]: { [POSITIVE_CONDITIONING]: {
type: onnx_model_type ? 'prompt_onnx' : 'compel', type: isUsingOnnxModel ? 'prompt_onnx' : 'compel',
id: POSITIVE_CONDITIONING, id: POSITIVE_CONDITIONING,
is_intermediate: true, is_intermediate: true,
prompt: positivePrompt, prompt: positivePrompt,
}, },
[NEGATIVE_CONDITIONING]: { [NEGATIVE_CONDITIONING]: {
type: onnx_model_type ? 'prompt_onnx' : 'compel', type: isUsingOnnxModel ? 'prompt_onnx' : 'compel',
id: NEGATIVE_CONDITIONING, id: NEGATIVE_CONDITIONING,
is_intermediate: true, is_intermediate: true,
prompt: negativePrompt, prompt: negativePrompt,
@ -89,17 +116,10 @@ export const buildCanvasTextToImageGraph = (
height, height,
use_cpu, use_cpu,
}, },
[TEXT_TO_LATENTS]: { [t2lNode.id]: t2lNode,
type: onnx_model_type ? 't2l_onnx' : 't2l', [modelLoaderNodeId]: {
id: TEXT_TO_LATENTS, type: modelLoaderNodeType,
is_intermediate: true, id: modelLoaderNodeId,
cfg_scale,
scheduler,
steps,
},
[model_loader]: {
type: model_loader,
id: model_loader,
is_intermediate: true, is_intermediate: true,
model, model,
}, },
@ -110,7 +130,7 @@ export const buildCanvasTextToImageGraph = (
skipped_layers: clipSkip, skipped_layers: clipSkip,
}, },
[LATENTS_TO_IMAGE]: { [LATENTS_TO_IMAGE]: {
type: onnx_model_type ? 'l2i_onnx' : 'l2i', type: isUsingOnnxModel ? 'l2i_onnx' : 'l2i',
id: LATENTS_TO_IMAGE, id: LATENTS_TO_IMAGE,
is_intermediate: !shouldAutoSave, is_intermediate: !shouldAutoSave,
}, },
@ -138,7 +158,7 @@ export const buildCanvasTextToImageGraph = (
}, },
{ {
source: { source: {
node_id: model_loader, node_id: modelLoaderNodeId,
field: 'clip', field: 'clip',
}, },
destination: { destination: {
@ -168,7 +188,7 @@ export const buildCanvasTextToImageGraph = (
}, },
{ {
source: { source: {
node_id: model_loader, node_id: modelLoaderNodeId,
field: 'unet', field: 'unet',
}, },
destination: { destination: {
@ -232,10 +252,10 @@ export const buildCanvasTextToImageGraph = (
}); });
// add LoRA support // add LoRA support
addLoRAsToGraph(state, graph, TEXT_TO_LATENTS, model_loader); addLoRAsToGraph(state, graph, TEXT_TO_LATENTS, modelLoaderNodeId);
// optionally add custom VAE // optionally add custom VAE
addVAEToGraph(state, graph, model_loader); addVAEToGraph(state, graph, modelLoaderNodeId);
// add dynamic prompts - also sets up core iteration and seed // add dynamic prompts - also sets up core iteration and seed
addDynamicPromptsToGraph(state, graph); addDynamicPromptsToGraph(state, graph);

View File

@ -20,6 +20,10 @@ import {
TEXT_TO_IMAGE_GRAPH, TEXT_TO_IMAGE_GRAPH,
TEXT_TO_LATENTS, TEXT_TO_LATENTS,
} from './constants'; } from './constants';
import {
ONNXTextToLatentsInvocation,
TextToLatentsInvocation,
} from 'services/api/types';
export const buildLinearTextToImageGraph = ( export const buildLinearTextToImageGraph = (
state: RootState state: RootState
@ -49,8 +53,31 @@ export const buildLinearTextToImageGraph = (
throw new Error('No model found in state'); throw new Error('No model found in state');
} }
const onnx_model_type = model.model_type.includes('onnx'); const isUsingOnnxModel = model.model_type === 'onnx';
const model_loader = onnx_model_type ? ONNX_MODEL_LOADER : MAIN_MODEL_LOADER; 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 * 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 * 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 = { const graph: NonNullableGraph = {
id: TEXT_TO_IMAGE_GRAPH, id: TEXT_TO_IMAGE_GRAPH,
nodes: { nodes: {
[model_loader]: {
type: model_loader,
id: model_loader,
model,
},
[CLIP_SKIP]: {
type: 'clip_skip',
id: CLIP_SKIP,
skipped_layers: clipSkip,
},
[POSITIVE_CONDITIONING]: { [POSITIVE_CONDITIONING]: {
type: onnx_model_type ? 'prompt_onnx' : 'compel', type: isUsingOnnxModel ? 'prompt_onnx' : 'compel',
id: POSITIVE_CONDITIONING, id: POSITIVE_CONDITIONING,
prompt: positivePrompt, prompt: positivePrompt,
is_intermediate: true,
}, },
[NEGATIVE_CONDITIONING]: { [NEGATIVE_CONDITIONING]: {
type: onnx_model_type ? 'prompt_onnx' : 'compel', type: isUsingOnnxModel ? 'prompt_onnx' : 'compel',
id: NEGATIVE_CONDITIONING, id: NEGATIVE_CONDITIONING,
prompt: negativePrompt, prompt: negativePrompt,
is_intermediate: true,
}, },
[NOISE]: { [NOISE]: {
type: 'noise', type: 'noise',
@ -92,16 +111,23 @@ export const buildLinearTextToImageGraph = (
width, width,
height, height,
use_cpu, use_cpu,
is_intermediate: true,
}, },
[TEXT_TO_LATENTS]: { [t2lNode.id]: t2lNode,
type: onnx_model_type ? 't2l_onnx' : 't2l', [modelLoaderNodeId]: {
id: TEXT_TO_LATENTS, type: modelLoaderNodeType,
cfg_scale, id: modelLoaderNodeId,
scheduler, is_intermediate: true,
steps, model,
},
[CLIP_SKIP]: {
type: 'clip_skip',
id: CLIP_SKIP,
skipped_layers: clipSkip,
is_intermediate: true,
}, },
[LATENTS_TO_IMAGE]: { [LATENTS_TO_IMAGE]: {
type: onnx_model_type ? 'l2i_onnx' : 'l2i', type: isUsingOnnxModel ? 'l2i_onnx' : 'l2i',
id: LATENTS_TO_IMAGE, id: LATENTS_TO_IMAGE,
fp32: vaePrecision === 'fp32' ? true : false, fp32: vaePrecision === 'fp32' ? true : false,
}, },
@ -109,7 +135,7 @@ export const buildLinearTextToImageGraph = (
edges: [ edges: [
{ {
source: { source: {
node_id: model_loader, node_id: modelLoaderNodeId,
field: 'clip', field: 'clip',
}, },
destination: { destination: {
@ -119,7 +145,7 @@ export const buildLinearTextToImageGraph = (
}, },
{ {
source: { source: {
node_id: model_loader, node_id: modelLoaderNodeId,
field: 'unet', field: 'unet',
}, },
destination: { destination: {
@ -223,10 +249,10 @@ export const buildLinearTextToImageGraph = (
}); });
// add LoRA support // add LoRA support
addLoRAsToGraph(state, graph, TEXT_TO_LATENTS, model_loader); addLoRAsToGraph(state, graph, TEXT_TO_LATENTS, modelLoaderNodeId);
// optionally add custom VAE // optionally add custom VAE
addVAEToGraph(state, graph, model_loader); addVAEToGraph(state, graph, modelLoaderNodeId);
// add dynamic prompts - also sets up core iteration and seed // add dynamic prompts - also sets up core iteration and seed
addDynamicPromptsToGraph(state, graph); addDynamicPromptsToGraph(state, graph);

View File

@ -35,6 +35,7 @@ import {
isValidSDXLNegativeStylePrompt, isValidSDXLNegativeStylePrompt,
isValidSDXLPositiveStylePrompt, isValidSDXLPositiveStylePrompt,
isValidSDXLRefinerAestheticScore, isValidSDXLRefinerAestheticScore,
isValidSDXLRefinerModel,
isValidSDXLRefinerStart, isValidSDXLRefinerStart,
isValidScheduler, isValidScheduler,
isValidSeed, isValidSeed,
@ -381,7 +382,7 @@ export const useRecallParameters = () => {
dispatch(setNegativeStylePromptSDXL(negative_style_prompt)); dispatch(setNegativeStylePromptSDXL(negative_style_prompt));
} }
if (isValidMainModel(refiner_model)) { if (isValidSDXLRefinerModel(refiner_model)) {
dispatch(refinerModelChanged(refiner_model)); dispatch(refinerModelChanged(refiner_model));
} }

View File

@ -3,13 +3,14 @@ import { createSlice } from '@reduxjs/toolkit';
import { roundToMultiple } from 'common/util/roundDownToMultiple'; import { roundToMultiple } from 'common/util/roundDownToMultiple';
import { configChanged } from 'features/system/store/configSlice'; import { configChanged } from 'features/system/store/configSlice';
import { clamp } from 'lodash-es'; 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 { clipSkipMap } from '../types/constants';
import { import {
CfgScaleParam, CfgScaleParam,
HeightParam, HeightParam,
MainModelParam, MainModelParam,
NegativePromptParam, NegativePromptParam,
OnnxModelParam,
PositivePromptParam, PositivePromptParam,
PrecisionParam, PrecisionParam,
SchedulerParam, SchedulerParam,
@ -50,7 +51,7 @@ export interface GenerationState {
shouldUseSymmetry: boolean; shouldUseSymmetry: boolean;
horizontalSymmetrySteps: number; horizontalSymmetrySteps: number;
verticalSymmetrySteps: number; verticalSymmetrySteps: number;
model: MainModelField | OnnxModelField | null; model: MainModelParam | OnnxModelParam | null;
vae: VaeModelParam | null; vae: VaeModelParam | null;
vaePrecision: PrecisionParam; vaePrecision: PrecisionParam;
seamlessXAxis: boolean; seamlessXAxis: boolean;
@ -229,7 +230,10 @@ export const generationSlice = createSlice({
const { image_name, width, height } = action.payload; const { image_name, width, height } = action.payload;
state.initialImage = { imageName: image_name, width, height }; state.initialImage = { imageName: image_name, width, height };
}, },
modelChanged: (state, action: PayloadAction<MainModelParam | null>) => { modelChanged: (
state,
action: PayloadAction<MainModelParam | OnnxModelParam | null>
) => {
state.model = action.payload; state.model = action.payload;
if (state.model === null) { if (state.model === null) {

View File

@ -210,42 +210,70 @@ export type HeightParam = z.infer<typeof zHeight>;
export const isValidHeight = (val: unknown): val is HeightParam => export const isValidHeight = (val: unknown): val is HeightParam =>
zHeight.safeParse(val).success; 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']); const zBaseModel = z.enum(['sd-1', 'sd-2', 'sdxl', 'sdxl-refiner']);
export type BaseModelParam = z.infer<typeof zBaseModel>; export type BaseModelParam = z.infer<typeof zBaseModel>;
/** /**
* Zod schema for model parameter * Zod schema for main model parameter
* TODO: Make this a dynamically generated enum? * TODO: Make this a dynamically generated enum?
*/ */
export const zMainModel = z.object({ export const zMainModel = z.object({
model_name: z.string().min(1), model_name: z.string().min(1),
base_model: zBaseModel, 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<typeof zMainModel>; export type MainModelParam = z.infer<typeof zMainModel>;
/** /**
* Type alias for model parameter, inferred from its zod schema * Validates/type-guards a value as a main model parameter
*/
export type OnnxModelParam = z.infer<typeof zMainModel>;
/**
* Validates/type-guards a value as a model parameter
*/ */
export const isValidMainModel = (val: unknown): val is MainModelParam => export const isValidMainModel = (val: unknown): val is MainModelParam =>
zMainModel.safeParse(val).success; 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<typeof zSDXLRefinerModel>;
/**
* 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<typeof zOnnxModel>;
/**
* 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 * Zod schema for VAE parameter
*/ */

View File

@ -1,16 +1,17 @@
import { logger } from 'app/logging/logger'; import { logger } from 'app/logging/logger';
import { import {
MainModelParam, MainModelParam,
zMainModel, OnnxModelParam,
zMainOrOnnxModel,
} from 'features/parameters/types/parameterSchemas'; } from 'features/parameters/types/parameterSchemas';
export const modelIdToMainModelParam = ( export const modelIdToMainModelParam = (
mainModelId: string mainModelId: string
): MainModelParam | undefined => { ): OnnxModelParam | MainModelParam | undefined => {
const log = logger('models'); const log = logger('models');
const [base_model, model_type, model_name] = mainModelId.split('/'); const [base_model, model_type, model_name] = mainModelId.split('/');
const result = zMainModel.safeParse({ const result = zMainOrOnnxModel.safeParse({
base_model, base_model,
model_name, model_name,
model_type, model_type,

View File

@ -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;
};

View File

@ -6,7 +6,7 @@ import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
import { defaultSelectorOptions } from 'app/store/util/defaultMemoizeOptions'; import { defaultSelectorOptions } from 'app/store/util/defaultMemoizeOptions';
import IAIMantineSearchableSelect from 'common/components/IAIMantineSearchableSelect'; import IAIMantineSearchableSelect from 'common/components/IAIMantineSearchableSelect';
import { MODEL_TYPE_MAP } from 'features/parameters/types/constants'; 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 { refinerModelChanged } from 'features/sdxl/store/sdxlSlice';
import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus'; import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus';
import SyncModelsButton from 'features/ui/components/tabs/ModelManager/subpanels/ModelManagerSettingsPanel/SyncModelsButton'; import SyncModelsButton from 'features/ui/components/tabs/ModelManager/subpanels/ModelManagerSettingsPanel/SyncModelsButton';
@ -68,7 +68,7 @@ const ParamSDXLRefinerModelSelect = () => {
return; return;
} }
const newModel = modelIdToMainModelParam(v); const newModel = modelIdToSDXLRefinerModelParam(v);
if (!newModel) { if (!newModel) {
return; return;

View File

@ -1,11 +1,10 @@
import { PayloadAction, createSlice } from '@reduxjs/toolkit'; import { PayloadAction, createSlice } from '@reduxjs/toolkit';
import { import {
MainModelParam,
NegativeStylePromptSDXLParam, NegativeStylePromptSDXLParam,
PositiveStylePromptSDXLParam, PositiveStylePromptSDXLParam,
SDXLRefinerModelParam,
SchedulerParam, SchedulerParam,
} from 'features/parameters/types/parameterSchemas'; } from 'features/parameters/types/parameterSchemas';
import { MainModelField } from 'services/api/types';
type SDXLInitialState = { type SDXLInitialState = {
positiveStylePrompt: PositiveStylePromptSDXLParam; positiveStylePrompt: PositiveStylePromptSDXLParam;
@ -13,7 +12,7 @@ type SDXLInitialState = {
shouldConcatSDXLStylePrompt: boolean; shouldConcatSDXLStylePrompt: boolean;
shouldUseSDXLRefiner: boolean; shouldUseSDXLRefiner: boolean;
sdxlImg2ImgDenoisingStrength: number; sdxlImg2ImgDenoisingStrength: number;
refinerModel: MainModelField | null; refinerModel: SDXLRefinerModelParam | null;
refinerSteps: number; refinerSteps: number;
refinerCFGScale: number; refinerCFGScale: number;
refinerScheduler: SchedulerParam; refinerScheduler: SchedulerParam;
@ -56,7 +55,7 @@ const sdxlSlice = createSlice({
}, },
refinerModelChanged: ( refinerModelChanged: (
state, state,
action: PayloadAction<MainModelParam | null> action: PayloadAction<SDXLRefinerModelParam | null>
) => { ) => {
state.refinerModel = action.payload; state.refinerModel = action.payload;
}, },

View File

@ -97,6 +97,13 @@ const ModelList = (props: ModelListProps) => {
> >
{t('modelManager.diffusersModels')} {t('modelManager.diffusersModels')}
</IAIButton> </IAIButton>
<IAIButton
size="sm"
onClick={() => setModelFormatFilter('checkpoint')}
isChecked={modelFormatFilter === 'checkpoint'}
>
{t('modelManager.checkpointModels')}
</IAIButton>
<IAIButton <IAIButton
size="sm" size="sm"
onClick={() => setModelFormatFilter('onnx')} onClick={() => setModelFormatFilter('onnx')}

View File

@ -15,10 +15,11 @@ import {
LoRAModelConfigEntity, LoRAModelConfigEntity,
useDeleteMainModelsMutation, useDeleteMainModelsMutation,
useDeleteLoRAModelsMutation, useDeleteLoRAModelsMutation,
OnnxModelConfigEntity,
} from 'services/api/endpoints/models'; } from 'services/api/endpoints/models';
type ModelListItemProps = { type ModelListItemProps = {
model: MainModelConfigEntity | LoRAModelConfigEntity; model: MainModelConfigEntity | OnnxModelConfigEntity | LoRAModelConfigEntity;
isSelected: boolean; isSelected: boolean;
setSelectedModelId: (v: string | undefined) => void; setSelectedModelId: (v: string | undefined) => void;
}; };
@ -37,9 +38,12 @@ export default function ModelListItem(props: ModelListItemProps) {
}, [model.id, setSelectedModelId]); }, [model.id, setSelectedModelId]);
const handleModelDelete = useCallback(() => { const handleModelDelete = useCallback(() => {
const method = { main: deleteMainModel, lora: deleteLoRAModel }[ const method = {
model.model_type main: deleteMainModel,
]; lora: deleteLoRAModel,
onnx: deleteMainModel,
}[model.model_type];
method(model) method(model)
.unwrap() .unwrap()
.then((_) => { .then((_) => {

View File

@ -1381,7 +1381,7 @@ export type components = {
* @description The nodes in this graph * @description The nodes in this graph
*/ */
nodes?: { 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 * Edges
@ -1424,7 +1424,7 @@ export type components = {
* @description The results of node executions * @description The results of node executions
*/ */
results: { 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 * Errors
@ -2562,10 +2562,10 @@ export type components = {
/** /**
* Infill Method * Infill Method
* @description The method used to infill empty regions (px) * @description The method used to infill empty regions (px)
* @default tile * @default patchmatch
* @enum {string} * @enum {string}
*/ */
infill_method?: "tile" | "solid"; infill_method?: "patchmatch" | "tile" | "solid";
/** /**
* Inpaint Width * Inpaint Width
* @description The width of the inpaint region (px) * @description The width of the inpaint region (px)
@ -5892,11 +5892,11 @@ export type components = {
image?: components["schemas"]["ImageField"]; image?: components["schemas"]["ImageField"];
}; };
/** /**
* StableDiffusionOnnxModelFormat * ControlNetModelFormat
* @description An enumeration. * @description An enumeration.
* @enum {string} * @enum {string}
*/ */
StableDiffusionOnnxModelFormat: "olive" | "onnx"; ControlNetModelFormat: "checkpoint" | "diffusers";
/** /**
* StableDiffusionXLModelFormat * StableDiffusionXLModelFormat
* @description An enumeration. * @description An enumeration.
@ -5904,11 +5904,11 @@ export type components = {
*/ */
StableDiffusionXLModelFormat: "checkpoint" | "diffusers"; StableDiffusionXLModelFormat: "checkpoint" | "diffusers";
/** /**
* ControlNetModelFormat * StableDiffusionOnnxModelFormat
* @description An enumeration. * @description An enumeration.
* @enum {string} * @enum {string}
*/ */
ControlNetModelFormat: "checkpoint" | "diffusers"; StableDiffusionOnnxModelFormat: "olive" | "onnx";
/** /**
* StableDiffusion2ModelFormat * StableDiffusion2ModelFormat
* @description An enumeration. * @description An enumeration.
@ -6031,7 +6031,7 @@ export type operations = {
}; };
requestBody: { requestBody: {
content: { 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: { responses: {
@ -6068,7 +6068,7 @@ export type operations = {
}; };
requestBody: { requestBody: {
content: { 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: { responses: {

View File

@ -59,9 +59,9 @@ export type DiffusersModelConfig =
export type CheckpointModelConfig = export type CheckpointModelConfig =
| components['schemas']['StableDiffusion1ModelCheckpointConfig'] | components['schemas']['StableDiffusion1ModelCheckpointConfig']
| components['schemas']['StableDiffusion2ModelCheckpointConfig'] | components['schemas']['StableDiffusion2ModelCheckpointConfig']
| components['schemas']['StableDiffusion2ModelDiffusersConfig'];
export type OnnxModelConfig = components['schemas']['ONNXStableDiffusion1ModelConfig']
| components['schemas']['StableDiffusionXLModelCheckpointConfig']; | components['schemas']['StableDiffusionXLModelCheckpointConfig'];
export type OnnxModelConfig =
components['schemas']['ONNXStableDiffusion1ModelConfig'];
export type MainModelConfig = DiffusersModelConfig | CheckpointModelConfig; export type MainModelConfig = DiffusersModelConfig | CheckpointModelConfig;
export type AnyModelConfig = export type AnyModelConfig =
| LoRAModelConfig | LoRAModelConfig
@ -116,6 +116,9 @@ export type NoiseInvocation = TypeReq<components['schemas']['NoiseInvocation']>;
export type TextToLatentsInvocation = TypeReq< export type TextToLatentsInvocation = TypeReq<
components['schemas']['TextToLatentsInvocation'] components['schemas']['TextToLatentsInvocation']
>; >;
export type ONNXTextToLatentsInvocation = TypeReq<
components['schemas']['ONNXTextToLatentsInvocation']
>;
export type LatentsToLatentsInvocation = TypeReq< export type LatentsToLatentsInvocation = TypeReq<
components['schemas']['LatentsToLatentsInvocation'] components['schemas']['LatentsToLatentsInvocation']
>; >;