Closed lurkerthrowaway closed 3 weeks ago
A small update: I'm not sure what I did differently, but this time I got an actual error before the UI crashed. Again, this is upon trying to switch to the third XL model in a plot.
It seems pretty clear to me that this comes down to a difference in memory management between Forge and base A1111, but I'm frankly a techlet, so if there's a clear way to solve this on my end I'd love some input (and the issue is on Forge's end, well, let it be known there's an issue).
generating image for xyz plot: OutOfMemoryError
Traceback (most recent call last):
File "E:\webui_forge_cu121_torch21\webui\scripts\xyz_grid.py", line 723, in cell
res = process_images(pc)
File "E:\webui_forge_cu121_torch21\webui\modules\processing.py", line 743, in process_images
sd_models.reload_model_weights()
File "E:\webui_forge_cu121_torch21\webui\modules\sd_models.py", line 628, in reload_model_weights
return load_model(info)
File "E:\webui_forge_cu121_torch21\webui\modules\sd_models.py", line 585, in load_model
sd_model = forge_loader.load_model_for_a1111(timer=timer, checkpoint_info=checkpoint_info, state_dict=state_dict)
File "E:\webui_forge_cu121_torch21\system\python\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "E:\webui_forge_cu121_torch21\webui\modules_forge\forge_loader.py", line 154, in load_model_for_a1111
forge_objects = load_checkpoint_guess_config(
File "E:\webui_forge_cu121_torch21\webui\modules_forge\forge_loader.py", line 104, in load_checkpoint_guess_config
model = model_config.get_model(sd, "model.diffusion_model.", device=inital_load_device)
File "E:\webui_forge_cu121_torch21\webui\ldm_patched\modules\supported_models.py", line 176, in get_model
out = model_base.SDXL(self, model_type=self.model_type(state_dict, prefix), device=device)
File "E:\webui_forge_cu121_torch21\webui\ldm_patched\modules\model_base.py", line 297, in __init__
super().__init__(model_config, model_type, device=device)
File "E:\webui_forge_cu121_torch21\webui\ldm_patched\modules\model_base.py", line 55, in __init__
self.diffusion_model = UNetModel(**unet_config, device=device, operations=operations)
File "E:\webui_forge_cu121_torch21\webui\ldm_patched\ldm\modules\diffusionmodules\openaimodel.py", line 788, in __init__
get_attention_layer(
File "E:\webui_forge_cu121_torch21\webui\ldm_patched\ldm\modules\diffusionmodules\openaimodel.py", line 571, in get_attention_layer
return SpatialTransformer(
File "E:\webui_forge_cu121_torch21\webui\ldm_patched\ldm\modules\attention.py", line 593, in __init__
[BasicTransformerBlock(inner_dim, n_heads, d_head, dropout=dropout, context_dim=context_dim[d],
File "E:\webui_forge_cu121_torch21\webui\ldm_patched\ldm\modules\attention.py", line 593, in <listcomp>
[BasicTransformerBlock(inner_dim, n_heads, d_head, dropout=dropout, context_dim=context_dim[d],
File "E:\webui_forge_cu121_torch21\webui\ldm_patched\ldm\modules\attention.py", line 423, in __init__
self.ff = FeedForward(inner_dim, dim_out=dim, dropout=dropout, glu=gated_ff, dtype=dtype, device=device, operations=operations)
File "E:\webui_forge_cu121_torch21\webui\ldm_patched\ldm\modules\attention.py", line 80, in __init__
) if not glu else GEGLU(dim, inner_dim, dtype=dtype, device=device, operations=operations)
File "E:\webui_forge_cu121_torch21\webui\ldm_patched\ldm\modules\attention.py", line 65, in __init__
self.proj = operations.Linear(dim_in, dim_out * 2, dtype=dtype, device=device)
File "E:\webui_forge_cu121_torch21\system\python\lib\site-packages\torch\nn\modules\linear.py", line 96, in __init__
self.weight = Parameter(torch.empty((out_features, in_features), **factory_kwargs))
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 26.00 MiB. GPU 0 has a total capacty of 12.00 GiB of which 7.37 GiB is free. Of the allocated memory 3.37 GiB is allocated by PyTorch, and 180.69 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
Loading weights [ac006fdd7e] from G:\stable-diffusion-webui/models/Stable-diffusion\testing testing\autismmixSDXL_autismmixConfetti.safetensors
Press any key to continue . . .```
Closing due to age and lack of relevance to Forge2 (error log shows ldm_patched
modules, which are no longer part of Forge).
Checklist
What happened?
When running an XYZ plot to compare between different XL checkpoints, there is some kind of nondescript failure upon switching to the third checkpoint, and the terminal crashes. This doesn't happen with 1.5 checkpoints, and it doesn't happen with the original Auto1111 either; on the base webUI, the plot finishes generating without issue, even with an extension like adetailer activated.
I have verified that this doesn't happen if I disable third-party extensions on Forge, but given that A1111 doesn't have this problem either and my settings on both are as similar as possible, I am very curious as to what is wrong. This may very well be user error, but if that's the case, I would love to know what to do to resolve the problem.
Steps to reproduce the problem
Press any key to continue . . .
What should have happened?
I mean, I'd at least appreciate some kind of error message or whatnot, but ideally, I would like to be able to complete the X/Y/Z plot.
What browsers do you use to access the UI ?
Mozilla Firefox
Sysinfo
sysinfo-2024-02-11-18-53.json
Console logs
Additional information
No response