fix(ui): skip RG layers with no mask

These do not need to be added to the graph or metadata, as they are no-ops on the backend.
This commit is contained in:
psychedelicious 2024-05-09 10:32:51 +10:00
parent ee6d63826f
commit 4d48a1a954

View File

@ -695,6 +695,10 @@ const isValidLayer = (layer: Layer, base: BaseModelType) => {
return true;
}
if (isRegionalGuidanceLayer(layer)) {
if (layer.maskObjects.length === 0) {
// Layer has no mask, meaning any guidance would be applied to an empty region.
return false;
}
const hasTextPrompt = Boolean(layer.positivePrompt) || Boolean(layer.negativePrompt);
const hasIPAdapter = layer.ipAdapters.filter((ipa) => isValidIPAdapter(ipa, base)).length > 0;
return hasTextPrompt || hasIPAdapter;