feat(ui): disable invoke button when t2i adapter used w/ image dims that are not multiples of 64

This commit is contained in:
psychedelicious 2024-05-10 16:35:04 +10:00
parent 2656f13a4a
commit d9ce9c62ac
2 changed files with 6 additions and 1 deletions

View File

@ -934,7 +934,8 @@
"noModelSelected": "No model selected",
"noPrompts": "No prompts generated",
"noNodesInGraph": "No nodes in graph",
"systemDisconnected": "System disconnected"
"systemDisconnected": "System disconnected",
"t2iAdapterMismatchedDimensions": "T2I Adapters require image dimensions to be multiples of 64"
},
"maskBlur": "Mask Blur",
"negativePromptPlaceholder": "Negative Prompt",

View File

@ -29,6 +29,7 @@ const selector = createMemoizedSelector(
],
(controlAdapters, generation, system, nodes, dynamicPrompts, controlLayers, activeTabName) => {
const { model } = generation;
const { size } = controlLayers.present;
const { positivePrompt } = controlLayers.present;
const { isConnected } = system;
@ -143,6 +144,9 @@ const selector = createMemoizedSelector(
})
);
}
if (ca.type === 't2i_adapter' && (size.width % 64 !== 0 || size.height % 64 !== 0)) {
reasons.push(i18n.t('parameters.invoke.t2iAdapterMismatchedDimensions'));
}
});
} else {
// Handling for all other tabs