justinpinkney / stable-diffusion

MIT License
1.45k stars 266 forks source link

Fix vram leak when loading model #35

Open Dong-Ki-Lee opened 2 years ago

Dong-Ki-Lee commented 2 years ago

When loading with the previous code, both pl_sd itself and the model read by state_dict from pl_sd are stored in vram, so the program consumes more graphics memory than it needs. Modify that part.