mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-07-19 21:08:19 +08:00
Add guardrails
This commit is contained in:
parent
718d3a6e2b
commit
9ea052a045
@ -58,13 +58,16 @@ def get_comfy_api_headers(node_cls: type[IO.ComfyNode]) -> dict[str, str]:
|
|||||||
relative/cloud URLs resolved against ``default_base_url()``; because the result
|
relative/cloud URLs resolved against ``default_base_url()``; because the result
|
||||||
includes auth, callers must not attach it to arbitrary absolute/presigned URLs.
|
includes auth, callers must not attach it to arbitrary absolute/presigned URLs.
|
||||||
"""
|
"""
|
||||||
return {
|
headers = {
|
||||||
**get_auth_header(node_cls),
|
**get_auth_header(node_cls),
|
||||||
"Comfy-Env": get_deploy_environment(),
|
"Comfy-Env": get_deploy_environment(),
|
||||||
"Comfy-Usage-Source": get_usage_source(node_cls),
|
"Comfy-Usage-Source": get_usage_source(node_cls),
|
||||||
"Comfy-Core-Version": comfyui_version,
|
"Comfy-Core-Version": comfyui_version,
|
||||||
"Comfy-Job-Id": get_executing_context().prompt_id,
|
|
||||||
}
|
}
|
||||||
|
ctx = get_executing_context()
|
||||||
|
if ctx is not None:
|
||||||
|
headers["Comfy-Job-Id"] = ctx.prompt_id
|
||||||
|
return headers
|
||||||
|
|
||||||
|
|
||||||
def default_base_url() -> str:
|
def default_base_url() -> str:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user