Websocket API calls with Sytan workflow
Closed this issue · 1 comments
I've been trying to utilize this workflow through the ComfyUI web API and I've run across an issue. When submitting the prompt to ComfyUI through urllib.request.Request("http://{}/prompt".format(server_address), data=data), where data is provided by:
with open("Sytan's SDXL 1.0 Workflow.json") as prompt
p = {"prompt": prompt, "client_id": client_id}
data = json.dumps(p).encode('utf-8')
I get an error code 500, with ComfyUI reporting:
File "ComfyUI/server.py", line 469, in post_prompt
valid = execution.validate_prompt(prompt)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "ComfyUI/execution.py", line 598, in validate_prompt
class_ = nodes.NODE_CLASS_MAPPINGS[prompt[x]['class_type']]
TypeError: 'int' object is not subscriptable
It seems to work with the ComfyUI supplied workflow, but I'm not sure how to make this workflow match the format of that workflow. Help would be much appreciated!
Sorry, I was mistaken about the API! You need to generate an API specific JSON that represents the prompt. I was using the JSON that represents the workflow layout. Please close this issue!