Skip to content

Remove unneeded flux2 text encoder float cast before quantization - #135

Merged
stikves merged 1 commit into
apple:mainfrom
kevchengcodes:flux2_text_encoder_precision
Jul 31, 2026
Merged

Remove unneeded flux2 text encoder float cast before quantization#135
stikves merged 1 commit into
apple:mainfrom
kevchengcodes:flux2_text_encoder_precision

Conversation

@kevchengcodes

Copy link
Copy Markdown
Contributor

Summary

In the FLUX2 export pipeline, we forced the text encoder to be float32 cast before compression/conversion. This was done to ensure text encoder parity during earlier seed builds, but it is no longer needed. We still get high parity and good image quality without this cast.

Motivation

Removing this allows the text encoder to default to float16 (like the other components) during this part of the export. This drastically reduces the memory pressure during model load/runtime. On a MacBook, the peak memory footprint dropped by almost 50%. On an iPhone/iPad, it also drops a significant amount.

Validation

Text encoder parity looked good, and image quality remained high.

Before this PR:
image

With this PR:
image

@kevchengcodes
kevchengcodes requested a review from stikves July 31, 2026 20:22
@kevchengcodes kevchengcodes self-assigned this Jul 31, 2026
@stikves
stikves merged commit c7421ba into apple:main Jul 31, 2026
3 checks passed
@kevchengcodes
kevchengcodes deleted the flux2_text_encoder_precision branch July 31, 2026 21:58
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.

4 participants