mrhan1993 / Fooocus-API

FastAPI powered API for Fooocus
GNU General Public License v3.0
502 stars 131 forks source link

Increase in memory usage as number of images increase #350

Open sidkau12 opened 3 weeks ago

sidkau12 commented 3 weeks ago

I have a csv file of prompts (100 prompts) and for each prompt I want to generate 32 images. I am using text to image API. The memory keeps increasing and when I see the logs of main.py

image

My script has async await functions and I am doing garbage collector, etc. But I am still facing this issue.

When I type htop I see the memory% spiking to 99% after generating around 100 images

Is anyone else facing this issue?

sidkau12 commented 3 weeks ago

@mrhan1993 @konieshadow When I am running the main.py of Fooocus, and I am running a script that hits Fooocus API, looks like it is storing everything in memory. And because it is storing everything in the memory the server is getting killed. What do we do in such a case?