Skip to content

fix: SD3 conditioning crash when clip_l text encoder is missing#1638

Open
Detensable wants to merge 1 commit into
leejet:masterfrom
Detensable:fix-sd3-no-text-encoder-crash
Open

fix: SD3 conditioning crash when clip_l text encoder is missing#1638
Detensable wants to merge 1 commit into
leejet:masterfrom
Detensable:fix-sd3-no-text-encoder-crash

Conversation

@Detensable

@Detensable Detensable commented Jun 11, 2026

Copy link
Copy Markdown

(Fixes #1631)

Running an SD3/SD3.5 model without text encoders (e.g. sd-cli -m sd3.5_large.gguf --steps 1) crashes during conditioning. It's supposed to fall back to a zero conditioning and still generate, and that's why SDXL and the others are fine and this is SD3-specific.

In get_learned_condition_common, the zero-fill branch for a missing clip_l writes to pooled instead of pooled_l:

pooled = sd::Tensor<float>::zeros({768, 1});   // should be pooled_l

The clip_g branch right below it correctly sets pooled_g, so clip_l was the odd one out. Because pooled_l never gets set, the later pooled = concat(pooled_l, pooled_g) concatenates an empty tensor and crashes. (The write to pooled was dead anyway, that concat overwrites it.)

Literal one-line fix: pooledpooled_l.

Introduced by #1373, which the reporter confirmed with a bisect. Compiles cleanly. I didn't do a full generation run since that needs the ~5GB SD3.5 weights, and wasn't tryna do that, but the fix just restores the intended zero-fallback and matches the working clip_g branch beside it.

Running SD3/SD3.5 without text encoders crashes during conditioning instead of falling back to zero conditioning. In get_learned_condition_common the missing-clip_l branch sets `pooled` instead of `pooled_l`, so pooled_l stays empty and the later concat(pooled_l, pooled_g) crashes. The clip_g branch right below sets pooled_g correctly.

Introduced by leejet#1373.

Fixes leejet#1631

Signed-off-by: Wyatt Caldwell <218154709+Detensable@users.noreply.github.com>
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.

[Bug] Crash in case of incomplete command line (sd-cli + SD3.5)

1 participant