From eefb504f843a1fb856a77ad399b4c34e49eeb4f0 Mon Sep 17 00:00:00 2001 From: Aleksi Vesanto Date: Tue, 24 Mar 2026 14:17:33 +0200 Subject: [PATCH] [diffusion] model: Fix FLUX.1 output correctness (#21041) Co-authored-by: Mick --- python/sglang/multimodal_gen/runtime/pipelines/flux.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/sglang/multimodal_gen/runtime/pipelines/flux.py b/python/sglang/multimodal_gen/runtime/pipelines/flux.py index 371e1c44e..80cd8fe8a 100644 --- a/python/sglang/multimodal_gen/runtime/pipelines/flux.py +++ b/python/sglang/multimodal_gen/runtime/pipelines/flux.py @@ -38,7 +38,9 @@ def prepare_mu(batch: Req, server_args: ServerArgs): vae_scale_factor = ( server_args.pipeline_config.vae_config.arch_config.vae_scale_factor ) - image_seq_len = (int(height) // vae_scale_factor) * (int(width) // vae_scale_factor) + image_seq_len = (int(height) // (vae_scale_factor * 2)) * ( + int(width) // (vae_scale_factor * 2) + ) mu = calculate_shift( image_seq_len,