comfyui-workspace-manager
comfyui-workspace-manager copied to clipboard
How to set civitai proxy for cn users
RT
what i usually do is, in the terminal where you start the python server, before you do python main.py
, run something like this:
export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
the port number depends on your VPN's port (In Clash menu, you can just "copy shell command", or global mode may help too, you may not need terminal proxy if on global mode
作者你好,请问能否添加设置代理的设置选项。我的comfyui部署在Linux服务器上,无论是直接在Linux上开启代理或者使用端口转发采用本地的代理都无法通过插件下载模型。我在您的源码model_installer.py中使用urllib.request.ProxyHandler为urllib.request设置了代理才成功实现模型的下载,但是如果要修改代理每次都需要修改源码,很不方便,因此希望能提供该设置功能,谢谢
这个代理是需要你输入一个什么endpoint吗?那是不是我们前端也得加一个什么对话框来输入?
如果你愿意帮我们简单加一下这个feature,pr一下那真是感激不尽🥹 最近feature太多忙不过来了
无论是直接在Linux上开启代理或者使用端口转发采用本地的代理都无法通过插件下载模型。
你有试过在python命令行挂代理吗? 我自己是在起python服务器之前,运行这么一行先:
export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
无论是直接在Linux上开启代理或者使用端口转发采用本地的代理都无法通过插件下载模型。
你有试过在python命令行挂代理吗? 我自己是在起python服务器之前,运行这么一行先:
export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
是的,我试过export https_proxy=http://127.0.0.1:7890/ http_proxy=http://127.0.0.1:7890/ all_proxy=socks5://127.0.0.1:7890该命令,但在Linux服务器上不起作用。不是很熟悉前端代码所以没有直接添加设置选项,应该像设置API key一样设置代理地址就行(研究僧还有论文任务,忙里偷闲玩一玩画图),具体我添加的代码如下:
# 设置代理!!!
proxies = {
"http":"http://127.0.0.1:7890",
"https":"http://127.0.0.1:7890",
# 此处实际为我拥有的一个代理地址,我直接拿本地代理端口代替,效果是一样的
}
httpproxy_handler = urllib.request.ProxyHandler(proxies)
opener = urllib.request.build_opener(httpproxy_handler)
urllib.request.install_opener(opener)
# 设置结束!!!
req = urllib.request.Request(url, headers=headers)