ai-dock / comfyui

ComfyUI docker images for use in GPU cloud and local environments. Includes AI-Dock base for authentication and improved user experience.
Other
645 stars 222 forks source link

Bypass ai-dock authentication for api requests to Comfy (runpod) #95

Closed baeuke closed 3 months ago

baeuke commented 3 months ago

Hi, When making an API request to a runpod instance running Comfy, the request first redirects to an ai-dock webpage for authentication. Is there a way to include the credentials directly in the API request to bypass this step and access Comfy without manual authentication? Thank you.

robballantyne commented 3 months ago

You need an Authorization header

Authorization: Bearer $WEB_TOKEN

The variable is auto generated if you haven't explicitly set it

baeuke commented 3 months ago

How do we explicitly set the token? by adding an environment variable when editing ai-dock template in runpod?

robballantyne commented 3 months ago

Yes, it's the equivalent of providing the docker run argument -e WEB_TOKEN=mysecret

baeuke commented 3 months ago

Thank you @robballantyne, works!

bollerdominik commented 2 months ago

Hi @robballantyne this works fine (thanks!) but it would be great if it is documented somewhere. Maybe I missed it in the doc but WEB_TOKEN is not described anywhere.

robballantyne commented 2 months ago

@bollerdominik You're right, I'll fix that asap. Docs really need an overhaul