Skip to content

Commit ef7c98a

Browse files
committed
fix: avoid sd2((non inpaint) crash on v-pred check (leejet#537)
1 parent 6de3ca3 commit ef7c98a

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
@@ -608,7 +608,9 @@ class StableDiffusionGGML {
608608
ggml_set_f32(timesteps, 999);
609609

610610
struct ggml_tensor* concat = is_inpaint ? ggml_new_tensor_4d(work_ctx, GGML_TYPE_F32, 8, 8, 5, 1) : NULL;
611-
ggml_set_f32(concat, 0);
611+
if (concat != NULL) {
612+
ggml_set_f32(concat, 0);
613+
}
612614

613615
int64_t t0 = ggml_time_ms();
614616
struct ggml_tensor* out = ggml_dup_tensor(work_ctx, x_t);

0 commit comments

Comments
 (0)