From 0131e7d9287706166f8d4ac07ebec2304b81690c Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Thu, 14 Mar 2024 12:18:06 +1100 Subject: [PATCH] fix(ui): recall control adapter metadata fields --- .../web/src/features/metadata/util/parsers.ts | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/invokeai/frontend/web/src/features/metadata/util/parsers.ts b/invokeai/frontend/web/src/features/metadata/util/parsers.ts index 4483a4d414..10eaf45ca7 100644 --- a/invokeai/frontend/web/src/features/metadata/util/parsers.ts +++ b/invokeai/frontend/web/src/features/metadata/util/parsers.ts @@ -225,28 +225,27 @@ const parseControlNet: MetadataParseFunc = async (meta const control_model = await getProperty(metadataItem, 'control_model'); const key = await getModelKey(control_model, 'controlnet'); const controlNetModel = await fetchModelConfigWithTypeGuard(key, isControlNetModelConfig); - - const image = zControlField.shape.image.nullish().catch(null).parse(getProperty(metadataItem, 'image')); + const image = zControlField.shape.image.nullish().catch(null).parse(await getProperty(metadataItem, 'image')); const control_weight = zControlField.shape.control_weight .nullish() .catch(null) - .parse(getProperty(metadataItem, 'control_weight')); + .parse(await getProperty(metadataItem, 'control_weight')); const begin_step_percent = zControlField.shape.begin_step_percent .nullish() .catch(null) - .parse(getProperty(metadataItem, 'begin_step_percent')); + .parse(await getProperty(metadataItem, 'begin_step_percent')); const end_step_percent = zControlField.shape.end_step_percent .nullish() .catch(null) - .parse(getProperty(metadataItem, 'end_step_percent')); + .parse(await getProperty(metadataItem, 'end_step_percent')); const control_mode = zControlField.shape.control_mode .nullish() .catch(null) - .parse(getProperty(metadataItem, 'control_mode')); + .parse(await getProperty(metadataItem, 'control_mode')); const resize_mode = zControlField.shape.resize_mode .nullish() .catch(null) - .parse(getProperty(metadataItem, 'resize_mode')); + .parse(await getProperty(metadataItem, 'resize_mode')); const { processorType, processorNode } = buildControlAdapterProcessor(controlNetModel); @@ -284,20 +283,20 @@ const parseT2IAdapter: MetadataParseFunc = async (meta const key = await getModelKey(t2i_adapter_model, 't2i_adapter'); const t2iAdapterModel = await fetchModelConfigWithTypeGuard(key, isT2IAdapterModelConfig); - const image = zT2IAdapterField.shape.image.nullish().catch(null).parse(getProperty(metadataItem, 'image')); - const weight = zT2IAdapterField.shape.weight.nullish().catch(null).parse(getProperty(metadataItem, 'weight')); + const image = zT2IAdapterField.shape.image.nullish().catch(null).parse(await getProperty(metadataItem, 'image')); + const weight = zT2IAdapterField.shape.weight.nullish().catch(null).parse(await getProperty(metadataItem, 'weight')); const begin_step_percent = zT2IAdapterField.shape.begin_step_percent .nullish() .catch(null) - .parse(getProperty(metadataItem, 'begin_step_percent')); + .parse(await getProperty(metadataItem, 'begin_step_percent')); const end_step_percent = zT2IAdapterField.shape.end_step_percent .nullish() .catch(null) - .parse(getProperty(metadataItem, 'end_step_percent')); + .parse(await getProperty(metadataItem, 'end_step_percent')); const resize_mode = zT2IAdapterField.shape.resize_mode .nullish() .catch(null) - .parse(getProperty(metadataItem, 'resize_mode')); + .parse(await getProperty(metadataItem, 'resize_mode')); const { processorType, processorNode } = buildControlAdapterProcessor(t2iAdapterModel); @@ -334,16 +333,16 @@ const parseIPAdapter: MetadataParseFunc = async (metada const key = await getModelKey(ip_adapter_model, 'ip_adapter'); const ipAdapterModel = await fetchModelConfigWithTypeGuard(key, isIPAdapterModelConfig); - const image = zIPAdapterField.shape.image.nullish().catch(null).parse(getProperty(metadataItem, 'image')); - const weight = zIPAdapterField.shape.weight.nullish().catch(null).parse(getProperty(metadataItem, 'weight')); + const image = zIPAdapterField.shape.image.nullish().catch(null).parse(await getProperty(metadataItem, 'image')); + const weight = zIPAdapterField.shape.weight.nullish().catch(null).parse(await getProperty(metadataItem, 'weight')); const begin_step_percent = zIPAdapterField.shape.begin_step_percent .nullish() .catch(null) - .parse(getProperty(metadataItem, 'begin_step_percent')); + .parse(await getProperty(metadataItem, 'begin_step_percent')); const end_step_percent = zIPAdapterField.shape.end_step_percent .nullish() .catch(null) - .parse(getProperty(metadataItem, 'end_step_percent')); + .parse(await getProperty(metadataItem, 'end_step_percent')); const ipAdapter: IPAdapterConfigMetadata = { id: uuidv4(),