Chaoses-Ib / ComfyScript

A Python frontend and library for ComfyUI
https://discord.gg/arqJbtEg7w
MIT License
422 stars 24 forks source link

Error with Inspire #46

Closed ghostsquad closed 5 months ago

ghostsquad commented 5 months ago

I know this error is coming from Inspire, however, it only shows up when using ComfyScript via VSCode. I was wondering if you had an prior knowledge/experience with what might be going on? Thanks!

[WARN] ComfyUI-Impact-Pack: Error on prompt - several features will not work.
'workflow'
[ERROR] An error occurred during the on_prompt_handler processing
Traceback (most recent call last):
  File "e:\ComfyUI_windows_portable\ComfyUI\server.py", line 650, in trigger_on_prompt
    json_data = handler(json_data)
                ^^^^^^^^^^^^^^^^^^
  File "E:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Inspire-Pack\inspire\inspire_server.py", line 365, in onprompt
    populate_wildcards(json_data)
  File "E:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Inspire-Pack\inspire\inspire_server.py", line 334, in populate_wildcards
    for node in json_data['extra_data']['extra_pnginfo']['workflow']['nodes']:
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
KeyError: 'workflow'

Note, this doesn't actually stop anything from generating. So it's kinda just spam logging. Still would like to resolve it if I can.

Chaoses-Ib commented 5 months ago

'workflow' is the workflow in the web UI format. It only exists when queuing workflows from the web UI. You will see the same warning if you are queuing the workflow in API format directly.

That being said, there is actually already a converter for converting API format to web UI format in the transpiler. So adding 'workflow' is simple. However, doing this may break the custom node instead. For example, if it has some hacks in the web UI to inject some info to the workflow, then the converted workflow will not have them, and then the custom node will break the generation process now. That's why I didn't add them before.

ghostsquad commented 5 months ago

makes sense! I'm happy to just ignore this for now.