huchenlei / sd-webui-openpose-editor

Openpose editor for ControlNet. Full hand/face support.
MIT License
664 stars 66 forks source link

Runpod compability #26

Closed thderoo closed 1 year ago

thderoo commented 1 year ago

Hello.

I've noticed that the extension doesn't work on Runpod (I get a blank page when I open the editing window).

I don't know how the extension works in detail, but I imagine it's because the FastAPI server is only accessible via localhost:7860.

I imagine this is the case for any Automatic1111 server that runs in a docker.

Are there any plans to address this issue?

huchenlei commented 1 year ago

The url localhost:7860 is not hardcoded anywhere here in this repository or in the ControlNet repository (Except for testing).

If you can access A1111 in your browser, technically you should be able to access the editor page. The extension mounts an extra route on FastAPI app called openpose_editor_index. You can test it by accessing {your_base_url}/openpose_editor_index directly in the browser.

Is there any console output when you click Edit? (Both backend in the terminal and frontend in the browser devtool console)

thderoo commented 1 year ago

Thank you for your reply.

Clicking on "Edit" does not display an error message in the editor or on the console.

The url through which I access automatic1111 takes the form https://[random string]-3000.proxy.runpod.net/, using the browser inpector, I noticed that requests were indeed being sent to https://[same string]-3000.proxy.runpod.net/openpose_editor_index/, but that the requests were failing due to a timeout, which seems to indicate that the api is indeed unreachable.

Having fairly rudimentary knowledge of networking or how docker/runpod works, I'm not sure which direction to investigate from here.

thderoo commented 1 year ago

Update : I just noticed that the Firefox console was displaying "Blocked loading mixed active content" errors during requests (which is probably also a problem in itself), after (temporarily) disabling the corresponding security option, now I have the "connection timeout" error directly in the window that opens when I press "Edit".

The console also displays a "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource" error concerning the same url.

huchenlei commented 1 year ago

Are you sure the [some string] here are the same?

https://[some string]-3000.proxy.runpod.net/ https://[some string]-3000.proxy.runpod.net/openpose_editor_index/

If they are the same string, it should not violate the same origin policy.

thderoo commented 1 year ago

Yes, it's an identifier that is specific to the server instance, a similar url is used to access jupyter for example.

On closer inspection, the error seems to stem from the fact that the openpose_editor_index request triggers a redirect to a different ip and port than the server's for some reason.

huchenlei commented 1 year ago

Fixed. See #27 for more details.