Skip to content

[Diffusion] Detect Flux2 custom VAE path from component_paths#19170

Merged
mickqian merged 3 commits intosgl-project:mainfrom
ChangyiYang:diffusion-fix-vae-path-component-detection
Feb 23, 2026
Merged

[Diffusion] Detect Flux2 custom VAE path from component_paths#19170
mickqian merged 3 commits intosgl-project:mainfrom
ChangyiYang:diffusion-fix-vae-path-component-detection

Conversation

@ChangyiYang
Copy link
Copy Markdown
Contributor

Motivation

--vae-path is parsed as a dynamic component override and stored in component_paths["vae"].

For flux_2_t2i_customized_vae_path, pipeline selection in PipelineConfig.from_kwargs() only checked vae_path, so it missed the custom VAE case and did not switch to Flux2FinetunedPipelineConfig. This led to incorrect decode scaling for fal/FLUX.2-Tiny-AutoEncoder and visibly washed-out outputs.

Modification

  • In PipelineConfig.from_kwargs(), when vae_path is not provided, also read component_paths["vae"] (including prefixed kwargs).
  • Keep existing Flux2 finetuned/tiny VAE detection logic unchanged, but feed it the resolved VAE path from either source.

This makes --vae-path and explicit vae_path behave consistently during pipeline config selection.

@github-actions github-actions bot added the diffusion SGLang Diffusion label Feb 23, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @ChangyiYang, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses an issue where custom VAE paths, when passed via component_paths, were not being correctly recognized during pipeline configuration selection for Flux2 models. The changes enhance the VAE path resolution mechanism in PipelineConfig.from_kwargs() to ensure consistency between explicitly provided vae_path arguments and those dynamically stored in component_paths, thereby preventing visual degradation in generated outputs.

Highlights

  • VAE Path Resolution: Modified PipelineConfig.from_kwargs() to correctly detect custom VAE paths stored within component_paths["vae"] when vae_path is not directly provided.
  • Flux2 VAE Detection: Ensured that the existing Flux2 finetuned/tiny VAE detection logic now utilizes the newly resolved VAE path, preventing incorrect decode scaling and visual artifacts for models like fal/FLUX.2-Tiny-AutoEncoder.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • python/sglang/multimodal_gen/configs/pipeline_configs/base.py
    • Improved VAE path detection logic to include component_paths.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The changes correctly implement the logic to detect custom VAE paths from component_paths when vae_path is not directly provided. This ensures consistent behavior for pipeline configuration selection, addressing the issue of incorrect decode scaling for Flux2 models. The code is clear and functionally sound.

@mickqian
Copy link
Copy Markdown
Collaborator

/tag-and-rerun-ci

@mickqian mickqian merged commit c3c1532 into sgl-project:main Feb 23, 2026
64 of 65 checks passed
xiaobaicxy added a commit to xiaobaicxy/sglang that referenced this pull request Feb 24, 2026
…o xverse_moe

* 'xverse_moe' of https://github.com/xiaobaicxy/sglang: (275 commits)
  fix: add missing blank line after docstring in serving_transcription.py (sgl-project#19206)
  Whisper model support & `/v1/audio/transcriptions` endpoint & benchmark (sgl-project#16983)
  fix: patch docker image fixes (sgl-project#19100)
  [PD-Disagg] Unify prefill info data transition flow, all with `PrefillServerInfo` (sgl-project#19195)
  [CI] Tiny enhance the dp attention load blance benchmark (sgl-project#19194)
  add new ci user (sgl-project#19133)
  [CI] fix the teardown output of disaggregation test (sgl-project#19193)
  [PD-Disagg] Support query dp rank from bootstrap server. (sgl-project#19168)
  [Kernel Slimming] Migrate AWQ marlin repack kernel to JIT (sgl-project#18949)
  [Diffusion] Match rotary_embedding module name style (sgl-project#19179)
  [Refactor] Split rotary_embedding.py into a modular package (sgl-project#19144)
  [NPU] bump sgl-kernel-npu to 2026.02.01.post2 (sgl-project#19178)
  Use single mma warp group for short q_len in FA to optimize decoding performance (sgl-project#18985)
  Reorganize topk logic to clean up code and expose logical experts (sgl-project#16945)
  [ROCm] Use unreg path for custom all-reduce during CUDA graph capture (sgl-project#19162)
  [diffusion] feat: detect Flux2 custom VAE path from component_paths (sgl-project#19170)
  [AMD] ENV flags tuning and cleanup (sgl-project#19176)
  Fix bench_one_batch_server by moving the print statements (sgl-project#19175)
  Update rocm7.2 Dockerfile to install amdsmi for QuickReduce Initialization (sgl-project#19091)
  Revert "Refactor graph input buffers (sgl-project#18991)" (sgl-project#19173)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

diffusion SGLang Diffusion run-ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants