From b247581782ef8db26917ed525650902429fdc3bd Mon Sep 17 00:00:00 2001 From: leejet Date: Mon, 4 Sep 2023 03:50:42 +0800 Subject: [PATCH] fix: insufficient memory error on macOS --- stable-diffusion.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stable-diffusion.cpp b/stable-diffusion.cpp index 0cefead..a8e2f98 100644 --- a/stable-diffusion.cpp +++ b/stable-diffusion.cpp @@ -3222,8 +3222,8 @@ class StableDiffusionGGML { struct ggml_tensor* hidden_states = cond_stage_model.text_model.forward(ctx, input_ids); - struct ggml_cgraph* cond_graph = ggml_build_forward_ctx(ctx, hidden_states); - struct ggml_cplan cplan = ggml_graph_plan(cond_graph, n_threads); + struct ggml_cgraph cond_graph = ggml_build_forward(hidden_states); + struct ggml_cplan cplan = ggml_graph_plan(&cond_graph, n_threads); ctx_size += cplan.work_size; ctx_size += ggml_used_mem(ctx) + ggml_used_mem_of_data(ctx);