> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-docs-recommend-assets-api.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# ComfyUI Manager 配置配置

> 配置 ComfyUI-Manager 设置

## 配置路径

从 V3.38 开始，Manager 使用受保护的系统路径以增强安全性。

| ComfyUI 版本 | Manager 路径                                  |
| ---------- | ------------------------------------------- |
| v0.3.76+   | `<USER_DIRECTORY>/__manager/`               |
| 旧版本        | `<USER_DIRECTORY>/default/ComfyUI-Manager/` |

<Note>
  如果不带任何选项执行，`<USER_DIRECTORY>` 路径默认为 `ComfyUI/user`。可以使用 `--user-directory <USER_DIRECTORY>` 设置。
</Note>

### 配置文件

| 文件                   | 描述          |
| -------------------- | ----------- |
| `config.ini`         | 基本配置        |
| `channels.list`      | 可配置的频道列表    |
| `pip_overrides.json` | 自定义 pip 包映射 |
| `pip_blacklist.list` | 阻止安装的包      |
| `pip_auto_fix.list`  | 自动恢复的包      |
| `snapshots/`         | 保存的快照文件     |
| `startup-scripts/`   | 启动脚本文件      |
| `components/`        | 组件文件        |

## Config.ini 选项

修改 `config.ini` 文件以应用设置。路径显示在启动日志消息中。

```ini theme={null}
[default]
git_exe = <git 可执行文件路径>
use_uv = <True/False - 使用 uv 代替 pip>
default_cache_as_channel_url = <True/False - 启动时获取指定为 channel_url 的数据库>
bypass_ssl = <True/False - 如果出现错误则禁用 SSL>
file_logging = <True/False - 创建日志文件>
windows_selector_event_loop_policy = <True/False - 修复 Windows 上的事件循环错误>
model_download_by_agent = <True/False - 使用代理下载模型>
downgrade_blacklist = <逗号分隔的阻止降级的包列表>
security_level = <strong|normal|normal-|weak>
always_lazy_install = <True/False - 在重启时执行依赖安装>
network_mode = <public|private|offline>
```

### 网络模式

| 模式        | 描述                                         |
| --------- | ------------------------------------------ |
| `public`  | 标准公共网络环境                                   |
| `private` | 通过 `channel_url` 配置私有节点数据库的封闭网络（如果可用则使用缓存） |
| `offline` | 无外部连接（如果可用则使用缓存）                           |

### 安全级别

| 级别        | 描述                                               |
| --------- | ------------------------------------------------ |
| `strong`  | 不允许高风险和中风险功能                                     |
| `normal`  | 不允许高风险功能；中风险功能可用                                 |
| `normal-` | 如果指定了 `--listen` 且不以 `127.` 开头，则不允许高风险功能；中风险功能可用 |
| `weak`    | 所有功能可用                                           |

#### 功能风险级别

| 风险级别  | 功能                                                |
| ----- | ------------------------------------------------- |
| **高** | 通过 git url 安装、pip install、安装不在默认频道中的自定义节点、修复自定义节点 |
| **中** | 卸载/更新、安装默认频道中的自定义节点、恢复/删除快照、重启                    |
| **低** | 更新 ComfyUI                                        |

## 环境变量

| 变量                | 描述                   |
| ----------------- | -------------------- |
| `COMFYUI_PATH`    | ComfyUI 的安装路径        |
| `GITHUB_ENDPOINT` | GitHub 访问的反向代理       |
| `HF_ENDPOINT`     | Hugging Face 访问的反向代理 |

### 示例

通过代理重定向 GitHub 请求：

```bash theme={null}
GITHUB_ENDPOINT=https://mirror.ghproxy.com/https://github.com
```

更改 Hugging Face 端点：

```bash theme={null}
HF_ENDPOINT=https://some-hf-mirror.com
```

## 高级配置

### 阻止特定包降级

在 `config.ini` 的 `downgrade_blacklist` 部分列出包名，用逗号分隔：

```ini theme={null}
downgrade_blacklist = diffusers, kornia
```

### 自定义 pip 映射

创建 `pip_overrides.json` 文件，将特定 pip 包的安装更改为用户定义的安装。格式请参考 `pip_overrides.json.template`。

### 阻止安装特定 pip 包

在 `pip_blacklist.list` 文件中每行列出一个包名。

### 自动恢复 pip 安装

在 `pip_auto_fix.list` 中列出 pip 规范要求（类似于 `requirements.txt`）。当启动 ComfyUI 或在自定义节点安装期间版本不匹配时，它将自动恢复指定版本。可以使用 `--index-url`。

### 使用 aria2 作为下载器

为了更快的下载速度，您可以配置 ComfyUI-Manager 使用 aria2。请参阅 [aria2 设置指南](https://github.com/comfy-org/ComfyUI-Manager/blob/main/docs/en/use_aria2.md)。

## extra\_model\_paths.yaml 配置

以下设置基于标记为 `is_default` 的部分应用：

* `custom_nodes`：安装自定义节点的路径
* `download_model_base`：下载模型的路径

## CLI 工具

ComfyUI-Manager 提供 `cm-cli`，这是一个命令行工具，允许您在不运行 ComfyUI 的情况下使用 Manager 功能。这对于自动化自定义节点安装和在无头环境中管理安装很有用。

有关详细的 cm-cli 文档，请参阅[官方 cm-cli 指南](https://github.com/ltdrdata/ComfyUI-Manager/blob/main/docs/en/cm-cli.md)。

如需更全面的 CLI 体验，请考虑使用 [comfy-cli](/zh/comfy-cli/getting-started)。
