mirror of
https://github.com/Comfy-Org/desktop.git
synced 2026-11-04 23:47:43 +00:00
[GH-ISSUE #1105] [Feature Request]: Support VPN proxy settings. #302
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#302
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 @comfyui-wiki on GitHub (Apr 21, 2025).
Original GitHub issue: https://github.com/Comfy-Org/desktop/issues/1105
Prerequisites
Problem Statement
It seems that ComfyUI still doesn't support VPN proxy settings right now.
I have searched the issues and found that previously there was one user in China who wanted this feature too #428. Then it was resolved by supporting the use of a custom torch pip mirror #473.
But I think the proxy setting still needs to be considered.
Here is why the proxy setting need been Supported for China users.
I just updated Desktop yesterday. But when the Desktop launched again, it showed that I need to install python packages again. But it still failed when I tried to install, maybe due to the network.
Even when I set the VPN to Global mode, it still didn't succeed.
Some VPN don't work well
I have tried several VPN these year, but some just don't worked well.
I can access Github with them but when I tried to clone repo from Github, it failed.
Sometimes just need to switch the VPN to global mode or use http.proxy for terminal will.
But not all the user know that they will just confuse why it didn't worked.
With VPN proxy the ComfyUI Manager works better.
Sometimes the ComfyUI Manager just can't fetch data. My VPN is always active when I start my computer.
When ComfyUI Manager can‘t fetch data, I just need to switch the VPN to global mode, then switch to normal mode after that.
My previous VPN doesn't work well. Even in global mode, it still can't fetch data, so I changed it recently.
But when using the previous VPN with the distribution made by 秋葉 aaaki, everything just works perfectly.
The mirrors are not always stable
I had tried to install the Desktop on several different devices for testing, but on some devices, the mirror settings don't work well.
I think that if the user can set up a VPN proxy at the beginning, even if the mirrors are not stable, the setup can run more smoothly.
I think set the VPN to global mode worked too, but I haven't try to test the Desktop install proccess again recently.
Proposed Solution
Support Proxy Settings
It would be better if the portable version supports it too.
Users in China really need that setting.
Potential workflow
Here is my demo.
1. Support proxy settings when install the Desktop
2. Support proxy settings in the menu
It should be with the mirror setting I think but I can't start my desktop today.
3. Support proxy settings in maintain mode
Maybe it need re-design in this part, maybe sometimes users just don't setup proxy before but they just encounter errors, so it will be help
Impact Level
Critical (Blocking my work)
Alternatives Considered
No response
Additional information
For reference I uploaded 秋葉's distribution.
https://drive.google.com/file/d/1dGlL4IeQ6h9TAkboxDMA1Jw_NnrjWRkF/view?usp=drive_link
You can try the network settings under the setting section. It would be better to have hf's mirror setting too.
Sometimes just can't download the model in the terminal successfully.
┆Issue is synchronized with this Notion page by Unito
@orchie commented on GitHub (Aug 30, 2025):
4个月过去了,最新版依然没有代理设置选项...
@dosubot[bot] commented on GitHub (Nov 29, 2025):
Hi, @comfyui-wiki. I'm Dosu, and I'm helping the desktop team manage their backlog and am marking this issue as stale.
Issue Summary:
Next Steps:
Thank you for your understanding and contribution!
@snomiao commented on GitHub (Mar 26, 2026):
Research: Implementing HTTP/HTTPS Proxy Settings for ComfyUI
This issue was closed by dosubot as stale, but the feature was never implemented. Mirrors (#573) only cover pip/Python install — they don't help with general outbound traffic (API calls, model downloads, git clones, custom node network requests, etc.). Reopening to track the actual proxy support.
Related Issues
The Problem
Users (especially in China) need ComfyUI to route all outbound HTTP/HTTPS traffic through a local proxy (e.g.
http://127.0.0.1:7890) without changing system-wide proxy settings. Currently there is zero proxy configuration in either the Python backend or the Electron desktop app.Proposed Approach: Environment Variables
The most robust strategy is setting standard
HTTP_PROXY/HTTPS_PROXY/NO_PROXYenvironment variables early in process startup. This works universally because all major HTTP libraries respect these by default:trust_env=Truedefault)ClientSessionsites)os.environImplementation Plan
1. Python Backend (
Comfy-Org/ComfyUI)comfy/cli_args.py— Add CLI argument:main.py— Set env vars early (around line 28, before heavy imports):This is the earliest safe point — after CLI args are parsed (line ~10) but before any heavy module imports (line ~34). All 6
aiohttp.ClientSessioncreations, allrequests.get()calls, and allurllibusage will automatically route through the proxy with zero per-call changes.2. Electron Desktop App (
Comfy-Org/desktop)Chromium/Electron side:
Python process spawning:
--http-proxy <url>when launching the ComfyUI Python serverHTTP_PROXY/HTTPS_PROXYin the child process envUI:
3. Network Locations That Will Be Covered
All of these currently have zero proxy support and would be automatically covered by the env var approach:
comfy_api_nodes/util/client.py(lines 482, 632)/proxy/*endpoint calls (OpenAI, Stability, BFL, Kling, etc.)comfy_api_nodes/util/download_helpers.py(line 85)comfy_api_nodes/util/upload_helpers.py(line 288)server.py(line 1033)app/frontend_management.py(lines 113, 126, 167)comfy/k_diffusion/utils.py(line 42)Why NOT Per-Session Proxy Config?
Patching each
aiohttp.ClientSession()orrequests.get()individually would:Setting env vars once covers everything automatically — including code that hasn't been written yet.
Next Steps
I'm happy to submit PRs for:
--http-proxy/--no-proxyCLI args + early env var setup inmain.pyproxy-serverswitch + passing args to Python processFeedback welcome on the approach before I start coding.
@snomiao commented on GitHub (Mar 27, 2026):
Draft PRs Submitted
Implementation is ready for review across all 3 repos:
--http-proxy,--https-proxy,--no-proxyCLI args + env var setup inmain.pysession.setProxy()for Chromium +process.envfor child processes + server launch argsHow it works
--http-proxyCLI arg)comfy.settings.jsonHTTP_PROXY/HTTPS_PROXY/NO_PROXYare set before any network activityaiohttp,requests,urllib) + subprocesses (git,pip,uv) automatically route through the proxysession.setProxy()Usage
CLI (standalone):
Desktop app: Set in Settings > Comfy > Network > "HTTP/HTTPS proxy URL", then restart.
This covers all 6
aiohttp.ClientSessionsites, allrequests.get()calls,urllibdownloads, custom nodes, and subprocesses — without modifying any individual call site.