Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 1280 but got size 2048 for tensor number 1 in the list. #33

Open
DarkAlchy opened this issue Aug 14, 2023 · 6 comments

Comments

@DarkAlchy
Copy link

RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 1280 but got size 2048 for tensor number 1 in the list. Only happens when your extension is enabled.

@dhwz
Copy link
Contributor

dhwz commented Aug 14, 2023

Your base checkpoint is SDXL?

@DarkAlchy
Copy link
Author

Yes, of course.
image
image

@dhwz
Copy link
Contributor

dhwz commented Aug 14, 2023

Any Loras in your prompt?

@DarkAlchy
Copy link
Author

None.

@wcde
Copy link
Owner

wcde commented Aug 14, 2023

You probably have another error before this one. Tensor size 2048 means that extension code was interrupted and generation continued with Base conditioning.

@DarkAlchy
Copy link
Author

Traceback (most recent call last):
  File "F:\stable-diffusion-webui-new\modules\call_queue.py", line 58, in f
    res = list(func(*args, **kwargs))
  File "F:\stable-diffusion-webui-new\modules\call_queue.py", line 37, in f
    res = func(*args, **kwargs)
  File "F:\stable-diffusion-webui-new\modules\txt2img.py", line 62, in txt2img
    processed = processing.process_images(p)
  File "F:\stable-diffusion-webui-new\modules\processing.py", line 677, in process_images
    res = process_images_inner(p)
  File "F:\stable-diffusion-webui-new\modules\processing.py", line 794, in process_images_inner
    samples_ddim = p.sample(conditioning=p.c, unconditional_conditioning=p.uc, seeds=p.seeds, subseeds=p.subseeds, subseed_strength=p.subseed_strength, prompts=p.prompts)
  File "F:\stable-diffusion-webui-new\modules\processing.py", line 1054, in sample
    samples = self.sampler.sample(self, x, conditioning, unconditional_conditioning, image_conditioning=self.txt2img_image_conditioning(x))
  File "F:\stable-diffusion-webui-new\modules\sd_samplers_kdiffusion.py", line 464, in sample
    samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args={
  File "F:\stable-diffusion-webui-new\modules\sd_samplers_kdiffusion.py", line 303, in launch_sampling
    return func()
  File "F:\stable-diffusion-webui-new\modules\sd_samplers_kdiffusion.py", line 464, in <lambda>
    samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args={
  File "F:\stable-diffusion-webui-new\venv\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "F:\stable-diffusion-webui-new\repositories\k-diffusion\k_diffusion\sampling.py", line 573, in sample_dpmpp_sde
    denoised_2 = model(x_2, sigma_fn(s) * s_in, **extra_args)
  File "F:\stable-diffusion-webui-new\venv\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "F:\stable-diffusion-webui-new\modules\sd_samplers_kdiffusion.py", line 168, in forward
    tensor = pad_cond(tensor, -num_repeats, empty)
  File "F:\stable-diffusion-webui-new\modules\sd_samplers_kdiffusion.py", line 74, in pad_cond
    tensor['crossattn'] = pad_cond(tensor['crossattn'], repeats, empty)
  File "F:\stable-diffusion-webui-new\modules\sd_samplers_kdiffusion.py", line 72, in pad_cond
    return torch.cat([tensor, empty.repeat((tensor.shape[0], repeats, 1))], axis=1)
RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 1280 but got size 2048 for tensor number 1 in the list.

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

No branches or pull requests

3 participants