You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HunyuanVideo 1.5 I2V image conditioning preprocessed at latent resolution instead of pixel resolution #13439
While working on the modular pipeline for HunyuanVideo 1.5 (#13389), I found a bug in prepare_cond_latents_and_mask in pipeline_hunyuan_video1_5_image2video.py.
Line 614 shadows the pixel height/width parameters with latent dims from latents.shape:
_get_image_latents then calls image_processor.preprocess(image, height=height, width=width) with latent dims (e.g. 30x44 instead of 480x704). After snapping to the nearest vae_scale_factor (16) multiple, the image gets resized to ~16x32 pixels before VAE encoding, producing a ~1x2 latent instead of the expected 30x44.
The original Tencent implementation (HunyuanVideo-1.5) resizes at pixel resolution before encoding.
I will open a pr for this
Reproduction
fromdiffusers.pipelines.hunyuan_video1_5.pipeline_hunyuan_video1_5_image2videoimportHunyuanVideo15ImageToVideoPipelineimportinspect# Line 614 of prepare_cond_latents_and_mask shadows pixel height/width with latent dimssource=inspect.getsource(HunyuanVideo15ImageToVideoPipeline.prepare_cond_latents_and_mask)
# "batch, channels, frames, height, width = latents.shape" overwrites the pixel h/w paramsassert"batch, channels, frames, height, width = latents.shape"insourceprint("height/width parameters are shadowed by latent dims from latents.shape")
Activity