From ca2edf2e8cf6bf47952e901e7e6679fc0c1ca92b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20du=20Hamel?= Date: Mon, 30 Dec 2024 17:19:46 +0100 Subject: [PATCH] Fix (non inpaint) sd2 crash on v-pred check --- stable-diffusion.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stable-diffusion.cpp b/stable-diffusion.cpp index e2daf5764..b5424ad2b 100644 --- a/stable-diffusion.cpp +++ b/stable-diffusion.cpp @@ -606,7 +606,9 @@ class StableDiffusionGGML { ggml_set_f32(timesteps, 999); struct ggml_tensor* concat = is_inpaint ? ggml_new_tensor_4d(work_ctx, GGML_TYPE_F32, 8, 8, 5, 1) : NULL; - ggml_set_f32(concat, 0); + if (concat != NULL) { + ggml_set_f32(concat, 0); + } int64_t t0 = ggml_time_ms(); struct ggml_tensor* out = ggml_dup_tensor(work_ctx, x_t);