检查并启动 Runtime
准备完成后,保存启动前检查结果,再启动仅监听本机的 Runtime。Doctor 就绪与完整 P0 验收是不同的事实。
保存启动前检查
Section titled “保存启动前检查”在仓库根目录执行。只有 Doctor 退出 0 后才启动服务。--no-sync 保证检查不触发依赖下载或环境修改。
param([ValidateRange(1, 65535)][int]$Port = 8188)
# Run from the repository root before starting Runtime. Saves only a successful check.$runtimeReadiness = uv run --project runtime/comfyui --no-sync python runtime/comfyui/manage.py doctor --json --port $Portif ($LASTEXITCODE -ne 0) { throw "Doctor failed. An existing successful receipt was not overwritten." }New-Item -ItemType Directory -Force -Path data | Out-Null$runtimeReadiness | Out-File -Encoding utf8 data/runtime-readiness.json完整示例: runtime/comfyui/examples/save-readiness.ps1 ↗
启动本地服务
Section titled “启动本地服务”param([ValidateRange(1, 65535)][int]$Port = 8188)
# Run from the repository root. Keep this terminal open; press Ctrl+C to stop.uv run --project runtime/comfyui --no-sync python runtime/comfyui/manage.py start --port $Portif ($LASTEXITCODE -ne 0) { throw "Runtime stopped with an error. Inspect the startup checks and service log." }完整示例: runtime/comfyui/examples/start.ps1 ↗
默认服务仅监听 http://127.0.0.1:8188,不会自动打开 Canvas。选择其他端口时,仍只监听本机。保持此终端运行;用 Ctrl+C 停止。
Doctor 检查空闲端口。服务启动后,转谱工具复用保存的真实成功 receipt,不在占用端口上重新制造就绪结果。
Doctor 检查真实 BF16 CUDA 运算、目标设备、锁定版本、节点与推理 imports、重采样、完整模型 SHA256、磁盘和端口。
Doctor 不加载完整权重,也不证明音乐质量。其 p0_passed=false 不由一次 readiness 检查改写。
| 检查结果 | 恢复动作 |
|---|---|
| 模型 missing / downloading | 执行 download-models;保留的 .part 会续传。 |
| SHA256 或文件大小不符 | 保留或移走损坏文件,再重新下载;命令不自动覆盖 invalid 文件。 |
| 端口被占用 | 确认占用者。保留其他 owner 的服务;为检查、保存 receipt、启动和转谱选择同一个空闲 -Port。 |
| probe 超时或非零退出 | 读取 last_stage、stdout_tail、stderr_tail,解决对应阶段后重试。 |
四个完整示例都接受 -Port,范围为 1–65535,默认 8188。若选定空闲的 8189,在仓库根目录依次执行 & ./runtime/comfyui/examples/doctor.ps1 -Port 8189、& ./runtime/comfyui/examples/save-readiness.ps1 -Port 8189 和 & ./runtime/comfyui/examples/start.ps1 -Port 8189。保持启动终端运行,在第二个终端执行 & ./runtime/comfyui/examples/transcribe.ps1 -Port 8189。转谱会连接 http://127.0.0.1:8189;省略任一步的参数会使用默认 8188。
1ce3268正文来源: docs/learn/doctor.md