-
Notifications
You must be signed in to change notification settings - Fork 99
[Model] [WIP] Add Flux2 Model support #210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: zjy0516 <[email protected]>
Signed-off-by: zjy0516 <[email protected]>
Signed-off-by: zjy0516 <[email protected]>
Signed-off-by: zjy0516 <[email protected]>
Signed-off-by: samithuang <[email protected]>
Signed-off-by: samithuang <[email protected]>
Signed-off-by: samithuang <[email protected]>
Signed-off-by: samithuang <[email protected]>
Signed-off-by: samithuang <[email protected]>
Signed-off-by: samithuang <[email protected]>
Signed-off-by: zjy0516 <[email protected]>
Signed-off-by: zjy0516 <[email protected]>
Signed-off-by: zjy0516 <[email protected]>
Signed-off-by: zjy0516 <[email protected]>
Signed-off-by: Prajwal A <[email protected]>
|
Pending tasks
|
|
cc: @hsliuustc0106 @ZJY0516 |
vllm_omni/diffusion/__init__.py
Outdated
| @@ -1,0 +1,10 @@ | |||
| # SPDX-License-Identifier: Apache-2.0 | |||
| # SPDX-FileCopyrightText: Copyright contributors to the vLLM project | |||
| """Diffusion model support for vllm-omni.""" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this?
| """Load transformer weights.""" | ||
| self.load_transformer() | ||
|
|
||
| def load_transformer(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use weight loader introduced in #157
|
|
||
| import torch | ||
| import torch.nn as nn | ||
| from diffusers.models.attention_dispatch import dispatch_attention_fn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use attention layer introduced in #115
| rope_theta: int = 2000, | ||
| eps: float = 1e-6, | ||
| ): | ||
| super().__init__() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please try to read some properties from od_config.tf_model_config like
vllm-omni/vllm_omni/diffusion/models/qwen_image/qwen_image_transformer.py
Lines 502 to 503 in c45cdea
| model_config = od_config.tf_model_config | |
| num_layers = model_config.num_layers |
Because we may use a little model with less layers to test in ci
Signed-off-by: Prajwal A <[email protected]>
Signed-off-by: Prajwal A <[email protected]>
- Resolved conflicts in registry.py by keeping both Flux2Pipeline and QwenImageEditPipeline - Resolved conflicts in z_image_transformer.py by removing duplicate Attention import - Includes latest changes from main: CI tests, new examples, model loader refactor
Signed-off-by: Prajwal A <[email protected]>
- Replace deprecated typing.Tuple/Dict/List with tuple/dict/list - Fix ambiguous variable name 'l' to 'layer_dim' - Remove unused variables batch_size and img_seq_len - Add TYPE_CHECKING import for OmniDiffusionConfig Signed-off-by: Prajwal A <[email protected]>
- Remove obsolete comments about local diffusers repo - Remove reference to deleted __init__.py file - All imports are now using standard diffusers package Signed-off-by: Prajwal A <[email protected]>
Add Flux 2.0 diffusion model support
Refer issue: #153
Purpose
Add support for Flux 2.0 text-to-image diffusion model with dual-stream (8 blocks) + single-stream (48 blocks) transformer architecture.
Key components:
VLLM_OMNI_DIFFUSERS_PATHenvironment variable supportFiles added:
vllm_omni/diffusion/models/flux2/(transformer and pipeline)__init__.pyTest Plan
Test Result
WIP
Checklist
supported_models.mdfor Flux 2.0