rupeshs / fastsdcpu

Fast stable diffusion on CPU
MIT License
1.01k stars 86 forks source link

Out of memory when trying to create a large number of images #50

Open veikk0 opened 8 months ago

veikk0 commented 8 months ago

When trying to create 25 images at 768x768 resolution and 25 inference steps, I got this error:

RuntimeError: Exception from src/inference/src/core.cpp:114:
[ GENERAL_ERROR ] Failed to allocate 70201324800 bytes of memory

It seems to be trying to allocate 70 gigs of memory at once.

The "number of images" functionality seems to work in an unintuitive way. I'd expect it to fully generate and output images one-by-one until X number of images has been reached, but instead it seems like it's trying to do it all in parallel or something.

Generating images one-by-one using the same settings works fine. I have 32 gigs of RAM and memory use only goes up to 13 GiB when generating one image at a time, so lack of memory shouldn't be a problem.

I'm using the latest git on Linux Mint 21.2.

Amin456789 commented 8 months ago

yes, a batch count [one by one generation] will be great