continue-revolution / sd-webui-animatediff

AnimateDiff for AUTOMATIC1111 Stable Diffusion WebUI
Other
3.07k stars 253 forks source link

[Bug]: AttributeError: 'dict' object has no attribute 'shape' #464

Closed sdman88 closed 6 months ago

sdman88 commented 6 months ago

Is there an existing issue for this?

Have you read FAQ on README?

What happened?

Keep getting this error when trying to use prompt travel with sdxl and animatediff. Prompt travel only seems to be working when using SD1.5 models for me

Steps to reproduce the problem

  1. Select any sdxl checkpoint in txt2img
  2. Use either sdxlbeta or hotshot xl mm
  3. Enter a prompt that uses prompt travel, see my example below
  4. Context batch set to 16 for sdxlbeta mm or 8 for hotshot, N or R-P loop
  5. Number of frames: set to anything higher than the ending frame number for prompt travel, my example used 20 with sdxlbeta mm
  6. Hit generate and should get this error

What should have happened?

Should have generated a gif using prompt travel without errors

Commit where the problem happens

webui: bef51ae extension: a390500

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

--xformers --autolaunch

Console logs

Traceback (most recent call last):
      File "D:\stable-diffusion\stable-diffusion-webui\modules\call_queue.py", line 57, in f
        res = list(func(*args, **kwargs))
      File "D:\stable-diffusion\stable-diffusion-webui\modules\call_queue.py", line 36, in f
        res = func(*args, **kwargs)
      File "D:\stable-diffusion\stable-diffusion-webui\modules\txt2img.py", line 110, in txt2img
        processed = processing.process_images(p)
      File "D:\stable-diffusion\stable-diffusion-webui\modules\processing.py", line 785, in process_images
        res = process_images_inner(p)
      File "D:\stable-diffusion\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\batch_hijack.py", line 48, in processing_process_images_hijack
        return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
      File "D:\stable-diffusion\stable-diffusion-webui\modules\processing.py", line 921, 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 "D:\stable-diffusion\stable-diffusion-webui\modules\processing.py", line 1257, in sample
        samples = self.sampler.sample(self, x, conditioning, unconditional_conditioning, image_conditioning=self.txt2img_image_conditioning(x))
      File "D:\stable-diffusion\stable-diffusion-webui\modules\sd_samplers_kdiffusion.py", line 234, in sample
        samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args=self.sampler_extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs))
      File "D:\stable-diffusion\stable-diffusion-webui\modules\sd_samplers_common.py", line 261, in launch_sampling
        return func()
      File "D:\stable-diffusion\stable-diffusion-webui\modules\sd_samplers_kdiffusion.py", line 234, in <lambda>
        samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args=self.sampler_extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs))
      File "D:\stable-diffusion\stable-diffusion-webui\venv\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
        return func(*args, **kwargs)
      File "D:\stable-diffusion\stable-diffusion-webui\repositories\k-diffusion\k_diffusion\sampling.py", line 553, in sample_dpmpp_sde
        denoised = model(x, sigmas[i] * s_in, **extra_args)
      File "D:\stable-diffusion\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
        return self._call_impl(*args, **kwargs)
      File "D:\stable-diffusion\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
        return forward_call(*args, **kwargs)
      File "D:\stable-diffusion\stable-diffusion-webui\modules\sd_samplers_cfg_denoiser.py", line 225, in forward
        elif shared.opts.pad_cond_uncond and tensor.shape[1] != uncond.shape[1]:
    AttributeError: 'dict' object has no attribute 'shape'

Additional information

prompt used for this traceback example:

positive prompt: person, 0: standing 16: sitting

negative prompt: (worst quality, low quality:1.5), lowres, watermark, text, error, blurry, jpeg artifacts, cropped, signature, username, artist name, text, logo, monochrome, greyscale, red eye effect

xgt1986627 commented 6 months ago

me too, how to dealwith it.

sdman88 commented 6 months ago

Awesome, thanks for looking into this and fixing so quickly