kkytai commited on
Commit
65a4b73
·
1 Parent(s): 1c02b3f

fix: Add memory cleanup to prevent CUDA OOM errors

Browse files

- Add _cleanup_memory() method with gc.collect() and torch.cuda.empty_cache()
- Call cleanup before/after batch processing
- Call cleanup after each image generation
- Force cleanup on errors
- Clean up when GPU memory usage exceeds 85%

1 file changed +44
handler.py+44