pkuliyi2015 / multidiffusion-upscaler-for-automatic1111

Tiled Diffusion and VAE optimize, licensed under CC BY-NC-SA 4.0
Other
4.63k stars 330 forks source link

Exception: CUDA out of memory when doing 4x upscaling with Tiled Diffusion and Tiled VAE #241

Closed tkittich closed 1 year ago

tkittich commented 1 year ago

Not sure if I did something wrong, but I got the following errors when doing 4x upscaling with Tiled Diffusion and Tiled VAE.

[Tiled Diffusion] ControlNet found, support is enabled.
00:58:03-410986 INFO     Loading model from cache: control_v11f1e_sd15_tile [a371b31b]
00:58:03-414990 INFO     Loading preprocessor: tile_resample
00:58:03-414990 INFO     Pixel Perfect Computation:
00:58:03-416492 INFO     resize_mode = ResizeMode.OUTER_FIT
00:58:03-417495 INFO     raw_H = 1024
00:58:03-417495 INFO     raw_W = 1824
00:58:03-418495 INFO     target_H = 4096
00:58:03-419496 INFO     target_W = 7296
00:58:03-419496 INFO     estimation = 4096.0
00:58:03-420497 INFO     preprocessor resolution = 4096
warn: noise inversion only supports the Euler sampler, switch to it sliently...
MultiDiffusion Sampling:   0%|                                    | 0/63 [00:00<?, ?it/s]MultiDiffusion hooked into 'Euler' sampler, Tile size: 96x96, Tile batches: 9, Batch size: 8. (ext: NoiseInv, ContrlNet)
[Tiled VAE]: input_size: torch.Size([1, 3, 4096, 7296]), tile_size: 3072, padding: 32
[Tiled VAE]: split to 2x3 = 6 tiles. Optimal tile size 2432x2016, original tile size 3072x3072

