feat: run conditional and unconditional CFG in one batched UNet forward (#2085)

This commit is contained in:
Daniele authored and GitHub committed 2026-10-10 23:35:58 +08:00
1 parent b7a74e68d7
commit 1b0ba10893
7 files changed
+148 -23

No files matched your search

+3 -1
View File
@@ -587,7 +587,9 @@ public:
label_emb = ggml_silu_inplace(ctx->ggml_ctx, label_emb);
label_emb = label_embed_2->forward(ctx, label_emb); // [N, time_embed_dim]
emb = ggml_add(ctx->ggml_ctx, emb, label_emb); // [N, time_embed_dim]
emb = label_emb->ne[1] > emb->ne[1]
? ggml_add(ctx->ggml_ctx, label_emb, emb)
: ggml_add(ctx->ggml_ctx, emb, label_emb); // [N, time_embed_dim]
}
// sd::ggml_graph_cut::mark_graph_cut(emb, "unet.prelude", "emb");