Skip to content

Comments

[BugFix] Fix noisy output without setting a seed in Qwen Image#1043

Merged
hsliuustc0106 merged 1 commit intovllm-project:mainfrom
natureofnature:bugfix/959
Jan 29, 2026
Merged

[BugFix] Fix noisy output without setting a seed in Qwen Image#1043
hsliuustc0106 merged 1 commit intovllm-project:mainfrom
natureofnature:bugfix/959

Conversation

@natureofnature
Copy link
Contributor

@natureofnature natureofnature commented Jan 29, 2026

PLEASE FILL IN THE PR DESCRIPTION HERE ENSURING ALL CHECKLIST ITEMS (AT THE BOTTOM) HAVE BEEN CONSIDERED.

Purpose

Fix #959
Reason: Without specifying a random seed, the random noise in multiprocessing/distributed environments may not be correctly synchronized.
Methods: add default random seed to api server

Test Plan

Test Result

from openai import OpenAI

import base64
import os
from datetime import datetime
client = OpenAI(base_url="http://localhost:40021/v1", api_key="none")

response = client.images.generate(
    model="/home/natureofnature/models/Qwen-Image-2512/",
    prompt="a horse jumping over a fence nearby a babbling brook",
    n=1,
    size="1024x1024",
    response_format="b64_json",
)

for idx, image in enumerate(response.data):
    image_data = base64.b64decode(image.b64_json)
    
    timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
    filename = f"generated_image_{timestamp}_{idx}.png"
    
    with open(filename, "wb") as f:
        f.write(image_data)
    
    print(f"Image saved to: {filename}")
image
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)

Signed-off-by: natureofnature <wzliu@connect.hku.hk>
@david6666666
Copy link
Collaborator

LGTM

@hsliuustc0106 hsliuustc0106 added the ready label to trigger buildkite CI label Jan 29, 2026
@hsliuustc0106 hsliuustc0106 merged commit 8306c91 into vllm-project:main Jan 29, 2026
7 checks passed
dongbo910220 pushed a commit to dongbo910220/vllm-omni that referenced this pull request Feb 1, 2026
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.

[Bug]: OpenAI compatible API produced a completely noisy image in qwen-image.

3 participants