From 6479bd425352a8047befe16047eb1fb7bdcc1d43 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Sat, 6 Jun 2026 13:43:17 +0000 Subject: [PATCH] feat(stablediffusion-ggml): support Ideogram4 unconditional diffusion model Bump stable-diffusion.cpp from 1f9ee88 to b9254dd, the upstream commit that adds Ideogram4 support (leejet/stable-diffusion.cpp#1609). Ideogram4 derives its classifier-free guidance from a separate unconditional diffusion model, exposed upstream through the new sd_ctx_params_t.uncond_diffusion_model_path field. Wire that field into the gosd wrapper via a new uncond_diffusion_model_path option. The _path suffix is deliberate: the Go loader only resolves options whose name contains "path" to an absolute path under the model directory, so this keeps the option consistent with diffusion_model_path and high_noise_diffusion_model_path. Signed-off-by: Ettore Di Giacinto Assisted-by: Claude:claude-opus-4-8 [Claude Code] --- backend/go/stablediffusion-ggml/Makefile | 2 +- backend/go/stablediffusion-ggml/cpp/gosd.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/go/stablediffusion-ggml/Makefile b/backend/go/stablediffusion-ggml/Makefile index c7cb92256..92ef9eae0 100644 --- a/backend/go/stablediffusion-ggml/Makefile +++ b/backend/go/stablediffusion-ggml/Makefile @@ -8,7 +8,7 @@ JOBS?=$(shell nproc --ignore=1) # stablediffusion.cpp (ggml) STABLEDIFFUSION_GGML_REPO?=https://github.com/leejet/stable-diffusion.cpp -STABLEDIFFUSION_GGML_VERSION?=1f9ee88e09c258053fa59d5e05e23dfb10fa0b13 +STABLEDIFFUSION_GGML_VERSION?=b9254dda0d10b91ee6f17fb7f4420097dd29824b CMAKE_ARGS+=-DGGML_MAX_NAME=128 diff --git a/backend/go/stablediffusion-ggml/cpp/gosd.cpp b/backend/go/stablediffusion-ggml/cpp/gosd.cpp index 3fa0f7063..607d3354c 100644 --- a/backend/go/stablediffusion-ggml/cpp/gosd.cpp +++ b/backend/go/stablediffusion-ggml/cpp/gosd.cpp @@ -386,6 +386,7 @@ int load_model(const char *model, char *model_path, char* options[], int threads const char *llm_vision_path = ""; const char *diffusion_model_path = stableDiffusionModel; const char *high_noise_diffusion_model_path = ""; + const char *uncond_diffusion_model_path = ""; const char *taesd_path = ""; const char *control_net_path = ""; const char *embedding_dir = ""; @@ -472,6 +473,7 @@ int load_model(const char *model, char *model_path, char* options[], int threads if (!strcmp(optname, "llm_vision_path")) llm_vision_path = strdup(optval); if (!strcmp(optname, "diffusion_model_path")) diffusion_model_path = strdup(optval); if (!strcmp(optname, "high_noise_diffusion_model_path")) high_noise_diffusion_model_path = strdup(optval); + if (!strcmp(optname, "uncond_diffusion_model_path")) uncond_diffusion_model_path = strdup(optval); if (!strcmp(optname, "taesd_path")) taesd_path = strdup(optval); if (!strcmp(optname, "control_net_path")) control_net_path = strdup(optval); if (!strcmp(optname, "embedding_dir")) { @@ -571,6 +573,7 @@ int load_model(const char *model, char *model_path, char* options[], int threads ctx_params.llm_vision_path = llm_vision_path; ctx_params.diffusion_model_path = diffusion_model_path; ctx_params.high_noise_diffusion_model_path = high_noise_diffusion_model_path; + ctx_params.uncond_diffusion_model_path = uncond_diffusion_model_path; ctx_params.vae_path = vae_path; ctx_params.audio_vae_path = audio_vae_path; ctx_params.embeddings_connectors_path = embeddings_connectors_path;