-
Notifications
You must be signed in to change notification settings - Fork 18
Description
First of all, thank you very much for the wan_ksampler node - it runs much faster than the standard sampler.
I noticed that over 40-50 generations RAM fills up and my debian terminates comfy. I have isolated the issue to the wan_ksampler node and I suspect there is a memory leak somewhere. I tried to find out where but I failed as I am not very familiar with the code. I am running comfy headless without UI and with --preview-method none.
What I suspect is one or more of these things:
- previewer objects inside prepare_callback (potentially large decoders or image objects)
- callback closures (may capture tensors and references)
- latent_image, noise, and noise_mask (multi-MB tensors)
This would be my first candidate
callback = latent_preview.prepare_callback(model_high_noise, steps)
It might be necessary to delete the callback using del
del callback
I would appreciate if you could have a look as you are much more familiar. If you don't have time, let me know and I will dig in.