Skip to content

Commit f6ff06f

Browse files
committed
fix: avoid coredump when generating large image
1 parent cf38e23 commit f6ff06f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

ggml

Submodule ggml updated 1 file

stable-diffusion.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3830,6 +3830,7 @@ std::vector<uint8_t> StableDiffusion::txt2img(const std::string& prompt,
38303830
std::vector<uint8_t> result;
38313831
struct ggml_init_params params;
38323832
params.mem_size = static_cast<size_t>(10 * 1024) * 1024; // 10M
3833+
params.mem_size += width * height * 3 * sizeof(float) * 2;
38333834
params.mem_buffer = NULL;
38343835
params.no_alloc = false;
38353836
params.dynamic = false;

0 commit comments

Comments
 (0)