memes-forever / Stable-diffusion-webui-video

157 stars 34 forks source link

list index out of range #12

Open eformx opened 1 year ago

eformx commented 1 year ago

getting error at line 237 list index out of range

files = files + [files[-1]] # minterpolate smooth break last frame, dupplicate this

Runs and generated 10 images and then dies.

Added image. Enter starting prompt and end prompt. All other settings unchanged (defaults) 10 frames, 1 second.

aellul27 commented 1 year ago

+1 Currently unusable

LeonimusTTV commented 1 year ago

you need to replace the line 234 by this line :

files = [i for i in glob.glob(f'{p.outpath_samples}/{datetime.date.today()}/*.png')]

and you also need to import datetime. If you get any other error try to replace the line 239 by this:

video_name = "vid.mp4"

but make attention that if you make another video, the first file will be override.

hoping that it helps.

futurepr0n commented 1 year ago

Commenting on this issue as I am also getting it - but when i replaced your suggestion in the line, I got a new set of issues:


Arguments: ('task(cnbjvbeh0wake12)', 0, 'an image of man dancing on a country road', '', [], <PIL.Image.Image image mode=RGBA size=512x512 at 0x7F9543C128C0>, None, None, None, None, None, None, 20, 0, 4, 0, 1, False, False, 1, 1, 7, 1.5, 0.75, -1.0, -1.0, 0, 0, 0, False, 512, 512, 0, 0, 32, 0, '', '', '', [], 8, '<ul>\n<li><code>CFG Scale</code> should be 2 or lower.</li>\n</ul>\n', True, True, '', '', True, 50, True, 1, 0, False, 4, 1, 'None', '<p style="margin-bottom:0.75em">Recommended settings: Sampling Steps: 80-100, Sampler: Euler a, Denoising strength: 0.8</p>', 128, 8, ['left', 'right', 'up', 'down'], 1, 0.05, 128, 4, 0, ['left', 'right', 'up', 'down'], False, False, 'positive', 'comma', 0, False, False, '', '<p style="margin-bottom:0.75em">Will upscale the image by the selected scale factor; use width and height sliders to set tile size</p>', 64, 0, 2, False, '', 0, 5, 1, True, 1, False, 1, 0, 0, False, 0, False, False, False, 0, False, False, 0, 1, '', 0, '', 0, '', True, False, False, False, 0, True, True, True, 0, 0.1, 1, 'None', False, 0, 2, 512, 512, False, '', '', False, '', 127, False, 30, 9999, 1, False, 10, 0.25, True, False, 'simple', '1', '', True, '', '', '', '', '', '', '', '', '', '', '', '', 'None', 0.3, 60) {}
Traceback (most recent call last):
  File "/home/futurepr0n/Hosted/stable-diffusion-webui/modules/call_queue.py", line 56, in f
    res = list(func(*args, **kwargs))
  File "/home/futurepr0n/Hosted/stable-diffusion-webui/modules/call_queue.py", line 37, in f
    res = func(*args, **kwargs)
  File "/home/futurepr0n/Hosted/stable-diffusion-webui/modules/img2img.py", line 169, in img2img
    processed = modules.scripts.scripts_img2img.run(p, *args)
  File "/home/futurepr0n/Hosted/stable-diffusion-webui/modules/scripts.py", line 399, in run
    processed = script.run(p, *script_args)
  File "/home/futurepr0n/Hosted/stable-diffusion-webui/scripts/video.py", line 243, in run
    video_path = make_video_ffmpeg(save_dir, video_name, files=files, fps=fps, smooth=smooth)
  File "/home/futurepr0n/Hosted/stable-diffusion-webui/scripts/video.py", line 295, in make_video_ffmpeg
    open(txt_name, 'w').write('\n'.join(["file '" + os.path.join(path, f) + "'" for f in files]))
FileNotFoundError: [Errno 2] No such file or directory: '/home/futurepr0n/Hosted/stable-diffusion-webui/outputs/img2img-videos/outputs/img2img-images/2023-03-22/00046-3282447932.mp4.txt'```
LeonimusTTV commented 1 year ago

can you send me a Screenshot of the lines 234 to 242 like this screen

image
futurepr0n commented 1 year ago
Screen Shot 2023-03-23 at 12 28 16 PM

@LeonimusTTV Thank you. I am going to try changing video_name = 'vid_1.mp4'

futurepr0n commented 1 year ago

It didn’t work unfortunately

robertlinke commented 1 year ago

this helped me fix the issue: add: import datetime on line 5 change line 234 to: files = [i for i in glob.glob(f'{p.outpath_samples}/{datetime.date.today()}/*.png')] and change line 239 to: video_name = "vid.mp4"

now if you want to save your next video made you have to change line 239 to: video_name = "vid1.mp4" then to vid2, vid3, etc.

clunky workaround? yes. functional? also yes

aemkei123 commented 1 year ago

you need to replace the line 234 by this line :

files = [i for i in glob.glob(f'{p.outpath_samples}/{datetime.date.today()}/*.png')]

and you also need to import datetime. If you get any other error try to replace the line 239 by this:

video_name = "vid.mp4"

but make attention that if you make another video, the first file will be override.

hoping that it helps.

how i can "import datetime."

thats are my erros:

Traceback (most recent call last): File "E:\Program Files\AI\AI ART\stable-diffusion-webui\modules\call_queue.py", line 56, in f res = list(func(*args, *kwargs)) File "E:\Program Files\AI\AI ART\stable-diffusion-webui\modules\call_queue.py", line 37, in f res = func(args, *kwargs) File "E:\Program Files\AI\AI ART\stable-diffusion-webui\modules\img2img.py", line 170, in img2img processed = modules.scripts.scripts_img2img.run(p, args) File "E:\Program Files\AI\AI ART\stable-diffusion-webui\modules\scripts.py", line 407, in run processed = script.run(p, script_args) File "E:\Program Files\AI\AI ART\stable-diffusion-webui\scripts\video.py", line 234, in run files = [i for i in glob.glob(f'{p.outpath_samples}/{datetime.date.today()}/.png')] NameError: name 'datetime' is not defined

flynet commented 7 months ago

Thanks @LeonimusTTV , it worked

line 5 import datetime

line 234 files = [i for i in glob.glob(f'{p.outpath_samples}/{datetime.date.today()}/*.png')]

(optional ?) uncommented line 286 save_dir = 'output/img2img-videos/' ( and changed outputs to output )

Restart required !