Skip to content

sd: sync to master-560-e8323ca#2082

Merged
LostRuins merged 10 commits intoLostRuins:concedo_experimentalfrom
wbruna:kcpp_sd_update_202604_1
Apr 9, 2026
Merged

sd: sync to master-560-e8323ca#2082
LostRuins merged 10 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 2 times, most recently 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

@wbruna
Copy link
Copy Markdown
Author

wbruna commented Apr 5, 2026

Hold on, the image mask is being ignored.

Edit: working on master-529 (current), broken on master-540.

@wbruna wbruna marked this pull request as draft April 5, 2026 12:24
@wbruna wbruna force-pushed the kcpp_sd_update_202604_1 branch from d3ccd18 to fdf4121 Compare April 5, 2026 14:08
@wbruna
Copy link
Copy Markdown
Author

wbruna commented Apr 5, 2026

I think I was able to fix it: leejet/stable-diffusion.cpp#1390 .

I've applied a similar local fix for now (f4a1997), in case you want to merge this before upstream.

Edit: another fix got merged upstream; I'll overwrite mine in the next sync.

@wbruna wbruna marked this pull request as ready for review April 5, 2026 14:31
@wbruna wbruna force-pushed the kcpp_sd_update_202604_1 branch from fdf4121 to e9a06f9 Compare April 6, 2026 11:51
@wbruna wbruna changed the title sd: sync to master-551-99c1de3 sd: sync to master-555-7397dda Apr 6, 2026
@wbruna
Copy link
Copy Markdown
Author

wbruna commented Apr 6, 2026

Updated to master-555-7397dda, getting the image mask fix. Since the main API hasn't changed, I've just kept the local avi_writer.h for now; we can refactor it after merging this PR.

@LostRuins
Copy link
Copy Markdown
Owner

now that gemma 4 is finally mostly stable ill try to get this merged in the next 1 or 2 days

@wbruna wbruna force-pushed the kcpp_sd_update_202604_1 branch from e9a06f9 to 1872186 Compare April 7, 2026 00:21
@wbruna
Copy link
Copy Markdown
Author

wbruna commented Apr 7, 2026

Rebased, and updated to master-558-8afbeb6, which only changed examples code.

@wbruna wbruna changed the title sd: sync to master-555-7397dda sd: sync to master-558-8afbeb6 Apr 7, 2026
@wbruna wbruna force-pushed the kcpp_sd_update_202604_1 branch from 1872186 to 5588cb0 Compare April 9, 2026 00:12
@wbruna
Copy link
Copy Markdown
Author

wbruna commented Apr 9, 2026

Updated to master-560-e8323ca, getting a scheduler fix and support for the Flux.2 small decoder. Both seem to be working fine.

@wbruna wbruna changed the title sd: sync to master-558-8afbeb6 sd: sync to master-560-e8323ca Apr 9, 2026
@LostRuins
Copy link
Copy Markdown
Owner

Sorry for the delays.
Tested SD1.5, Qwen Edit, Qwen Image and Z-Image, all ok. merging.

@LostRuins LostRuins merged commit f371bb1 into LostRuins:concedo_experimental Apr 9, 2026
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