continue-revolution / sd-webui-animatediff

AnimateDiff for AUTOMATIC1111 Stable Diffusion WebUI
Other
3.11k stars 258 forks source link

[Bug]: RuntimeError: CUDA error: invalid configuration argument #190

Closed fishingcatgo closed 1 year ago

fishingcatgo commented 1 year ago

Is there an existing issue for this?

Have you read FAQ on README?

What happened?

Traceback (most recent call last): File "/home/Meger/stable-diffusion-webui/modules/call_queue.py", line 57, in f res = list(func(*args, kwargs)) File "/home/Meger/stable-diffusion-webui/modules/call_queue.py", line 36, in f res = func(*args, *kwargs) File "/home/Meger/stable-diffusion-webui/modules/txt2img.py", line 55, in txt2img processed = processing.process_images(p) File "/home/Meger/stable-diffusion-webui/modules/processing.py", line 732, in process_images res = process_images_inner(p) File "/home/Meger/stable-diffusion-webui/extensions/sd-webui-animatediff/scripts/animatediff_cn.py", line 108, in hacked_processing_process_images_hijack return getattr(processing, '__controlnet_original_process_images_inner')(p, args, kwargs) File "/home/Meger/stable-diffusion-webui/modules/processing.py", line 867, 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 "/home/Meger/stable-diffusion-webui/modules/processing.py", line 1140, in sample samples = self.sampler.sample(self, x, conditioning, unconditional_conditioning, image_conditioning=self.txt2img_image_conditioning(x)) File "/home/Meger/stable-diffusion-webui/modules/sd_samplers_kdiffusion.py", line 235, 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 "/home/Meger/stable-diffusion-webui/modules/sd_samplers_common.py", line 261, in launch_sampling return func() File "/home/Meger/stable-diffusion-webui/modules/sd_samplers_kdiffusion.py", line 235, in 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 "/root/miniconda3/envs/meger/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context return func(*args, kwargs) File "/home/Meger/stable-diffusion-webui/repositories/k-diffusion/k_diffusion/sampling.py", line 594, in sample_dpmpp_2m denoised = model(x, sigmas[i] * s_in, *extra_args) File "/root/miniconda3/envs/meger/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(args, kwargs) File "/home/Meger/stable-diffusion-webui/extensions/sd-webui-animatediff/scripts/animatediff_infv2v.py", line 252, in mm_cfg_forward x_out = mm_sd_forward(self, x_in, sigma_in, cond_in, image_cond_in, make_condition_dict) # hook File "/home/Meger/stable-diffusion-webui/extensions/sd-webui-animatediff/scripts/animatediff_infv2v.py", line 167, in mm_sd_forward out = self.inner_model(x_in[_context], sigma_in[_context], cond=make_condition_dict(cond_in[_context], image_cond_in[_context])) File "/root/miniconda3/envs/meger/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(*args, kwargs) File "/home/Meger/stable-diffusion-webui/repositories/k-diffusion/k_diffusion/external.py", line 112, in forward eps = self.get_eps(input * c_in, self.sigma_to_t(sigma), *kwargs) File "/home/Meger/stable-diffusion-webui/repositories/k-diffusion/k_diffusion/external.py", line 138, in get_eps return self.inner_model.apply_model(args, kwargs) File "/home/Meger/stable-diffusion-webui/modules/sd_hijack_utils.py", line 17, in setattr(resolved_obj, func_path[-1], lambda *args, kwargs: self(*args, *kwargs)) File "/home/Meger/stable-diffusion-webui/modules/sd_hijack_utils.py", line 28, in call return self.__orig_func(args, kwargs) File "/home/Meger/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/models/diffusion/ddpm.py", line 858, in apply_model x_recon = self.model(x_noisy, t, cond) File "/root/miniconda3/envs/meger/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(*args, *kwargs) File "/home/Meger/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/models/diffusion/ddpm.py", line 1335, in forward out = self.diffusion_model(x, t, context=cc) File "/root/miniconda3/envs/meger/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(args, kwargs) File "/home/Meger/stable-diffusion-webui/modules/sd_unet.py", line 91, in UNetModel_forward return ldm.modules.diffusionmodules.openaimodel.copy_of_UNetModel_forward_for_webui(self, x, timesteps, context, *args, kwargs) File "/home/Meger/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/modules/diffusionmodules/openaimodel.py", line 797, in forward h = module(h, emb, context) File "/root/miniconda3/envs/meger/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(*args, *kwargs) File "/home/Meger/stable-diffusion-webui/extensions/sd-webui-animatediff/scripts/animatediff_mm.py", line 86, in mm_tes_forward x = layer(x, context) File "/root/miniconda3/envs/meger/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(args, kwargs) File "/home/Meger/stable-diffusion-webui/extensions/sd-webui-animatediff/motion_module.py", line 86, in forward return self.temporal_transformer(input_tensor, encoder_hidden_states, attention_mask) File "/root/miniconda3/envs/meger/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(*args, kwargs) File "/home/Meger/stable-diffusion-webui/extensions/sd-webui-animatediff/motion_module.py", line 150, in forward hidden_states = block(hidden_states, encoder_hidden_states=encoder_hidden_states, video_length=video_length) File "/root/miniconda3/envs/meger/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(*args, *kwargs) File "/home/Meger/stable-diffusion-webui/extensions/sd-webui-animatediff/motion_module.py", line 212, in forward hidden_states = attention_block( File "/root/miniconda3/envs/meger/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(args, kwargs) File "/home/Meger/stable-diffusion-webui/extensions/sd-webui-animatediff/motion_module.py", line 567, in forward hidden_states = self._memory_efficient_attention(query, key, value, attention_mask, optimizer_name) File "/home/Meger/stable-diffusion-webui/extensions/sd-webui-animatediff/motion_module.py", line 467, in _memory_efficient_attention hidden_states = xformers.ops.memory_efficient_attention( File "/root/miniconda3/envs/meger/lib/python3.10/site-packages/xformers/ops/fmha/init.py", line 193, in memory_efficient_attention return _memory_efficient_attention( File "/root/miniconda3/envs/meger/lib/python3.10/site-packages/xformers/ops/fmha/init.py", line 291, in _memory_efficient_attention return _memory_efficient_attention_forward( File "/root/miniconda3/envs/meger/lib/python3.10/site-packages/xformers/ops/fmha/init.py", line 311, in _memory_efficient_attentionforward out, * = op.apply(inp, needs_gradient=False) File "/root/miniconda3/envs/meger/lib/python3.10/site-packages/xformers/ops/fmha/flash.py", line 251, in apply out, softmax_lse, rng_state = cls.OPERATOR( File "/root/miniconda3/envs/meger/lib/python3.10/site-packages/torch/_ops.py", line 502, in call return self._op(*args, **kwargs or {}) File "/root/miniconda3/envs/meger/lib/python3.10/site-packages/xformers/ops/fmha/flash.py", line 79, in _flash_fwd ) = _C_flashattention.varlen_fwd( RuntimeError: CUDA error: invalid configuration argument CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1. Compile with TORCH_USE_CUDA_DSA to enable device-side assertions.

Steps to reproduce the problem

  1. Go to ....
  2. Press ....
  3. ... python launch.py --share --xformers --listen CUDA error: invalid configuration argument

What should have happened?

python launch.py --share --xformers --listen

Commit where the problem happens

webui: extension: python launch.py --share --xformers --listen

What browsers do you use to access the UI ?

Mozilla Firefox

Command Line Arguments

python launch.py --share  --xformers  --listen

Console logs

python launch.py --share  --xformers  --listen

Additional information

python launch.py --share --xformers --listen

continue-revolution commented 1 year ago

172

fishingcatgo commented 1 year ago

172

OK close thank you very much