Skip to content

Commit e80e518

Browse files
fix(ui): disable invoke button if not valid model is selected
a (hopefully) rare edge case.
1 parent 08cf4d6 commit e80e518

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

invokeai/frontend/web/src/common/hooks/useIsReadyToInvoke.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,18 @@ const readinessSelector = createSelector(
1818
let isReady = true;
1919
const reasonsWhyNotReady: string[] = [];
2020

21-
if (activeTabName === 'img2img' && !initialImage) {
22-
isReady = false;
23-
reasonsWhyNotReady.push('No initial image selected');
21+
if (activeTabName === 'img2img') {
22+
if (!initialImage) {
23+
isReady = false;
24+
reasonsWhyNotReady.push('No initial image selected');
25+
}
26+
}
27+
28+
if (activeTabName !== 'nodes') {
29+
if (!state.generation.model) {
30+
isReady = false;
31+
reasonsWhyNotReady.push('No main model selected');
32+
}
2433
}
2534

2635
const { isSuccess: mainModelsSuccessfullyLoaded } =

0 commit comments

Comments
 (0)