Skip to content

Commit cc103ff

Browse files
committed
Increase context memory when loading multiple auto encoders
1 parent 737b3dd commit cc103ff

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
@@ -1676,6 +1676,9 @@ sd_image_t* txt2img(sd_ctx_t* sd_ctx,
16761676
if (sd_ctx->sd->stacked_id) {
16771677
params.mem_size += static_cast<size_t>(10 * 1024 * 1024); // 10 MB
16781678
}
1679+
if (sd_ctx->sd->first_stage_model != nullptr && sd_ctx->sd->tae_first_stage != nullptr) {
1680+
params.mem_size *= 2;
1681+
}
16791682
params.mem_size += width * height * 3 * sizeof(float);
16801683
params.mem_size *= batch_count;
16811684
params.mem_buffer = NULL;

0 commit comments

Comments
 (0)