Skip to content

RAM OOMΒ #20

@twitset

Description

@twitset

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions