Kosinkadink / ComfyUI-Advanced-ControlNet

ControlNet scheduling and masking nodes with sliding context support
GNU General Public License v3.0
615 stars 61 forks source link

Er #158

Closed dkfreak closed 3 months ago

dkfreak commented 3 months ago

Hi, when trying to run advanced controlnet i keep running into the same issue across multiple workflows. There error I am getting is as follows :::

!!! Exception during processing!!! ControlBase.set_cond_hint() takes from 2 to 4 positional arguments but 5 were given Traceback (most recent call last): File "/home/samo/comfyUImanual/ComfyUI/execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/samo/comfyUImanual/ComfyUI/execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/samo/comfyUImanual/ComfyUI/execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/samo/comfyUImanual/ComfyUI/nodes.py", line 804, in apply_controlnet c_net = control_net.copy().set_cond_hint(control_hint, strength, (start_percent, end_percent), vae) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: ControlBase.set_cond_hint() takes from 2 to 4 positional arguments but 5 were given

When doing a search i could not find anyone else with this problem and it seems to be a general pythin error - somethinhg about missing an extra close bracket but before i go digging into the code, i assume there is a problem on my end since it works for others.

I have updated everything i tried a fresh install, ... but keep getting this error.

I am runing thsi on linux. Thanks for any help.

Kosinkadink commented 3 months ago

Is that the full error stack? I don't see it going through any Advanced-ControlNet code there.

Kosinkadink commented 3 months ago

Can you take a screenshot of the controlnet portion of whatever workflow you're using?

dkfreak commented 3 months ago

ok here is a screenshot of the entire workflow and i have included the workflow also...

Prompt executed in 0.05 seconds got prompt model_path is /home/samo/comfyUImanual/ComfyUI/custom_nodes/comfyui_controlnet_aux/ckpts/lllyasviel/Annotators/sk_model.pth

model_path is /home/samo/comfyUImanual/ComfyUI/custom_nodes/comfyui_controlnet_aux/ckpts/lllyasviel/Annotators/sk_model2.pth

!!! Exception during processing!!! ControlBase.set_cond_hint() takes from 2 to 4 positional arguments but 5 were given Traceback (most recent call last): File "/home/samo/comfyUImanual/ComfyUI/execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/samo/comfyUImanual/ComfyUI/execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/home/samo/comfyUImanual/ComfyUI/execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/samo/comfyUImanual/ComfyUI/nodes.py", line 804, in apply_controlnet c_net = control_net.copy().set_cond_hint(control_hint, strength, (start_percent, end_percent), vae) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

TypeError: ControlBase.set_cond_hint() takes from 2 to 4 positional arguments but 5 were given

Prompt executed in 0.50 seconds

On Sat, Aug 17, 2024 at 9:42 PM Jedrzej Kosinski @.***> wrote:

Can you take a screenshot of the controlnet portion of whatever workflow you're using?

— Reply to this email directly, view it on GitHub https://github.com/Kosinkadink/ComfyUI-Advanced-ControlNet/issues/158#issuecomment-2295076508, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUCDAWQADPHEALK4LXPR2ZLZSAC2DAVCNFSM6AAAAABMV5YRYOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJVGA3TMNJQHA . You are receiving this because you authored the thread.Message ID: @.***>

dkfreak commented 3 months ago

Screenshot_20240819_193820

dkfreak commented 3 months ago

here is the workflow so u can just run it

control.json

I know this is probably some error on my end so i exhausted all options before submutting this. It doesn't seem like others are having this problem after doing an extensive search but i have tried everything i know to fix it. I have been at this for a couple months and this is my first problem i could not fix.

slammpete commented 3 months ago

Is that the full error stack? I don't see it going through any Advanced-ControlNet code there.

yes that is the entire error message i am getting. Comyui dies on your "Apply Control net (Advanced" node then it spits out -

