From bcf127e38717f93569677034bc69f0377c3fa9ee Mon Sep 17 00:00:00 2001 From: ceruleandeep Date: Mon, 18 Nov 2024 22:17:19 +1100 Subject: [PATCH] Add diffusion unets to ComfyUI models list rm string interpolation --- src/endpoints/stable-diffusion.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/endpoints/stable-diffusion.js b/src/endpoints/stable-diffusion.js index 3679d9ea1..567dadf13 100644 --- a/src/endpoints/stable-diffusion.js +++ b/src/endpoints/stable-diffusion.js @@ -411,10 +411,11 @@ comfy.post('/models', jsonParser, async (request, response) => { const data = await result.json(); const ckpts = data.CheckpointLoaderSimple.input.required.ckpt_name[0].map(it => ({ value: it, text: it })) || []; + const unets = data.UNETLoader.input.required.unet_name[0].map(it => ({ value: it, text: `UNet: ${it}` })) || []; // load list of GGUF unets from diffusion_models if the loader node is available const ggufs = data.UnetLoaderGGUF?.input.required.unet_name[0].map(it => ({ value: it, text: `GGUF: ${it}` })) || []; - const models = ckpts.concat(ggufs); + const models = [...ckpts, ...unets, ...ggufs]; // make the display names of the models somewhat presentable models.forEach(it => it.text = it.text.replace(/\.[^.]*$/, '').replace(/_/g, ' ')); @@ -577,7 +578,7 @@ comfy.post('/generate', jsonParser, async (request, response) => { return response.send(imgBuffer.toString('base64')); } catch (error) { console.log('ComfyUI error:', error); - response.status(500).send(`${error.message}`); + response.status(500).send(error.message); return response; } });