Kosinkadink / ComfyUI-Advanced-ControlNet

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

How to connect the node like A111 "ControlNet is more important" #87

Closed whl0070179 closed 4 months ago

whl0070179 commented 6 months ago

微信图片_20240321095253

Kosinkadink commented 6 months ago

You can't at the moment, but it's on my list of features to work on as I've gotten a lot of requests for it. I'll let you know when it's ready.

whl0070179 commented 6 months ago

Thx 👍

Kosinkadink commented 4 months ago

The "ControlNet is more important" feature is now available. It is exposed via the uncond_multiplier param on Soft Weights. Setting it to 0.0 is the exact replication of "ControlNet is more important", but with the way it works, it can be tweaked with any value between 0.0 and 1.0, so it is a further extension of the auto1111 sd-webui-controlnet feature. In diffusers, it is referred to as "guess_mode".

(NOTE, when set to 1.0, the Soft Weights are equivalent to "My prompt is more important", same as before.)

image

curlysasha commented 4 months ago

The "ControlNet is more important" feature is now available. It is exposed via the uncond_multiplier param on Soft Weights. Setting it to 0.0 is the exact replication of "ControlNet is more important", but with the way it works, it can be tweaked with any value between 0.0 and 1.0, so it is a further extension of the auto1111 sd-webui-controlnet feature. In diffusers, it is referred to as "guess_mode".

(NOTE, when set to 1.0, the Soft Weights are equivalent to "My prompt is more important", same as before.)

image

Thank you!

whl0070179 commented 4 months ago

Thx!

wuliwalaboy commented 2 months ago

@Kosinkadink when i set uncond_multiplier= 0.00 as example , it doesnot work image

get errors like below: cond_or_uncond = self.batched_number.cond_or_uncond AttributeError: 'int' object has no attribute 'cond_or_uncond'

pls help me ,thx!

Kosinkadink commented 2 months ago

Which KSampler are you attempting to use it with?

wuliwalaboy commented 2 months ago

image I used both KSamplers, and both gave this error.

Kosinkadink commented 2 months ago

Create the simplest workflow that replicates the issue that uses KSampler advanced, and send it my way

Kosinkadink commented 2 months ago

I've confirmed that uncond_multiplier still works as intended on my end on latest ComfyUI and Advanced-ControlNet, so perhaps there is something in your workflow that makes the code not go through the usual ComfyUI codepath for sampling. Once you give me the simplest workflow that you can make that still has the issue, that should clear things up.

wuliwalaboy commented 2 months ago

image

I re-experimented and found that when I connect the tiled diffusion node, this error occurs. Here is a partial screenshot of my workflow, please take a look.

Kosinkadink commented 2 months ago

Yep, it's likely that. Tiled Diffusion has its own version of sampling code. Currently, the implementation for uncond_multiplier requires that the sampling code is written in a particular manner, as I need to figure out the cond and uncond portions of the batches. I will talk with comfy about changing the controlnet code to provide the additional info, although that will be a change that will require other sampling code (like tiles Diffusion) to account for it anyway.

TL;Dr nothing I can do at the moment to make it work with tiled Diffusion, unless tiled diffusion node slightly modifies it's sampling code

wuliwalaboy commented 2 months ago

I'm really looking forward to it. Thank you again for your response!

dushunpeng163 commented 2 months ago

Yep, it's likely that. Tiled Diffusion has its own version of sampling code. Currently, the implementation for uncond_multiplier requires that the sampling code is written in a particular manner, as I need to figure out the cond and uncond portions of the batches. I will talk with comfy about changing the controlnet code to provide the additional info, although that will be a change that will require other sampling code (like tiles Diffusion) to account for it anyway.

TL;Dr nothing I can do at the moment to make it work with tiled Diffusion, unless tiled diffusion node slightly modifies it's sampling code

hi,@Kosinkadink May I ask if there has been any progress? I have encountered the same issue. pls help!😢