Skip to content

Commit 8125ff3

Browse files
psychedelicioushipsterusername
authored andcommitted
fix(ui): prefer 'lama' infill when handling infill fallback
LaMA is the next best infill after patchmatch - prefer it.
1 parent 6e6bbc5 commit 8125ff3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/appConfigReceived.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ export const addAppConfigReceivedListener = (startAppListening: AppStartListenin
1111
const infillMethod = getState().params.infillMethod;
1212

1313
if (!infill_methods.includes(infillMethod)) {
14-
// if there is no infill method, set it to the first one
15-
// if there is no first one... god help us
16-
dispatch(setInfillMethod(infill_methods[0] as string));
14+
// If the selected infill method does not exist, prefer 'lama' if it's in the list, otherwise 'tile'.
15+
// TODO(psyche): lama _should_ always be in the list, but the API doesn't guarantee it...
16+
const infillMethod = infill_methods.includes('lama') ? 'lama' : 'tile';
17+
dispatch(setInfillMethod(infillMethod));
1718
}
1819

1920
if (!nsfw_methods.includes('nsfw_checker')) {

0 commit comments

Comments
 (0)