[New model] Qwen-Image-2.1 support (rebase + review follow-ups) (#8099)

Signed-off-by: NumberWan <wantszkin2003@gmail.com>
Signed-off-by: SamitHuang <285365963@qq.com>
Signed-off-by: Samit <285365963@qq.com>
Co-authored-by: Isotr0py <Isotr0py@outlook.com>
Co-authored-by: Tianyu Guo <guoty9@mail2.sysu.edu.cn>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: SamitHuang <285365963@qq.com>
Co-authored-by: Gao Han <hgaoaf@connect.ust.hk>
This commit is contained in:
authored and GitHub committed 2026-10-07 21:23:59 +08:00
1 parent 8ef77be66e
commit 3dc35694b3
52 files changed
+8058 -136

No files matched your search

+15 -2
View File
@@ -16,7 +16,7 @@ import diffusers
import huggingface_hub
import torch
from PIL import Image
from pydantic import Field, model_validator
from pydantic import model_validator
from typing_extensions import Self
from vllm.config.utils import config
from vllm.logger import init_logger
@@ -981,6 +981,19 @@ class OmniDiffusionConfig:
# Compilation
enforce_eager: bool = False
# Capture fixed-shape KV-cache decode (denoising) steps into CUDA graphs.
# Currently only Qwen-Image-2.1's transformer implements this; other models
# ignore the flag. This is a per-model diffusion path, independent of the
# AR engine's ``compilation_config.cudagraph_mode`` (which does not apply
# to diffusion stages). It stacks with ``diffusion_compile_granularity``:
# the DiT blocks are still torch.compile'd and graph capture records the
# compiled (fused) kernels, while inductor's own cudagraphs stay off.
# ``enforce_eager=True`` forces eager decode and
# disables capture regardless of this flag; unsupported configurations
# (SP/TP, ring, HSDP, dynamic LoRA, padded masks, quantized prefix KV, or
# a second in-flight request aliasing the same graph key) log and fall
# back to eager decode.
enable_cuda_graph_decode: bool = True
# Controls the generic compilation path used when a pipeline does not
# provide its own setup_compile() implementation.
diffusion_compile_granularity: str = "regional"
@@ -1140,7 +1153,7 @@ class OmniDiffusionConfig:
request_batch_max_wait_ms: float = 0.0
# Supplementary model specific parameters
extras: dict[str, Any] = Field(default_factory=dict)
extras: dict[str, Any] = field(default_factory=dict)
@property
def is_moe(self) -> bool: