Kosinkadink / ComfyUI-AnimateDiff-Evolved

Improved AnimateDiff for ComfyUI and Advanced Sampling Support
Apache License 2.0
2.69k stars 204 forks source link

KSampler 'NoneType' object has no attribute 'shape' #485

Closed wenxini234 closed 1 week ago

wenxini234 commented 1 week ago

[2024-10-12 22:27] !!! Exception during processing !!! 'NoneType' object has no attribute 'shape' [2024-10-12 22:27] Traceback (most recent call last): File "/mnt/workspace/ComfyUI/execution.py", line 323, in execute output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) File "/mnt/workspace/ComfyUI/execution.py", line 198, in get_output_data return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) File "/mnt/workspace/ComfyUI/execution.py", line 169, in _map_node_over_list process_inputs(input_dict, i) File "/mnt/workspace/ComfyUI/execution.py", line 158, in process_inputs results.append(getattr(obj, func)(inputs)) File "/mnt/workspace/ComfyUI/nodes.py", line 1437, in sample return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise) File "/mnt/workspace/ComfyUI/nodes.py", line 1404, in common_ksampler samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, File "/mnt/workspace/ComfyUI/custom_nodes/ComfyUI-Advanced-ControlNet/adv_control/sampling.py", line 116, in acn_sample return orig_comfy_sample(model, *args, *kwargs) File "/mnt/workspace/ComfyUI/custom_nodes/ComfyUI-Advanced-ControlNet/adv_control/utils.py", line 117, in uncond_multiplier_check_cn_sample return orig_comfy_sample(model, args, kwargs) File "/mnt/workspace/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved/animatediff/sampling.py", line 526, in motion_sample latents = orig_comfy_sample(model, noise, *args, kwargs) File "/mnt/workspace/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 "/mnt/workspace/ComfyUI/comfy/sample.py", line 43, in sample samples = sampler.sample(noise, positive, negative, 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 "/mnt/workspace/ComfyUI/comfy/samplers.py", line 829, 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 "/mnt/workspace/ComfyUI/comfy/samplers.py", line 729, in sample return cfg_guider.sample(noise, latent_image, sampler, sigmas, denoise_mask, callback, disable_pbar, seed) File "/mnt/workspace/ComfyUI/comfy/samplers.py", line 716, in sample output = self.inner_sample(noise, latent_image, device, sampler, sigmas, denoise_mask, callback, disable_pbar, seed) File "/mnt/workspace/ComfyUI/comfy/samplers.py", line 695, in inner_sample samples = sampler.sample(self, sigmas, extra_args, callback, noise, latent_image, denoise_mask, disable_pbar) File "/mnt/workspace/ComfyUI/comfy/samplers.py", line 600, in sample samples = self.sampler_function(model_k, noise, sigmas, extra_args=extra_args, callback=k_callback, disable=disable_pbar, self.extra_options) File "/usr/local/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context return func(args, kwargs) File "/mnt/workspace/ComfyUI/comfy/k_diffusion/sampling.py", line 843, in sample_lcm denoised = model(x, sigmas[i] * s_in, *extra_args) File "/mnt/workspace/ComfyUI/comfy/samplers.py", line 299, in call out = self.inner_model(x, sigma, model_options=model_options, seed=seed) File "/mnt/workspace/ComfyUI/comfy/samplers.py", line 682, in call return self.predict_noise(args, kwargs) File "/mnt/workspace/ComfyUI/comfy/samplers.py", line 685, in predict_noise return sampling_function(self.inner_model, x, timestep, self.conds.get("negative", None), self.conds.get("positive", None), self.cfg, model_options=model_options, seed=seed) File "/mnt/workspace/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved/animatediff/sampling.py", line 633, in evolved_sampling_function cond_pred, uncond_pred = calc_conds_batchwrapper(model, [cond, uncond], x, timestep, model_options) File "/mnt/workspace/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved/animatediff/sampling.py", line 993, in calc_conds_batch_wrapper return comfy.samplers.calc_cond_batch(model, conds, x_in, timestep, model_options) File "/mnt/workspace/ComfyUI/comfy/samplers.py", line 228, in calc_cond_batch output = model.apply_model(inputx, timestep, c).chunk(batch_chunks) File "/mnt/workspace/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved/animatediff/sampling.py", line 218, in apply_model_ade_wrapper motion_model.prepare_img_features(x=x, cond_or_uncond=cond_or_uncond, ad_params=ad_params, latent_format=self.latent_format) File "/mnt/workspace/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved/animatediff/model_injection.py", line 946, in prepare_img_features img_latents = comfy.utils.common_upscale(self.orig_img_latents, x.shape[3], x.shape[2], 'nearest-exact', 'center').to(x.dtype).to(x.device) File "/mnt/workspace/ComfyUI/comfy/utils.py", line 694, in common_upscale old_width = samples.shape[3] AttributeError: 'NoneType' object has no attribute 'shape'

[2024-10-12 22:27] Prompt executed in 27.46 seconds

Kosinkadink commented 1 week ago

What exactly are you doing in your workflow? Please show a screenshot

wenxini234 commented 1 week ago
截屏2024-10-12 22 44 26

This error occurred when adding animateLcm models

Kosinkadink commented 1 week ago

That's the i2v model, you must use the Apply AnimateLCM-I2V Model node to use it properly

Kosinkadink commented 1 week ago

I thought I had an error message that should appear when it's not used properly, but I guess something is off, I'll have the error properly appear at some point

wenxini234 commented 1 week ago

Thank you very much, @Kosinkadink, I should have used the wrong model, I will try it with t2v animateLCM models