stable-diffusion-webui
stable-diffusion-webui copied to clipboard
[Bug]: SDXL Lowram flag is broken (Probably)
Checklist
- [X] The issue exists after disabling all extensions
- [X] The issue exists on a clean installation of webui
- [ ] The issue is caused by an extension, but I believe it is caused by a bug in the webui
- [X] The issue exists in the current version of the webui
- [X] The issue has not been reported before recently
- [ ] The issue has been reported before but has not been fixed yet
What happened?
SDXL in combination with --lowram
flag and lora causes abnormal RAM usage.
Steps to reproduce the problem
- Add the
--lowram
in the startup script - Run WebUI and load SDXL checkpoint
- Add any SDXL lora to the prompt
- Observe abnormal filling of the RAM
What should have happened?
Memory management should work better, WebUI should leave RAM as it is and work only with VRAM if the --lowram
flag is enabled
What browsers do you use to access the UI ?
Mozilla Firefox, Google Chrome, Android
Sysinfo
Console logs
Console logs are irrelevant in this situation because they don't show anything outside of normal behavior.
Additional information
Hello.
Recently I tested the performance of the webui with extreme cases of memory shortage. The test that caught my attention was done with the minimum amount of RAM (8GB). More specifically, SDXL in combination with the "--lowram" flag and loaded LoRA causes abnormal filling of RAM.
Normally, after the checkpoint is loaded and moved from RAM to VRAM, the amount of RAM doesn't change during the generation process.
(although this is strange behavior considering the enabled fast safetensors flag, which should force the webui to load checkpoint directly into VRAM)
This abnormal RAM behavior started to become noticeable somewhere between 57727e554d8f87b4cf438390d6cb05a27d1734f5 and c1713bfeac461bc28158b66ef8d956a39e296b94.
At this time I cannot provide you with a more precise range of suspected commits, I will try to find them later. However, I should note that this problem is also occurring in the lllyasviel/stable-diffusion-webui-forge fork. I hope you'll find this information useful in tracking down the exact change.
Screenshots:
Version 57727e554d8f87b4cf438390d6cb05a27d1734f5 after checkpoint is loaded
Version 57727e554d8f87b4cf438390d6cb05a27d1734f5 after generating an image with lora
Version 57727e554d8f87b4cf438390d6cb05a27d1734f5 after restart and generating an image without lora
Version c1713bfeac461bc28158b66ef8d956a39e296b94 after generation two images with lora
https://github.com/lllyasviel/stable-diffusion-webui-forge/issues/500