continue-revolution / sd-webui-animatediff

AnimateDiff for AUTOMATIC1111 Stable Diffusion WebUI
Other
3.11k stars 258 forks source link

[FIX] motion_module.py, error: missing encoder_hidden_states #205

Closed Alexpinilla closed 1 year ago

Alexpinilla commented 1 year ago

I fixed this error:

TypeError: VanillaTemporalModule.forward() missing 1 required positional argument: 'encoder_hidden_states'

With this fix this error won't happen again.

continue-revolution commented 1 year ago

This is a required argument. The problem is that your hook might be un-successful

Alexpinilla commented 1 year ago

I know that is a required argument, but the fix set its to None when it is not provided, that fixes it.

I experimented this error, with this fix it won't happen again and the animation will be generated.

Without this code, when it fails, no animation will work until you restart the process and will return the "TypeError: VanillaTemporalModule.forward() missing 1 required positional argument: 'encoder_hidden_states' "

continue-revolution commented 1 year ago

encoder_hidden_states do seem to be always None

I will merge this, but the reason why you receive this error is that https://github.com/continue-revolution/sd-webui-animatediff/blob/master/scripts/animatediff_mm.py#L91 hook failed