Closed ak74fire closed 1 year ago
same problem here
Do you have any additional setup of an web server proxy?
The editor is setup to use relative path /openpose_editor_index
.
According to the log messages, you are running WebUI locally on port 3000, but the editor is accessing port 60892.
There is nothing I can do in the repo as it is already relative path. You would need to figure out why the FastAPI route /openpose_editor_index
is not served with HTTPS in your setup.
The WebUI is running behind a RunPod proxy: https://docs.runpod.io/docs/expose-ports
It maps internal URL http://127.0.0.1:3000
to external URL like https://{POD_ID}-{INTERNAL_PORT}.proxy.runpod.net:{EXTERNAL_PORT}
.
However the blocked URL http://100.65.14.206:60892/openpose_editor_index/
wasn't the URL exposed by RunPod proxy, don't know how FastAPI
made the IP/port. But certainly it's not truely using relative path.
Is it possible to ask FastAPI
to use real relative path?
This seems like a similar issue to #26.
Sounds like same issue. I'm not familiar with FastAPI
, but looks like it does handle proxy scenario:
https://fastapi.tiangolo.com/advanced/behind-a-proxy/
Seems like I should prefix the path with /sdapi/v1
as all other paths in WebUI have this prefix.
Well. Things are pretty messy on WebUI's part. There are also prefix /internal
other than sdapi/v1
. You can try adding these prefixes to both this repo and controlnet repo to see if the problem is solved. I do not own a runpod instance so I cannot reproduce/test it.
Refs:
Adding the prefix doesn't solve the issue.
In browser console fetch('/sdapi/v1/openpose_editor_index')
got a redirection (HTTP 307) to the non-https URL:
Cf-Cache-Status: DYNAMIC
Cf-Ray: 7da0b7f85abd0495-HKG
Content-Length: 0
Date: Tue, 20 Jun 2023 02:52:57 GMT
Location: http://100.65.10.194:60775/sdapi/v1/openpose_editor_index/
Nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=r2QumR4do3Hk3E8F2dOjE5iQNnccFN9CGKtHvMU6KswHyv4le3pfLIwAQRtZBLlrhEU%2BXf9h%2FssC4vjE8UX64yX0apdY0vVRGJ5C7P70rye8fk4h39PpOQT7l5PpWycNSeyV8lRzEDwtW%2Bb7UWOAGlKchnCMQw%3D%3D"}],"group":"cf-nel","max_age":604800}
Server: cloudflare
Strict-Transport-Security: max-age=63072000; includeSubDomains
RunPod doesn't seem to produce the redirection automatically as fetch('/info')
got a normal HTTP 200 response.
Any idea where in the code issued the redirection?
The redirection could be caused by extra /
at the end of the editor path:
However in sd-webui-controlnet repo, the editor path has no ending /
:
const EDITOR_PATH = '/openpose_editor_index';
I guess FastAPI
would somehow issue a redirection in such situation.
Removed the extra /
and now openpose editor UI can be loaded properly in RunPod.
Guess I'm too lazy to create a pull request, but it's only 2 lines of change:
index 21d7dd1..ba9b118 100644
--- a/scripts/openpose_editor.py
+++ b/scripts/openpose_editor.py
@@ -110,13 +110,13 @@ def mount_openpose_api(_: gr.Blocks, app: FastAPI):
name="openpose_editor",
)
- @app.get("/openpose_editor_index/", response_class=HTMLResponse)
+ @app.get("/openpose_editor_index", response_class=HTMLResponse)
async def index_get(request: Request):
return templates.TemplateResponse(
"index.html", {"request": request, "data": {}}
)
- @app.post("/openpose_editor_index/", response_class=HTMLResponse)
+ @app.post("/openpose_editor_index", response_class=HTMLResponse)
async def index_post(request: Request, item: Item):
return templates.TemplateResponse(
"index.html", {"request": request, "data": item.dict()}
After all it has nothing to do with the path prefixes.
Fixed in https://github.com/huchenlei/sd-webui-openpose-editor/commit/84b1fe1059a2d6ea6474ee16742396f805f7ca53. Thanks for tracking this down!
Is there an existing issue for this?
What happened?
When WebUI is served via https, the editor cannot be loaded.
Steps to reproduce the problem
What should have happened?
sd-webui-openpose-editor should load properly when WebUI is served via https.
Commit where the problem happens
webui: v1.3.2 controlnet: v1.1.220 (2598ca9e78f167014c6556cb89dab792a745749f) openpose-editor: 8843a7e10c96a13f93b9f37ca16b3e39d8a4fcda
What browsers do you use to access the UI ?
Google Chrome
Command Line Arguments
Console logs
Browser logs
Additional information
No response