diff --git a/fastvideo/models/hunyuan/modules/attenion.py b/fastvideo/models/hunyuan/modules/attenion.py index 5dc655850..4bd20e6f4 100644 --- a/fastvideo/models/hunyuan/modules/attenion.py +++ b/fastvideo/models/hunyuan/modules/attenion.py @@ -92,7 +92,7 @@ def parallel_attention(q, k, v, img_q_len, img_kv_len, text_mask, mask_strategy= value = torch.cat([value, encoder_value], dim=1) # B, S, 3, H, D qkv = torch.stack([query, key, value], dim=2) - + attn_mask = F.pad(text_mask, (sequence_length, 0), value=True) hidden_states = flash_attn_no_pad(qkv, attn_mask, causal=False, dropout_p=0.0, softmax_scale=None) diff --git a/fastvideo/sample/sample_t2v_hunyuan_STA.py b/fastvideo/sample/sample_t2v_hunyuan_STA.py index 5ca76bb13..b14db3a32 100644 --- a/fastvideo/sample/sample_t2v_hunyuan_STA.py +++ b/fastvideo/sample/sample_t2v_hunyuan_STA.py @@ -13,7 +13,8 @@ from einops import rearrange from fastvideo.models.hunyuan.inference import HunyuanVideoSampler from fastvideo.models.hunyuan.modules.modulate_layers import modulate -from fastvideo.utils.parallel_states import (initialize_sequence_parallel_state, nccl_info) +from fastvideo.utils.parallel_states import ( + initialize_sequence_parallel_state, nccl_info) def teacache_forward( @@ -399,9 +400,7 @@ if __name__ == "__main__": args = parser.parse_args() # process for vae sequence parallel if args.vae_sp and not args.vae_tiling: - raise ValueError( - "Currently enabling vae_sp requires enabling vae_tiling, please set --vae-tiling to True." - ) + raise ValueError("Currently enabling vae_sp requires enabling vae_tiling, please set --vae-tiling to True.") if args.enable_teacache and args.enable_torch_compile: raise ValueError( "--enable_teacache and --enable_torch_compile cannot be used simultaneously. Please enable only one of these options."