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

Method queue_prompt

tests/execution/test_preview_method.py:82–94  ·  view source on GitHub ↗

Queue a prompt and return response with prompt_id.

(self, prompt: dict, extra_data: dict = None)

Source from the content-addressed store, hash-verified

80 self.ws.close()
81
82 def queue_prompt(self, prompt: dict, extra_data: dict = None) -> dict:
83 """Queue a prompt and return response with prompt_id."""
84 data = {
85 "prompt": prompt,
86 "client_id": self.client_id,
87 "extra_data": extra_data or {}
88 }
89 req = urllib.request.Request(
90 f"http://{self.server_address}/prompt",
91 data=json.dumps(data).encode("utf-8"),
92 headers={"Content-Type": "application/json"}
93 )
94 return json.loads(urllib.request.urlopen(req).read())
95
96 def wait_for_execution(self, prompt_id: str, timeout: float = 120.0) -> dict:
97 """

Calls 1

encodeMethod · 0.45

Tested by

no test coverage detected