From 571ba87e1348dd11e3ce8ed91afdf1660093decc Mon Sep 17 00:00:00 2001 From: Mary Hipp Date: Wed, 31 Jul 2024 10:11:48 -0400 Subject: [PATCH] fix(ui): include upscale metadata for SDXL multidiffusion --- .../graph/buildMultidiffusionUpscaleGraph.ts | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/invokeai/frontend/web/src/features/nodes/util/graph/buildMultidiffusionUpscaleGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graph/buildMultidiffusionUpscaleGraph.ts index 551cc45113..2905f31b50 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graph/buildMultidiffusionUpscaleGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graph/buildMultidiffusionUpscaleGraph.ts @@ -125,19 +125,11 @@ export const buildMultidiffusionUpscaleGraph = async (state: RootState): Promise g.addEdge(modelNode, 'unet', tiledMultidiffusionNode, 'unet'); addSDXLLoRas(state, g, tiledMultidiffusionNode, modelNode, null, posCondNode, negCondNode); - const modelConfig = await fetchModelConfigWithTypeGuard(model.key, isNonRefinerMainModelConfig); - g.upsertMetadata({ - cfg_scale, positive_prompt: positivePrompt, negative_prompt: negativePrompt, positive_style_prompt: positiveStylePrompt, negative_style_prompt: negativeStylePrompt, - model: Graph.getModelMetadataField(modelConfig), - seed, - steps, - scheduler, - vae: vae ?? undefined, }); } else { posCondNode = g.addNode({ @@ -166,24 +158,33 @@ export const buildMultidiffusionUpscaleGraph = async (state: RootState): Promise g.addEdge(modelNode, 'unet', tiledMultidiffusionNode, 'unet'); addLoRAs(state, g, tiledMultidiffusionNode, modelNode, null, clipSkipNode, posCondNode, negCondNode); - const modelConfig = await fetchModelConfigWithTypeGuard(model.key, isNonRefinerMainModelConfig); - const upscaleModelConfig = await fetchModelConfigWithTypeGuard(upscaleModel.key, isSpandrelImageToImageModelConfig); - g.upsertMetadata({ - cfg_scale, positive_prompt: positivePrompt, negative_prompt: negativePrompt, - model: Graph.getModelMetadataField(modelConfig), - seed, - steps, - scheduler, - vae: vae ?? undefined, - upscale_model: Graph.getModelMetadataField(upscaleModelConfig), - creativity, - structure, }); } + const modelConfig = await fetchModelConfigWithTypeGuard(model.key, isNonRefinerMainModelConfig); + const upscaleModelConfig = await fetchModelConfigWithTypeGuard(upscaleModel.key, isSpandrelImageToImageModelConfig); + + g.upsertMetadata({ + cfg_scale, + model: Graph.getModelMetadataField(modelConfig), + seed, + steps, + scheduler, + vae: vae ?? undefined, + upscale_model: Graph.getModelMetadataField(upscaleModelConfig), + creativity, + structure, + upscale_initial_image: { + image_name: upscaleInitialImage.image_name, + width: upscaleInitialImage.width, + height: upscaleInitialImage.height, + }, + upscale_scale: scale, + }); + g.setMetadataReceivingNode(l2iNode); g.addEdgeToMetadata(upscaleNode, 'width', 'width'); g.addEdgeToMetadata(upscaleNode, 'height', 'height');