Skip to content

Commit 587a37b

Browse files
authored
fix: avoid sd2((non inpaint) crash on v-pred check (#537)
1 parent 4fe83d5 commit 587a37b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

stable-diffusion.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,9 @@ class StableDiffusionGGML {
606606
ggml_set_f32(timesteps, 999);
607607

608608
struct ggml_tensor* concat = is_inpaint ? ggml_new_tensor_4d(work_ctx, GGML_TYPE_F32, 8, 8, 5, 1) : NULL;
609-
ggml_set_f32(concat, 0);
609+
if (concat != NULL) {
610+
ggml_set_f32(concat, 0);
611+
}
610612

611613
int64_t t0 = ggml_time_ms();
612614
struct ggml_tensor* out = ggml_dup_tensor(work_ctx, x_t);

0 commit comments

Comments
 (0)