The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.
TypeScript agentai-chatai-studioall-in-onecoding-agentdesktop-appfluximage-generationlinuxllmlocal-ailocal-llmopen-sourceprivacyself-hostedstable-diffusionuncensoreduncensored-aivideo-generationwindows
fix(models): refresh on comfyui-model-downloaded, not just installBundleComplete
purple9b531d48b741
diff --git a/src/api/discover.ts b/src/api/discover.tsindex ae77719e..e1bda64a 100644--- a/src/api/discover.ts+++ b/src/api/discover.ts@@ -257,15 +257,11 @@ export async function installBundleComplete(bundle: ModelBundle): Promise<void>await refreshComfyModels()} catch { /* non-fatal — fetchModels also calls refresh */ }- // Dispatch event so CreateView refreshes model list+ // Dispatch event so CreateView + the Model Manager refresh their lists. This+ // fires AFTER refreshComfyModels() above, so a consumer that refetches here+ // sees ComfyUI's rescanned /object_info (the new file). useModels listens for+ // this event too (see its effect) so the Installed tab + pickers update.window.dispatchEvent(new CustomEvent('comfyui-model-downloaded'))- // Also fire the canonical model-list refresh: the Model Manager's Installed- // tab and the shared model store (chat + create pickers) listen on- // 'lu-models-refresh', NOT the comfy-specific event above. Without this a- // freshly downloaded image/video model showed as installed in Discover but- // was missing from the Installed tab and unselectable until a manual refresh- // (d37d7bf5 + neejuh, 2026-06-24, on v2.5.5).- window.dispatchEvent(new CustomEvent('lu-models-refresh'))if (errors.length > 0) {throw new Error(`Bundle install had ${errors.length} issue(s): ${errors.join('; ')}`)diff --git a/src/hooks/useModels.ts b/src/hooks/useModels.tsindex 784888fe..0cad9eb0 100644--- a/src/hooks/useModels.ts+++ b/src/hooks/useModels.ts@@ -39,7 +39,19 @@ export function useModels() {useEffect(() => {const handler = () => { fetchModels().catch(() => {}) }window.addEventListener('lu-models-refresh', handler)- return () => window.removeEventListener('lu-models-refresh', handler)+ // A finished ComfyUI image/video download fires 'comfyui-model-downloaded' —+ // from the download-store poller on completion AND from installBundleComplete+ // after it rescans ComfyUI. useModels must refetch on it too, or a freshly+ // downloaded model stays missing from the Installed tab + the chat/create+ // pickers until a manual reload (d37d7bf5 + neejuh, 2026-06-24, v2.5.5).+ // 'lu-models-refresh' alone did NOT cover this: installBundleComplete can bail+ // before any dispatch when ComfyUI is not fully up, while the file still+ // downloads and only the poller's event fires (verified live 2026-06-25).+ window.addEventListener('comfyui-model-downloaded', handler)+ return () => {+ window.removeEventListener('lu-models-refresh', handler)+ window.removeEventListener('comfyui-model-downloaded', handler)+ }// fetchModels is reassigned below on every render but always wraps the// same setModels — depending on it would just churn listeners.// eslint-disable-next-line react-hooks/exhaustive-deps