stuff
This commit is contained in:
parent
bcf466c472
commit
ce67604926
@ -222,6 +222,7 @@ create_native_run_endpoint = None
|
|||||||
status_endpoint = None
|
status_endpoint = None
|
||||||
file_upload_endpoint = None
|
file_upload_endpoint = None
|
||||||
|
|
||||||
|
|
||||||
def clear_current_prompt(sid):
|
def clear_current_prompt(sid):
|
||||||
prompt_server = server.PromptServer.instance
|
prompt_server = server.PromptServer.instance
|
||||||
to_delete = list(
|
to_delete = list(
|
||||||
@ -422,25 +423,22 @@ def send_prompt(sid: str, inputs: StreamingPrompt):
|
|||||||
logger.info(f"error: {error_type}, {e}")
|
logger.info(f"error: {error_type}, {e}")
|
||||||
logger.info(f"stack trace: {stack_trace_short}")
|
logger.info(f"stack trace: {stack_trace_short}")
|
||||||
|
|
||||||
|
|
||||||
# # Add custom logic here
|
# # Add custom logic here
|
||||||
# if 'prompt_id' in response:
|
# if 'prompt_id' in response:
|
||||||
# prompt_id = response['prompt_id']
|
# prompt_id = response['prompt_id']
|
||||||
# if prompt_id in prompt_metadata:
|
# if prompt_id in prompt_metadata:
|
||||||
# metadata = prompt_metadata[prompt_id]
|
# metadata = prompt_metadata[prompt_id]
|
||||||
|
|
||||||
# # Add additional information to the response
|
# # Add additional information to the response
|
||||||
# response['status_endpoint'] = metadata.status_endpoint
|
# response['status_endpoint'] = metadata.status_endpoint
|
||||||
# response['file_upload_endpoint'] = metadata.file_upload_endpoint
|
# response['file_upload_endpoint'] = metadata.file_upload_endpoint
|
||||||
|
|
||||||
return response
|
|
||||||
|
|
||||||
|
|
||||||
@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()
|
data = await request.json()
|
||||||
|
|
||||||
client_id = data.get("client_id")
|
client_id = data.get("client_id")
|
||||||
# We proxy the request to Comfy Deploy, this is a native run
|
# We proxy the request to Comfy Deploy, this is a native run
|
||||||
if "is_native_run" in data:
|
if "is_native_run" in data:
|
||||||
@ -448,13 +446,17 @@ async def comfy_deploy_run(request):
|
|||||||
pprint(data)
|
pprint(data)
|
||||||
# headers = request.headers.copy()
|
# headers = request.headers.copy()
|
||||||
# headers['Content-Type'] = 'application/json'
|
# headers['Content-Type'] = 'application/json'
|
||||||
async with session.post(data.get("native_run_api_endpoint"), json=data, headers={
|
async with session.post(
|
||||||
'Content-Type': 'application/json',
|
data.get("native_run_api_endpoint"),
|
||||||
'Authorization': request.headers.get('Authorization')
|
json=data,
|
||||||
}) as response:
|
headers={
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"Authorization": request.headers.get("Authorization"),
|
||||||
|
},
|
||||||
|
) as response:
|
||||||
data = await response.json()
|
data = await response.json()
|
||||||
print(data)
|
print(data)
|
||||||
|
|
||||||
if "cd_token" in data:
|
if "cd_token" in data:
|
||||||
token = data["cd_token"]
|
token = data["cd_token"]
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user