00:58:33-597628 ERROR    Exception: CUDA out of memory. Tried to allocate 11.64 GiB (GPU
                         0; 24.00 GiB total capacity; 16.77 GiB already allocated; 5.69
                         GiB free; 16.97 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
00:58:33-598629 ERROR    Arguments: args=('task(uqezfgjt2jo2agh)', 0, 'a painting of a
                         matte handsome (oval face:1.2) soft gold lpa buddha head with
                         white halo around the head surrounded by colorful
                         soft-rainbow-pastel lpa sky with stars and (galaxies:1.2) above a
                         large soft-rainbow-pastel swirling lpa galaxy,
                         <lora:lpa15haCc16s100n1t2v2-1024-30-04:0.7>, high details,
                         masterpiece, highres, best quality', '(low quality:2), (normal
                         quality:2), lowres, ((monochrome)), ((grayscale)), (dark
                         colors:1.2), (text, signature, watermark:1.2), (wattle:1.2)', [],
                         <PIL.Image.Image image mode=RGBA size=1824x1024 at
                         0x2917A412E60>, None, None, None, None, None, None, 30, 0, 4, 0,
                         1, False, False, 1, 1, 2, 1.5, 1, 0.2, 413579143.0, -1.0, 0, 0,
                         0, False, 1, 512, 912, 4, 2, 0, 32, 0, '', '', '', [], 0, True,
                         'MultiDiffusion', False, False, 1024, 1024, 96, 96, 8, 8, 'None',
                         4, True, 10, 10, 1, 64, False, False, False, False, False, 0.4,
                         0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4,
                         0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2,
                         0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2,
                         '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '',
                         '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '',
                         'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '',
                         'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '',
                         'Background', 0.2, -1.0, True, 3072, 192, True, False, False,
                         False, False, 7, 100, 'Constant', 0, 'Power Up', 3, 4, False,
                         'x264', 'blend', 10, 0, 0, False, True, True, True,
                         'intermediate', 'animation',
                         <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit
                         object at 0x000002917A8B7A00>,
                         <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit
                         object at 0x00000290FF00FCA0>, False, False, 0, None, [], 0,
                         False, [], [], False, 0, 1, False, False, 0, None, [], -2, False,
                         [], False, 0, None, None, False, 0.75, 1, '<ul>\n<li><code>CFG
                         Scale</code> should be 2 or lower.</li>\n</ul>\n', True, True,
                         '', '', True, 50, True, 1, 0, False, 4, 0.5, 'Linear', 'None',
                         '<p style="margin-bottom:0.75em">Recommended settings: Sampling
                         Steps: 80-100, Sampler: Euler a, Denoising strength: 0.8</p>',
                         128, 8, ['left', 'right', 'up', 'down'], 1, 0.05, 128, 4, 0,
                         ['left', 'right', 'up', 'down'], False, False, 'positive',
                         'comma', 0, False, False, '', '<p
                         style="margin-bottom:0.75em">Will upscale the image by the
                         selected scale factor; use width and height sliders to set tile
                         size</p>', 64, 0, 2, 0, '2,3', [], 13, '0.2,0.3,0.4', [], 0, '',
                         [], True, False, False, False, 0, False, None, None, False, None,
                         None, False, 50, False, 4.0, '', 10.0, 'Linear', 3, False, 30.0,
                         True, False, False, 0, 0.0, 'Lanczos', 1, True, 0, 0, 0.001, 75,
                         0.0, False, True, '<p style="margin-bottom:0.75em">Will upscale
                         the image depending on the selected target size type</p>', 512,
                         0, 8, 32, 64, 0.35, 32, 0, True, 0, False, 8, 0, 0, 2048, 2048,
                         2) kwargs={}
00:58:33-608193 ERROR    gradio call: OutOfMemoryError
╭────────────────────────── Traceback (most recent call last) ───────────────────────────╮
│ D:\theera\aiart\automatic\modules\call_queue.py:34 in f                                │
│                                                                                        │
│    33 │   │   │   try:                                                                 │
│ ❱  34 │   │   │   │   res = func(*args, **kwargs)                                      │
│    35 │   │   │   │   progress.record_results(id_task, res)                            │
│                                                                                        │
│ D:\theera\aiart\automatic\modules\img2img.py:174 in img2img                            │
│                                                                                        │
│   173 │   │   if processed is None:                                                    │
│ ❱ 174 │   │   │   processed = process_images(p)                                        │
│   175 │   p.close()                                                                    │
│                                                                                        │
│                                ... 14 frames hidden ...                                │
│                                                                                        │
│ D:\theera\aiart\automatic\extensions-builtin\multidiffusion-upscaler-for-automatic1111 │
│ \scripts\vae_optimize.py:106 in <lambda>                                               │
│                                                                                        │
│   105 │   task_queue.append(('pre_norm', net.norm))                                    │
│ ❱ 106 │   task_queue.append(('attn', lambda x, net=net: attn_forward(net, x)))         │
│   107 │   task_queue.append(['add_res', None])                                         │
│                                                                                        │
│ D:\theera\aiart\automatic\extensions-builtin\multidiffusion-upscaler-for-automatic1111 │
│ \tile_utils\attn.py:165 in sdp_attnblock_forward                                       │
│                                                                                        │
│   164 │   v = v.contiguous()                                                           │
│ ❱ 165 │   out = torch.nn.functional.scaled_dot_product_attention(q, k, v, dropout_p=0. │
│   166 │   out = out.to(dtype)                                                          │
╰────────────────────────────────────────────────────────────────────────────────────────╯
OutOfMemoryError: CUDA out of memory. Tried to allocate 11.64 GiB (GPU 0; 24.00 GiB total
capacity; 16.77 GiB already allocated; 5.69 GiB free; 16.97 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
pkuliyi2015 commented 1 year ago

Please try to use --xformers instead of sdp optimization.

tkittich commented 1 year ago

Please try to use --xformers instead of sdp optimization.

Thank you for a quick reply. Using xformers also gave CUDA out of memory error.

[Tiled Diffusion] ControlNet found, support is enabled.
12:11:10-109556 INFO     Loading model from cache: control_v11f1e_sd15_tile [a371b31b]
12:11:10-113060 INFO     Loading preprocessor: tile_resample
12:11:10-114062 INFO     Pixel Perfect Computation:
12:11:10-115064 INFO     resize_mode = ResizeMode.OUTER_FIT
12:11:10-116064 INFO     raw_H = 1024
12:11:10-116064 INFO     raw_W = 1824
12:11:10-117065 INFO     target_H = 4096
12:11:10-117065 INFO     target_W = 7296
12:11:10-118066 INFO     estimation = 4096.0
12:11:10-119067 INFO     preprocessor resolution = 4096
warn: noise inversion only supports the Euler sampler, switch to it sliently...
MixtureOfDiffusers Sampling:   0%|                               | 0/462 [00:00<?, ?it/s]Mixture of Diffusers hooked into 'Euler' sampler, Tile size: 96x96, Tile batches: 66, Batch size: 1. (ext: NoiseInv, ContrlNet)
[Tiled VAE]: input_size: torch.Size([1, 3, 4096, 7296]), tile_size: 3072, padding: 32
[Tiled VAE]: split to 2x3 = 6 tiles. Optimal tile size 2432x2016, original tile size 3072x3072
[Tiled VAE]: Executing Encoder Task Queue: 100%|███████| 546/546 [01:24<00:00,  6.46it/s]
[Tiled VAE]: Done in 85.606s, max VRAM alloc 10263.351 MB537/546 [01:24<00:00, 40.62it/s]
MixtureOfDiffusers Sampling:  18%|███▊                  | 81/462 [01:36<02:31,  2.51it/s]12:12:49-726587 ERROR    API error: POST: http://127.0.0.1:7860/internal/progress
                         {'error': 'OutOfMemoryError', 'detail': '', 'body': '', 'errors':
                         'CUDA out of memory. Tried to allocate 3.56 GiB (GPU 0; 24.00 GiB
                         total capacity; 19.92 GiB already allocated; 2.33 GiB free; 20.33
                         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'}
12:12:49-728590 ERROR    HTTP API: OutOfMemoryError
╭────────────────────────── Traceback (most recent call last) ───────────────────────────╮
│ D:\theera\aiart\automatic\venv\lib\site-packages\anyio\streams\memory.py:94 in receive │
│                                                                                        │
│ D:\theera\aiart\automatic\venv\lib\site-packages\anyio\streams\memory.py:89 in         │
│ receive_nowait                                                                         │
╰────────────────────────────────────────────────────────────────────────────────────────╯
WouldBlock

During handling of the above exception, another exception occurred:

╭────────────────────────── Traceback (most recent call last) ───────────────────────────╮
│ D:\theera\aiart\automatic\venv\lib\site-packages\starlette\middleware\base.py:78 in    │
│ call_next                                                                              │
│                                                                                        │
│ D:\theera\aiart\automatic\venv\lib\site-packages\anyio\streams\memory.py:114 in        │
│ receive                                                                                │
╰────────────────────────────────────────────────────────────────────────────────────────╯
EndOfStream

During handling of the above exception, another exception occurred:

╭────────────────────────── Traceback (most recent call last) ───────────────────────────╮
│ D:\theera\aiart\automatic\modules\middleware.py:72 in exception_handling               │
│                                                                                        │
│   71 │   │   try:                                                                      │
│ ❱ 72 │   │   │   return await call_next(req)                                           │
│   73 │   │   except CancelledError:                                                    │
│                                                                                        │
│ D:\theera\aiart\automatic\venv\lib\site-packages\starlette\middleware\base.py:84 in    │
│ call_next                                                                              │
│                                                                                        │
│                                ... 31 frames hidden ...                                │
│                                                                                        │
│ D:\theera\aiart\automatic\venv\lib\site-packages\torch\nn\modules\conv.py:463 in       │
│ forward                                                                                │
│                                                                                        │
│    462 │   def forward(self, input: Tensor) -> Tensor:                                 │
│ ❱  463 │   │   return self._conv_forward(input, self.weight, self.bias)                │
│    464                                                                                 │
│                                                                                        │
│ D:\theera\aiart\automatic\venv\lib\site-packages\torch\nn\modules\conv.py:459 in       │
│ _conv_forward                                                                          │
│                                                                                        │
│    458 │   │   │   │   │   │   │   _pair(0), self.dilation, self.groups)               │
│ ❱  459 │   │   return F.conv2d(input, weight, bias, self.stride,                       │
│    460 │   │   │   │   │   │   self.padding, self.dilation, self.groups)               │

OutOfMemoryError: CUDA out of memory. Tried to allocate 3.56 GiB (GPU 0; 24.00 GiB total
capacity; 19.92 GiB already allocated; 2.33 GiB free; 20.33 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
MixtureOfDiffusers Sampling: 100%|█████████████████████| 462/462 [02:15<00:00,  3.42it/s]
Noise Inversion: 100%|███████████████████████████████████| 10/10 [01:06<00:00,  6.66s/it]
100%|██████████████████████████████████████████████████████| 7/7 [01:17<00:00, 11.11s/it]
[Tiled VAE]: input_size: torch.Size([1, 4, 512, 912]), tile_size: 192, padding: 11
[Tiled VAE]: split to 3x5 = 15 tiles. Optimal tile size 192x192, original tile size 192x192
[Tiled VAE]: Executing Decoder Task Queue:  76%|███▊ | 1402/1845 [01:27<04:39,  1.58it/s]

12:16:31-737958 ERROR    Exception: CUDA out of memory. Tried to allocate 1.40 GiB (GPU 0;
                         24.00 GiB total capacity; 21.69 GiB already allocated; 448.00 MiB
                         free; 22.22 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
12:16:31-739961 ERROR    Arguments: args=('task(mnhr1903qqr1lrr)', 0, 'a painting of a
                         matte handsome (oval face:1.2) soft gold lpa buddha head with
                         white halo around the head surrounded by colorful
                         soft-rainbow-pastel lpa sky with stars and (galaxies:1.2) above a
                         large soft-rainbow-pastel swirling lpa galaxy,
                         <lora:lpa15haCc16s100n1t2v2-1024-30-04:0.7>, high details,
                         masterpiece, highres, best quality', '(low quality:2), (normal
                         quality:2), lowres, ((monochrome)), ((grayscale)), (dark
                         colors:1.2), (text, signature, watermark:1.2), (wattle:1.2)', [],
                         <PIL.Image.Image image mode=RGBA size=1824x1024 at
                         0x25384ED36A0>, None, None, None, None, None, None, 30, 0, 4, 0,
                         1, False, False, 1, 1, 2, 1.5, 1, 0.2, 413579143.0, -1.0, 0, 0,
                         0, False, 1, 512, 912, 4, 2, 0, 32, 0, '', '', '', [], 0, True,
                         'Mixture of Diffusers', False, False, 1024, 1024, 96, 96, 8, 1,
                         'None', 2, True, 10, 10, 1, 64, False, False, False, False,
                         False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0,
                         False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0,
                         False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0,
                         False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0,
                         False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0,
                         False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0,
                         False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0,
                         False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, True,
                         3072, 192, True, False, False, False, False, 7, 100, 'Constant',
                         0, 'Power Up', 3, 4, False, 'x264', 'blend', 10, 0, 0, False,
                         True, True, True, 'intermediate', 'animation',
                         <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit
                         object at 0x0000025363CF4220>,
                         <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit
                         object at 0x0000025384ED1F30>, False, False, 0, None, [], 0,
                         False, [], [], False, 0, 1, False, False, 0, None, [], -2, False,
                         [], False, 0, None, None, False, 0.75, 1, '<ul>\n<li><code>CFG
                         Scale</code> should be 2 or lower.</li>\n</ul>\n', True, True,
                         '', '', True, 50, True, 1, 0, False, 4, 0.5, 'Linear', 'None',
                         '<p style="margin-bottom:0.75em">Recommended settings: Sampling
                         Steps: 80-100, Sampler: Euler a, Denoising strength: 0.8</p>',
                         128, 8, ['left', 'right', 'up', 'down'], 1, 0.05, 128, 4, 0,
                         ['left', 'right', 'up', 'down'], False, False, 'positive',
                         'comma', 0, False, False, '', '<p
                         style="margin-bottom:0.75em">Will upscale the image by the
                         selected scale factor; use width and height sliders to set tile
                         size</p>', 64, 0, 2, 7, '', [], 0, '', [], 0, '', [], True,
                         False, False, False, 0, False, None, None, False, None, None,
                         False, 50, False, 4.0, '', 10.0, 'Linear', 3, False, 30.0, True,
                         False, False, 0, 0.0, 'Lanczos', 1, True, 0, 0, 0.001, 75, 0.0,
                         False, True, '<p style="margin-bottom:0.75em">Will upscale the
                         image depending on the selected target size type</p>', 512, 0, 8,
                         32, 64, 0.35, 32, 0, True, 0, False, 8, 0, 0, 2048, 2048, 2)
                         kwargs={}
12:16:31-748968 ERROR    gradio call: OutOfMemoryError
╭────────────────────────── Traceback (most recent call last) ───────────────────────────╮
│ D:\theera\aiart\automatic\modules\call_queue.py:34 in f                                │
│                                                                                        │
│    33 │   │   │   try:                                                                 │
│ ❱  34 │   │   │   │   res = func(*args, **kwargs)                                      │
│    35 │   │   │   │   progress.record_results(id_task, res)                            │
│                                                                                        │
│ D:\theera\aiart\automatic\modules\img2img.py:174 in img2img                            │
│                                                                                        │
│   173 │   │   if processed is None:                                                    │
│ ❱ 174 │   │   │   processed = process_images(p)                                        │
│   175 │   p.close()                                                                    │
│                                                                                        │
│                                ... 20 frames hidden ...                                │
│                                                                                        │
│ D:\theera\aiart\automatic\venv\lib\site-packages\torch\nn\modules\conv.py:463 in       │
│ forward                                                                                │
│                                                                                        │
│    462 │   def forward(self, input: Tensor) -> Tensor:                                 │
│ ❱  463 │   │   return self._conv_forward(input, self.weight, self.bias)                │
│    464                                                                                 │
│                                                                                        │
│ D:\theera\aiart\automatic\venv\lib\site-packages\torch\nn\modules\conv.py:459 in       │
│ _conv_forward                                                                          │
│                                                                                        │
│    458 │   │   │   │   │   │   │   _pair(0), self.dilation, self.groups)               │
│ ❱  459 │   │   return F.conv2d(input, weight, bias, self.stride,                       │
│    460 │   │   │   │   │   │   self.padding, self.dilation, self.groups)               │
╰────────────────────────────────────────────────────────────────────────────────────────╯
OutOfMemoryError: CUDA out of memory. Tried to allocate 1.40 GiB (GPU 0; 24.00 GiB total
capacity; 21.69 GiB already allocated; 448.00 MiB free; 22.22 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
josh5671 commented 1 year ago

mind to share your txt2img/img2img + tiled diffusion and tiled vae setting? i think you going too high for tiled vae 'Encoder Tile Size'

tkittich commented 1 year ago

mind to share your txt2img/img2img + tiled diffusion and tiled vae setting? i think you going too high for tiled vae 'Encoder Tile Size'

I've tried setting tiled vae 'Encoder Tile Size' to 512 and still got the same error. 3072 is the default value. Here're my settings

img2img diffusion vae
pkuliyi2015 commented 1 year ago

My first reply has addressed your problem in the tiled vae. Now the OOM happens in the UNet.

It is quite weird that your 24 GB GPU reports OOM. You may try to reduce the tiled diffusion tile size to 64 instead of 96.

Normally speaking this won't happen. I'm confused too.

wardensc2 commented 1 year ago

Hi pkuliyi2015 I have a question. When I try to upscale 8k image I notice that first is my VRAM full then come to RAM then my SSD, until my SSD full then SD notice OOM so in theory that if I have enough space from RAM or SSD I still can generate high resolution image but with very slow speed, is that correct.

Anh can you change regional prompt into some kind of inpaint to make whatever the shape of the regional prompt not just rectangular shape. Other regional prompt such as latent couple ... are to complicated to use more effectively

AugmentedRealityCat commented 1 year ago

Normally speaking this won't happen. I'm confused too.

I have been having the exact same problem, and I still haven't found the solution. I used to be able to upscale my images to 16K and even 21K, but now I keep getting out of memory errors. And that's with using smaller tile numbers than I used to.

By the way I'm also using a RTX 4090 with 24 GB of VRAM. A1111 install info: version: v1.3.2-241-g59419bd6 •  python: 3.10.6  •  torch: 2.0.0+cu118  •  xformers: N/A  •  gradio: 3.32.0  •  checkpoint: 6ce0161689

I believe the change was induced at the same time as the A1111-WebUI was officially upgraded to support and install Torch 2.0, but it might just be a coincidence.

Let me know what kind of tests I should make and what is the feedback I should provide to better help you with this. It will be a pleasure to help if I can in any way - just bear in mind that I am not a programmer.

pkuliyi2015 commented 1 year ago

Normally speaking this won't happen. I'm confused too.

I have been having the exact same problem, and I still haven't found the solution. I used to be able to upscale my images to 16K and even 21K, but now I keep getting out of memory errors. And that's with using smaller tile numbers than I used to.

By the way I'm also using a RTX 4090 with 24 GB of VRAM. A1111 install info: version: v1.3.2-241-g59419bd6 •  python: 3.10.6  •  torch: 2.0.0+cu118  •  xformers: N/A  •  gradio: 3.32.0  •  checkpoint: 6ce0161689

I believe the change was induced at the same time as the A1111-WebUI was officially upgraded to support and install Torch 2.0, but it might just be a coincidence.

Let me know what kind of tests I should make and what is the feedback I should provide to better help you with this. It will be a pleasure to help if I can in any way - just bear in mind that I am not a programmer.

You need to install xformers 0.0.19 first. If the error still exists, let me know then.

pkuliyi2015 commented 1 year ago

Hi pkuliyi2015 I have a question. When I try to upscale 8k image I notice that first is my VRAM full then come to RAM then my SSD, until my SSD full then SD notice OOM so in theory that if I have enough space from RAM or SSD I still can generate high resolution image but with very slow speed, is that correct.

Anh can you change regional prompt into some kind of inpaint to make whatever the shape of the regional prompt not just rectangular shape. Other regional prompt such as latent couple ... are to complicated to use more effectively

The latest NVIDIA driver introduces the bug. Please refer to https://github.com/vladmandic/automatic/discussions/1285

AugmentedRealityCat commented 1 year ago

Thanks for your quick reply.

Just to clear this up after reading your reply to another person above, it's not a driver issue for me since I'm still on version 531 - in fact I never updated my drivers recently so I did not even have to roll back. I did just check if it had automatically updated just in case, and it did not, so it can't be the driver, or if it is, then driver 531.61 is also affected by the problem.

So after reading your reply, I started a new A1111-WebUI with the xformers config I used when I tried to debug this problem. I had already installed Torch 2.0 by then.

Here is the info when I run my xformers config - version: v1.3.2-241-g59419bd6  •  python: 3.10.6  •  torch: 2.0.1+cu118  •  xformers: 0.0.20  •  gradio: 3.32.0  •  checkpoint: 6ce0161689

Is the problem related to xformers 0.0.20 instead of 0.0.19 like you recommended ? Should I test that next ? What would be the best way to remove 0.0.20 and install 0.0.19 ?

Thanks for your support.

pkuliyi2015 commented 1 year ago

Can you provide the OOM error logs?

AugmentedRealityCat commented 1 year ago

Can you provide the OOM error logs?

Sure. They are below this message. Some more information: even without xformers often it will give me an error message and keep on going after.

When it does that you can find that some tiles have just be upscaled and not re-generated by the multi-diffusion / mixture of diffusers.

Here I am showing the log from a test where I try to double a 3K image to 6K - which should be easy.

It did fail at step 5 and then kept on going - you can see that in the log where you have this line:

MixtureOfDiffusers Sampling: : 0it [00:03, ?it/s]
  0%|                                                                                           | 0/26 [00:00<?, ?it/s]
ERROR:    Exception in ASGI application                                                  | 5/26 [00:53<03:46, 10.76s/it]

I did not do anything else after starting A1111 so the whole log is about startup + running this img2img 3K x2 uprez to 6K. Let me know what I can do next to help you help me :)


venv "C:\stable-diffusion-webui\venvxformers\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.3.2-241-g59419bd6
Commit hash: 59419bd64a1581caccaac04dceb66c1c069a2db1
Installing requirements

[Auto-Photoshop-SD] Attempting auto-update...
[Auto-Photoshop-SD] switch branch to extension branch.
checkout_result: Your branch is up to date with 'origin/master'.

[Auto-Photoshop-SD] Current Branch.
branch_result: * master

[Auto-Photoshop-SD] Fetch upstream.
fetch_result:
[Auto-Photoshop-SD] Pull upstream.
pull_result: Already up to date.

current transparent-background 1.2.4

Requirement already satisfied: send2trash~=1.8 in c:\stable-diffusion-webui\venvxformers\lib\site-packages (1.8.2)
Requirement already satisfied: dynamicprompts[attentiongrabber,magicprompt]~=0.27.0 in c:\stable-diffusion-webui\venvxformers\lib\site-packages (0.27.0)
Requirement already satisfied: jinja2~=3.1 in c:\stable-diffusion-webui\venvxformers\lib\site-packages (from dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (3.1.2)
Requirement already satisfied: pyparsing~=3.0 in c:\stable-diffusion-webui\venvxformers\lib\site-packages (from dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (3.0.9)
Requirement already satisfied: transformers[torch]~=4.19 in c:\stable-diffusion-webui\venvxformers\lib\site-packages (from dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (4.25.1)
Requirement already satisfied: MarkupSafe>=2.0 in c:\stable-diffusion-webui\venvxformers\lib\site-packages (from jinja2~=3.1->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (2.0.1)
Requirement already satisfied: packaging>=20.0 in c:\stable-diffusion-webui\venvxformers\lib\site-packages (from transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (23.1)
Requirement already satisfied: filelock in c:\stable-diffusion-webui\venvxformers\lib\site-packages (from transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (3.12.0)
Requirement already satisfied: pyyaml>=5.1 in c:\stable-diffusion-webui\venvxformers\lib\site-packages (from transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (6.0)
Requirement already satisfied: regex!=2019.12.17 in c:\stable-diffusion-webui\venvxformers\lib\site-packages (from transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (2023.6.3)
Requirement already satisfied: tokenizers!=0.11.3,<0.14,>=0.11.1 in c:\stable-diffusion-webui\venvxformers\lib\site-packages (from transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (0.13.3)
Requirement already satisfied: tqdm>=4.27 in c:\stable-diffusion-webui\venvxformers\lib\site-packages (from transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (4.65.0)
Requirement already satisfied: requests in c:\stable-diffusion-webui\venvxformers\lib\site-packages (from transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (2.31.0)
Requirement already satisfied: numpy>=1.17 in c:\stable-diffusion-webui\venvxformers\lib\site-packages (from transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (1.23.5)
Requirement already satisfied: huggingface-hub<1.0,>=0.10.0 in c:\stable-diffusion-webui\venvxformers\lib\site-packages (from transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (0.15.1)
Requirement already satisfied: torch!=1.12.0,>=1.7 in c:\stable-diffusion-webui\venvxformers\lib\site-packages (from transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (2.0.1+cu118)
Requirement already satisfied: fsspec in c:\stable-diffusion-webui\venvxformers\lib\site-packages (from huggingface-hub<1.0,>=0.10.0->transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (2023.5.0)
Requirement already satisfied: typing-extensions>=3.7.4.3 in c:\stable-diffusion-webui\venvxformers\lib\site-packages (from huggingface-hub<1.0,>=0.10.0->transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (4.6.3)
Requirement already satisfied: sympy in c:\stable-diffusion-webui\venvxformers\lib\site-packages (from torch!=1.12.0,>=1.7->transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (1.12)
Requirement already satisfied: networkx in c:\stable-diffusion-webui\venvxformers\lib\site-packages (from torch!=1.12.0,>=1.7->transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (3.1)
Requirement already satisfied: colorama in c:\stable-diffusion-webui\venvxformers\lib\site-packages (from tqdm>=4.27->transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (0.4.6)
Requirement already satisfied: idna<4,>=2.5 in c:\stable-diffusion-webui\venvxformers\lib\site-packages (from requests->transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (3.4)
Requirement already satisfied: certifi>=2017.4.17 in c:\stable-diffusion-webui\venvxformers\lib\site-packages (from requests->transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (2023.5.7)
Requirement already satisfied: urllib3<3,>=1.21.1 in c:\stable-diffusion-webui\venvxformers\lib\site-packages (from requests->transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (1.26.16)
Requirement already satisfied: charset-normalizer<4,>=2 in c:\stable-diffusion-webui\venvxformers\lib\site-packages (from requests->transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (3.1.0)
Requirement already satisfied: mpmath>=0.19 in c:\stable-diffusion-webui\venvxformers\lib\site-packages (from sympy->torch!=1.12.0,>=1.7->transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (1.3.0)
sd-dynamic-prompts installer: running 'C:\stable-diffusion-webui\venvxformers\Scripts\python.exe' -m pip install 'send2trash~=1.8' 'dynamicprompts[attentiongrabber,magicprompt]~=0.27.0'

Installing opencv-python
Installing opencv-python for pixel extension

Check FaceSwap requirements
Install insightface==0.7.3
Installing sd-webui-faceswap requirement: insightface==0.7.3
Install onnx==1.14.0
Installing sd-webui-faceswap requirement: onnx==1.14.0
Install onnxruntime==1.15.0
Installing sd-webui-faceswap requirement: onnxruntime==1.15.0
Install tensorflow==2.12.0
Installing sd-webui-faceswap requirement: tensorflow==2.12.0
Install opencv-python==4.7.0.72
Installing sd-webui-faceswap requirement: opencv-python==4.7.0.72

Installing imageio-ffmpeg requirement for depthmap script
Installing pyqt5 requirement for depthmap script

Launching Web UI with arguments: --xformers
python_server_full_path:  C:\stable-diffusion-webui\extensions\Auto-Photoshop-StableDiffusion-Plugin\server/python_server
Civitai Helper: Get Custom Model Folder
Civitai Helper: Load setting from: C:\stable-diffusion-webui\extensions\Stable-Diffusion-Webui-Civitai-Helper\setting.json
Additional Network extension not installed, Only hijack built-in lora
LoCon Extension hijack built-in lora successfully
Using cache found in C:\Users\User/.cache\torch\hub\isl-org_ZoeDepth_main
img_size [384, 512]
Using cache found in C:\Users\User/.cache\torch\hub\intel-isl_MiDaS_master
Params passed to Resize transform:
        width:  512
        height:  384
        resize_target:  True
        keep_aspect_ratio:  True
        ensure_multiple_of:  32
        resize_method:  minimal
Using pretrained resource url::https://github.com/isl-org/ZoeDepth/releases/download/v1.0/ZoeD_M12_N.pt
Loaded successfully
[-] ADetailer initialized. version: 23.6.2, num models: 8
2023-06-12 05:25:37,185 - ControlNet - INFO - ControlNet v1.1.224
ControlNet preprocessor location: C:\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\downloads
2023-06-12 05:25:37,258 - ControlNet - INFO - ControlNet v1.1.224
2023-06-12 05:25:37,310 - FaceSwap - INFO - FaceSwap v0.0.6
2023-06-12 05:25:37,311 - FaceSwap - INFO - FaceSwap v0.0.6
Loading weights [6ce0161689] from C:\stable-diffusion-webui\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors
Creating model from config: C:\stable-diffusion-webui\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Textual inversion embeddings loaded(298): 0lg4kury, 16-token-negative-deliberate-neg, 512paintstyle1, 512paintstyle3, 512paintstyle3-light, 512speedpainter, 80sdarkfantasysd15b, AdriannePalicki1, aid28, aidv1-neg, anatomical-illustration, ancient-ruin, ancient-ruin-forest, angry512, anime-AI-being, archmagazine, art by sel-foc, AshleyCipher, Asian-Less, Asian-Less-Toon, atompunkstylesd15, avGdnr, b_w, backrooms, bad-artist, bad-artist-anime, bad-hands-5, bad-image-9600, bad-image-v2-11000, bad-image-v2-27000, bad-image-v2-39000, bad_prompt, bad_prompt (2), bad_prompt_version2, badhandsv5-neg, badv3, badv4, badv5, Boichi2_style-6000, By bad artist -neg, cervicalMRI, CFStyle, CharTurner, CharTurnerV2, chemicalbending_stableDiffusion, chibi_style, close portrait, cobwebber, coloring-book-style, coop himmelblau museum, cry5t415ku11, dangercrow, dangerdonkey, dangerhawk, dangermouse, dark-forest, Dark_fantasy, dark_ouroboros, DarkFantasy, defiance512, donglu, dragon, dragon inn-18500, drr-style, EasyNegative, easynegative, edwardhopperembed, el-salvador-style-style, ErinMoriarty2, Exodus-Styling, expomech_expomech, fantasycharacter, fenn_jesus, Floral_Graffiti, flower_style, françoise hardy, fruityslices3, gothbuilding, grin512, gushu, gushuman, gustavedore, HannahWaddingham2, happy512, hgr1ce-step-240, hndpnt-145, hndpnt-261, hobbithouse, hongxinliang, hrgiger-drmacabre_or_barba, HudsonHornet, HyperStylizeV6, iconPxvGameHangv001_iconPxvGameHangv001, ilo-kunst, ink_style, josangonzalez, KateMara2, kc16-4000-sd1-5, kidbooks, kkw-ami, kkw-Autumn, kkw-bp, kkw-card, kkw-chibi, kkw-el-fire, kkw-el-grass, kkw-el-ice, kkw-el-Lightning , kkw-el-rock, kkw-el-sand, kkw-el-water, kkw-fat-m, kkw-hdr, kkw-horror, kkw-hyb-eleph, kkw-hyb-spider, kkw-macro, kkw-medieval, kkw-micro, kkw-old, kkw-paper, kkw-ph1, kkw-ph1-neg, kkw-splatter, kkw-Spring, kkw-Summer, kkw-Winter, kkw-xeno, land_style, lands_between, landscape_style, laugh512, lightning_style, lightning_style-7500, LiliReinhart1, liminal-spaces-2-0, line-art, line-style, liquidlight, lol_splash, lr, marblingart, marsattacks3, max-headroom , memphisstyle-6750, metropolis_e, midthunder, minimal_gradient, mmax00, moe-bius, moebius, neg_facelift512, neon-ground-astronaut, neonbath, nervous512, NG_DeepNegative_V1_16T, NG_DeepNegative_V1_2T, NG_DeepNegative_V1_32T, NG_DeepNegative_V1_4T, NG_DeepNegative_V1_64T, NG_DeepNegative_V1_75T, np_simple_negatives, np_simple_negatives_v2-neg, oldstyle_v1, olfn, one-line-drawing, pantone-milk, pastel_style, pen-ink-portraits-bennorthen, photozoov15, PigglyWiggly, PlanIt, pmantis, poly-hd, qualityzoov15, quimbystyle, rainbow-candy, rcnz_style, realisticvision-negative-embedding, renderzoov15, repeat, RFKTR_bontrex, RFKTR_bontrex-150, rfktr_circrex, RFKTR_rootrex, RFKTR_sinetempore, rico_tubbs, rmadanegative4_sd15-neg, rw1510, rz-neg-15-foranalog, sad512, schnucks, sd15_journalSketch, shev-linocut, shock512, silky-folds, skelewags, slpashter, slpashter_2, smile512, Smrai_style, southofthebordersd15, star_style, stardeaf-greenmageddon, stardeaf-inkmage-orange , stardeaf-inkmage-white , steampunkgranny, structurezoov15, Style-Autumn, Style-Autumn-neg, Style-BladeRunner2049-8v, style-bridal, Style-Empire, Style-Empire-neg, Style-Glass, Style-Glorious, Style-Glorious-neg, Style-Hamunaptra, Style-Info, Style-Italy, Style-Japan, Style-Kilt, Style-Kitchen, Style-Kitchen-neg, style-kotor, Style-Moana, Style-Moana-neg, style-nagel, Style-NebMagic, Style-NebMagic-neg, Style-Necromancy, style-paintmagic, Style-Petal, Style-Petal-neg, style-pnmagic, Style-Princess, Style-Psycho, Style-Psycho-neg, Style-Renaissance, Style-Renaissance-neg, style-rustmagic, style-rustmagic-neg, style-sylvamagic, Style-TronLegacy-12v-v2, Style-TronLegacy-8v-B, style-widow, Style-Winter, Style-Winter-neg, Style-Witcher3, style_cctv, style_the grand budapest hotel, style_tombraider, suijing, super_ugly1t, super_ugly3t, taiji, tarot512, TaylorSwift2, test, tfftgirlv05, tffthairv07nike, tffthairv07phto, tloustyle, toy_ugly, tropical-island, trypophobia, u1t1m4t3w4rr10r, ukiyoestyle-1500, Unspeakable-Horrors-16v, Unspeakable-Horrors-24v, Unspeakable-Horrors-32v, Unspeakable-Horrors-48v, Unspeakable-Horrors-64v, Unspeakable-Horrors-Composition, utpvirt, vintagemap_f, vladstudio, was-battletech, was-diablo, was-dieselpunk, was-gunpla, was-hs, was-hs-v2, was-jaeger, was-mecha, was-senua, was-steampunk, was-vb, wasmoebius, wassnonam-39400, wb17_din_djarin, winter_style, winter_style-4500, winter_style-7500, wire-angels, zhongshinei, zhubao, ZoeSaldana2
Textual inversion embeddings skipped(185): 21charturnerv2, ActionHelper, AnalogFilm768-BW-Classic, AnalogFilm768-BW-Modern, AnalogFilm768-BW-Tintype, AnalogFilm768-BW-Vintage, AnalogFilm768-Old-School, AnalogFilm768, anthro, Apoc768, Apocofy, aslanscifi-v1, aslanscifi-v2, bruegel-style-artwork, CandyPunk, CandyPunk_V2, CarHelper, cgart, Chadeisson, ChemPunk-96, Cinema768-Analog, Cinema768-BW, Cinema768-Classic, Cinema768-Digital, Cinema768-SilentFilm, CinemaHelper, conceptart-200, conceptart-200_V2, conceptart-300, conceptart-300_V2, conceptart-400, conceptart-400_V2, conceptart-500, conceptart-500_V2, CutAway-420, CutAway-420_V2, CutAway-460, CutAway-460_V2, CutAway-500, CutAway-500_V2, dangergoose, dangerhorse, dangermoose, dangerowl, DaveSpaceFour, DaveSpaceOne, Decay768, Ellsworth_Kelly, EMB_Black_Marble_Style_V5-2000, emb_blck_egpt_v4-1000, FFbF_aTon, FFbF_effect, FFbF_Heavy, FFbF_light, FFbF_neon, FFbF_power, FloralMarble-150, FloralMarble-250, FloralMarble-400, FloralMarble, fragmenv2, fragmenv2_V2, glitch, HeartArt-1000, HeartArt-1500, HeartArt-2000, HeartArt, hellscape768, HorrorByDave, HydroFood, HyperFluid, HyperNuke, HyperSmoke, InkPunk768, InkPunkHeavy768, InkPunkLandscapes768, InkPunkLite768, inksketchcolour1, inksketchcolour1subtle, Inksplat768, knollingcase-embeddings-sd-v2-0_V2, knollingcase_32, laconia, latteart, lavastyle-12000, Lavastyle, laxpeint, laxpeintV2, mdjrny-ppc, midjourney_sd_2_0, midjourney_style_for_v2_use_in the style of midjourney, midjourney_style_for_v2_use_in the style of midjourney_V2, mj-gs, mjart, mjSymbiote, NegLowRes-1200, NegLowRes-200, NegLowRes-2400, NegLowRes-500, NegMutation-1200, negmutation-200, NegMutation-2400, negmutation-500, neg_Colorizer768-Cool, Neg_Colorizer768-Intense, neg_Colorizer768-neutral, Neg_Colorizer768-Vibrant, Neg_Colorizer768-Vivid, neg_Colorizer768-Warm, Neg_Facelift768, nfixer, no_unrealistic768, nrealfixer, Painted Abstract, painted_abstract, painted_landscape, painted_landscape_V2, PaintStyle1, PaintStyle3, PaintStyle4, paintstyle5, paintstyle6-neg, paintstyle6, paintstyle8, papercutcraft-v2, ParchArt, PhotoHelper, PhotoHelper_V2, photozoov21, pixelart, PlanIt2, PMondrian, PortraitHelper, PortraitHelper_V2, protogemb, protogemb2, qualityzoov21, Rain_and_Monsters_prue640v2, Rain_and_Monsters_prue640v2_V2, remix, remix_V2, renderzoov21, retrofutur, rmadaneg-neg, Ruin768, rz-neg-foranalogportrait, rz-neg-forbettercontrast, rz-neg-general, ScaryMonsters, ScaryMonstersV2, SCG768-Bliss, SCG768-Euphoria, SCG768-Illustrate, SCG768-Nebula, SocialistRealism, SpanishElegy, structurezoov21, style-bridal_sd2, style-princess_sd2, style-widow_sd2, tarot768, tf86movie-550, tfboxart-100, tfboxart-250, tfboxart-600, tfboxart, trinkdber, UlukInkSketch2, UNBADS, UNREALS, UrbanJungle, Vint-3000, Vint, VintageHelper-600, VintageHelper, waterworksv2-500, waterworksv2-5000, wrong_embedding_sd_2_0, wrong_embedding_sd_2_0_V2, ZiCyb, ZiCybB, ZiCybL, ZiCybP, zombified768, Zootopiav4
Model loaded in 2.5s (create model: 0.2s, apply weights to model: 0.5s, apply half(): 0.5s, move model to device: 0.5s, load textual inversion embeddings: 0.2s, calculate empty prompt: 0.6s).
Applying attention optimization: xformers... done.
2023-06-12 05:25:42,732 - FaceSwap - WARNING - You should at least have one model in models directory, please read the doc here : https://github.com/Ynn/sd-webui-faceswap/
2023-06-12 05:25:42,986 - FaceSwap - WARNING - You should at least have one model in models directory, please read the doc here : https://github.com/Ynn/sd-webui-faceswap/
add tab
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
COMMANDLINE_ARGS does not contain --api, API won't be mounted.
Startup time: 18.1s (import torch: 1.8s, import gradio: 0.6s, import ldm: 0.3s, other imports: 0.4s, load scripts: 13.1s, create ui: 1.6s, gradio launch: 0.2s).
preload_extensions_git_metadata for 50 extensions took 2.08s
[Tiled Diffusion] upscaling image with 4x-UltraSharp...
[Tiled Diffusion] ControlNet found, support is enabled.
2023-06-12 05:26:23,767 - ControlNet - INFO - Loading model: control_v11f1e_sd15_tile [a371b31b]
2023-06-12 05:26:24,072 - ControlNet - INFO - Loaded state_dict from [C:\stable-diffusion-webui\extensions\sd-webui-controlnet\models\control_v11f1e_sd15_tile.pth]
2023-06-12 05:26:24,073 - ControlNet - INFO - Loading config: C:\stable-diffusion-webui\extensions\sd-webui-controlnet\models\control_v11f1e_sd15_tile.yaml
2023-06-12 05:26:25,320 - ControlNet - INFO - ControlNet model control_v11f1e_sd15_tile [a371b31b] loaded.
2023-06-12 05:26:25,408 - ControlNet - INFO - Loading preprocessor: tile_resample
2023-06-12 05:26:25,408 - ControlNet - INFO - Pixel Perfect Computation:
2023-06-12 05:26:25,408 - ControlNet - INFO - resize_mode = ResizeMode.INNER_FIT
2023-06-12 05:26:25,410 - ControlNet - INFO - raw_H = 1536
2023-06-12 05:26:25,410 - ControlNet - INFO - raw_W = 3072
2023-06-12 05:26:25,410 - ControlNet - INFO - target_H = 3072
2023-06-12 05:26:25,410 - ControlNet - INFO - target_W = 6144
2023-06-12 05:26:25,410 - ControlNet - INFO - estimation = 3072.0
2023-06-12 05:26:25,410 - ControlNet - INFO - preprocessor resolution = 3072
MixtureOfDiffusers Sampling: : 0it [00:00, ?it/s]Mixture of Diffusers hooked into 'Euler' sampler, Tile size: 64x64, Tile batches: 253, Batch size: 1. (ext: ContrlNet)
[Tiled VAE]: input_size: torch.Size([1, 3, 3072, 6144]), tile_size: 1024, padding: 32
[Tiled VAE]: split to 3x6 = 18 tiles. Optimal tile size 1024x1024, original tile size 1024x1024
[Tiled VAE] Warning: Unknown attention optimization method . Please try to update the extension.
[Tiled VAE]: Fast mode enabled, estimating group norm parameters on 1024 x 512 image
[Tiled VAE]: Executing Encoder Task Queue: 100%|██████████████████████████████████| 1638/1638 [00:01<00:00, 858.74it/s]
[Tiled VAE]: Done in 2.642s, max VRAM alloc 7469.417 MB█████████████████████████▏ | 1548/1638 [00:01<00:00, 897.74it/s]
MixtureOfDiffusers Sampling: : 0it [00:03, ?it/s]
  0%|                                                                                           | 0/26 [00:00<?, ?it/s]ERROR:    Exception in ASGI application                                                  | 5/26 [00:53<03:46, 10.76s/it]
Traceback (most recent call last):
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 428, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\fastapi\applications.py", line 273, in __call__
    await super().__call__(scope, receive, send)
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\starlette\applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\starlette\middleware\errors.py", line 184, in __call__
    raise exc
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\starlette\middleware\errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\starlette\middleware\cors.py", line 92, in __call__
    await self.simple_response(scope, receive, send, request_headers=headers)
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\starlette\middleware\cors.py", line 147, in simple_response
    await self.app(scope, receive, send)
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\starlette\middleware\gzip.py", line 24, in __call__
    await responder(scope, receive, send)
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\starlette\middleware\gzip.py", line 44, in __call__
    await self.app(scope, receive, self.send_with_gzip)
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\starlette\middleware\exceptions.py", line 79, in __call__
    raise exc
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\starlette\middleware\exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 21, in __call__
    raise e
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\starlette\routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\starlette\routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\starlette\routing.py", line 66, in app
    response = await func(request)
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\fastapi\routing.py", line 237, in app
    raw_response = await run_endpoint_function(
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\fastapi\routing.py", line 165, in run_endpoint_function
    return await run_in_threadpool(dependant.call, **values)
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\starlette\concurrency.py", line 41, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "C:\stable-diffusion-webui\modules\progress.py", line 93, in progressapi
    shared.state.set_current_image()
  File "C:\stable-diffusion-webui\modules\shared.py", line 205, in set_current_image
    self.do_set_current_image()
  File "C:\stable-diffusion-webui\modules\shared.py", line 215, in do_set_current_image
    self.assign_current_image(modules.sd_samplers.sample_to_image(self.current_latent))
  File "C:\stable-diffusion-webui\modules\sd_samplers_common.py", line 50, in sample_to_image
    return single_sample_to_image(samples[index], approximation)
  File "C:\stable-diffusion-webui\modules\sd_samplers_common.py", line 38, in single_sample_to_image
    x_sample = sd_vae_taesd.model()(x_sample.to(devices.device, devices.dtype).unsqueeze(0))[0].detach()
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\torch\nn\modules\container.py", line 217, in forward
    input = module(input)
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\stable-diffusion-webui\modules\sd_vae_taesd.py", line 34, in forward
    return self.fuse(self.conv(x) + self.skip(x))
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\torch\nn\modules\container.py", line 217, in forward
    input = module(input)
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\torch\nn\modules\activation.py", line 103, in forward
    return F.relu(input, inplace=self.inplace)
  File "C:\stable-diffusion-webui\venvxformers\lib\site-packages\torch\nn\functional.py", line 1457, in relu
    result = torch.relu(input)
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 2.25 GiB (GPU 0; 23.99 GiB total capacity; 20.09 GiB already allocated; 316.40 MiB free; 20.88 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
100%|██████████████████████████████████████████████████████████████████████████████████| 26/26 [06:14<00:00, 14.42s/it]
[Tiled VAE]: input_size: torch.Size([1, 4, 384, 768]), tile_size: 64, padding: 11██████| 26/26 [06:14<00:00, 13.92s/it]
[Tiled VAE]: split to 6x12 = 72 tiles. Optimal tile size 64x64, original tile size 64x64
[Tiled VAE] Warning: Unknown attention optimization method . Please try to update the extension.
[Tiled VAE]: Fast mode enabled, estimating group norm parameters on 64 x 32 image
[Tiled VAE]: Executing Decoder Task Queue: 100%|█████████████████████████████████| 8856/8856 [00:04<00:00, 1912.77it/s]
[Tiled VAE]: Done in 5.278s, max VRAM alloc 21679.468 MB
Total progress: 100%|██████████████████████████████████████████████████████████████████| 26/26 [06:23<00:00, 14.75s/it]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 26/26 [06:23<00:00, 13.92s/it]
pkuliyi2015 commented 1 year ago

I understand. Your problem is from the Live Preview "TAESD". Just go to settings and disable the live preview, then you can generate as normal (but you can no longer see the preview image).

You can also switch to Approx NN or other methods to see whether they will use up your VRAM. I guess the Approx NN won't take so much VRAM.

AugmentedRealityCat commented 1 year ago

Thanks a lot ! It happens that I activated that TAESD preview about at the same time as Torch 2.0 was installed, so chronologically it makes sense as well. Before that I almost never used live preview, so I can live without it if I need to.

I'll try that and report back if I still have problems.

EDIT: I confirm that removing TAESD was the solution for me, in addition to using Xformers. I used Xformers 0.0.20. instead of 0.0.19. and that seems to be working well.

tkittich commented 1 year ago

My first reply has addressed your problem in the tiled vae. Now the OOM happens in the UNet.

It is quite weird that your 24 GB GPU reports OOM. You may try to reduce the tiled diffusion tile size to 64 instead of 96.

Normally speaking this won't happen. I'm confused too.

I've downgraded the driver to 531.79 and used xformers with 64 diffusion tile size. Still got the following errors:

[Tiled Diffusion] ControlNet found, support is enabled.
19:50:09-320417 INFO     Loading model from cache: control_v11f1e_sd15_tile [a371b31b]
19:50:09-320417 INFO     Loading preprocessor: tile_resample
19:50:09-320417 INFO     Pixel Perfect Computation:
19:50:09-320417 INFO     resize_mode = ResizeMode.OUTER_FIT
19:50:09-320417 INFO     raw_H = 1024
19:50:09-320417 INFO     raw_W = 1824
19:50:09-320417 INFO     target_H = 4096
19:50:09-320417 INFO     target_W = 7296
19:50:09-336043 INFO     estimation = 4096.0
19:50:09-336043 INFO     preprocessor resolution = 4096
warn: noise inversion only supports the Euler sampler, switch to it sliently...
MultiDiffusion Sampling:   0%|                                   | 0/140 [00:00<?, ?it/s]
MultiDiffusion hooked into 'Euler' sampler, Tile size: 64x64, Tile batches: 20, Batch size: 8. (ext: NoiseInv, ContrlNet)
[Tiled VAE]: input_size: torch.Size([1, 3, 4096, 7296]), tile_size: 1024, padding: 32
[Tiled VAE]: split to 4x8 = 32 tiles. Optimal tile size 928x1024, original tile size 1024x1024
[Tiled VAE]: Executing Encoder Task Queue: 100%|█████| 2912/2912 [00:46<00:00, 62.56it/s]
[Tiled VAE]: Done in 47.687s, max VRAM alloc 5505.459 MB44/2912 [00:46<00:00, 400.71it/s]
MultiDiffusion Sampling:  25%|██████▌                   | 35/140 [01:07<00:54,  1.93it/s]
19:51:20-007424 ERROR    API error: POST: http://127.0.0.1:7860/internal/progress
                         {'error': 'OutOfMemoryError', 'detail': '', 'body': '', 'errors':
                         'CUDA out of memory. Tried to allocate 3.56 GiB (GPU 0; 24.00 GiB
                         total capacity; 19.95 GiB already allocated; 2.14 GiB free; 20.55
                         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'}
19:51:20-007424 ERROR    HTTP API: OutOfMemoryError
╭────────────────────────── Traceback (most recent call last) ───────────────────────────╮
│ D:\theera\aiart\automatic\venv\lib\site-packages\anyio\streams\memory.py:94 in receive │
│                                                                                        │
│ D:\theera\aiart\automatic\venv\lib\site-packages\anyio\streams\memory.py:89 in         │
│ receive_nowait                                                                         │
╰────────────────────────────────────────────────────────────────────────────────────────╯
WouldBlock

During handling of the above exception, another exception occurred:

╭────────────────────────── Traceback (most recent call last) ───────────────────────────╮
│ D:\theera\aiart\automatic\venv\lib\site-packages\starlette\middleware\base.py:78 in    │
│ call_next                                                                              │
│                                                                                        │
│ D:\theera\aiart\automatic\venv\lib\site-packages\anyio\streams\memory.py:114 in        │
│ receive                                                                                │
╰────────────────────────────────────────────────────────────────────────────────────────╯
EndOfStream

During handling of the above exception, another exception occurred:

╭────────────────────────── Traceback (most recent call last) ───────────────────────────╮
│ D:\theera\aiart\automatic\modules\middleware.py:42 in log_and_time                     │
│                                                                                        │
│   41 │   │   │   ts = time.time()                                                      │
│ ❱ 42 │   │   │   res: Response = await call_next(req)                                  │
│   43 │   │   │   duration = str(round(time.time() - ts, 4))                            │
│                                                                                        │
│ D:\theera\aiart\automatic\venv\lib\site-packages\starlette\middleware\base.py:84 in    │
│ call_next                                                                              │
│                                                                                        │
│                                ... 27 frames hidden ...                                │
│                                                                                        │
│ D:\theera\aiart\automatic\venv\lib\site-packages\torch\nn\modules\conv.py:463 in       │
│ forward                                                                                │
│                                                                                        │
│    462 │   def forward(self, input: Tensor) -> Tensor:                                 │
│ ❱  463 │   │   return self._conv_forward(input, self.weight, self.bias)                │
│    464                                                                                 │
│                                                                                        │
│ D:\theera\aiart\automatic\venv\lib\site-packages\torch\nn\modules\conv.py:459 in       │
│ _conv_forward                                                                          │
│                                                                                        │
│    458 │   │   │   │   │   │   │   _pair(0), self.dilation, self.groups)               │
│ ❱  459 │   │   return F.conv2d(input, weight, bias, self.stride,                       │
│    460 │   │   │   │   │   │   self.padding, self.dilation, self.groups)               │
╰────────────────────────────────────────────────────────────────────────────────────────╯

OutOfMemoryError: CUDA out of memory. Tried to allocate 3.56 GiB (GPU 0; 24.00 GiB total
capacity; 19.95 GiB already allocated; 2.14 GiB free; 20.55 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
MultiDiffusion Sampling: 100%|█████████████████████████| 140/140 [01:33<00:00,  1.51it/s]
Noise Inversion: 100%|███████████████████████████████████| 10/10 [00:55<00:00,  5.55s/it]
100%|██████████████████████████████████████████████████████| 7/7 [01:12<00:00, 10.35s/it]
[Tiled VAE]: input_size: torch.Size([1, 4, 512, 912]), tile_size: 192, padding: 11
[Tiled VAE]: split to 3x5 = 15 tiles. Optimal tile size 192x192, original tile size 192x192
[Tiled VAE]: Executing Decoder Task Queue:  76%|███▊ | 1402/1845 [01:38<04:43,  1.57it/s]
19:54:47-257397 ERROR    Exception: CUDA out of memory. Tried to allocate 1.40 GiB (GPU 0;
                         24.00 GiB total capacity; 21.68 GiB already allocated; 280.00 MiB
                         free; 22.42 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
19:54:47-257397 ERROR    Arguments: args=('task(sfktwuwscatyaa4)', 0, 'a painting of a
                         matte handsome (oval face:1.2) soft gold lpa buddha head with
                         white halo around the head surrounded by colorful
                         soft-rainbow-pastel lpa sky with stars and (galaxies:1.2) above a
                         large soft-rainbow-pastel swirling lpa galaxy,
                         <lora:lpa15haCc16s100n1t2v2-1024-30-04:0.7>, high details,
                         masterpiece, highres, best quality', '(low quality:2), (normal
                         quality:2), lowres, ((monochrome)), ((grayscale)), (dark
                         colors:1.2), (text, signature, watermark:1.2), (wattle:1.2)', [],
                         <PIL.Image.Image image mode=RGBA size=1824x1024 at
                         0x1CAFE543160>, None, None, None, None, None, None, 30, 0, 4, 0,
                         1, False, False, 1, 1, 2, 1.5, 1, 0.2, 413579143.0, -1.0, 0, 0,
                         0, False, 1, 512, 912, 4, 2, 0, 32, 0, '', '', '', [], 0, True,
                         'MultiDiffusion', False, False, 1024, 1024, 64, 64, 8, 8, 'None',
                         2, True, 10, 1, 1, 64, False, False, False, False, False, 0.4,
                         0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4,
                         0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2,
                         0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2,
                         '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '',
                         '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '',
                         'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '',
                         'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '',
                         'Background', 0.2, -1.0, True, 1024, 192, True, False, False,
                         False, False, 7, 100, 'Constant', 0, 'Power Up', 3, 4, False,
                         'x264', 'blend', 10, 0, 0, False, True, True, True,
                         'intermediate', 'animation',
                         <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit
                         object at 0x000001CAFE7AE9B0>,
                         <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit
                         object at 0x000001CAFE540700>, False, False, 0, None, [], 0,
                         False, [], [], False, 0, 1, False, False, 0, None, [], -2, False,
                         [], False, 0, None, None, False, 0.75, 1, '<ul>\n<li><code>CFG
                         Scale</code> should be 2 or lower.</li>\n</ul>\n', True, True,
                         '', '', True, 50, True, 1, 0, False, 4, 0.5, 'Linear', 'None',
                         '<p style="margin-bottom:0.75em">Recommended settings: Sampling
                         Steps: 80-100, Sampler: Euler a, Denoising strength: 0.8</p>',
                         128, 8, ['left', 'right', 'up', 'down'], 1, 0.05, 128, 4, 0,
                         ['left', 'right', 'up', 'down'], False, False, 'positive',
                         'comma', 0, False, False, '', '<p
                         style="margin-bottom:0.75em">Will upscale the image by the
                         selected scale factor; use width and height sliders to set tile
                         size</p>', 64, 0, 2, 7, '', [], 0, '', [], 0, '', [], True,
                         False, False, False, 0, False, None, None, False, None, None,
                         False, 50, False, 4.0, '', 10.0, 'Linear', 3, False, 30.0, True,
                         False, False, 0, 0.0, 'Lanczos', 1, True, 0, 0, 0.001, 75, 0.0,
                         False, True, '<p style="margin-bottom:0.75em">Will upscale the
                         image depending on the selected target size type</p>', 512, 0, 8,
                         32, 64, 0.35, 32, 0, True, 0, False, 8, 0, 0, 2048, 2048, 2)
                         kwargs={}
19:54:47-262901 ERROR    gradio call: OutOfMemoryError
╭────────────────────────── Traceback (most recent call last) ───────────────────────────╮
│ D:\theera\aiart\automatic\modules\call_queue.py:34 in f                                │
│                                                                                        │
│    33 │   │   │   try:                                                                 │
│ ❱  34 │   │   │   │   res = func(*args, **kwargs)                                      │
│    35 │   │   │   │   progress.record_results(id_task, res)                            │
│                                                                                        │
│ D:\theera\aiart\automatic\modules\img2img.py:174 in img2img                            │
│                                                                                        │
│   173 │   │   if processed is None:                                                    │
│ ❱ 174 │   │   │   processed = process_images(p)                                        │
│   175 │   p.close()                                                                    │
│                                                                                        │
│                                ... 20 frames hidden ...                                │
│                                                                                        │
│ D:\theera\aiart\automatic\venv\lib\site-packages\torch\nn\modules\conv.py:463 in       │
│ forward                                                                                │
│                                                                                        │
│    462 │   def forward(self, input: Tensor) -> Tensor:                                 │
│ ❱  463 │   │   return self._conv_forward(input, self.weight, self.bias)                │
│    464                                                                                 │
│                                                                                        │
│ D:\theera\aiart\automatic\venv\lib\site-packages\torch\nn\modules\conv.py:459 in       │
│ _conv_forward                                                                          │
│                                                                                        │
│    458 │   │   │   │   │   │   │   _pair(0), self.dilation, self.groups)               │
│ ❱  459 │   │   return F.conv2d(input, weight, bias, self.stride,                       │
│    460 │   │   │   │   │   │   self.padding, self.dilation, self.groups)               │
╰────────────────────────────────────────────────────────────────────────────────────────╯
OutOfMemoryError: CUDA out of memory. Tried to allocate 1.40 GiB (GPU 0; 24.00 GiB total
capacity; 21.68 GiB already allocated; 280.00 MiB free; 22.42 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
tkittich commented 1 year ago

Ohhhh, I was using TAESD preview too. Switching to Approx NN fixed the OOM error. 4x upscaling now works fine. Thanks a lot. ^^

pkuliyi2015 commented 1 year ago

I think this issue has come to an end. As a summary:

  1. Use smaller encoder/decoder tile size
  2. Use --xformers.
  3. Don't use TAESD in the live preview.
boneanxs commented 11 months ago

I think this issue has come to an end. As a summary:

  1. Use smaller encoder/decoder tile size
  2. Use --xformers.
  3. Don't use TAESD in the live preview.

@pkuliyi2015 Hey, I also encounter this issue when upscaling image from 2048 to 4096, and I already use xformers(0.0.20) and downgrade driver version to 531, also I can confirm that I don't enable TAESD in the live preview. My memory is 24GB and even after I reduce the tile size to 64, the issue still exists, this is my error log, can you pls help me how to fix it?

Startup time: 8.5s (launcher: 2.9s, import torch: 1.7s, import gradio: 0.8s, setup paths: 0.7s, other imports: 0.7s, load scripts: 0.9s, create ui: 0.6s, gradio launch: 0.1s).
Creating model from config: /workspaces/stable-diffusion-webui/configs/v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Applying attention optimization: xformers... done.
Model loaded in 2.1s (load weights from disk: 0.8s, create model: 0.3s, apply weights to model: 0.4s, apply half(): 0.2s, move model to device: 0.3s).
[Tiled Diffusion] upscaling image with R-ESRGAN 4x+ Anime6B...
        Tile 1/121
        Tile 2/121
        Tile 3/121
        Tile 4/121
        Tile 5/121
        Tile 6/121
        Tile 7/121
        Tile 8/121
        Tile 9/121
        Tile 10/121
        Tile 11/121
        Tile 12/121
        Tile 13/121
        Tile 14/121
        Tile 15/121
        Tile 16/121
        Tile 17/121
        Tile 18/121
        Tile 19/121
        Tile 20/121
        Tile 21/121
        Tile 22/121
        Tile 23/121
        Tile 24/121
        Tile 25/121
        Tile 26/121
        Tile 27/121
        Tile 28/121
        Tile 29/121
        Tile 30/121
        Tile 31/121
        Tile 32/121
        Tile 33/121
        Tile 34/121
        Tile 35/121
        Tile 36/121
        Tile 37/121
        Tile 38/121
        Tile 39/121
        Tile 40/121
        Tile 41/121
        Tile 42/121
        Tile 43/121
        Tile 44/121
        Tile 45/121
        Tile 46/121
        Tile 47/121
        Tile 48/121
        Tile 49/121
        Tile 50/121
        Tile 51/121
        Tile 52/121
        Tile 53/121
        Tile 54/121
        Tile 55/121
        Tile 56/121
        Tile 57/121
        Tile 58/121
        Tile 59/121
        Tile 60/121
        Tile 61/121
        Tile 62/121
        Tile 63/121
        Tile 64/121
        Tile 65/121
        Tile 66/121
        Tile 67/121
        Tile 68/121
        Tile 69/121
        Tile 70/121
        Tile 71/121
        Tile 72/121
        Tile 73/121
        Tile 74/121
        Tile 75/121
        Tile 76/121
        Tile 77/121
        Tile 78/121
        Tile 79/121
        Tile 80/121
        Tile 81/121
        Tile 82/121
        Tile 83/121
        Tile 84/121
        Tile 85/121
        Tile 86/121
        Tile 87/121
        Tile 88/121
        Tile 89/121
        Tile 90/121
        Tile 91/121
        Tile 92/121
        Tile 93/121
        Tile 94/121
        Tile 95/121
        Tile 96/121
        Tile 97/121
        Tile 98/121
        Tile 99/121
        Tile 100/121
        Tile 101/121
        Tile 102/121
        Tile 103/121
        Tile 104/121
        Tile 105/121
        Tile 106/121
        Tile 107/121
        Tile 108/121
        Tile 109/121
        Tile 110/121
        Tile 111/121
        Tile 112/121
        Tile 113/121
        Tile 114/121
        Tile 115/121
        Tile 116/121
        Tile 117/121
        Tile 118/121
        Tile 119/121
        Tile 120/121
        Tile 121/121
[Tiled Diffusion] ControlNet found, support is enabled.
MultiDiffusion Sampling: : 0it [00:00, ?it/s]MultiDiffusion hooked into 'Euler a' sampler, Tile size: 64x64, Tile batches: 57, Batch size: 4. (ext: ContrlNet)
*** Error completing request
*** Arguments: ('task(f0pl63gnf45152u)', 0, 'blue sky, sun, sea, beach, waves,', 'easynegative', [], <PIL.Image.Image image mode=RGBA size=2048x2048 at 0x7FF05D2314B0>, None, None, None, None, None, None, 20, 0, 4, 0, 1, False, False, 1, 1, 7, 1.5, 0.75, 881253758.0, -1.0, 0, 0, 0, False, 0, 2048, 2048, 1, 0, 0, 32, 0, '', '', '', ['Clip skip: 1'], False, [], '', <gradio.routes.Request object at 0x7ff05d231060>, 0, True, 'MultiDiffusion', False, True, 1024, 1024, 64, 64, 32, 4, 'R-ESRGAN 4x+ Anime6B', 2, False, 10, 1, 1, 64, True, False, False, False, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 3072, 192, True, True, True, False, False, False, 'LoRA', 'None', 0, 0, 'LoRA', 'None', 0, 0, 'LoRA', 'None', 0, 0, 'LoRA', 'None', 0, 0, 'LoRA', 'None', 0, 0, None, 'Refresh models', <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x7ff05d1f62c0>, <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x7ff05d1f7910>, <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x7ff05d1f7880>, False, False, 'Matrix', 'Horizontal', 'Mask', 'Prompt', '1,1', '0.2', False, False, False, 'Attention', False, '0', '0', '0.4', None, '<ul>\n<li><code>CFG Scale</code> should be 2 or lower.</li>\n</ul>\n', True, True, '', '', True, 50, True, 1, 0, False, 4, 0.5, 'Linear', 'None', '<p style="margin-bottom:0.75em">Recommended settings: Sampling Steps: 80-100, Sampler: Euler a, Denoising strength: 0.8</p>', 128, 8, ['left', 'right', 'up', 'down'], 1, 0.05, 128, 4, 0, ['left', 'right', 'up', 'down'], False, False, 'positive', 'comma', 0, False, False, '', '<p style="margin-bottom:0.75em">Will upscale the image by the selected scale factor; use width and height sliders to set tile size</p>', 64, 0, 2, 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, None, None, False, None, None, False, None, None, False, 50) {}
    Traceback (most recent call last):
      File "/workspaces/stable-diffusion-webui/modules/call_queue.py", line 58, in f
        res = list(func(*args, **kwargs))
      File "/workspaces/stable-diffusion-webui/modules/call_queue.py", line 37, in f
        res = func(*args, **kwargs)
      File "/workspaces/stable-diffusion-webui/modules/img2img.py", line 232, in img2img
        processed = process_images(p)
      File "/workspaces/stable-diffusion-webui/modules/processing.py", line 677, in process_images
        res = process_images_inner(p)
      File "/workspaces/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/batch_hijack.py", line 42, in processing_process_images_hijack
        return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
      File "/workspaces/stable-diffusion-webui/modules/processing.py", line 734, in process_images_inner
        p.init(p.all_prompts, p.all_seeds, p.all_subseeds)
      File "/workspaces/stable-diffusion-webui/modules/processing.py", line 1350, in init
        self.init_latent = self.sd_model.get_first_stage_encoding(self.sd_model.encode_first_stage(image))
      File "/workspaces/stable-diffusion-webui/modules/sd_hijack_utils.py", line 17, in <lambda>
        setattr(resolved_obj, func_path[-1], lambda *args, **kwargs: self(*args, **kwargs))
      File "/workspaces/stable-diffusion-webui/modules/sd_hijack_utils.py", line 28, in __call__
        return self.__orig_func(*args, **kwargs)
      File "/workspaces/stable-diffusion-webui/sd/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
        return func(*args, **kwargs)
      File "/workspaces/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/models/diffusion/ddpm.py", line 830, in encode_first_stage
        return self.first_stage_model.encode(x)
      File "/workspaces/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/models/autoencoder.py", line 83, in encode
        h = self.encoder(x)
      File "/workspaces/stable-diffusion-webui/sd/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
        return forward_call(*args, **kwargs)
      File "/workspaces/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/modules/diffusionmodules/model.py", line 526, in forward
        h = self.down[i_level].block[i_block](hs[-1], temb)
      File "/workspaces/stable-diffusion-webui/sd/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
        return forward_call(*args, **kwargs)
      File "/workspaces/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/modules/diffusionmodules/model.py", line 133, in forward
        h = self.conv1(h)
      File "/workspaces/stable-diffusion-webui/sd/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
        return forward_call(*args, **kwargs)
      File "/workspaces/stable-diffusion-webui/extensions-builtin/Lora/networks.py", line 376, in network_Conv2d_forward
        return torch.nn.Conv2d_forward_before_network(self, input)
      File "/workspaces/stable-diffusion-webui/extensions/a1111-sd-webui-lycoris/lycoris.py", line 753, in lyco_Conv2d_forward
        return torch.nn.Conv2d_forward_before_lyco(self, input)
      File "/workspaces/stable-diffusion-webui/sd/lib/python3.10/site-packages/torch/nn/modules/conv.py", line 463, in forward
        return self._conv_forward(input, self.weight, self.bias)
      File "/workspaces/stable-diffusion-webui/sd/lib/python3.10/site-packages/torch/nn/modules/conv.py", line 459, in _conv_forward
        return F.conv2d(input, weight, bias, self.stride,
    torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 36.00 GiB (GPU 0; 23.99 GiB total capacity; 22.12 GiB already allocated; 0 bytes free; 22.42 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
pkuliyi2015 commented 11 months ago

Please also enable Tiled VAE