feat: point Comfy Cloud at cloud.comfy.org and default baseUrl to it - #24
Conversation
The Comfy Cloud deployment now serves /api/v2 on cloud.comfy.org rather than api.comfy.org, which keeps serving the node registry. baseUrl is a required constructor argument with no default, so this does not change what the client sends on its own — it updates the spec's server entry, the baseUrl union regenerated from it, the documented URL, and the test fixtures. Callers pass their own baseUrl and must update it.
|
Warning
|
| Layer / File(s) | Summary |
|---|---|
Default URL constructor support src/sdk/client.ts, src/sdk/index.ts, src/sdk/defaultBaseUrl.test.ts |
Adds the exported Cloud URL constant, supports no-argument and options-only construction, preserves positional base URL construction, and tests these forms. |
Update Comfy Cloud references spec/openapi.yaml, README.md, src/index.ts, src/low/followUpLinks.test.ts, src/sdk/client.ts |
Cloud examples, OpenAPI metadata, and bare-surface self-link expectations now use https://cloud.comfy.org. |
Possibly related PRs
- Comfy-Org/ComfyTypeScriptSDK#16: Modifies the same
Comfyconstructor and option-wiring code paths.
Suggested reviewers: alexisrolland, bigcat88
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
| Check name | Status | Explanation |
|---|---|---|
| Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Commit unit tests in branch
wei/cloud-comfy-org-base-url
✨ Simplify code
- Create PR with simplified code
- Commit simplified code in branch
wei/cloud-comfy-org-base-url
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 @coderabbitai help to get the list of available commands.
baseUrl was required, so every caller hardcoded a host and a move of
that host meant every caller editing their own code. Default it to the
hosted deployment and export COMFY_CLOUD_BASE_URL, so new Comfy({apiKey})
targets Comfy Cloud and only self-hosted or serverless callers pass a URL.
Added as an overload rather than an optional first parameter, so the
options-only form does not read new Comfy(undefined, {apiKey}).
Backward compatible: new Comfy(url, options) is unchanged.
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 `@src/sdk/defaultBaseUrl.test.ts`:
- Around line 10-20: Update the tests around the Comfy constructor cases in
defaultBaseUrl.test.ts to use the injected fetch spy or equivalent request seam
and assert the actual target URL. Verify that both options-only and no-argument
construction requests the Comfy Cloud URL, while positional construction
requests the explicit self-hosted URL; retain the existing construction
coverage.
🪄 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: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 95370210-cbbf-40e7-a624-c1e112d4b9ad
📒 Files selected for processing (5)
README.mdsrc/index.tssrc/sdk/client.tssrc/sdk/defaultBaseUrl.test.tssrc/sdk/index.ts
Comfy Cloud serves
/api/v2oncloud.comfy.org.api.comfy.orgkeeps serving the node registry, so this is a new hostname for the cloud API rather than a domain rename.Two changes
1. Point at the new host —
spec/openapi.yamlservers:, thebaseUrlunion regenerated from it viapnpm generate(one line; no generator drift), docs and test fixtures.2. Default
baseUrlto it. It was a required argument, so every caller hardcoded a host — which is why a server-side move otherwise forces every caller to edit their own code. Now:Added as an overload rather than an optional first parameter, so the options-only form doesn't read
new Comfy(undefined, { apiKey }).COMFY_CLOUD_BASE_URLis exported for callers who want the value.Backward compatible — the positional form every existing caller uses is untouched, and an explicit URL still wins.
Verification
pnpm test138 passing across 16 files (4 new, covering all constructor forms),pnpm typecheckandpnpm lintclean.Note:
npm cifails here — the repo is pnpm (packageManager: pnpm@11.13.0) with nopackage-lock.json. Usepnpm install --frozen-lockfile.🤖 Generated with Claude Code