mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix: merge conflicts
This commit is contained in:
parent
e9633a3adb
commit
382a55afd3
@ -13,6 +13,7 @@ import ControlNetModelInputField from './inputs/ControlNetModelInputField';
|
|||||||
import EnumInputField from './inputs/EnumInputField';
|
import EnumInputField from './inputs/EnumInputField';
|
||||||
import ImageCollectionInputField from './inputs/ImageCollectionInputField';
|
import ImageCollectionInputField from './inputs/ImageCollectionInputField';
|
||||||
import ImageInputField from './inputs/ImageInputField';
|
import ImageInputField from './inputs/ImageInputField';
|
||||||
|
import InpaintMaskInputField from './inputs/InpaintMaskInputField';
|
||||||
import LatentsInputField from './inputs/LatentsInputField';
|
import LatentsInputField from './inputs/LatentsInputField';
|
||||||
import LoRAModelInputField from './inputs/LoRAModelInputField';
|
import LoRAModelInputField from './inputs/LoRAModelInputField';
|
||||||
import MainModelInputField from './inputs/MainModelInputField';
|
import MainModelInputField from './inputs/MainModelInputField';
|
||||||
@ -105,6 +106,19 @@ const InputFieldRenderer = ({ nodeId, fieldName }: InputFieldProps) => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
field?.type === 'InpaintMaskField' &&
|
||||||
|
fieldTemplate?.type === 'InpaintMaskField'
|
||||||
|
) {
|
||||||
|
return (
|
||||||
|
<InpaintMaskInputField
|
||||||
|
nodeId={nodeId}
|
||||||
|
field={field}
|
||||||
|
fieldTemplate={fieldTemplate}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
field?.type === 'ConditioningField' &&
|
field?.type === 'ConditioningField' &&
|
||||||
fieldTemplate?.type === 'ConditioningField'
|
fieldTemplate?.type === 'ConditioningField'
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import {
|
import {
|
||||||
InpaintMaskFieldValue,
|
FieldComponentProps,
|
||||||
InpaintMaskInputFieldTemplate,
|
InpaintMaskInputFieldTemplate,
|
||||||
|
InpaintMaskInputFieldValue,
|
||||||
} from 'features/nodes/types/types';
|
} from 'features/nodes/types/types';
|
||||||
import { memo } from 'react';
|
import { memo } from 'react';
|
||||||
import { FieldComponentProps } from './types';
|
|
||||||
|
|
||||||
const InpaintMaskInputFieldComponent = (
|
const InpaintMaskInputFieldComponent = (
|
||||||
_props: FieldComponentProps<
|
_props: FieldComponentProps<
|
||||||
InpaintMaskFieldValue,
|
InpaintMaskInputFieldValue,
|
||||||
InpaintMaskInputFieldTemplate
|
InpaintMaskInputFieldTemplate
|
||||||
>
|
>
|
||||||
) => {
|
) => {
|
||||||
|
@ -109,40 +109,6 @@ export type FieldType = z.infer<typeof zFieldType>;
|
|||||||
export const isFieldType = (value: unknown): value is FieldType =>
|
export const isFieldType = (value: unknown): value is FieldType =>
|
||||||
zFieldType.safeParse(value).success;
|
zFieldType.safeParse(value).success;
|
||||||
|
|
||||||
/**
|
|
||||||
* An input field is persisted across reloads as part of the user's local state.
|
|
||||||
*
|
|
||||||
* An input field has three properties:
|
|
||||||
* - `id` a unique identifier
|
|
||||||
* - `name` the name of the field, which comes from the python dataclass
|
|
||||||
* - `value` the field's value
|
|
||||||
*/
|
|
||||||
export type InputFieldValue =
|
|
||||||
| IntegerInputFieldValue
|
|
||||||
| SeedInputFieldValue
|
|
||||||
| FloatInputFieldValue
|
|
||||||
| StringInputFieldValue
|
|
||||||
| BooleanInputFieldValue
|
|
||||||
| ImageInputFieldValue
|
|
||||||
| InpaintMaskFieldValue
|
|
||||||
| LatentsInputFieldValue
|
|
||||||
| ConditioningInputFieldValue
|
|
||||||
| UNetInputFieldValue
|
|
||||||
| ClipInputFieldValue
|
|
||||||
| VaeInputFieldValue
|
|
||||||
| ControlInputFieldValue
|
|
||||||
| EnumInputFieldValue
|
|
||||||
| MainModelInputFieldValue
|
|
||||||
| SDXLMainModelInputFieldValue
|
|
||||||
| SDXLRefinerModelInputFieldValue
|
|
||||||
| VaeModelInputFieldValue
|
|
||||||
| LoRAModelInputFieldValue
|
|
||||||
| ControlNetModelInputFieldValue
|
|
||||||
| CollectionInputFieldValue
|
|
||||||
| CollectionItemInputFieldValue
|
|
||||||
| ColorInputFieldValue
|
|
||||||
| ImageCollectionInputFieldValue;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An input field template is generated on each page load from the OpenAPI schema.
|
* An input field template is generated on each page load from the OpenAPI schema.
|
||||||
*
|
*
|
||||||
@ -241,6 +207,12 @@ export const zConditioningField = z.object({
|
|||||||
});
|
});
|
||||||
export type ConditioningField = z.infer<typeof zConditioningField>;
|
export type ConditioningField = z.infer<typeof zConditioningField>;
|
||||||
|
|
||||||
|
export const zInpaintMaskField = z.object({
|
||||||
|
mask_name: z.string().trim().min(1),
|
||||||
|
masked_latents_name: z.string().trim().min(1).optional(),
|
||||||
|
});
|
||||||
|
export type InpaintMaskFieldValue = z.infer<typeof zInpaintMaskField>;
|
||||||
|
|
||||||
export const zIntegerInputFieldValue = zInputFieldValueBase.extend({
|
export const zIntegerInputFieldValue = zInputFieldValueBase.extend({
|
||||||
type: z.literal('integer'),
|
type: z.literal('integer'),
|
||||||
value: z.number().optional(),
|
value: z.number().optional(),
|
||||||
@ -277,6 +249,14 @@ export const zLatentsInputFieldValue = zInputFieldValueBase.extend({
|
|||||||
});
|
});
|
||||||
export type LatentsInputFieldValue = z.infer<typeof zLatentsInputFieldValue>;
|
export type LatentsInputFieldValue = z.infer<typeof zLatentsInputFieldValue>;
|
||||||
|
|
||||||
|
export const zInpaintMaskInputFieldValue = zInputFieldValueBase.extend({
|
||||||
|
type: z.literal('InpaintMaskField'),
|
||||||
|
value: zInpaintMaskField.optional(),
|
||||||
|
});
|
||||||
|
export type InpaintMaskInputFieldValue = z.infer<
|
||||||
|
typeof zInpaintMaskInputFieldValue
|
||||||
|
>;
|
||||||
|
|
||||||
export const zConditioningInputFieldValue = zInputFieldValueBase.extend({
|
export const zConditioningInputFieldValue = zInputFieldValueBase.extend({
|
||||||
type: z.literal('ConditioningField'),
|
type: z.literal('ConditioningField'),
|
||||||
value: zConditioningField.optional(),
|
value: zConditioningField.optional(),
|
||||||
@ -495,6 +475,7 @@ export const zInputFieldValue = z.discriminatedUnion('type', [
|
|||||||
zBooleanInputFieldValue,
|
zBooleanInputFieldValue,
|
||||||
zImageInputFieldValue,
|
zImageInputFieldValue,
|
||||||
zLatentsInputFieldValue,
|
zLatentsInputFieldValue,
|
||||||
|
zInpaintMaskInputFieldValue,
|
||||||
zConditioningInputFieldValue,
|
zConditioningInputFieldValue,
|
||||||
zUNetInputFieldValue,
|
zUNetInputFieldValue,
|
||||||
zClipInputFieldValue,
|
zClipInputFieldValue,
|
||||||
|
Loading…
Reference in New Issue
Block a user