chore: accept cd_token
This commit is contained in:
parent
fb6bb2357a
commit
4927d81e73
@ -368,6 +368,11 @@ def send_prompt(sid: str, inputs: StreamingPrompt):
|
|||||||
@server.PromptServer.instance.routes.post("/comfyui-deploy/run")
|
@server.PromptServer.instance.routes.post("/comfyui-deploy/run")
|
||||||
async def comfy_deploy_run(request):
|
async def comfy_deploy_run(request):
|
||||||
# Extract the bearer token from the Authorization header
|
# Extract the bearer token from the Authorization header
|
||||||
|
data = await request.json()
|
||||||
|
|
||||||
|
if "cd_token" in data:
|
||||||
|
token = data["cd_token"]
|
||||||
|
else:
|
||||||
auth_header = request.headers.get('Authorization')
|
auth_header = request.headers.get('Authorization')
|
||||||
token = None
|
token = None
|
||||||
if auth_header:
|
if auth_header:
|
||||||
@ -375,8 +380,6 @@ async def comfy_deploy_run(request):
|
|||||||
if len(parts) == 2 and parts[0].lower() == 'bearer':
|
if len(parts) == 2 and parts[0].lower() == 'bearer':
|
||||||
token = parts[1]
|
token = parts[1]
|
||||||
|
|
||||||
data = await request.json()
|
|
||||||
|
|
||||||
# In older version, we use workflow_api, but this has inputs already swapped in nextjs frontend, which is tricky
|
# In older version, we use workflow_api, but this has inputs already swapped in nextjs frontend, which is tricky
|
||||||
workflow_api = data.get("workflow_api_raw")
|
workflow_api = data.get("workflow_api_raw")
|
||||||
# The prompt id generated from comfy deploy, can be None
|
# The prompt id generated from comfy deploy, can be None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user