mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): handle disabled RG layers
Was missing a check for `layer.isEnabled`.
This commit is contained in:
parent
fc7f484935
commit
cec8840038
@ -679,29 +679,23 @@ const isValidIPAdapter = (ipa: IPAdapterConfigV2, base: BaseModelType): boolean
|
|||||||
};
|
};
|
||||||
|
|
||||||
const isValidLayer = (layer: Layer, base: BaseModelType) => {
|
const isValidLayer = (layer: Layer, base: BaseModelType) => {
|
||||||
if (isControlAdapterLayer(layer)) {
|
|
||||||
if (!layer.isEnabled) {
|
if (!layer.isEnabled) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (isControlAdapterLayer(layer)) {
|
||||||
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;
|
return true;
|
||||||
}
|
}
|
||||||
if (isRegionalGuidanceLayer(layer)) {
|
if (isRegionalGuidanceLayer(layer)) {
|
||||||
const hasTextPrompt = Boolean(layer.positivePrompt || layer.negativePrompt);
|
const hasTextPrompt = Boolean(layer.positivePrompt) || Boolean(layer.negativePrompt);
|
||||||
const hasIPAdapter = layer.ipAdapters.filter((ipa) => isValidIPAdapter(ipa, base)).length > 0;
|
const hasIPAdapter = layer.ipAdapters.filter((ipa) => isValidIPAdapter(ipa, base)).length > 0;
|
||||||
return hasTextPrompt || hasIPAdapter;
|
return hasTextPrompt || hasIPAdapter;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user