From d45c33b44660c32c65765285d4cbe54181b7f91a Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Fri, 24 May 2024 06:17:07 +1000 Subject: [PATCH] fix(ui): `'undefined'` being used for metadata on uploaded images --- invokeai/frontend/web/src/services/api/endpoints/images.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/invokeai/frontend/web/src/services/api/endpoints/images.ts b/invokeai/frontend/web/src/services/api/endpoints/images.ts index 5d56a61add..c9052a607d 100644 --- a/invokeai/frontend/web/src/services/api/endpoints/images.ts +++ b/invokeai/frontend/web/src/services/api/endpoints/images.ts @@ -576,7 +576,9 @@ export const imagesApi = api.injectEndpoints({ query: ({ file, image_category, is_intermediate, session_id, board_id, crop_visible, metadata }) => { const formData = new FormData(); formData.append('file', file); - formData.append('metadata', JSON.stringify(metadata)); + if (metadata) { + formData.append('metadata', JSON.stringify(metadata)); + } return { url: buildImagesUrl('upload'), method: 'POST',