From 8125ff3e5f750e0b699ee3ff4a017808b08c6a6b Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Tue, 24 Sep 2024 06:52:34 +1000 Subject: [PATCH] fix(ui): prefer 'lama' infill when handling infill fallback LaMA is the next best infill after patchmatch - prefer it. --- .../listenerMiddleware/listeners/appConfigReceived.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/appConfigReceived.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/appConfigReceived.ts index d4d529b0de2..a8f3602440b 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/appConfigReceived.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/appConfigReceived.ts @@ -11,9 +11,10 @@ export const addAppConfigReceivedListener = (startAppListening: AppStartListenin const infillMethod = getState().params.infillMethod; if (!infill_methods.includes(infillMethod)) { - // if there is no infill method, set it to the first one - // if there is no first one... god help us - dispatch(setInfillMethod(infill_methods[0] as string)); + // If the selected infill method does not exist, prefer 'lama' if it's in the list, otherwise 'tile'. + // TODO(psyche): lama _should_ always be in the list, but the API doesn't guarantee it... + const infillMethod = infill_methods.includes('lama') ? 'lama' : 'tile'; + dispatch(setInfillMethod(infillMethod)); } if (!nsfw_methods.includes('nsfw_checker')) {