Skip to content

sd: sync to master-551-99c1de3#2082

Open
wbruna wants to merge 6 commits intoLostRuins:concedo_experimentalfrom
wbruna:kcpp_sd_update_202604_1
Open

sd: sync to master-551-99c1de3#2082
wbruna wants to merge 6 commits intoLostRuins:concedo_experimentalfrom
wbruna:kcpp_sd_update_202604_1

Conversation

@wbruna
Copy link
Copy Markdown

@wbruna wbruna commented Apr 1, 2026

45 files changed, 9892 insertions(+), 9131 deletions(-)

And the only new functionality is this:

diff --git a/src/z_image.hpp b/src/z_image.hpp
index 9f17890..53a7cf8 100644
--- a/src/z_image.hpp
+++ b/src/z_image.hpp
@@ -131,7 +131,7 @@ namespace ZImage {
 
             auto x1 = w1->forward(ctx, x);
             auto x3 = w3->forward(ctx, x);
-            x       = ggml_mul(ctx->ggml_ctx, ggml_silu(ctx->ggml_ctx, x1), x3);
+            x       = ggml_swiglu_split(ctx->ggml_ctx, x1, x3);
             x       = w2->forward(ctx, x);
 
             return x;

Seems appropriate for an April 1st 🙂

@wbruna wbruna force-pushed the kcpp_sd_update_202604_1 branch from ea7f4b0 to d1d9b53 Compare April 1, 2026 13:38
@wbruna
Copy link
Copy Markdown
Author

wbruna commented Apr 2, 2026

Updated to master-551-99c1de3, which included the Euler Ancestral algorithm for flow models (#2058). Most other changes are refactors or sd-server and sd-cli features.

I've sidestepped a build issue by adding vendor/nlohmann as an include path when building sd.cpp sources. If there aren't strong reasons to not do it this way, I'll clean up the other changed includes afterwards.

@wbruna wbruna changed the title sd: sync to master-540-f16a110 sd: sync to master-551-99c1de3 Apr 2, 2026
@LostRuins
Copy link
Copy Markdown
Owner

oh my this is massive.

but i trust when you say it's mostly just linting right? i'll just do a few quick tests and then we can probably merge before the next release

@wbruna
Copy link
Copy Markdown
Author

wbruna commented Apr 2, 2026

but i trust when you say it's mostly just linting right?

Not quite. Part of it is things like removing struct from types, but the really big change was reorganizing the code to use a new Tensor class (replacing loops with higher-level operations), That commit alone changed ~7k lines. And we get that VAE reorg with it too, because the related VAE-on-CPU fix is entangled with it.

The jump from master-540 to master-551 is less disruptive: mostly replacing the big case labels on the denoiser with a function dispatch (and I did that exact refactor a few days ago, so I understand what it is doing 🙂). But if you prefer, we can get just master-540 for now, since it had more time to be tested upstream.

Oh, and master-552 will replace avi_writer.h 🙁

@wbruna wbruna force-pushed the kcpp_sd_update_202604_1 branch from 6f6098d to df69630 Compare April 3, 2026 11:17
@wbruna wbruna force-pushed the kcpp_sd_update_202604_1 branch from df69630 to d3ccd18 Compare April 3, 2026 11:19
@wbruna
Copy link
Copy Markdown
Author

wbruna commented Apr 3, 2026

Tested so far: Z-Image Turbo, Flux.2 Klein 9b, Qwen Image Edit (all working with Euler Ancestral); SD1.5, SDXL, SDXL Turbo; preloaded and dynamic LoRAs; and TAESD.

@LostRuins
Copy link
Copy Markdown
Owner

Great. I'll look into this once I get the gemma4 release out and good since people are chomping at the bit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants