[Bugfix] Fix config misalignment between offline and online diffusion inference (Wan2.2, Qwen-Image series) (#1979)

Signed-off-by: samithuang <285365963@qq.com>
Signed-off-by: Samit <285365963@qq.com>
Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
This commit is contained in:
SamitandHongsheng Liu authored and GitHub committed 2026-03-19 16:00:26 +08:00
1 parent 81793f1918
commit 5699fe7a96
6 files changed
+40 -22

No files matched your search

@@ -95,6 +95,9 @@ def get_qwen_image_layered_pre_process_func(
else:
image = cast(PIL.Image.Image | torch.Tensor | np.ndarray, raw_image)
if isinstance(image, PIL.Image.Image) and image.mode != "RGBA":
image = image.convert("RGBA")
# 1. calculate dimensions
image_size = image.size
assert request.sampling_params.resolution in [640, 1024], (
@@ -652,6 +655,8 @@ the image\n<|vision_start|><|image_pad|><|vision_end|><|im_end|>\n<|im_start|>as
width = req.sampling_params.width
else:
# fallback to run pre-processing in pipeline (debug only)
if isinstance(image, PIL.Image.Image) and image.mode != "RGBA":
image = image.convert("RGBA")
image_size = image[0].size if isinstance(image, list) else image.size
assert resolution in [640, 1024], f"resolution must be either 640 or 1024, but got {resolution}"
calculated_width, calculated_height = calculate_dimensions(