mrhan1993 / Fooocus-API

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

Manually release memory footprint to avoid OOM that may occur after long-term use #252

Closed mrhan1993 closed 3 months ago

mrhan1993 commented 3 months ago

After running for a long time, due to the loading problem of the model, the GPU memory and memory footprint will continue to increase, which will lead to the emergence of OOM. Add manual release logic while avoiding repeated loading of the model as much as possible.

thanks for @PeakLee and his code: https://github.com/mrhan1993/Fooocus-API/issues/245#issuecomment-2007381687