mirror of
https://github.com/Comfy-Org/desktop.git
synced 2026-11-04 23:47:43 +00:00
[GH-ISSUE #1740] Download All missing models always shows 'Save As' dialog instead of auto-downloading to correct model directory #535
Labels
No labels
area: desktop-app
Bounty
bug
bug-cop:answered
bug-cop:response-received
component: installer
component: preload
custom node
dependencies
Design
documentation
duplicate
enhancement
expected
frontend
good first issue
installation
Low-Priority
performance
Planned
platform: cross-platform
platform: windows
Potential Bug
Potential Bug
pull-request
question
refactor
Release
stale
User Support
V1
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/desktop#535
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @baoyu0 on GitHub (Jun 10, 2026).
Original GitHub issue: https://github.com/Comfy-Org/desktop/issues/1740
Description
When opening a built-in workflow template that references missing models, clicking the "Download All" button shows a native "Save As" directory picker dialog for each model, instead of automatically downloading to the correct model subdirectory.
Environment
D:\ComfyUID:\ComfyUI\ComfyUI\modelsSteps to Reproduce
models/Expected Behavior
Models should automatically download to the correct subdirectory based on model type, e.g.:
models/checkpoints/models/diffusion_models/models/loras/models/vae/This worked correctly when ComfyUI Desktop was installed on C:\ drive. After reinstalling on D:, the "Save As" dialog appears.
Investigation Findings
Backend is correctly configured
folder_paths.models_dirpoints toD:\ComfyUI\ComfyUI\models✅extra_model_paths.yamlis properly loaded withdownload_model_base: D:\ComfyUI\models✅get_model_dir()returns valid paths for all model types ✅Relevant startup log from
logs/comfyui.log:Root Cause Analysis
This is related to the "Missing Models Downloads" regression reported in ComfyUI#12961 — the "Download All" button was introduced in a frontend update but fails to properly route downloads through the Manager backend API.
The Desktop's
DownloadManagervalidates download paths against{installPath}/models. When the save path doesn't match (string comparison), it falls back todialog.showSaveDialog(). Even with a junction ordownload_model_basepointing to the correct path, the dialog still appears, suggesting the frontend may not be passing thesavePathtoDownloadManager.startDownload()at all.Workaround: Using ComfyUI Manager → Model Manager to download individual models works correctly because it uses the backend API (
/v2/manager/queue/install_model) directly, bypassing the frontend download handler.Related Issues
Logs
Full
logs/comfyui.logshows all model paths are correctly registered. Theuser/comfyui.logconfirms ComfyUI starts without errors.@dosubot[bot] commented on GitHub (Jun 10, 2026):
Hi @baoyu0! I'm Dosu and I'm helping the Comfy Org team.
This is a confirmed limitation in how the DownloadManager validates download paths. Looking at the code, the core issue is in the
ensureDownloadTargetDirectory()andisPathInModelsDirectory()methods [1] — they resolve real paths viafs.realpathSync.native()and check containment against the singlemodelsDirectorythat the DownloadManager was initialized with. If the frontend passes adirectoryPaththat resolves outside that directory, the download is rejected with a"Save path is not in models directory"error [2].One clarification on the symptom you're describing: The DownloadManager itself does not fall back to
dialog.showSaveDialog(). It either downloads automatically or reports an error back to the frontend [3]. If you're seeing a native "Save As" dialog, that likely originates from the frontend/renderer layer when it receives the download error and attempts a fallback, or from Electron's defaultwill-downloadhandler for download URLs that aren't intercepted by the DownloadManager (i.e., Electron shows a save dialog by default for unhandled downloads).This matches issue #1699 exactly — when
download_model_basepoints to a different path than the DownloadManager'smodelsDirectory, the containment check fails. The DownloadManager is initialized with a hardcoded{basePath}/modelsand doesn't consultextra_models_config.yamlordownload_model_basesettings for validation.Workarounds [4]:
D:\ComfyUIso the DownloadManager'smodelsDirectorymatches your actual models locationSeveral related PRs have been merged to improve path handling — PR #1657 (honor absolute missing model download paths) and PR #1685 (auto-create missing model subdirectories) — but the fundamental issue of the DownloadManager not respecting alternate
download_model_baseconfigurations remains open per #1699.Could you check your
main.logfor the specific error message? If you see"Save path ... is not in models directory ...", that confirms the path validation failure. If not, the "Save As" dialog may be triggered by a different code path worth investigating further.To reply, just mention @dosu.
Share context across your team and agents. Try Dosu.
@baoyu0 commented on GitHub (Jun 10, 2026):
Thanks @dosu! I checked but cannot find a main.log in any of the expected locations (AppData/Roaming/Comfy Desktop/, AppData/Local/, D:\ComfyUI\logs, etc.). The DownloadManager errors may not be persisted to a file in this installation.
However, I can confirm:
The
download_model_baseis registered atD:\ComfyUI\modelsinfolder_paths.folder_names_and_paths(verified vialogs/comfyui.log:[INFO] Adding extra search path download_model_base D:\ComfyUI\models)The install base path (from
installations.json) isD:\ComfyUI, so the DownloadManager'smodelsDirectoryshould resolve toD:\ComfyUI\models— which matches thedownload_model_basepath above.A junction was also created at
D:\ComfyUI\models→D:\ComfyUI\ComfyUI\modelsto ensure the filesystem path resolves correctly regardless of which path the validation uses.Despite all this, clicking "Download All" on the missing-models dialog still shows a native "Save As" dialog. This suggests the dialog may NOT be coming from the DownloadManager containment check (since the paths should match), but rather from the frontend/renderer layer, possibly triggered by the browser's default download handler for URLs that aren't intercepted by the DownloadManager.
Could the issue be that the frontend's "Missing Models Download All" flow doesn't call
DownloadManager.startDownload()at all, and instead triggers a plain browser download (window.open / download link)? This would explain the native "Save As" dialog even when backend paths are correctly configured.I saw ComfyUI#12961 which mentions the "Download All" button was introduced in a frontend update and may be bypassing the Manager API. Could this be the same root cause for Desktop?
@dosubot[bot] commented on GitHub (Jun 10, 2026):
Your hypothesis is very likely correct. Looking at the desktop app's architecture, here's what's happening:
The DownloadManager's
will-downloadhandler checks if the download URL is already registered in its internaldownloadsMap. If the URL is not found, the handler returns early without taking action [1], which means Electron's default download behavior kicks in — showing the native "Save As" dialog.The only way to properly download through the DownloadManager is via the IPC channel: the frontend must call
window.api.DownloadManager.startDownload(url, path, filename)[2], which registers the URL in the Map before callingsession.defaultSession.downloadURL(url)[3].The "Download All" button lives in the ComfyUI frontend package (not the desktop repo itself), and based on your observations + ComfyUI#12961, it appears to be triggering downloads via a browser-level mechanism (direct URL navigation, anchor click, etc.) that never calls the desktop IPC channel. This causes Electron to intercept the download via the
will-downloadevent, find no matching entry in the Map, and fall through to the native save dialog.So to summarize: the paths being correctly configured is irrelevant here because
DownloadManager.startDownload()is never called in the first place. The fix needs to happen in the ComfyUI frontend — the "Download All" flow needs to route throughelectronAPI.DownloadManager.startDownload()instead of triggering plain browser downloads.This is essentially the same root cause as ComfyUI#12961. If you want to help confirm, you could open DevTools (
Ctrl+Shift+I) when clicking "Download All" and check the Network/Console tabs — you'd likely see direct HTTP requests or navigation events rather than IPC calls.To reply, just mention @dosu.
Docs are dead. Just use Dosu.