_!!! Exception during processing!!! ControlBase.set_cond_hint() takes from 2 to 4 positional arguments but 5 were given Traceback (most recent call last): File "/home/samo/comfyUImanual/ComfyUI/execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/samo/comfyUImanual/ComfyUI/execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/samo/comfyUImanual/ComfyUI/execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/samo/comfyUImanual/ComfyUI/nodes.py", line 804, in apply_controlnet c_net = control_net.copy().set_cond_hint(control_hint, strength, (start_percent, end_percent), vae) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: C!!! Exception during processing!!! ControlBase.set_cond_hint() takes from 2 to 4 positional arguments but 5 were given Traceback (most recent call last): File "/home/samo/comfyUImanual/ComfyUI/execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/samo/comfyUImanual/ComfyUI/execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/samo/comfyUImanual/ComfyUI/execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/samo/comfyUImanual/ComfyUI/nodes.py", line 804, in apply_controlnet c_net = control_net.copy().set_cond_hint(control_hint, strength, (start_percent, end_percent), vae) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: ControlBase.set_cond_hint() takes from 2 to 4 positional arguments but 5 were givenontrolBase.set_condhint() takes from 2 to 4 positional arguments but 5 were given

isn't this part of your code "TypeError: ControlBase.set_cond_hint() t"

i am able to use control net just fine.

Kosinkadink commented 3 months ago

All of the nodes in your workflow are vanilla ControlNet nodes. Apply ControlNet (Advanced) is part of native ComfyUI. The one in this node pack is "Apply Advanced ControlNet" with emojis at the end - all of the nodes in my node packs have emojis in the node names to easily differentiate between my nodes and vanilla nodes.

There is no mention of ComfyUI-Advanced-ControlNet in your error stack, so something might be off in your ComfyUI install since it throws that error on the vanilla node.

slammpete commented 3 months ago

ok i downloaded a bad workflow, not sure how they got it to work . here is my real error -

Error occurred when executing ACN_ControlNet++LoaderSingle:

'/home/samo/comfyUImanual/ComfyUI/models/controlnet/control_v11p_sd15_openpose.pth' is not a valid ControlNet++ model.

