AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
141.4k stars 26.72k forks source link

[1.6.0] XL model change too slow in ubuntu server, Can I keep this model in memery forever? #12936

Open inspire-boy opened 1 year ago

inspire-boy commented 1 year ago

Is there an existing issue for this?

What happened?

loading xl model cost too long time

Steps to reproduce the problem

1、load a SD1.5 model 2、change to a XL model.

Can I always keep a special model in memery?

What should have happened?

loading XL model cost long time. (SSD)

Sysinfo

It take 3 mins to load sdxl

What browsers do you use to access the UI ?

Google Chrome

Console logs

Applying attention optimization: xformers... done.
Model loaded in 21.8s (load weights from disk: 2.6s, create model: 0.6s, apply weights to model: 14.7s, apply half(): 0.1s, apply dtype to VAE: 1.7s, move model to device: 0.2s, calculate empty prompt: 1.7s).
【--------------- cost in this place-----------------】
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:17<00:00,  1.15it/s]
Total progress: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:15<00:00,  1.30it/s]
Total progress: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:15<00:00,  1.55it/s]

Additional information

Can I always keep a special model in memery?

dhwz commented 1 year ago

try settings -> system -> disable memmapping for loading safetensors