fix: Type errors & missing Unet field component

This commit is contained in:
blessedcoolant 2023-07-14 18:00:41 +12:00 committed by psychedelicious
parent 8dd4ca5723
commit e1d6c09ed2
4 changed files with 25 additions and 11 deletions

View File

@ -16,8 +16,7 @@ import LoRAModelInputFieldComponent from './fields/LoRAModelInputFieldComponent'
import ModelInputFieldComponent from './fields/ModelInputFieldComponent';
import NumberInputFieldComponent from './fields/NumberInputFieldComponent';
import StringInputFieldComponent from './fields/StringInputFieldComponent';
import UNetInputFieldComponent from './fields/UNetInputFieldComponent';
import VaeInputFieldComponent from './fields/VaeInputFieldComponent';
import UnetInputFieldComponent from './fields/UnetInputFieldComponent';
import VaeModelInputFieldComponent from './fields/VaeModelInputFieldComponent';
type InputFieldComponentProps = {
@ -106,7 +105,7 @@ const InputFieldComponent = (props: InputFieldComponentProps) => {
if (type === 'unet' && template.type === 'unet') {
return (
<UNetInputFieldComponent
<UnetInputFieldComponent
nodeId={nodeId}
field={field}
template={template}
@ -124,9 +123,9 @@ const InputFieldComponent = (props: InputFieldComponentProps) => {
);
}
if (type === 'vae' && template.type === 'vae') {
if (type === 'vae_model' && template.type === 'vae_model') {
return (
<VaeInputFieldComponent
<VaeModelInputFieldComponent
nodeId={nodeId}
field={field}
template={template}

View File

@ -5,8 +5,8 @@ import IAIMantineSelect from 'common/components/IAIMantineSelect';
import IAIMantineSelectItemWithTooltip from 'common/components/IAIMantineSelectItemWithTooltip';
import { fieldValueChanged } from 'features/nodes/store/nodesSlice';
import {
VaeModelInputFieldTemplate,
VaeModelInputFieldValue,
LoRAModelInputFieldTemplate,
LoRAModelInputFieldValue,
} from 'features/nodes/types/types';
import { MODEL_TYPE_MAP } from 'features/parameters/types/constants';
import { modelIdToLoRAModelParam } from 'features/parameters/util/modelIdToLoRAModelParam';
@ -17,8 +17,8 @@ import { FieldComponentProps } from './types';
const LoRAModelInputFieldComponent = (
props: FieldComponentProps<
VaeModelInputFieldValue,
VaeModelInputFieldTemplate
LoRAModelInputFieldValue,
LoRAModelInputFieldTemplate
>
) => {
const { nodeId, field } = props;

View File

@ -0,0 +1,15 @@
import {
UNetInputFieldTemplate,
UNetInputFieldValue,
} from 'features/nodes/types/types';
import { memo } from 'react';
import { FieldComponentProps } from './types';
const UNetInputFieldComponent = (
props: FieldComponentProps<UNetInputFieldValue, UNetInputFieldTemplate>
) => {
const { nodeId, field } = props;
return null;
};
export default memo(UNetInputFieldComponent);

View File

@ -94,7 +94,7 @@ export type InputFieldValue =
| ConditioningInputFieldValue
| UNetInputFieldValue
| ClipInputFieldValue
| VaeInputFieldValue
| VaeModelInputFieldValue
| ControlInputFieldValue
| EnumInputFieldValue
| MainModelInputFieldValue
@ -121,7 +121,7 @@ export type InputFieldTemplate =
| ConditioningInputFieldTemplate
| UNetInputFieldTemplate
| ClipInputFieldTemplate
| VaeInputFieldTemplate
| VaeModelInputFieldTemplate
| ControlInputFieldTemplate
| EnumInputFieldTemplate
| ModelInputFieldTemplate