Skip to content

Commit 28e6a71

Browse files
fix(ui): add control adapters to canvas coherence pass
1 parent 1625854 commit 28e6a71

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

invokeai/frontend/web/src/features/nodes/util/graphBuilders/addControlNetToLinearGraph.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ import {
88
MetadataAccumulatorInvocation,
99
} from 'services/api/types';
1010
import { NonNullableGraph } from '../../types/types';
11-
import { CONTROL_NET_COLLECT, METADATA_ACCUMULATOR } from './constants';
11+
import {
12+
CANVAS_COHERENCE_DENOISE_LATENTS,
13+
CONTROL_NET_COLLECT,
14+
METADATA_ACCUMULATOR,
15+
} from './constants';
1216

1317
export const addControlNetToLinearGraph = (
1418
state: RootState,
@@ -100,6 +104,16 @@ export const addControlNetToLinearGraph = (
100104
field: 'item',
101105
},
102106
});
107+
108+
if (CANVAS_COHERENCE_DENOISE_LATENTS in graph.nodes) {
109+
graph.edges.push({
110+
source: { node_id: controlNetNode.id, field: 'control' },
111+
destination: {
112+
node_id: CANVAS_COHERENCE_DENOISE_LATENTS,
113+
field: 'control',
114+
},
115+
});
116+
}
103117
});
104118
}
105119
}

invokeai/frontend/web/src/features/nodes/util/graphBuilders/addIPAdapterToLinearGraph.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { RootState } from 'app/store/store';
22
import { IPAdapterInvocation } from 'services/api/types';
33
import { NonNullableGraph } from '../../types/types';
4-
import { IP_ADAPTER } from './constants';
4+
import { CANVAS_COHERENCE_DENOISE_LATENTS, IP_ADAPTER } from './constants';
55

66
export const addIPAdapterToLinearGraph = (
77
state: RootState,
@@ -55,5 +55,15 @@ export const addIPAdapterToLinearGraph = (
5555
field: 'ip_adapter',
5656
},
5757
});
58+
59+
if (CANVAS_COHERENCE_DENOISE_LATENTS in graph.nodes) {
60+
graph.edges.push({
61+
source: { node_id: ipAdapterNode.id, field: 'ip_adapter' },
62+
destination: {
63+
node_id: CANVAS_COHERENCE_DENOISE_LATENTS,
64+
field: 'ip_adapter',
65+
},
66+
});
67+
}
5868
}
5969
};

0 commit comments

Comments
 (0)