lllyasviel / lllyasviel/stable-diffusion-webui-forge

Hires checkpoint doesn't respect setting "Maximum number of checkpoints loaded at the same time"

Open
#522 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
13k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

### 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?

For each generation, SD-Forge performs 6 "load model" operations, even after models should be loaded (The following example is SDXL->SD1.5, but this is true of any combination):

1. Load SDXLClipModel
2. Load SDXL
3. Load AutoencoderKL
4. Load SD1ClipModel
5. Load AutoencoderKL
6. Load BaseModel

### Steps to reproduce the problem

Setup to reproduce bug on a clean install:

1. Enable settings:
- **enable**: Hires fix: show hires checkpoint and sampler selection
- **set to 2+**: Maximum number of checkpoints loaded at the same time
- **disable**: Only keep one model on device

2. Set up generation:
- Create image with one SD checkpoint for initial pass and a separate one for hires fix. Any two models will do.

3. Generate image.

### What should have happened?

Watching VRAM usage indicates models are being unloaded after every pass. The Hires checkpoint setting either needs its own "keep in VRAM" setting or should apply the current one.

### What browsers do you use to access the UI ?

_No response_

### Sysinfo

[sysinfo-2024-03-09-19-23.json](https://github.com/lllyasviel/stable-diffusion-webui-forge/files/14547522/sysinfo-2024-03-09-19-23.json)

### Console logs

```Shell
Here's the log output for a single generation with the above settings:
https://pastebin.com/qrVR4XzD

Notice that it's attempting to "load 1 model" 6 times for a generation that has only two models being used.
```

### Additional information

_No response_

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce one generation with Hires fix checkpoint selection enabled, Maximum number of checkpoints loaded at the same time set to 2 or more, and Only keep one model on device disabled. Review the linked sysinfo and console log, then verify that the configured checkpoint limit is respected and models are not unloaded between the expected load operations.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.