From 337399ff7c81c62b23a6b52f4fae77d5a8da9885 Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Tue, 18 Jul 2023 11:57:45 +1200 Subject: [PATCH] fix: Add API tags for Scanned Models --- .../web/src/services/api/endpoints/models.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/invokeai/frontend/web/src/services/api/endpoints/models.ts b/invokeai/frontend/web/src/services/api/endpoints/models.ts index 015ba6ce2c..27e9aefcdb 100644 --- a/invokeai/frontend/web/src/services/api/endpoints/models.ts +++ b/invokeai/frontend/web/src/services/api/endpoints/models.ts @@ -385,6 +385,21 @@ export const modelsApi = api.injectEndpoints({ url: `/models/search?${folderQueryStr}`, }; }, + providesTags: (result, error, arg) => { + const tags: ApiFullTagDescription[] = [ + { type: 'ScannedModels', id: LIST_TAG }, + ]; + + if (result) { + tags.push( + ...result.map((id) => ({ + type: 'ScannedModels' as const, + id, + })) + ); + } + return tags; + }, }), getCheckpointConfigs: build.query({ query: () => {