[HunyuanVideo1.5] support step-distilled#12802
Merged
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
sayakpaul
approved these changes
Dec 8, 2025
| ) | ||
| converted_state_dict["time_embed.timestep_embedder.linear_2.bias"] = original_state_dict.pop("time_in.mlp.2.bias") | ||
|
|
||
| if config.use_meanflow: |
Member
There was a problem hiding this comment.
Maybe slightly better?
Suggested change
| if config.use_meanflow: | |
| if config is not None and getattr(config, "use_meanflow", False): |
| self.time_proj_r = None | ||
| self.timestep_embedder_r = None | ||
| if use_meanflow: | ||
| self.time_proj_r = Timesteps(num_channels=256, flip_sin_to_cos=True, downscale_freq_shift=0) |
Member
There was a problem hiding this comment.
(nit): Maybe time_proj_meanflow and timestep_embedder_meanflow are better names?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
adding support for https://huggingface.co/tencent/HunyuanVideo-1.5/tree/main/transformer/480p_i2v_step_distilled
import torch dtype = torch.bfloat16 device = "cuda:0" from diffusers import HunyuanVideo15ImageToVideoPipeline, attention_backend from diffusers.utils import export_to_video, load_image pipe = HunyuanVideo15ImageToVideoPipeline.from_pretrained("hunyuanvideo-community/HunyuanVideo-1.5-Diffusers-480p_i2v_step_distilled", torch_dtype=dtype) pipe.enable_model_cpu_offload() pipe.vae.enable_tiling() generator = torch.Generator(device=device).manual_seed(1) image = load_image("https://huggingface.co/datasets/YiYiXu/testing-images/resolve/main/wan_i2v_input.JPG") prompt="Summer beach vacation style, a white cat wearing sunglasses sits on a surfboard. The fluffy-furred feline gazes directly at the camera with a relaxed expression. Blurred beach scenery forms the background featuring crystal-clear waters, distant green hills, and a blue sky dotted with white clouds. The cat assumes a naturally relaxed posture, as if savoring the sea breeze and warm sunlight. A close-up shot highlights the feline's intricate details and the refreshing atmosphere of the seaside." with attention_backend("flash_varlen"): # or `"flash_varlen_hub" video = pipe( prompt=prompt, image=image, generator=generator, num_frames=121, num_inference_steps=12, ).frames[0] export_to_video(video, "yiyi_test_7_1_output.mp4", fps=24)