Skip to content

feat: point Comfy Cloud at cloud.comfy.org and default baseUrl to it - #24

Merged
wei-hai merged 2 commits into
mainfrom
wei/cloud-comfy-org-base-url
Jul 28, 2026
Merged

feat: point Comfy Cloud at cloud.comfy.org and default baseUrl to it#24
wei-hai merged 2 commits into
mainfrom
wei/cloud-comfy-org-base-url

Conversation

@wei-hai

@wei-hai wei-hai commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Comfy Cloud serves /api/v2 on cloud.comfy.org. api.comfy.org keeps 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 hostspec/openapi.yaml servers:, the baseUrl union regenerated from it via pnpm generate (one line; no generator drift), docs and test fixtures.

2. Default baseUrl to 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:

new Comfy({ apiKey: "..." })                              // Comfy Cloud
new Comfy("http://127.0.0.1:8189", { apiKey: "..." })     // self-hosted, unchanged

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_URL is 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 test 138 passing across 16 files (4 new, covering all constructor forms), pnpm typecheck and pnpm lint clean.

Note: npm ci fails here — the repo is pnpm (packageManager: pnpm@11.13.0) with no package-lock.json. Use pnpm install --frozen-lockfile.

🤖 Generated with Claude Code

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.
@wei-hai
wei-hai requested review from a team as code owners July 28, 2026 02:10
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: Too big: expected string to have <=250 characters at "tone_instructions"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
📝 Walkthrough

Walkthrough

The SDK now defaults Comfy to https://cloud.comfy.org when no base URL is provided, while retaining explicit base URL support. The constant is exported, and related documentation, OpenAPI metadata, and self-link tests use the new origin.

Changes

Comfy Cloud default URL

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

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai
coderabbitai Bot requested review from alexisrolland and bigcat88 July 28, 2026 02:11
@wei-hai wei-hai changed the title docs: point Comfy Cloud at cloud.comfy.org feat: point Comfy Cloud at cloud.comfy.org and default baseUrl to it Jul 28, 2026
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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between e0f3823 and 4a61652.

📒 Files selected for processing (5)
  • README.md
  • src/index.ts
  • src/sdk/client.ts
  • src/sdk/defaultBaseUrl.test.ts
  • src/sdk/index.ts

Comment thread src/sdk/defaultBaseUrl.test.ts
@wei-hai
wei-hai merged commit 2b935f0 into main Jul 28, 2026
7 checks passed
@wei-hai
wei-hai deleted the wei/cloud-comfy-org-base-url branch July 28, 2026 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant