Closed ryuan closed 8 months ago
Looks like parse_prompt() in animatediff_prompt.py needs to check for invalid frame numbers.
Not just this, but in general we should find a way to recover from any kind of errors. I have not implemented any error recovery strategy, and there might be no such strategy, but I’m not sure. Need further investigation.
The readme needs to be updated for Prompt Travel example to show 0: and 7: not 8: Or change the math to start with frame 1, not 0.
Why not 8? I assume that the context batch size is 16. I think this description is clear enough.
The second and third lines are for prompt interpolation, in format frame number: prompt. Your frame number should be in ascending order, smaller than the total Number of frames. The first frame is 0 index.
Your example would have to be using context batch size 8 for this example to work. So frame 8 - 1 = frame index of 7.
A realistic example with context batch size 16 would be frame 16 listed as "15:" in the readme.
Is there an existing issue for this?
Have you read FAQ on README?
What happened?
If you try to generate a prompt travel GIF by specifying an invalid frame number (ex., in a 16 frame GIF, specifying a trail prompt frame number of 16 when the largest valid frame number should be 15 given the 0-based index), you get the error
IndexError: index 16 is out of bounds for dimension 0 with size 16
.Attempting to generate another GIF after correcting for this error (ex., reducing the tail prompt frame number down to 15 or attempting to generate a GIF without any prompt travel) produces a GIF of just random noise.
At the moment, the only fix is to completely exit+restart A1111 to reset everything. Reloading UI wasn't enough for me - it still produces an animated noise GIF.
Steps to reproduce the problem
IndexError
What should have happened?
After getting the
IndexError
, one should be able to correct the invalid frame number, press "Generate", and get a valid output without having to close out and restart Automatic entirely.Commit where the problem happens
webui: 1.6.0 extension: https://github.com/continue-revolution/sd-webui-animatediff/commit/552f50599783cc1814ea0309982be00ad6af677c
What browsers do you use to access the UI ?
Apple Safari
Command Line Arguments
Console logs
Additional information
Please let me know if others are able to replicate this issue. I am on a Apple Silicon Mac, which always has its own particularities, so this issue could be isolated to M1/M2 Mac devices.
Also, if this issue is replicable, I'm happy to find a solution and submit a pull request. Let me know if you have any leads on why this issue is happening.