fix(ui): control layers don't disable correctly

Closes #6424
This commit is contained in:
psychedelicious 2024-05-23 07:34:04 +10:00
parent 106674175c
commit 55d7d9cc75

View File

@ -487,26 +487,19 @@ const isValidIPAdapter = (ipa: IPAdapterConfigV2, base: BaseModelType): boolean
}; };
const isValidLayer = (layer: Layer, base: BaseModelType) => { const isValidLayer = (layer: Layer, base: BaseModelType) => {
if (!layer.isEnabled) {
return false;
}
if (isControlAdapterLayer(layer)) { if (isControlAdapterLayer(layer)) {
if (!layer.isEnabled) {
return false;
}
return isValidControlAdapter(layer.controlAdapter, base); return isValidControlAdapter(layer.controlAdapter, base);
} }
if (isIPAdapterLayer(layer)) { if (isIPAdapterLayer(layer)) {
if (!layer.isEnabled) {
return false;
}
return isValidIPAdapter(layer.ipAdapter, base); return isValidIPAdapter(layer.ipAdapter, base);
} }
if (isInitialImageLayer(layer)) { if (isInitialImageLayer(layer)) {
if (!layer.isEnabled) {
return false;
}
if (!layer.image) { if (!layer.image) {
return false; return false;
} }
return true;
} }
if (isRegionalGuidanceLayer(layer)) { if (isRegionalGuidanceLayer(layer)) {
const hasTextPrompt = Boolean(layer.positivePrompt || layer.negativePrompt); const hasTextPrompt = Boolean(layer.positivePrompt || layer.negativePrompt);