JettHu / ComfyUI_TGate

T-GATE implementation for ComfyUI.
GNU General Public License v3.0
80 stars 9 forks source link

After updating, there is an error when using animatediff: “The size of tensor a (16) must match the size of tensor b (8) at non-singleton dimension 0” #8

Closed hahy36 closed 6 months ago

hahy36 commented 6 months ago

Traceback (most recent call last): File "/kaggle/working/ComfyUI/execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "/kaggle/working/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 "/kaggle/working/ComfyUI/execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(slice_dict(input_data_all, i))) File "/kaggle/working/ComfyUI/nodes.py", line 1378, 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 "/kaggle/working/ComfyUI/nodes.py", line 1314, in common_ksampler samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, File "/kaggle/working/ComfyUI/custom_nodes/ComfyUI-Advanced-ControlNet/adv_control/control_reference.py", line 47, in refcn_sample return orig_comfy_sample(model, *args, *kwargs) File "/kaggle/working/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved/animatediff/sampling.py", line 383, in motion_sample latents = orig_comfy_sample(model, noise, args, kwargs) File "/kaggle/working/ComfyUI/comfy/sample.py", line 37, 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 "/kaggle/working/ComfyUI/comfy/samplers.py", line 755, 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 "/kaggle/working/ComfyUI/comfy/samplers.py", line 657, in sample return cfg_guider.sample(noise, latent_image, sampler, sigmas, denoise_mask, callback, disable_pbar, seed) File "/kaggle/working/ComfyUI/comfy/samplers.py", line 644, in sample output = self.inner_sample(noise, latent_image, device, sampler, sigmas, denoise_mask, callback, disable_pbar, seed) File "/kaggle/working/ComfyUI/comfy/samplers.py", line 623, in inner_sample samples = sampler.sample(self, sigmas, extra_args, callback, noise, latent_image, denoise_mask, disable_pbar) File "/kaggle/working/ComfyUI/comfy/samplers.py", line 534, in sample samples = self.sampler_function(model_k, noise, sigmas, extra_args=extra_args, callback=k_callback, disable=disable_pbar, self.extra_options) File "/kaggle/venv/venv/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context return func(*args, *kwargs) File "/kaggle/working/ComfyUI/comfy/k_diffusion/sampling.py", line 745, in sample_lcm denoised = model(x, sigmas[i] s_in, extra_args) File "/kaggle/working/ComfyUI/comfy/samplers.py", line 272, in call out = self.inner_model(x, sigma, model_options=model_options, seed=seed) File "/kaggle/working/ComfyUI/comfy/samplers.py", line 610, in call return self.predict_noise(*args, kwargs) File "/kaggle/working/ComfyUI/comfy/samplers.py", line 613, 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 "/kaggle/working/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved/animatediff/sampling.py", line 424, in evolved_sampling_function cond_pred, uncond_pred = comfy.samplers.calc_condbatch(model, [cond, uncond], x, timestep, model_options) File "/kaggle/working/ComfyUI/comfy/samplers.py", line 218, in calc_cond_batch output = model.apply_model(inputx, timestep, c).chunk(batch_chunks) File "/kaggle/working/ComfyUI/comfy/model_base.py", line 97, in apply_model model_output = self.diffusion_model(xc, t, context=context, control=control, transformer_options=transformer_options, extra_conds).float() File "/kaggle/venv/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl return self._call_impl(*args, *kwargs) File "/kaggle/venv/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl return forward_call(args, kwargs) File "/kaggle/working/ComfyUI/comfy/ldm/modules/diffusionmodules/openaimodel.py", line 850, in forward h = forward_timestep_embed(module, h, emb, context, transformer_options, time_context=time_context, num_video_frames=num_video_frames, image_only_indicator=image_only_indicator) File "/kaggle/working/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved/animatediff/sampling.py", line 109, in forward_timestep_embed x = layer(x, context, transformer_options) File "/kaggle/venv/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl return self._call_impl(*args, kwargs) File "/kaggle/venv/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl return forward_call(*args, *kwargs) File "/kaggle/working/ComfyUI/comfy/ldm/modules/attention.py", line 633, in forward x = block(x, context=context[i], transformer_options=transformer_options) File "/kaggle/venv/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl return self._call_impl(args, kwargs) File "/kaggle/venv/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl return forward_call(*args, *kwargs) File "/kaggle/working/ComfyUI/comfy/ldm/modules/attention.py", line 460, in forward return checkpoint(self._forward, (x, context, transformer_options), self.parameters(), self.checkpoint) File "/kaggle/working/ComfyUI/comfy/ldm/modules/diffusionmodules/util.py", line 191, in checkpoint return func(inputs) File "/kaggle/working/ComfyUI/custom_nodes/ComfyUI_TGate/TGate.py", line 124, in tgate_forward x += n

hahy36 commented 6 months ago

Before the update, it could run.

JettHu commented 6 months ago

Probably related to #7 . Already merged.

hahy36 commented 6 months ago

This time, Animatediff is no longer reporting any errors.