[Bugfix] Fix washed-out LingBot Video outputs (#7037)

Signed-off-by: wtz2333 <2955110911@qq.com>
Co-authored-by: Yuanheng Zhao <54058983+yuanheng-zhao@users.noreply.github.com>
This commit is contained in:
wtz2333andYuanheng Zhao authored and GitHub committed 2026-10-02 03:57:50 +00:00
1 parent bbee488da3
commit 68003cf6ad
2 files changed
+45 -6

No files matched your search

@@ -288,13 +288,13 @@ def get_lingbot_video_post_process_func(od_config: OmniDiffusionConfig):
output_key = output_keys[0]
frames = frames[output_key]
output_type = getattr(sampling_params, "output_type", None) or "pt"
# The image serving path currently accepts PIL images or NumPy arrays,
# while LingBot decodes T2I outputs to tensors. Keep that compatibility
# conversion without discarding the model's image/video payload key.
# Decoded LingBot pixels are already in [0, 1]. The video API treats
# floating tensors as [-1, 1], so use its NumPy path to avoid normalizing
# twice. Images also need NumPy for serving; keep latent tensors intact.
if (
isinstance(frames, torch.Tensor)
and output_type != "latent"
and (output_type == "np" or output_key == "image")
and (output_type == "np" or output_key in {"image", "video"})
):
frames = frames.float().cpu().numpy()
return {output_key: frames} if output_key is not None else frames