lllyasviel / lllyasviel/stable-diffusion-webui-forge
Mac Pro GPU AMD 6950XT exceeds 1024 image output prompt RuntimeError: Invalid buffer size: 4.00 GB
- Dominant language
- Python
- Stars
- 13k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
### Checklist
- [ ] The issue exists after disabling all extensions
- [ ] The issue exists on a clean installation of webui
- [ ] The issue is caused by an extension, but I believe it is caused by a bug in the webui
- [ ] The issue exists in the current version of the webui
- [ ] The issue has not been reported before recently
- [x] The issue has been reported before but has not been fixed yet
### What happened?
Mac Pro GPU AMD 6950XT exceeds 1024 image output prompt RuntimeError: Invalid buffer size: 4.00 GB
### Steps to reproduce the problem
Mac Pro GPU AMD 6950XT exceeds 1024 image output prompt RuntimeError: Invalid buffer size: 4.00 GB
### What should have happened?
Mac Pro GPU AMD 6950XT exceeds 1024 image output prompt RuntimeError: Invalid buffer size: 4.00 GB
### What browsers do you use to access the UI ?
_No response_
### Sysinfo
100%|███████████████████████████████████████████| 20/20 [00:06<00:00, 3.08it/s]
0%| | 0/20 [00:00, 'a boy,', '', [], 20, 'DPM++ 2M Karras', 1, 1, 7, 512, 512, True, 0.7, 2, 'Latent', 0, 0, 0, 'Use same checkpoint', 'Use same sampler', '', '', [], 0, False, '', 0.8, -1, False, -1, 0, 0, 0, UiControlNetUnit(input_mode=, use_preview_as_input=False, batch_image_dir='', batch_input_gallery=[], generated_image=None, mask_image=None, enabled=False, module='None', model='None', weight=1, image=None, resize_mode='Crop and Resize', processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced'), UiControlNetUnit(input_mode=, use_preview_as_input=False, batch_image_dir='', batch_input_gallery=[], generated_image=None, mask_image=None, enabled=False, module='None', model='None', weight=1, image=None, resize_mode='Crop and Resize', processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced'), UiControlNetUnit(input_mode=, use_preview_as_input=False, batch_image_dir='', batch_input_gallery=[], generated_image=None, mask_image=None, enabled=False, module='None', model='None', weight=1, image=None, resize_mode='Crop and Resize', processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced'), False, 1.01, 1.02, 0.99, 0.95, False, 256, 2, 0, False, False, 3, 2, 0, 0.35, True, 'bicubic', 'bicubic', False, 0.5, 2, False, False, '(SDXL) Only Generate Transparent Image (Attention Injection)', 1, 1, None, None, None, 'Crop and Resize', False, '', '', '', False, False, 'positive', 'comma', 0, False, False, 'start', '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, False, False, False, 0, False) {}
Traceback (most recent call last):
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/modules/call_queue.py", line 57, in f
res = list(func(*args, **kwargs))
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/modules/call_queue.py", line 36, in f
res = func(*args, **kwargs)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/modules/txt2img.py", line 110, in txt2img
processed = processing.process_images(p)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/modules/processing.py", line 749, in process_images
res = process_images_inner(p)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/modules/processing.py", line 920, 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 "/Volumes/F_OS/webui_forge_cu121_torch21/webui/modules/processing.py", line 1291, in sample
return self.sample_hr_pass(samples, decoded_samples, seeds, subseeds, subseed_strength, prompts)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/modules/processing.py", line 1388, in sample_hr_pass
samples = self.sampler.sample_img2img(self, samples, noise, self.hr_c, self.hr_uc, steps=self.hr_second_pass_steps or self.steps, image_conditioning=image_conditioning)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/modules/sd_samplers_kdiffusion.py", line 197, in sample_img2img
samples = self.launch_sampling(t_enc + 1, lambda: self.func(self.model_wrap_cfg, xi, extra_args=self.sampler_extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs))
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/modules/sd_samplers_common.py", line 260, in launch_sampling
return func()
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/modules/sd_samplers_kdiffusion.py", line 197, in
samples = self.launch_sampling(t_enc + 1, lambda: self.func(self.model_wrap_cfg, xi, extra_args=self.sampler_extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs))
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/venv/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/repositories/k-diffusion/k_diffusion/sampling.py", line 594, in sample_dpmpp_2m
denoised = model(x, sigmas[i] * s_in, **extra_args)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/modules/sd_samplers_cfg_denoiser.py", line 179, in forward
denoised = forge_sampler.forge_sample(self, denoiser_params=denoiser_params,
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/modules_forge/forge_sampler.py", line 82, in forge_sample
denoised = sampling_function(model, x, timestep, uncond, cond, cond_scale, model_options, seed)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/ldm_patched/modules/samplers.py", line 282, in sampling_function
cond_pred, uncond_pred = calc_cond_uncond_batch(model, cond, uncond_, x, timestep, model_options)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/ldm_patched/modules/samplers.py", line 253, in calc_cond_uncond_batch
output = model.apply_model(input_x, timestep_, **c).chunk(batch_chunks)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/ldm_patched/modules/model_base.py", line 85, in apply_model
model_output = self.diffusion_model(xc, t, context=context, control=control, transformer_options=transformer_options, **extra_conds).float()
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/ldm_patched/ldm/modules/diffusionmodules/openaimodel.py", line 860, 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 "/Volumes/F_OS/webui_forge_cu121_torch21/webui/ldm_patched/ldm/modules/diffusionmodules/openaimodel.py", line 48, in forward_timestep_embed
x = layer(x, context, transformer_options)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/ldm_patched/ldm/modules/attention.py", line 613, in forward
x = block(x, context=context[i], transformer_options=transformer_options)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/ldm_patched/ldm/modules/attention.py", line 440, in forward
return checkpoint(self._forward, (x, context, transformer_options), self.parameters(), self.checkpoint)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/ldm_patched/ldm/modules/diffusionmodules/util.py", line 189, in checkpoint
return func(*inputs)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/ldm_patched/ldm/modules/attention.py", line 500, in _forward
n = self.attn1(n, context=context_attn1, value=value_attn1)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/ldm_patched/ldm/modules/attention.py", line 392, in forward
out = optimized_attention(q, k, v, self.heads)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/ldm_patched/ldm/modules/attention.py", line 168, in attention_sub_quad
hidden_states = efficient_dot_product_attention(
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/ldm_patched/ldm/modules/sub_quadratic_attention.py", line 265, in efficient_dot_product_attention
res = torch.cat([
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/ldm_patched/ldm/modules/sub_quadratic_attention.py", line 266, in
compute_query_chunk_attn(
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/ldm_patched/ldm/modules/sub_quadratic_attention.py", line 159, in _get_attention_scores_no_kv_chunking
attn_scores = torch.baddbmm(
RuntimeError: Invalid buffer size: 4.00 GB
### Console logs
```Shell
100%|███████████████████████████████████████████| 20/20 [00:06<00:00, 3.08it/s]
0%| | 0/20 [00:00, 'a boy,', '', [], 20, 'DPM++ 2M Karras', 1, 1, 7, 512, 512, True, 0.7, 2, 'Latent', 0, 0, 0, 'Use same checkpoint', 'Use same sampler', '', '', [], 0, False, '', 0.8, -1, False, -1, 0, 0, 0, UiControlNetUnit(input_mode=, use_preview_as_input=False, batch_image_dir='', batch_input_gallery=[], generated_image=None, mask_image=None, enabled=False, module='None', model='None', weight=1, image=None, resize_mode='Crop and Resize', processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced'), UiControlNetUnit(input_mode=, use_preview_as_input=False, batch_image_dir='', batch_input_gallery=[], generated_image=None, mask_image=None, enabled=False, module='None', model='None', weight=1, image=None, resize_mode='Crop and Resize', processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced'), UiControlNetUnit(input_mode=, use_preview_as_input=False, batch_image_dir='', batch_input_gallery=[], generated_image=None, mask_image=None, enabled=False, module='None', model='None', weight=1, image=None, resize_mode='Crop and Resize', processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced'), False, 1.01, 1.02, 0.99, 0.95, False, 256, 2, 0, False, False, 3, 2, 0, 0.35, True, 'bicubic', 'bicubic', False, 0.5, 2, False, False, '(SDXL) Only Generate Transparent Image (Attention Injection)', 1, 1, None, None, None, 'Crop and Resize', False, '', '', '', False, False, 'positive', 'comma', 0, False, False, 'start', '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, False, False, False, 0, False) {}
Traceback (most recent call last):
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/modules/call_queue.py", line 57, in f
res = list(func(*args, **kwargs))
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/modules/call_queue.py", line 36, in f
res = func(*args, **kwargs)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/modules/txt2img.py", line 110, in txt2img
processed = processing.process_images(p)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/modules/processing.py", line 749, in process_images
res = process_images_inner(p)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/modules/processing.py", line 920, 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 "/Volumes/F_OS/webui_forge_cu121_torch21/webui/modules/processing.py", line 1291, in sample
return self.sample_hr_pass(samples, decoded_samples, seeds, subseeds, subseed_strength, prompts)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/modules/processing.py", line 1388, in sample_hr_pass
samples = self.sampler.sample_img2img(self, samples, noise, self.hr_c, self.hr_uc, steps=self.hr_second_pass_steps or self.steps, image_conditioning=image_conditioning)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/modules/sd_samplers_kdiffusion.py", line 197, in sample_img2img
samples = self.launch_sampling(t_enc + 1, lambda: self.func(self.model_wrap_cfg, xi, extra_args=self.sampler_extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs))
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/modules/sd_samplers_common.py", line 260, in launch_sampling
return func()
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/modules/sd_samplers_kdiffusion.py", line 197, in
samples = self.launch_sampling(t_enc + 1, lambda: self.func(self.model_wrap_cfg, xi, extra_args=self.sampler_extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs))
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/venv/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/repositories/k-diffusion/k_diffusion/sampling.py", line 594, in sample_dpmpp_2m
denoised = model(x, sigmas[i] * s_in, **extra_args)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/modules/sd_samplers_cfg_denoiser.py", line 179, in forward
denoised = forge_sampler.forge_sample(self, denoiser_params=denoiser_params,
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/modules_forge/forge_sampler.py", line 82, in forge_sample
denoised = sampling_function(model, x, timestep, uncond, cond, cond_scale, model_options, seed)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/ldm_patched/modules/samplers.py", line 282, in sampling_function
cond_pred, uncond_pred = calc_cond_uncond_batch(model, cond, uncond_, x, timestep, model_options)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/ldm_patched/modules/samplers.py", line 253, in calc_cond_uncond_batch
output = model.apply_model(input_x, timestep_, **c).chunk(batch_chunks)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/ldm_patched/modules/model_base.py", line 85, in apply_model
model_output = self.diffusion_model(xc, t, context=context, control=control, transformer_options=transformer_options, **extra_conds).float()
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/ldm_patched/ldm/modules/diffusionmodules/openaimodel.py", line 860, 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 "/Volumes/F_OS/webui_forge_cu121_torch21/webui/ldm_patched/ldm/modules/diffusionmodules/openaimodel.py", line 48, in forward_timestep_embed
x = layer(x, context, transformer_options)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/ldm_patched/ldm/modules/attention.py", line 613, in forward
x = block(x, context=context[i], transformer_options=transformer_options)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/ldm_patched/ldm/modules/attention.py", line 440, in forward
return checkpoint(self._forward, (x, context, transformer_options), self.parameters(), self.checkpoint)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/ldm_patched/ldm/modules/diffusionmodules/util.py", line 189, in checkpoint
return func(*inputs)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/ldm_patched/ldm/modules/attention.py", line 500, in _forward
n = self.attn1(n, context=context_attn1, value=value_attn1)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/ldm_patched/ldm/modules/attention.py", line 392, in forward
out = optimized_attention(q, k, v, self.heads)
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/ldm_patched/ldm/modules/attention.py", line 168, in attention_sub_quad
hidden_states = efficient_dot_product_attention(
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/ldm_patched/ldm/modules/sub_quadratic_attention.py", line 265, in efficient_dot_product_attention
res = torch.cat([
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/ldm_patched/ldm/modules/sub_quadratic_attention.py", line 266, in
compute_query_chunk_attn(
File "/Volumes/F_OS/webui_forge_cu121_torch21/webui/ldm_patched/ldm/modules/sub_quadratic_attention.py", line 159, in _get_attention_scores_no_kv_chunking
attn_scores = torch.baddbmm(
RuntimeError: Invalid buffer size: 4.00 GB
```
### Additional information
Mac Pro GPU AMD 6950XT exceeds 1024 image output prompt RuntimeError: Invalid buffer size: 4.00 GB
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the AMD 6950XT failure with an image output above 1024, then trace the request through modules/processing.py and modules/sd_samplers_kdiffusion.py. The traceback reaches ldm_patched/ldm/modules/sub_quadratic_attention.py at torch.baddbmm; done means the generation completes without the Invalid buffer size error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100