fix: prefer INTERNAL_APP_URL for ComfyUI server calls#15387
Conversation
|
@xujingli is attempting to deploy a commit to the LobeHub OSS Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3f0274786e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const isInVercel = process.env.VERCEL === '1'; | ||
| const vercelUrl = `https://${process.env.VERCEL_URL}`; | ||
| const appUrl = | ||
| process.env.INTERNAL_APP_URL || |
There was a problem hiding this comment.
Normalize INTERNAL_APP_URL before appending the path
When INTERNAL_APP_URL is configured with a trailing slash, this concatenation sends the request to //webapi/create-image/comfyui instead of /webapi/create-image/comfyui. Unlike the async server caller, which uses urlJoin and explicitly tests trailing-slash normalization, this path can miss the Next route or rely on a redirect for the POST, so deployments that set INTERNAL_APP_URL=http://localhost:3210/ can still fail ComfyUI generation despite configuring the new internal URL.
Useful? React with 👍 / 👎.
|
@tjx666 - This is a model provider (ComfyUI image generation) fix. Please take a look. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## canary #15387 +/- ##
===========================================
- Coverage 89.22% 70.85% -18.37%
===========================================
Files 892 3255 +2363
Lines 108146 321010 +212864
Branches 10604 29331 +18727
===========================================
+ Hits 96490 227457 +130967
- Misses 11474 93371 +81897
Partials 182 182
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
3f02747 to
b51380b
Compare
b51380b to
a0f4de8
Compare
|
❤️ Great PR @xujingli ❤️ The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world. |
💻 Change Type
🔗 Related Issue
Fixes #15328
🔀 Description of Change
This PR makes
LobeComfyUI.createImage()preferINTERNAL_APP_URLwhen calling the internal/webapi/create-image/comfyuiendpoint.This keeps the existing fallback order intact for deployments that do not configure
INTERNAL_APP_URL:INTERNAL_APP_URLAPP_URLPORTfallbackThis helps self-hosted reverse-proxy deployments route server-to-server ComfyUI calls through an internal URL instead of the public URL protected by auth/CDN/proxy layers.
🧪 How to Test