InvokeAI icon indicating copy to clipboard operation
InvokeAI copied to clipboard

[enhancement]: Allow user to clear caches

Open JPPhoto opened this issue 1 year ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Contact Details

No response

What should this feature add?

I suggest that Invoke settings have a button to force flushing of the VRAM/RAM caches so a user could keep Invoke running while doing other GPU-intensive things, then come back to Invoke.

Alternatives

The alternative is stopping Invoke to free up memory for other applications, then restarting it when done with those other programs.

Additional Content

No response

JPPhoto avatar Mar 27 '24 20:03 JPPhoto

How about this API?

context.model_manager.load.clear_cache((LoaderCacheType.VRAM, LoaderCacheType.RAM))

Where LoaderCacheType is an enum of CONVERT_CACHE, RAM, and VRAM. Calling with no argument clears all three caches.

lstein avatar Mar 29 '24 13:03 lstein

That'd probably do the trick (maybe).

JPPhoto avatar Apr 04 '24 00:04 JPPhoto