lllyasviel / lllyasviel/stable-diffusion-webui-forge

OOM When switching models

Open
#2,127 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
13k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

24GB VRAM 3090, 32GB RAM

Is this almost expected behavior when changing a base model, as it happens 99% of the time? I've tried so many different combinations of settings and every one crashes. This is particularly annoying because I use (or would like to) Forge remotely, and every time this happens I can't use it again until I'm back at PC

Specifically the error is ```torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 160.00 MiB. GPU```

I've tried the Never OOM for UNET and VAE, this does seem to work but unsure of the downsides? I've tried to google but cannot find any information on this, and I'm unsure why it wouldn't be baked into the backend if there weren't downsides to it.

Shouldn't Forge just unload any models before loading in a new one? I mean you don't offer queuing like Comfy so why would two base models ever need to be loaded?

I love the simplicity of Forge but I have never once had an OOM with Comfy, so surely something is wrong here.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce switching between base models on the reported 24GB GPU and capture the CUDA out-of-memory failure when loading the replacement model. Compare the behavior with Never OOM enabled for UNET and VAE, then determine whether switching reliably releases the previous model; done means model changes no longer produce the reported allocation failure without requiring a restart.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
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.