Skip to content

Conversation

@nussejzz
Copy link
Contributor

@nussejzz nussejzz commented Feb 10, 2026

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:
image-20260211220459039

without cfg or disable cfg:
image-20260211220509774

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 60
image-20260211221455805

Text2img

--prompts "A woman drawing a blue dress is dancing happily"
--cfg-text-scale 3.0
image-20260211214126849


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft.

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)

@nussejzz
Copy link
Contributor Author

@princepride PTAL

@nussejzz nussejzz closed this Feb 11, 2026
@nussejzz nussejzz reopened this Feb 11, 2026
@nussejzz nussejzz force-pushed the main branch 2 times, most recently from fa0e4e4 to ba55194 Compare February 11, 2026 14:22
@nussejzz nussejzz marked this pull request as ready for review February 11, 2026 14:48
@nussejzz nussejzz changed the title [Bugfix] img2img, Image is noisy [Feature][Bugfix] Add CFG feature to Bagel Feb 11, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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".

@nussejzz
Copy link
Contributor Author

PTAL!😊❤️ @princepride @hsliuustc0106

I will revise the stage configuration and comments in a short time, taking your feedback into account!

@princepride
Copy link
Collaborator

@nussejzz Can you revert the change of load_weight

@nussejzz
Copy link
Contributor Author

@princepride Thanks for your help! I will learn from it!😊

nussejzz and others added 14 commits February 12, 2026 16:28
Signed-off-by: Ding Zuhao <[email protected]>
Signed-off-by: Ding Zuhao <[email protected]>
Signed-off-by: Ding Zuhao <[email protected]>
Removed comment about CFG parameters.

Signed-off-by: 汪志鹏 <[email protected]>
Co-authored-by: Wang Zhipeng <[email protected]>
Signed-off-by: Ding Zuhao <[email protected]>
@princepride princepride added the ready label to trigger buildkite CI label Feb 12, 2026
@princepride princepride merged commit b16965d into vllm-project:main Feb 12, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready label to trigger buildkite CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants