On an AutoDL server civitai.com timed out while civitai.red, Civitai's other address with the same API, answered in about a second, so scans there fell back to guessing from the files. civitai_client.api_hosts gives both addresses, the one that answered last first; the scan's lookups, import's and Model Check's (download_sources._civitai_json) and the network test ask the other one when the first does not answer at all. An HTTP error is Civitai's own answer and is not asked again. The test answers which host answered, and Settings says so when it was civitai.red. The pictures stay on image.civitai.com, which such networks often cannot reach either: after COVERS_DOWN_AFTER (2) covers in a row that would not download, a scan fetches no more covers instead of waiting on each. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4.1 KiB
在云服务器上使用(AutoDL 等)
ComfyUI 装在租来的云服务器上(AutoDL、RunPod 之类),你在自己电脑的浏览器里打开它时,对插件来说页面是从“别的设备”打开的。为了不让别人远程改动你的文件,插件默认只让这种页面浏览:标题旁会显示 仅浏览,扫描、下载、移动、删除、保存这类改动会被拒绝。
想在云服务器上照常使用,有两个办法,选一个就行。
办法一:用 SSH 隧道打开(推荐,什么都不用改)
SSH 隧道把服务器上 ComfyUI 的端口接到你自己电脑上,浏览器打开的是 http://127.0.0.1:端口。请求在服务器上也是从本机发出的,插件就当成本机,所有功能都能用,也不会把页面开放给别人。
AutoDL 控制台里每台实例都有 SSH 登录指令和密码,平台也提供了现成的隧道小工具;按平台说明把 ComfyUI 的端口(常见是 6006 或 8188)映射到本地,再用浏览器打开映射出来的 127.0.0.1 地址即可。
办法二:在服务器上放一个开关文件
如果你只能用平台给的网址打开 ComfyUI,最简单的做法:
- 点标题旁的 仅浏览,在弹出的说明里点 复制。复制的是一行命令,已经填好了你服务器上插件的真实位置。
- 打开服务器的终端(AutoDL:JupyterLab → 终端),粘贴,按回车。
- 重启 ComfyUI。启动日志里会出现一行提示,标题旁的标签变成黄色的 远程可修改。
想自己动手也可以:
-
在服务器上打开插件文件夹
ComfyUI/custom_nodes/Anomalous_Model_Browser(AutoDL 可以用 JupyterLab 的文件浏览器,或在终端里操作)。 -
新建一个空文件,名字是
allow_remote_changes(没有扩展名)。终端里可以这样做:touch ComfyUI/custom_nodes/Anomalous_Model_Browser/allow_remote_changes -
重启 ComfyUI。启动日志里会出现一行提示,标题旁的标签变成黄色的 远程可修改。
风险: 打开之后,任何能打开这个网址的人都能扫描、移动、删除(进回收站)你的模型,改插件设置,也能用你的 Civitai Key。只在网址不外传时这样做;不需要了就删掉这个文件(点黄色的 远程可修改,里面也有一行可以复制的命令),再重启 ComfyUI。这个文件只能在服务器上建,网页里打不开也关不掉。
AI 软件用的 MCP 接口不受这个开关影响,始终只接受本机。
国内服务器连不上 Civitai
国内机房的服务器常常连不上 civitai.com。插件这时会自动改用 Civitai 的另一个地址 civitai.red(在 AutoDL 上测过能连上),照样能认出模型的名字、触发词和底模;封面图放在 civitai.com 那边,多半下不来,连续两张下不了,这次扫描就不再下载封面。设置 → 网络 → 测试连接 会告诉你连上的是哪一个。
两个都连不上时,扫描会自动改成只看文件(没有封面和触发词);也可以在 设置 → 网络 里填代理,或者在扫描页选 离线。
English summary
When civitai.com cannot be reached (often so from mainland China), the plugin asks Civitai's other address, civitai.red, which gives names and trigger words; the covers may not download. On a rented cloud server the page is always opened from another device, so the plugin is view only there by default. Either open ComfyUI through an SSH tunnel (the browser address starts with 127.0.0.1; counts as this computer, nothing to change), or create an empty file named allow_remote_changes in the plugin folder on the server and restart ComfyUI (press View only: its dialog has the line to copy into the server's terminal, with the real path filled in). With that file, anyone who can open the address may scan, move, delete and save, and use your Civitai key, so only do it while the address stays private; delete the file and restart to go back. The page cannot create or remove the file, and the MCP endpoint stays local-only either way.