InvokeAI/invokeai/app/services/object_serializer
psychedelicious b7ffd36cc6 feat(nodes): use TemporaryDirectory to handle ephemeral storage in ObjectSerializerDisk
Replace `delete_on_startup: bool` & associated logic with `ephemeral: bool` and `TemporaryDirectory`.

The temp dir is created inside of `output_dir`. For example, if `output_dir` is `invokeai/outputs/tensors/`, then the temp dir might be `invokeai/outputs/tensors/tmpvj35ht7b/`.

The temp dir is cleaned up when the service is stopped, or when it is GC'd if not properly stopped.

In the event of a catastrophic crash where the temp files are not cleaned up, the user can delete the tempdir themselves.

This situation may not occur in normal use, but if you kill the process, python cannot clean up the temp dir itself. This includes running the app in a debugger and killing the debugger process - something I do relatively often.

Tests updated.
2024-02-15 17:30:03 +11:00
..
object_serializer_base.py tidy(nodes): remove object serializer on_saved 2024-02-15 17:30:03 +11:00
object_serializer_common.py revert(nodes): revert making tensors/conditioning use item storage 2024-02-15 17:30:03 +11:00
object_serializer_disk.py feat(nodes): use TemporaryDirectory to handle ephemeral storage in ObjectSerializerDisk 2024-02-15 17:30:03 +11:00
object_serializer_forward_cache.py chore(nodes): update ObjectSerializerForwardCache docstring 2024-02-15 17:30:03 +11:00