Kosinkadink / ComfyUI-Advanced-ControlNet

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

new Controlnet nodes not compatible with animatediff v3 sparseControl model #54

Closed qingyuan18 closed 8 months ago

qingyuan18 commented 8 months ago

new Controlnet nodes not compatible with animatediff v3 sparseControl model when upgrade animatediff into v3,which contains the sparsContoller model, the KSampler throws out Error after apply controlnet to KSampler nodes as following: `'NoneType' object has no attribute 'strength'

File "/home/ubuntu/ComfyUI/execution.py", line 155, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "/home/ubuntu/ComfyUI/execution.py", line 85, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "/home/ubuntu/ComfyUI/execution.py", line 78, in map_node_over_list results.append(getattr(obj, func)(slice_dict(input_data_all, i))) File "/home/ubuntu/ComfyUI/nodes.py", line 1389, in sample return common_ksampler(model, noise_seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise, disable_noise=disable_noise, start_step=start_at_step, last_step=end_at_step, force_full_denoise=force_full_denoise) File "/home/ubuntu/ComfyUI/nodes.py", line 1325, in common_ksampler samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, File "/home/ubuntu/ComfyUI/custom_nodes/ComfyUI-Impact-Pack/modules/impact/sample_error_enhancer.py", line 9, in informative_sample return original_sample(*args, *kwargs) # This code helps interpret error messages that occur within exceptions but does not have any impact on other operations. File "/home/ubuntu/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved/animatediff/sampling.py", line 299, in motion_sample latents = wrap_function_to_inject_xformers_bug_info(orig_comfy_sample)(model, noise, args, kwargs) File "/home/ubuntu/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved/animatediff/model_utils.py", line 205, in wrapped_function return function_to_wrap(*args, kwargs) File "/home/ubuntu/ComfyUI/comfy/sample.py", line 100, in sample samples = sampler.sample(noise, positive_copy, negative_copy, cfg=cfg, latent_image=latent_image, start_step=start_step, last_step=last_step, force_full_denoise=force_full_denoise, denoise_mask=noise_mask, sigmas=sigmas, callback=callback, disable_pbar=disable_pbar, seed=seed) File "/home/ubuntu/ComfyUI/custom_nodes/ComfyUI_smZNodes/init.py", line 129, in KSampler_sample return _KSampler_sample(*args, *kwargs) File "/home/ubuntu/ComfyUI/comfy/samplers.py", line 716, in sample return sample(self.model, noise, positive, negative, cfg, self.device, sampler, sigmas, self.model_options, latent_image=latent_image, denoise_mask=denoise_mask, callback=callback, disable_pbar=disable_pbar, seed=seed) File "/home/ubuntu/ComfyUI/custom_nodes/ComfyUI_smZNodes/init.py", line 138, in sample return _sample(args, kwargs) File "/home/ubuntu/ComfyUI/comfy/samplers.py", line 622, in sample samples = sampler.sample(model_wrap, sigmas, extra_args, callback, noise, latent_image, denoise_mask, disable_pbar) File "/home/ubuntu/ComfyUI/comfy/samplers.py", line 561, in sample samples = self.sampler_function(model_k, noise, sigmas, extra_args=extra_args, callback=k_callback, disable=disable_pbar, self.extra_options) File "/opt/conda/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context return func(*args, *kwargs) File "/home/ubuntu/ComfyUI/comfy/k_diffusion/sampling.py", line 137, in sample_euler denoised = model(x, sigma_hat s_in, extra_args) File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl return self._call_impl(*args, kwargs) File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl return forward_call(*args, *kwargs) File "/home/ubuntu/ComfyUI/comfy/samplers.py", line 285, in forward out = self.inner_model(x, sigma, cond=cond, uncond=uncond, cond_scale=cond_scale, model_options=model_options, seed=seed) File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl return self._call_impl(args, kwargs) File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl return forward_call(*args, kwargs) File "/home/ubuntu/ComfyUI/comfy/samplers.py", line 275, in forward return self.apply_model(*args, *kwargs) File "/home/ubuntu/ComfyUI/custom_nodes/ComfyUI_smZNodes/smZNodes.py", line 998, in apply_model out = super().apply_model(args, kwargs) File "/home/ubuntu/ComfyUI/comfy/samplers.py", line 272, in apply_model out = sampling_function(self.inner_model, x, timestep, uncond, cond, cond_scale, model_options=model_options, seed=seed) File "/home/ubuntu/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved/animatediff/sampling.py", line 649, in sliding_sampling_function cond, uncond = calc_cond_uncond_batch(model, cond, uncond, x, timestep, model_options) File "/home/ubuntu/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved/animatediff/sampling.py", line 506, in calc_cond_uncond_batch c['control'] = control.get_control(inputx, timestep, c, len(cond_or_uncond)) File "/home/ubuntu/ComfyUI/custom_nodes/ComfyUI-Advanced-ControlNet/adv_control/utils.py", line 402, in get_control_inject if self.strength == 0.0 or self.current_timestep_keyframe.strength == 0.0:`

workflow: ![Uploading image.png…]()

qingyuan18 commented 8 months ago

workflow : image

Kosinkadink commented 8 months ago

Everything should be working, I think you may have a badly outdated ComfyUI if you're experiencing this issue: https://github.com/Kosinkadink/ComfyUI-Advanced-ControlNet/issues/32

I'll take a look if there was some new ComfyUI update that broke things, but I think your best bet is to make triple sure your ComfyUI is updated properly. Sometimes the update may silently fail, so you may not have successfully gotten the newest version in over a month.

qingyuan18 commented 8 months ago

problem solved, not ComfyUI/Controlnet node related, it's due to the scheduler mismatch between model loader and animatediff node

Thanks for your help! hence close the ticket