Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

TypeError: WanS2VDiT.forward() got an unexpected keyword argument 'attn_kwargs'

Open
#221 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
python

Research direction

Compare diffsynth_engine/pipelines/wan_s2v.py with diffsynth_engine/models/wan/wan_s2v_dit.py, starting at the predict_noise call and WanS2VDiT.forward signature. Reproduce the failure with examples/wan_speech_to_video.py and verify that the example completes without the unexpected keyword argument error.

Written by the indexing model from the issue text.

Description

In commit 4ae8f2c0542b1fbb6d744a41ac38b57abbd55908, the 'attn_kwargs' is added in the diffsynth_engine/pipelines/wan_s2v.py, we can see diffsynth_engine/models/wan/wan_dit.py is updated, but diffsynth_engine/models/wan/wan_s2v_dit is not updated.

Find the error below.
Traceback (most recent call last):
File "DiffSynth-Engine/examples/wan_speech_to_video.py", line 106, in
wan_rs2v(pipe, args.input_data_dir)
File "DiffSynth-Engine/examples/wan_speech_to_video.py", line 15, in wan_rs2v
frames = pipe(
ref_image=Image.open(f"{input_data_dir}/image.png").convert("RGB"),
...<8 lines>...
ref_as_first_frame=True,
)
File "miniconda3/lib/python3.13/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
return func(*args, **kwargs)
File "DiffSynth-Engine/diffsynth_engine/pipelines/wan_s2v.py", line 530, in call
noise_pred = self.predict_noise_with_cfg(
model=self.dit,
...<14 lines>...
void_audio_input=void_audio_emb,
)
File "DiffSynth-Engine/diffsynth_engine/pipelines/wan_s2v.py", line 326, in predict_noise_with_cfg
positive_noise_pred = self.predict_noise(
model=model,
...<11 lines>...
void_audio_input=void_audio_input,
)
File "DiffSynth-Engine/diffsynth_engine/pipelines/wan_s2v.py", line 399, in predict_noise
noise_pred = model(
x=latents,
...<11 lines>...
attn_kwargs=attn_kwargs,
)
File "miniconda3/lib/python3.13/site-packages/torch/nn/modules/module.py", line 1739, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "miniconda3/lib/python3.13/site-packages/torch/nn/modules/module.py", line 1750, in _call_impl
return forward_call(*args, **kwargs)
TypeError: WanS2VDiT.forward() got an unexpected keyword argument 'attn_kwargs'

Dominant language
Python
Stars
432
Forks
51
Avg merge
3d 5h
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from modelscope/DiffSynth-Engine

All issues in modelscope/DiffSynth-Engine

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.