File "/home/samo/comfyUImanual/ComfyUI/execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/samo/comfyUImanual/ComfyUI/execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/samo/comfyUImanual/ComfyUI/execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/samo/comfyUImanual/ComfyUI/custom_nodes/ComfyUI-Advanced-ControlNet/adv_control/nodes_plusplus.py", line 49, in load_controlnet_plusplus controlnet = load_controlnetplusplus(controlnet_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/samo/comfyUImanual/ComfyUI/custom_nodes/ComfyUI-Advanced-ControlNet/adv_control/control_plusplus.py", line 354, in load_controlnetplusplus raise Exception(f"'{ckpt_path}' is not a valid ControlNet++ model.") Queue size: 0 ERROR CPU 4% RAM 61% GPU 45% VRAM 28% Temp 56° HDD 87% Extra options

i downloaded this model from the comfyui manager. same exact name as stated on your git hub page.

Standard Lineart standard_lineart control_v11p_sd15_lineart

so i checked the models directory and that model was dl with no problems and exists in the correct path and is the correct model. correct? even on the manager it said model for new controlnet and was the only one with that name

slammpete commented 3 months ago

let me load the emoji control net nodes and i will gte back to u.

slammpete commented 3 months ago

control

ok these are the correct nodes correct? here is the trace...

Loading 1 new model !!! Exception during processing!!! 'ControlNet' object has no attribute 'latent_format' Traceback (most recent call last): File "/home/samo/comfyUImanual/ComfyUI/execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/samo/comfyUImanual/ComfyUI/execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/samo/comfyUImanual/ComfyUI/execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/samo/comfyUImanual/ComfyUI/custom_nodes/ComfyUI-Advanced-ControlNet/adv_control/nodes.py", line 51, in load_controlnet controlnet = load_controlnet(controlnet_path, tk_optional) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/samo/comfyUImanual/ComfyUI/custom_nodes/ComfyUI-Advanced-ControlNet/adv_control/control.py", line 468, in load_controlnet return convert_to_advanced(control, timestep_keyframe=timestep_keyframe) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/samo/comfyUImanual/ComfyUI/custom_nodes/ComfyUI-Advanced-ControlNet/adv_control/control.py", line 477, in convert_to_advanced control = ControlNetAdvanced.from_vanilla(v=control, timestep_keyframe=timestep_keyframe) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/samo/comfyUImanual/ComfyUI/custom_nodes/ComfyUI-Advanced-ControlNet/adv_control/control.py", line 102, in from_vanilla global_average_pooling=v.global_average_pooling, compression_ratio=v.compression_ratio, latent_format=v.latent_format, device=v.device, load_device=v.load_device, manual_cast_dtype=v.manual_cast_dtype) ^^^^^^^^^^^^^^^ AttributeError: 'ControlNet' object has no attribute 'latent_format'

Prompt executed in 3.39 seconds

I updated comfyui and all other models , did a restart . this is your code correct?

Kosinkadink commented 3 months ago

Your ComfyUI is outdated by a few months if the vanilla ControlNet obj doesn't have latent_format on it.

slammpete commented 3 months ago

i reinstalled comfyui from scratch the other day. and just updated it in comfymanager and also did a git pull in the comfyui directory?

does your code require and sdxl model?

Kosinkadink commented 3 months ago

My code requires nothing special. The fact the vanilla ControlNet nodes don't work points at something having gone horrificly wrong with your ComfyUI install.

Kosinkadink commented 3 months ago

You may need to reinstall completely, and then try again with the vanilla nodes. Once the vanilla nodes work fine, then I think you can be pretty confident that everything will be working properly.

Kosinkadink commented 3 months ago

Currently, it's almost like your install is a weird mix of the current version of ComfyUI, and months-old version of ComfyUI.

slammpete commented 3 months ago

i did have an older version but installed each into a separate conda environment. i thought that would isolate them from one another. apparently not?

ok thanks for your help. i am new to python , my company only allows us to use c or c++ for their trading systems so don't have experience with this mess.. some just released a paper on benchmark speeds of most languages - c came in first, python was second to last . running 17x slower than c.

thanks again, sorry for bugging you.

Kosinkadink commented 3 months ago

No worries. Raw python is indeed slow - everything inside it, from function calls to types to variable definition, is basically a Map/Dictionary that points to something else. The benefit of that design is that it has a very lax syntax and easy extendibility.

In the case of research/performance usage, python libraries can include compiled c/c++/rust code - python can act like a wrapper to run other code. Pytorch is the framework for running tensors, and all the hard work is done by c code. Pytorch takes care of putting the tensors on specific device (CPU,GPU, etc).

Going a full c/c++ route would be faster, but not by a game-changing amount, and at a price of limited extendibility. The reason so much research is done in python is that the higher level things are very simple to extend, while the lower level things are accelerated by precompiled code in the pytorch framework.

slammpete commented 3 months ago

Yeah I got it working, i just kept the models directory, my input, output, and uninstalled/deleted everything. I always tell people if you're the only one complaining about something that thousands of others have had no problems using, it's definitely you. The problem is there is no chat for beginners really that i have found. Reddit is a joke, every question i submit gets auto rejected. I also got banned from reddit because i said as a joke to someone who was asking where they can get cocaine, i said 'probably colombia'.

No i get why python is used, It's a higher level language. You can get stuff done a lot faster without having to worry about dealing directly with the system plus they have a lot of libraries u can reuse. I still use perl or java, sometimes pascal but when it comes to production trading systems we have to write everything from scratch which makes debugging super easy. Hell we hired one guy once to write our own C compiler.

A lot of the higher level languages are either written in c ( java , etc.. ) or use c libraries. I see your point about the speed but on wall st every .00001 second counts, especially when we write HFT trading systems. Hell speed is so important our company pays millions a year to keep our HFT servers next to the trading floor. Our offices are located 2 blocks down the street !! So when dealing with those kinds of speeds every little bit counts.

Soon we'll have the highest level language ever via natural language. Of course i am joking, regardless of what these tech 'gurus' say LLM\s are not AI and the chances of them becoming real AI is nearly 0. When chatgpt went live to the public Noam Chomsky, probably the smartest person alive today, the inventor of linguistics at MIT, took one look at llm's and in an hour destroyed anyone's argument that LLM's would one day become AI.

I really do enjoy messing around with these stable diffusion models though. We'll see much better progress in this vs llms.... all i want to know is why can't they draw goddam hands and feet properly :) To be honest I think they are messing them up on purpose as a safety mechanism because it's always my most realistic photos that get the bad hands and feet so not i just don't put them in my photos... then i created 5 ai photos and took 5 regular photos, gave them to 10 people who do AI and they could not spot them. Scary.

Thanks for all your work man, everyone appreciates all the work being done .........!!