mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): fix crash when controlnet enabled but no controlnets added
This commit is contained in:
parent
e051c450ed
commit
8607b1994c
@ -12,8 +12,10 @@ export const addControlNetToLinearGraph = (
|
|||||||
): void => {
|
): void => {
|
||||||
const { isEnabled: isControlNetEnabled, controlNets } = state.controlNet;
|
const { isEnabled: isControlNetEnabled, controlNets } = state.controlNet;
|
||||||
|
|
||||||
|
const controlNetCount = size(controlNets);
|
||||||
|
|
||||||
// Add ControlNet
|
// Add ControlNet
|
||||||
if (isControlNetEnabled) {
|
if (isControlNetEnabled && controlNetCount > 0) {
|
||||||
if (size(controlNets) > 1) {
|
if (size(controlNets) > 1) {
|
||||||
const controlNetIterateNode: CollectInvocation = {
|
const controlNetIterateNode: CollectInvocation = {
|
||||||
id: CONTROL_NET_COLLECT,
|
id: CONTROL_NET_COLLECT,
|
||||||
|
Loading…
Reference in New Issue
Block a user