From 28e6a7139b7e8c2c84409cc47d3e13505bd95005 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Thu, 21 Sep 2023 13:07:15 +1000 Subject: [PATCH] fix(ui): add control adapters to canvas coherence pass --- .../graphBuilders/addControlNetToLinearGraph.ts | 16 +++++++++++++++- .../graphBuilders/addIPAdapterToLinearGraph.ts | 12 +++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addControlNetToLinearGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addControlNetToLinearGraph.ts index 491c6547ba..1df90624ef 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addControlNetToLinearGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addControlNetToLinearGraph.ts @@ -8,7 +8,11 @@ import { MetadataAccumulatorInvocation, } from 'services/api/types'; import { NonNullableGraph } from '../../types/types'; -import { CONTROL_NET_COLLECT, METADATA_ACCUMULATOR } from './constants'; +import { + CANVAS_COHERENCE_DENOISE_LATENTS, + CONTROL_NET_COLLECT, + METADATA_ACCUMULATOR, +} from './constants'; export const addControlNetToLinearGraph = ( state: RootState, @@ -100,6 +104,16 @@ export const addControlNetToLinearGraph = ( field: 'item', }, }); + + if (CANVAS_COHERENCE_DENOISE_LATENTS in graph.nodes) { + graph.edges.push({ + source: { node_id: controlNetNode.id, field: 'control' }, + destination: { + node_id: CANVAS_COHERENCE_DENOISE_LATENTS, + field: 'control', + }, + }); + } }); } } diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addIPAdapterToLinearGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addIPAdapterToLinearGraph.ts index da67b1d34d..d645b274ec 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addIPAdapterToLinearGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addIPAdapterToLinearGraph.ts @@ -1,7 +1,7 @@ import { RootState } from 'app/store/store'; import { IPAdapterInvocation } from 'services/api/types'; import { NonNullableGraph } from '../../types/types'; -import { IP_ADAPTER } from './constants'; +import { CANVAS_COHERENCE_DENOISE_LATENTS, IP_ADAPTER } from './constants'; export const addIPAdapterToLinearGraph = ( state: RootState, @@ -55,5 +55,15 @@ export const addIPAdapterToLinearGraph = ( field: 'ip_adapter', }, }); + + if (CANVAS_COHERENCE_DENOISE_LATENTS in graph.nodes) { + graph.edges.push({ + source: { node_id: ipAdapterNode.id, field: 'ip_adapter' }, + destination: { + node_id: CANVAS_COHERENCE_DENOISE_LATENTS, + field: 'ip_adapter', + }, + }); + } } };