MCPcopy Create free account
hub / github.com/Comfy-Org/ComfyUI / queue_prompt

Function queue_prompt

script_examples/basic_api_example.py:98–110  ·  view source on GitHub ↗
(prompt)

Source from the content-addressed store, hash-verified

96"""
97
98def queue_prompt(prompt):
99 p = {"prompt": prompt}
100
101 # If the workflow contains API nodes, you can add a Comfy API key to the `extra_data`` field of the payload.
102 # p["extra_data"] = {
103 # "api_key_comfy_org": "comfyui-87d01e28d*******************************************************" # replace with real key
104 # }
105 # See: https://docs.comfy.org/tutorials/api-nodes/overview
106 # Generate a key here: https://platform.comfy.org/login
107
108 data = json.dumps(p).encode('utf-8')
109 req = request.Request("http://127.0.0.1:8188/prompt", data=data)
110 request.urlopen(req)
111
112
113prompt = json.loads(prompt_text)

Callers 1

Calls 1

encodeMethod · 0.45

Tested by

no test coverage detected