lllyasviel / lllyasviel/stable-diffusion-webui-forge
Increment RAM used while swap flux model
- Dominant language
- Python
- Stars
- 13k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
Hello!
I have discovered an unpleasant feature of working with the Flux model. Every time I change the model, the RAM consumption constantly increases, it starts using swap and eventually everything starts to generate for a long time, and then everything crashes.
I have a GTX 1070 8 Gb + 64 Gb RAM, when changing the model it gets to the point that all the RAM and 70 Gb of swap are used.
Is there any way to fix this so as not to restart everything? As I understand it, for some reason the memory is not being freed up, perhaps it considers swap as part of the memory, but in theory this should not happen with those models that are stored in memory.
In addition, in my settings it is set to save only one model in memory, that is, this is most likely an error, and not the correct behavior.

Contributor guide
No contributing guide indexed for this repository
Research direction
No files, tests, or entry points are named. Start by reproducing repeated Flux model switching with the one-model-in-memory setting while monitoring RAM and swap; done means switching models no longer causes unbounded memory growth or requires restarting the application.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100