Trung0246 / ComfyUI-0246

Random nodes for ComfyUI
MIT License
108 stars 11 forks source link

[REQUEST] Documentation/Tips on using the Looping Functions #19

Closed Gerkinfeltser closed 8 months ago

Gerkinfeltser commented 8 months ago

Hello Trung0246,

I'm reaching out to express my appreciation for your work on comfyui! I'm currently delving into the looping functionality which seems unique and super powerful, and find myself needing a bit more guidance to fully utilize them.

Could you provide additional documentation or examples that clarify the intended use-cases, practical implementation, and any best practices for these looping functions? I've looked through your example workflow in the repository but still can't quite wrap my head around it honestly.

Your insights would be invaluable to me and others in the community looking to deepen our understanding of these features! Thank you for your time and for the invaluable resource you've created. Your expertise and assistance are greatly appreciated!

Trung0246 commented 8 months ago

I'm planning on rework the Hold node soon so stay tuned :)

Trung0246 commented 8 months ago

workflow_loop_demo

The latest patch I have reworked the Hold node. This workflow example (embedded in the image) should be the starting point for messing around with Loop :)

Gerkinfeltser commented 8 months ago

Hello again, I actually updated the extension & ran the workflow above again. I'm still getting an error but it seems different. You also asked for the node number. I'm attaching an image of that as well! Both attached images are from the top chain of the workflow. I notice there is a "key: 44" (first image) as well as a node with #44. Not sure if that means anything (second image).

got prompt
ERROR:root:Failed to validate prompt for output 37:
ERROR:root:* (prompt):
ERROR:root:  - Required input is missing: data
ERROR:root:* 0246.Beautify 37:
ERROR:root:  - Required input is missing: data
ERROR:root:Output will be ignored
ERROR:root:Failed to validate prompt for output 41:
ERROR:root:* (prompt):
ERROR:root:  - Required input is missing: data
ERROR:root:* 0246.Beautify 41:
ERROR:root:  - Required input is missing: data
ERROR:root:Output will be ignored
Prompt executor has been patched by Job Iterator!
ERROR:root:!!! Exception during processing !!!
ERROR:root:Traceback (most recent call last):
  File "C:\ai\ComfyUI_windows_portable\ComfyUI\execution.py", line 154, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ai\ComfyUI_windows_portable\ComfyUI\execution.py", line 84, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ai\ComfyUI_windows_portable\ComfyUI\execution.py", line 68, in map_node_over_list
    results.append(getattr(obj, func)(**input_data_all))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ai\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-0246\nodes.py", line 933, in execute
    lib0246.hijack(execution, "map_node_over_list", map_node_over_list_param_handle)
        ^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: '44'

Prompt executed in 0.01 seconds

image image

Trung0246 commented 8 months ago

Can you download the latest patch and run the workflow again (if that does not fix then you can directly download this repo and place the content to be in the same folder)? Also you can try to update ComfyUI itself and see if it's help.

Honestly this bug is extremely weird and I have no idea why it could cause this at all.

If there's some weird problem with workflow serialization then you probably could try to delete everything and starting from scratch, placing nodes manually 1:1 with the _key_id to be exact same configuration and see if that work.

If you don't mind we could chat about this in discord and see how the issue on your side since for my side I cannot replicate the bug at all.

Gerkinfeltser commented 8 months ago

Starting out, I'll just update my comfy (& the 0246 extension) & see if that fixes it. I'll get back to you. 😄

Gerkinfeltser commented 8 months ago

Yep, it must have been comfy being out of date! Seems to be working fine after doing an "Update All" via manager. Sorry for the false alarm!