Skip to content

Conversation

@vanDuven
Copy link

@vanDuven vanDuven commented Dec 8, 2025

This PR improves FP16 stability for Z-Image by using scaling instead of clamping.

Because the tensor passes through Linear and RMSNorm, the fp16 tensor can be scaled down to prevent overflow.
The scale value(2^x) is based on testing.
No noticeable impact on inference speed.
Tested with: Z-Image and Lumina 2.

The clamp_fp16 function can be safely removed or stay just in case.
workflow.json
comparison_result

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.

1 participant