[diffusion] model: Fix FLUX.1 output correctness#21041
Merged
sglang-npu-bot merged 2 commits intosgl-project:mainfrom Mar 24, 2026
Merged
[diffusion] model: Fix FLUX.1 output correctness#21041sglang-npu-bot merged 2 commits intosgl-project:mainfrom
sglang-npu-bot merged 2 commits intosgl-project:mainfrom
Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Collaborator
|
excellent, could you attach the result of diffusers as well? |
Contributor
Author
|
Hi, there's still a small difference between SGL-D and diffusers output: However, the quality seems to be on par here, i.e. no longer a "blocky" image and can generate 2kx2k images, just a bit different image. Still some discrepancies in the implemention, I wager. Seems like the modification 2) was already fixed in #20679, I'll remove it from my PR. |
1bad8fe to
6dd8f1d
Compare
Collaborator
|
/tag-and-rerun-ci |
Collaborator
|
/tag-and-rerun-ci |
Collaborator
|
/tag-and-rerun-ci |
Collaborator
|
/rerun-failed-ci |
1 similar comment
Collaborator
|
/rerun-failed-ci |
Collaborator
|
I merged it as Mick approved and all CIs passed |
adityavaid
pushed a commit
to adityavaid/sglang
that referenced
this pull request
Mar 24, 2026
Co-authored-by: Mick <mickjagger19@icloud.com>
adityavaid
pushed a commit
to adityavaid/sglang
that referenced
this pull request
Mar 24, 2026
Co-authored-by: Mick <mickjagger19@icloud.com>
0-693
pushed a commit
to 0-693/sglang
that referenced
this pull request
Mar 25, 2026
Co-authored-by: Mick <mickjagger19@icloud.com>
johnnycxm
pushed a commit
to johnnycxm/sglang
that referenced
this pull request
Mar 25, 2026
Co-authored-by: Mick <mickjagger19@icloud.com>
johnnycxm
pushed a commit
to johnnycxm/sglang
that referenced
this pull request
Mar 25, 2026
Co-authored-by: Mick <mickjagger19@icloud.com>
JustinTong0323
pushed a commit
to JustinTong0323/sglang
that referenced
this pull request
Apr 7, 2026
Co-authored-by: Mick <mickjagger19@icloud.com>
yhyang201
pushed a commit
to yhyang201/sglang
that referenced
this pull request
Apr 22, 2026
Co-authored-by: Mick <mickjagger19@icloud.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.

Motivation
Currently FLUX.1-dev has two correctness issues that deteriorate the output quality. This can be seen as a blocky output image and the inability to generate higher resolution (2048 * 2048) images that it should be able to. This PR adds fixes to the two issues, improving the output quality significantly.
Modifications
muvalues are too big, pushing sigma values to 1.0 incorrectly.2. Change the self-attention to not replicate the un-sharded text tokens. This now follows how it is done with FLUX.2, for example.Already fixed in [diffusion] fix: fix accuracy for some image models #20679Accuracy Tests
Without fixes:
1 GPU:
Run command:
8 GPUs:
Run command:
8 GPUs (2048x2048):
Run command:
With fixes:
1 GPU:
Run command:
8 GPUs:
Run command:
8 GPUs (2048x2048):
Run command:
Benchmarking and Profiling
Checklist
Review Process
/tag-run-ci-label,/rerun-failed-ci,/tag-and-rerun-ci