Skip to content

Commit 2a23987

Browse files
committed
Increase context memory when loading multiple auto encoders
1 parent 48fcec2 commit 2a23987

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

stable-diffusion.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,6 +1611,9 @@ sd_image_t* txt2img(sd_ctx_t* sd_ctx,
16111611
if (sd_ctx->sd->stacked_id) {
16121612
params.mem_size += static_cast<size_t>(10 * 1024 * 1024); // 10 MB
16131613
}
1614+
if (sd_ctx->sd->first_stage_model != nullptr && sd_ctx->sd->tae_first_stage != nullptr) {
1615+
params.mem_size *= 2;
1616+
}
16141617
params.mem_size += width * height * 3 * sizeof(float);
16151618
params.mem_size *= batch_count;
16161619
params.mem_buffer = NULL;

0 commit comments

Comments
 (0)