当前位置:   article > 正文

Stable Diffusion WebUI rtx 2060 6G 高清修复 爆显存torch.cuda.OutOfMemoryError: CUDA out of memory._stable diffusion torch.cuda.outofmemoryerror: cuda

stable diffusion torch.cuda.outofmemoryerror: cuda out of memory.

故障日志

  1. *** Arguments: ('task(9bknuv75x8gvtjn)', '1girl,3d,architecture,blurry,blurry background,breasts,brown hair,building,cherry blossoms,city,cityscape,cosplay photo,cowboy shot,day,depth of field,east asian architecture,flower,lips,long hair,looking at viewer,medium breasts,midriff,motion blur,navel,outdoors,photo \\(medium\\),photo background,pink flower,scrunchie,shirt,shorts,skyscraper,solo,street,tree,white shirt,best quality,ultra high res,(photorealistic:1.4),1girl,<lora:styleJelly_v10:1> ', 'paintings,sketches,(worst quality:2),(low quality:2),(normal quality:2),lowres,normal quality,((monochrome)),((grayscale)),skin spots,acnes,skin blemishes,age spot,glans,{{{bad_hands}}},badhand,bad_feet,', [], 30, 17, False, False, 1, 1, 7, -1.0, -1.0, 0, 0, 0, False, 512, 300, True, 0.7, 2, 'Latent', 0, 0, 0, 0, '', '', [], 0, <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x7fde10debb50>, False, False, 0, None, [], 0, False, [], [], False, 0, 1, False, False, 0, None, [], -2, False, [], False, 0, None, None, False, False, 'positive', 'comma', 0, False, False, '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, None, None, False, 50) {}
  2. Traceback (most recent call last):
  3. File "/home/yeqiang/Downloads/ai/stable-diffusion-webui/modules/call_queue.py", line 55, in f
  4. res = list(func(*args, **kwargs))
  5. File "/home/yeqiang/Downloads/ai/stable-diffusion-webui/modules/call_queue.py", line 35, in f
  6. res = func(*args, **kwargs)
  7. File "/home/yeqiang/Downloads/ai/stable-diffusion-webui/modules/txt2img.py", line 57, in txt2img
  8. processed = processing.process_images(p)
  9. File "/home/yeqiang/Downloads/ai/stable-diffusion-webui/modules/processing.py", line 620, in process_images
  10. res = process_images_inner(p)
  11. File "/home/yeqiang/Downloads/ai/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/batch_hijack.py", line 42, in processing_process_images_hijack
  12. return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
  13. File "/home/yeqiang/Downloads/ai/stable-diffusion-webui/modules/processing.py", line 741, in process_images_inner
  14. x_samples_ddim = [decode_first_stage(p.sd_model, samples_ddim[i:i+1].to(dtype=devices.dtype_vae))[0].cpu() for i in range(samples_ddim.size(0))]
  15. File "/home/yeqiang/Downloads/ai/stable-diffusion-webui/modules/processing.py", line 741, in <listcomp>
  16. x_samples_ddim = [decode_first_stage(p.sd_model, samples_ddim[i:i+1].to(dtype=devices.dtype_vae))[0].cpu() for i in range(samples_ddim.size(0))]
  17. File "/home/yeqiang/Downloads/ai/stable-diffusion-webui/modules/processing.py", line 525, in decode_first_stage
  18. x = model.decode_first_stage(x)
  19. File "/home/yeqiang/Downloads/ai/stable-diffusion-webui/modules/sd_hijack_utils.py", line 17, in <lambda>
  20. setattr(resolved_obj, func_path[-1], lambda *args, **kwargs: self(*args, **kwargs))
  21. File "/home/yeqiang/Downloads/ai/stable-diffusion-webui/modules/sd_hijack_utils.py", line 28, in __call__
  22. return self.__orig_func(*args, **kwargs)
  23. File "/home/yeqiang/Downloads/ai/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
  24. return func(*args, **kwargs)
  25. File "/home/yeqiang/Downloads/ai/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/models/diffusion/ddpm.py", line 826, in decode_first_stage
  26. return self.first_stage_model.decode(z)
  27. File "/home/yeqiang/Downloads/ai/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/models/autoencoder.py", line 90, in decode
  28. dec = self.decoder(z)
  29. File "/home/yeqiang/Downloads/ai/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
  30. return forward_call(*args, **kwargs)
  31. File "/home/yeqiang/Downloads/ai/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/modules/diffusionmodules/model.py", line 641, in forward
  32. h = self.up[i_level].upsample(h)
  33. File "/home/yeqiang/Downloads/ai/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
  34. return forward_call(*args, **kwargs)
  35. File "/home/yeqiang/Downloads/ai/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/modules/diffusionmodules/model.py", line 64, in forward
  36. x = self.conv(x)
  37. File "/home/yeqiang/Downloads/ai/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
  38. return forward_call(*args, **kwargs)
  39. File "/home/yeqiang/Downloads/ai/stable-diffusion-webui/extensions-builtin/Lora/lora.py", line 415, in lora_Conv2d_forward
  40. return torch.nn.Conv2d_forward_before_lora(self, input)
  41. File "/home/yeqiang/Downloads/ai/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/conv.py", line 463, in forward
  42. return self._conv_forward(input, self.weight, self.bias)
  43. File "/home/yeqiang/Downloads/ai/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/conv.py", line 459, in _conv_forward
  44. return F.conv2d(input, weight, bias, self.stride,
  45. torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 150.00 MiB (GPU 0; 5.79 GiB total capacity; 4.14 GiB already allocated; 130.62 MiB free; 4.25 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

零食解决办法,重启webui.sh进程,重新执行生成图片

日志

  1. ^CInterrupted with signal 2 in <frame at 0x5573c3eeeb50, file '/home/yeqiang/miniconda3/envs/stable-diffusion-webui/lib/python3.10/threading.py', line 324, code wait>
  2. yeqiang@yeqiang-MS-7B23:~/Downloads/ai/stable-diffusion-webui$ ./webui.sh
  3. ################################################################
  4. Install script for stable-diffusion + Web UI
  5. Tested on Debian 11 (Bullseye)
  6. ################################################################
  7. ################################################################
  8. Running on yeqiang user
  9. ################################################################
  10. ################################################################
  11. Repo already cloned, using it as install directory
  12. ################################################################
  13. ################################################################
  14. Create and activate python venv
  15. ################################################################
  16. ################################################################
  17. Launching launch.py...
  18. ################################################################
  19. Using TCMalloc: libtcmalloc_minimal.so.4
  20. Python 3.10.6 | packaged by conda-forge | (main, Aug 22 2022, 20:36:39) [GCC 10.4.0]
  21. Version: v1.4.0
  22. Commit hash: 394ffa7b0a7fff3ec484bcd084e673a8b301ccc8
  23. Installing requirements
  24. Launching Web UI with arguments:
  25. No module 'xformers'. Proceeding without it.
  26. 2023-07-10 08:54:22,210 - ControlNet - INFO - ControlNet v1.1.231
  27. ControlNet preprocessor location: /home/yeqiang/Downloads/ai/stable-diffusion-webui/extensions/sd-webui-controlnet/annotator/downloads
  28. 2023-07-10 08:54:22,275 - ControlNet - INFO - ControlNet v1.1.231
  29. sd-webui-prompt-all-in-one background API service started successfully.
  30. Loading weights [7234b76e42] from /home/yeqiang/Downloads/ai/stable-diffusion-webui/models/Stable-diffusion/chilloutmix_Ni.safetensors
  31. preload_extensions_git_metadata for 13 extensions took 0.34s
  32. Creating model from config: /home/yeqiang/Downloads/ai/stable-diffusion-webui/configs/v1-inference.yaml
  33. LatentDiffusion: Running in eps-prediction mode
  34. DiffusionWrapper has 859.52 M params.
  35. Applying attention optimization: Doggettx... done.
  36. Textual inversion embeddings loaded(0):
  37. Model loaded in 2.2s (load weights from disk: 0.8s, create model: 0.5s, apply weights to model: 0.4s, apply half(): 0.3s, move model to device: 0.2s).
  38. Running on local URL: http://127.0.0.1:7860
  39. To create a public link, set `share=True` in `launch()`.
  40. Startup time: 8.2s (import torch: 0.8s, import gradio: 0.7s, import ldm: 0.3s, other imports: 0.4s, load scripts: 3.2s, create ui: 0.4s, gradio launch: 2.3s).
  41. 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 30/30 [00:09<00:00, 3.22it/s]
  42. 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 30/30 [00:38<00:00, 1.29s/it]
  43. Total progress: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 60/60 [00:52<00:00, 1.14it/s]
  44. Total progress: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 60/60 [00:52<00:00, 1.27s/it]

 

确实清晰不少 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/89102
推荐阅读
相关标签
  

闽ICP备14008679号