mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-24 06:35:10 +00:00
## Summary Allow staging api/platform base URLs to be overridden by env vars so non-cloud builds can target an alternate backend without source edits. ## Changes - **What**: `BUILD_TIME_API_BASE_URL` / `BUILD_TIME_PLATFORM_BASE_URL` in `src/config/comfyApi.ts` now read `import.meta.env.VITE_STAGING_API_BASE_URL` / `VITE_STAGING_PLATFORM_BASE_URL` first, falling back to the existing `stagingapi.comfy.org` / `stagingplatform.comfy.org` constants. Vars typed in `src/vite-env.d.ts` and documented in `.env_example`. - **Breaking**: None. Defaults unchanged. The cloud-runtime override path via the features endpoint (`comfy_api_base_url`, `comfy_platform_base_url` in `RemoteConfig`) is untouched. ## Review Focus Override only applies to the non-prod branch of the build-time ternary, so prod builds (`USE_PROD_CONFIG=true`) cannot be redirected. Cloud builds continue to resolve URLs at runtime via `remoteConfig` regardless of these env vars. ## Note Pre-commit `pnpm typecheck` fails on `origin/main` independently of this change (`src/utils/nodeDefUtil.ts` and `src/workbench/utils/nodeHelpUtil.ts` import non-existent exports from `@/schemas/nodeDefSchema` / `@/types/nodeSource`). Verified by stashing this PR's diff and re-running. Committed with `--no-verify`; please address the underlying breakage separately.