From 2156ce9453a8508efec4c36c26e810a14a3ce473 Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Mon, 12 May 2025 20:06:44 -0700 Subject: [PATCH] add comment about using api key in headless (#8082) --- script_examples/basic_api_example.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/script_examples/basic_api_example.py b/script_examples/basic_api_example.py index c916e6cb9..9128420c4 100644 --- a/script_examples/basic_api_example.py +++ b/script_examples/basic_api_example.py @@ -101,6 +101,14 @@ prompt_text = """ def queue_prompt(prompt): p = {"prompt": prompt} + + # If the workflow contains API nodes, you can add a Comfy API key to the `extra_data`` field of the payload. + # p["extra_data"] = { + # "api_key_comfy_org": "comfyui-87d01e28d*******************************************************" # replace with real key + # } + # See: https://docs.comfy.org/tutorials/api-nodes/overview + # Generate a key here: https://platform.comfy.org/login + data = json.dumps(p).encode('utf-8') req = request.Request("http://127.0.0.1:8188/prompt", data=data) request.urlopen(req)