[Feature][Bugfix] Add CFG feature to Bagel#1310
Merged
princepride merged 15 commits intovllm-project:mainfrom Feb 12, 2026
Merged
[Feature][Bugfix] Add CFG feature to Bagel#1310princepride merged 15 commits intovllm-project:mainfrom
princepride merged 15 commits intovllm-project:mainfrom
Conversation
Contributor
Author
|
@princepride PTAL |
fa0e4e4 to
ba55194
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ba551948a9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Contributor
Author
|
PTAL!😊❤️ @princepride @hsliuustc0106 I will revise the stage configuration and comments in a short time, taking your feedback into account! |
princepride
requested changes
Feb 12, 2026
Collaborator
|
@nussejzz Can you revert the change of load_weight |
Contributor
Author
|
@princepride Thanks for your help! I will learn from it!😊 |
Signed-off-by: Ding Zuhao <e1583181@u.nus.edu>
Signed-off-by: Ding Zuhao <e1583181@u.nus.edu>
Signed-off-by: Ding Zuhao <e1583181@u.nus.edu>
Signed-off-by: Ding Zuhao <e1583181@u.nus.edu>
Signed-off-by: Ding Zuhao <e1583181@u.nus.edu>
Signed-off-by: Ding Zuhao <e1583181@u.nus.edu>
…er logic Signed-off-by: Ding Zuhao <e1583181@u.nus.edu>
Signed-off-by: Ding Zuhao <e1583181@u.nus.edu>
Removed comment about CFG parameters. Signed-off-by: 汪志鹏 <wangzhipeng628@gmail.com>
Signed-off-by: 汪志鹏 <wangzhipeng628@gmail.com>
Signed-off-by: 汪志鹏 <wangzhipeng628@gmail.com>
Signed-off-by: 汪志鹏 <wangzhipeng628@gmail.com>
Co-authored-by: Wang Zhipeng <wangzhipeng628@gmail.com> Signed-off-by: Ding Zuhao <e1583181@u.nus.edu>
princepride
approved these changes
Feb 12, 2026
YanickSchraner
pushed a commit
to YanickSchraner/vllm-omni
that referenced
this pull request
Feb 20, 2026
Signed-off-by: Ding Zuhao <e1583181@u.nus.edu> Signed-off-by: 汪志鹏 <wangzhipeng628@gmail.com> Co-authored-by: 汪志鹏 <wangzhipeng628@gmail.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.
PLEASE FILL IN THE PR DESCRIPTION HERE ENSURING ALL CHECKLIST ITEMS (AT THE BOTTOM) HAVE BEEN CONSIDERED.
Purpose
This PR fixes the noisy image issue in img2img generation by implementing Classifier-Free Guidance (CFG) for both text and image conditions.
#1047
Key Changes:
✅ Implemented dual CFG support (text CFG + image CFG) in Bagel transformer
✅ Added configurable CFG scales via command-line arguments (--cfg-text-scale, --cfg-img-scale)
✅ Improved image resizing logic to ensure proper stride alignment
✅ Refactored weight loading logic for better compatibility
Test Plan
The four modes of offline inference were run, with a focus on comparing the changes in image editing and text-based image tasks.
Test Result
It ran successfully, and the quality of the generated images has been greatly improved.
Image Edit
prompt: "let the dog open half of its eyes"
original:

without cfg or disable cfg:

with cfg:

python end2end.py --modality img2img --image-path puppy.jpg --prompts "let the dog open half of its eyes" --cfg-text-scale 3.0 --cfg-img-scale 1.2 --steps 60Text2img
--prompts "A woman drawing a blue dress is dancing happily"

--cfg-text-scale 3.0
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.BEFORE SUBMITTING, PLEASE READ https://github.com/vllm-project/vllm-omni/blob/main/CONTRIBUTING.md (anything written below this line will be removed by GitHub Actions)