perf: free unused params immediately to reduce memory usage

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

View File

@@ -322,7 +322,8 @@ int main(int argc, const char* argv[]) {
}
init_img.assign(img_data, img_data + (opt.w * opt.h * c));
}
StableDiffusion sd(opt.n_threads, vae_decode_only);
StableDiffusion sd(opt.n_threads, vae_decode_only, true);
if (!sd.load_from_file(opt.model_path)) {
return 1;
}