Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error occurs when using layer_diffusion_cond_fg_all.json #15

Closed
wTechArtist opened this issue Mar 4, 2024 · 1 comment
Closed

An error occurs when using layer_diffusion_cond_fg_all.json #15

wTechArtist opened this issue Mar 4, 2024 · 1 comment

Comments

@wTechArtist
Copy link

An error occurs when using layer_diffusion_cond_fg_all.json
After I downloaded it and ran it directly, the following error occurred:

Error occurred when executing KSampler:

Sizes of tensors must match except in dimension 1. Expected size 128 but got size 144 for tensor number 1 in the list.

File "D:\Software\Ai\ComfyUI-aki-v1.2\execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "D:\Software\Ai\ComfyUI-aki-v1.2\execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "D:\Software\Ai\ComfyUI-aki-v1.2\execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "D:\Software\Ai\ComfyUI-aki-v1.2\nodes.py", line 1368, in sample
return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise)
File "D:\Software\Ai\ComfyUI-aki-v1.2\nodes.py", line 1338, in common_ksampler
samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image,
File "D:\Software\Ai\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-Impact-Pack\modules\impact\sample_error_enhancer.py", line 22, in informative_sample
raise e
File "D:\Software\Ai\ComfyUI-aki-v1.2\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 "D:\Software\Ai\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-AnimateDiff-Evolved\animatediff\sampling.py", line 248, in motion_sample
return orig_comfy_sample(model, noise, *args, **kwargs)
File "D:\Software\Ai\ComfyUI-aki-v1.2\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 "D:\Software\Ai\ComfyUI-aki-v1.2\comfy\samplers.py", line 703, 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 "D:\Software\Ai\ComfyUI-aki-v1.2\comfy\samplers.py", line 608, in sample
samples = sampler.sample(model_wrap, sigmas, extra_args, callback, noise, latent_image, denoise_mask, disable_pbar)
File "D:\Software\Ai\ComfyUI-aki-v1.2\comfy\samplers.py", line 547, in sample
samples = self.sampler_function(model_k, noise, sigmas, extra_args=extra_args, callback=k_callback, disable=disable_pbar, **self.extra_options)
File "D:\Software\Ai\ComfyUI-aki-v1.2\python\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "D:\Software\Ai\ComfyUI-aki-v1.2\comfy\k_diffusion\sampling.py", line 137, in sample_euler
denoised = model(x, sigma_hat * s_in, **extra_args)
File "D:\Software\Ai\ComfyUI-aki-v1.2\python\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "D:\Software\Ai\ComfyUI-aki-v1.2\python\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "D:\Software\Ai\ComfyUI-aki-v1.2\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 "D:\Software\Ai\ComfyUI-aki-v1.2\python\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self.call_impl(*args, **kwargs)
File "D:\Software\Ai\ComfyUI-aki-v1.2\python\lib\site-packages\torch\nn\modules\module.py", line 1527, in call_impl
return forward_call(*args, **kwargs)
File "D:\Software\Ai\ComfyUI-aki-v1.2\comfy\samplers.py", line 272, in forward
return self.apply_model(*args, **kwargs)
File "D:\Software\Ai\ComfyUI-aki-v1.2\comfy\samplers.py", line 269, in apply_model
out = sampling_function(self.inner_model, x, timestep, uncond, cond, cond_scale, model_options=model_options, seed=seed)
File "D:\Software\Ai\ComfyUI-aki-v1.2\comfy\samplers.py", line 249, in sampling_function
cond_pred, uncond_pred = calc_cond_uncond_batch(model, cond, uncond
, x, timestep, model_options)
File "D:\Software\Ai\ComfyUI-aki-v1.2\comfy\samplers.py", line 223, in calc_cond_uncond_batch
output = model.apply_model(input_x, timestep
, **c).chunk(batch_chunks)
File "D:\Software\Ai\ComfyUI-aki-v1.2\comfy\model_base.py", line 76, in apply_model
xc = torch.cat([xc] + [c_concat], dim=1)

@huchenlei
Copy link
Owner

This is likely caused by input image having size that is different from latent noise. You can add a crop image node to crop/resize the image to match the latent's size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants