fix: SD3 conditioning crash when clip_l text encoder is missing#1638
Open
Detensable wants to merge 1 commit into
Open
fix: SD3 conditioning crash when clip_l text encoder is missing#1638Detensable wants to merge 1 commit into
Detensable wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(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 missingclip_lwrites topooledinstead ofpooled_l:The
clip_gbranch right below it correctly setspooled_g, soclip_lwas the odd one out. Becausepooled_lnever gets set, the laterpooled = concat(pooled_l, pooled_g)concatenates an empty tensor and crashes. (The write topooledwas dead anyway, that concat overwrites it.)Literal one-line fix:
pooled→pooled_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_gbranch beside it.