fix: avoid coredump when generating large image

This commit is contained in:
leejet 2023-09-04 21:37:46 +08:00
parent cf38e238d4
commit f6ff06fcb7
2 changed files with 2 additions and 1 deletions

2
ggml

@ -1 +1 @@
Subproject commit eec8d3ca1258d1317a26fdbf561682a7dad4eb01
Subproject commit 6958cd05c72b2c9461c8b3a270e87beff651797f

View File

@ -3830,6 +3830,7 @@ std::vector<uint8_t> StableDiffusion::txt2img(const std::string& prompt,
std::vector<uint8_t> result;
struct ggml_init_params params;
params.mem_size = static_cast<size_t>(10 * 1024) * 1024; // 10M
params.mem_size += width * height * 3 * sizeof(float) * 2;
params.mem_buffer = NULL;
params.no_alloc = false;
params.dynamic = false;