fix(ui): fix crash when controlnet enabled but no controlnets added

This commit is contained in:
psychedelicious 2023-06-12 10:09:41 +10:00
parent e051c450ed
commit 8607b1994c

View File

@ -12,8 +12,10 @@ export const addControlNetToLinearGraph = (
): void => {
const { isEnabled: isControlNetEnabled, controlNets } = state.controlNet;
const controlNetCount = size(controlNets);
// Add ControlNet
if (isControlNetEnabled) {
if (isControlNetEnabled && controlNetCount > 0) {
if (size(controlNets) > 1) {
const controlNetIterateNode: CollectInvocation = {
id: CONTROL_NET_COLLECT,