mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): remove overly strict constraints on control adapter weight
This commit is contained in:
parent
66858effa2
commit
843f82c837
@ -1,7 +1,13 @@
|
|||||||
import { deepClone } from 'common/util/deepClone';
|
import { deepClone } from 'common/util/deepClone';
|
||||||
import { zModelIdentifierField } from 'features/nodes/types/common';
|
import { zModelIdentifierField } from 'features/nodes/types/common';
|
||||||
import { merge, omit } from 'lodash-es';
|
import { merge, omit } from 'lodash-es';
|
||||||
import type { BaseModelType, ControlNetModelConfig, Graph, ImageDTO, T2IAdapterModelConfig } from 'services/api/types';
|
import type {
|
||||||
|
AnyInvocation,
|
||||||
|
BaseModelType,
|
||||||
|
ControlNetModelConfig,
|
||||||
|
ImageDTO,
|
||||||
|
T2IAdapterModelConfig,
|
||||||
|
} from 'services/api/types';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
const zId = z.string().min(1);
|
const zId = z.string().min(1);
|
||||||
@ -147,7 +153,7 @@ const zBeginEndStepPct = z
|
|||||||
|
|
||||||
const zControlAdapterBase = z.object({
|
const zControlAdapterBase = z.object({
|
||||||
id: zId,
|
id: zId,
|
||||||
weight: z.number().gte(0).lte(1),
|
weight: z.number().gte(-1).lte(2),
|
||||||
image: zImageWithDims.nullable(),
|
image: zImageWithDims.nullable(),
|
||||||
processedImage: zImageWithDims.nullable(),
|
processedImage: zImageWithDims.nullable(),
|
||||||
processorConfig: zProcessorConfig.nullable(),
|
processorConfig: zProcessorConfig.nullable(),
|
||||||
@ -183,7 +189,7 @@ export const isIPMethodV2 = (v: unknown): v is IPMethodV2 => zIPMethodV2.safePar
|
|||||||
export const zIPAdapterConfigV2 = z.object({
|
export const zIPAdapterConfigV2 = z.object({
|
||||||
id: zId,
|
id: zId,
|
||||||
type: z.literal('ip_adapter'),
|
type: z.literal('ip_adapter'),
|
||||||
weight: z.number().gte(0).lte(1),
|
weight: z.number().gte(-1).lte(2),
|
||||||
method: zIPMethodV2,
|
method: zIPMethodV2,
|
||||||
image: zImageWithDims.nullable(),
|
image: zImageWithDims.nullable(),
|
||||||
model: zModelIdentifierField.nullable(),
|
model: zModelIdentifierField.nullable(),
|
||||||
@ -216,10 +222,7 @@ type ProcessorData<T extends ProcessorTypeV2> = {
|
|||||||
labelTKey: string;
|
labelTKey: string;
|
||||||
descriptionTKey: string;
|
descriptionTKey: string;
|
||||||
buildDefaults(baseModel?: BaseModelType): Extract<ProcessorConfig, { type: T }>;
|
buildDefaults(baseModel?: BaseModelType): Extract<ProcessorConfig, { type: T }>;
|
||||||
buildNode(
|
buildNode(image: ImageWithDims, config: Extract<ProcessorConfig, { type: T }>): Extract<AnyInvocation, { type: T }>;
|
||||||
image: ImageWithDims,
|
|
||||||
config: Extract<ProcessorConfig, { type: T }>
|
|
||||||
): Extract<Graph['nodes'][string], { type: T }>;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const minDim = (image: ImageWithDims): number => Math.min(image.width, image.height);
|
const minDim = (image: ImageWithDims): number => Math.min(image.width, image.height);
|
||||||
|
Loading…
Reference in New Issue
Block a user