feat(server): expose comfy_api_base in /api/system_stats response#13571
feat(server): expose comfy_api_base in /api/system_stats response#13571snomiao wants to merge 1 commit intoComfy-Org:masterfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThe 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
There was a problem hiding this comment.
Pull request overview
Exposes the configured Comfy API base URL directly in the /api/system_stats (and legacy /system_stats) response so thin clients can reliably detect the cloud environment without parsing argv.
Changes:
- Add
system.comfy_api_baseto the system stats JSON payload, sourced fromargs.comfy_api_base(already defaulting tohttps://api.comfy.org).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add prPreviewBadges extension (active only when CI_PR_NUMBER is set): - Topbar warning badge showing "PR #XXXX", tooltip with author/commit/backend URL - About panel badges: clickable PR#, author (@handle), commit hash links - Declare __CI_PR_NUMBER__, __CI_PR_AUTHOR__, __CI_BRANCH__, __CI_RUN_ID__, __CI_JOB_ID__, __COMFYUI_FRONTEND_COMMIT__ as global TS constants in vite-env.d.ts - Extract resolveBackendCloudBase() to shared util at src/platform/connectionPanel/resolveBackendCloudBase.ts - Add comfy_api_base as optional field in zSystemStats schema (companion to backend PR Comfy-Org/ComfyUI#13571) - Add prPreview i18n keys Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add prPreviewBadges extension (active only when CI_PR_NUMBER is set): - Topbar warning badge showing "PR #XXXX", tooltip with author/commit/backend URL - About panel badges: clickable PR#, author (@handle), commit hash links - Declare __CI_PR_NUMBER__, __CI_PR_AUTHOR__, __CI_BRANCH__, __CI_RUN_ID__, __CI_JOB_ID__, __COMFYUI_FRONTEND_COMMIT__ as global TS constants in vite-env.d.ts - Extract resolveBackendCloudBase() to shared util at src/platform/connectionPanel/resolveBackendCloudBase.ts - Add comfy_api_base as optional field in zSystemStats schema (companion to backend PR Comfy-Org/ComfyUI#13571) - Add prPreview i18n keys Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add system.comfy_api_base to /api/system_stats so clients (especially the static preview frontend) can read the configured cloud API base URL directly instead of parsing it out of argv. The value is always present: it defaults to https://api.comfy.org when --comfy-api-base is not specified, matching the existing default in cli_args.py.
fb65176 to
06adf92
Compare
Problem
The static preview frontend (and other thin clients) need to know which cloud environment a ComfyUI instance is configured for. Currently the only way to determine this is to parse the raw
argvarray from/api/system_statsand look for--comfy-api-base. This is fragile and doesn't handle the default case cleanly.Solution
Add
comfy_api_basedirectly tosystem.system_statsresponse. The value comes fromargs.comfy_api_base, which already defaults tohttps://api.comfy.orgwhen the flag is not specified."system": { ... "argv": sys.argv, + "comfy_api_base": args.comfy_api_base }Before
{ "system": { "argv": ["main.py", "--comfy-api-base", "https://api.comfy.org", ...] } }Clients had to scan argv for the flag, handle both
--flag valueand--flag=valueforms, and guess the default when the flag was absent.After
{ "system": { "argv": [...], "comfy_api_base": "https://api.comfy.org" } }Clients read a single field. Default is always explicit.
Companion frontend PR
Comfy-Org/ComfyUI_frontend#11118 — the preview frontend will consume
comfy_api_basedirectly when present, with argv parsing as a fallback for older backends.Testing
No behavioural change for existing installs — the field just becomes visible. Can be verified by curling a running instance:
Expected:
"comfy_api_base": "https://api.comfy.org"(or the value passed via--comfy-api-base).