fix(ui): add control adapters to canvas coherence pass

This commit is contained in:
psychedelicious 2023-09-21 13:07:15 +10:00
parent 1625854eaf
commit 28e6a7139b
2 changed files with 26 additions and 2 deletions

View File

@ -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',
},
});
}
});
}
}

View File

@ -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',
},
});
}
}
};