lllyasviel / lllyasviel/stable-diffusion-webui-forge

Increment RAM used while swap flux model

Open
#2,836 1 comment 0 reactions 0 assignees View on GitHub
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.

![Image](https://github.com/user-attachments/assets/0a2af484-b924-4f11-bd62-181249b0caee)

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.