perf: free unused params immediately to reduce memory usage

This commit is contained in:
leejet committed 2023-08-17 00:55:36 +08:00
1 parent cbee3c9a4f
commit 8f34dd7cc7
4 files changed
+232 -73

No files matched your search

+2 -1
View File
@@ -23,7 +23,8 @@ class StableDiffusion {
public:
StableDiffusion(int n_threads = -1,
bool vae_decode_only = false);
bool vae_decode_only = false,
bool free_params_immediately = false);
bool load_from_file(const std::string& file_path);
std::vector<uint8_t> txt2img(
const std::string& prompt,