feat: allow --comfy-api-base target ephemeral testenvs#14569
Conversation
Signed-off-by: bigcat88 <bigcat88@icloud.com>
📝 WalkthroughWalkthroughA new module 🚥 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@comfy/comfy_api_env.py`:
- Around line 23-32: The normalize_comfy_api_base function only preserves the
scheme and hostname when rewriting the URL on line 32, but discards the original
URL's port, path, query parameters, and fragment. This can silently retarget
requests when the input includes a custom port or path prefix. To fix this,
preserve all URL components from the parsed object when reconstructing the URL:
either manually include parsed.port, parsed.path, parsed.query, and
parsed.fragment in the f-string, or use urlunparse to reconstruct the full URL
after modifying the hostname in the parsed URL object.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: ea0505eb-c654-45cc-a238-d54ae12d0c0a
📒 Files selected for processing (4)
comfy/comfy_api_env.pycomfy_api/feature_flags.pycomfy_api_nodes/util/_helpers.pytests-unit/feature_flags_test.py
Today the frontend only learns which backend to talk to at build time. This PR allows Frontend to read the
comfy-api-baseat runtime instead.Supersedes: #14200
When you start ComfyUI with
--comfy-api-basepointed at one of our non-production backends (staging, or a per-PR preview environment under*.testenvs.comfy.org), the server now includes that backend's URLs in its/featuresresponse.The frontend reads them from there, so the same prebuilt UI can follow along without anyone rebuilding it.
Preview environments keep their friendly URL separate from the actual API host, so you can pass the friendly one (
pr-N.testenvs.comfy.org) and let the server resolve the real host (pr-N-registry.testenvs.comfy.org) for you, both in what it tells the frontend and in where the API nodes send their calls.Production and ordinary self-hosting are untouched: the server only adds this when you point it somewhere non-production, so everyone else sees exactly what they do today.
API Node PR Checklist
Scope
Pricing & Billing
If Need pricing update:
QA
Comms