feat(ui): disable invoke button if enabled control adapter model does not match base model

This commit is contained in:
psychedelicious 2023-10-07 17:45:28 +11:00
parent ad136c2680
commit e86658f864
2 changed files with 16 additions and 5 deletions

View File

@ -961,9 +961,10 @@
"missingFieldTemplate": "Missing field template",
"missingInputForField": "{{nodeLabel}} -> {{fieldLabel}} missing input",
"missingNodeTemplate": "Missing node template",
"noControlImageForControlNet": "ControlNet {{index}} has no control image",
"noControlImageForControlAdapter": "Control Adapter {{number}} has no control image",
"noInitialImageSelected": "No initial image selected",
"noModelForControlNet": "ControlNet {{index}} has no model selected.",
"noModelForControlAdapter": "Control Adapter {{number}} has no model selected.",
"incompatibleBaseModelForControlAdapter": "Control Adapter {{number}} model is invalid with main model.",
"noModelSelected": "No model selected",
"noPrompts": "No prompts generated",
"noNodesInGraph": "No nodes in graph",

View File

@ -93,9 +93,19 @@ const selector = createSelector(
if (!ca.isEnabled) {
return;
}
if (!ca.model) {
reasons.push(
i18n.t('parameters.invoke.noModelForControlNet', { index: i + 1 })
i18n.t('parameters.invoke.noModelForControlAdapter', {
number: i + 1,
})
);
} else if (ca.model.base_model !== model?.base_model) {
// This should never happen, just a sanity check
reasons.push(
i18n.t('parameters.invoke.incompatibleBaseModelForControlAdapter', {
number: i + 1,
})
);
}
@ -106,8 +116,8 @@ const selector = createSelector(
ca.processorType !== 'none')
) {
reasons.push(
i18n.t('parameters.invoke.noControlImageForControlNet', {
index: i + 1,
i18n.t('parameters.invoke.noControlImageForControlAdapter', {
number: i + 1,
})
);
}