fix(ui): do not add control adapters with incompatible models to graph

This commit is contained in:
psychedelicious 2023-10-07 17:40:41 +11:00
parent 35374ec531
commit ad136c2680
3 changed files with 9 additions and 3 deletions

View File

@ -19,7 +19,9 @@ export const addControlNetToLinearGraph = (
graph: NonNullableGraph,
baseNodeId: string
): void => {
const validControlNets = selectValidControlNets(state.controlAdapters);
const validControlNets = selectValidControlNets(state.controlAdapters).filter(
(ca) => ca.model?.base_model === state.generation.model?.base_model
);
const metadataAccumulator = graph.nodes[METADATA_ACCUMULATOR] as
| MetadataAccumulatorInvocation

View File

@ -17,7 +17,9 @@ export const addIPAdapterToLinearGraph = (
graph: NonNullableGraph,
baseNodeId: string
): void => {
const validIPAdapters = selectValidIPAdapters(state.controlAdapters);
const validIPAdapters = selectValidIPAdapters(state.controlAdapters).filter(
(ca) => ca.model?.base_model === state.generation.model?.base_model
);
const metadataAccumulator = graph.nodes[METADATA_ACCUMULATOR] as
| MetadataAccumulatorInvocation

View File

@ -18,7 +18,9 @@ export const addT2IAdaptersToLinearGraph = (
graph: NonNullableGraph,
baseNodeId: string
): void => {
const validT2IAdapters = selectValidT2IAdapters(state.controlAdapters);
const validT2IAdapters = selectValidT2IAdapters(state.controlAdapters).filter(
(ca) => ca.model?.base_model === state.generation.model?.base_model
);
const metadataAccumulator = graph.nodes[METADATA_ACCUMULATOR] as
| MetadataAccumulatorInvocation