mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-09-05 04:21:12 +02:00
sd: free audio VAE weights after encoding and decoding (#2430)
This commit is contained in:
@@ -6902,6 +6902,10 @@ static std::optional<ImageGenerationLatents> prepare_video_generation_latents(sd
|
||||
latents.init_latent = pack_ltxav_audio_and_video_latents(latents.init_latent, latents.audio_latent);
|
||||
}
|
||||
|
||||
if (sd_ctx->sd->audio_vae_model != nullptr) {
|
||||
sd_ctx->sd->audio_vae_model->runner_done();
|
||||
}
|
||||
|
||||
return latents;
|
||||
}
|
||||
|
||||
@@ -7617,6 +7621,10 @@ SD_API bool generate_video(sd_ctx_t* sd_ctx,
|
||||
LOG_INFO("decoding audio latent completed, taking %.2fs", (audio_latent_decode_end - audio_latent_decode_start) * 1.0f / 1000);
|
||||
}
|
||||
|
||||
if (sd_ctx->sd->audio_vae_model != nullptr) {
|
||||
sd_ctx->sd->audio_vae_model->runner_done();
|
||||
}
|
||||
|
||||
if (latents.video_conditioning_frame_count > 0) {
|
||||
int64_t target_frames = latents.video_target_frame_count > 0 ? latents.video_target_frame_count
|
||||
: final_latent.shape()[2] - latents.video_conditioning_frame_count;
|
||||
|
||||
Reference in New Issue
Block a user