sdwebuiapi icon indicating copy to clipboard operation
sdwebuiapi copied to clipboard

Does animatediff function added to the webuiapi?

Open Louis24 opened this issue 1 year ago • 7 comments

Does animatediff function added to the webuiapi?

Louis24 avatar Jul 25 '24 06:07 Louis24

Added AnimateDiff extension support :)

adiff = webuiapi.AnimateDiff(model='mm_sd15_v3.safetensors',
                             video_length=24,
                             closed_loop='R+P',
                             format=['GIF'])

r = api.txt2img(prompt='cute puppy', animatediff=adiff)

# save GIF file. need save_all=True to save animated GIF.
r.image.save('puppy.gif', save_all=True)

# Display animated GIF in Jupyter notebook
from IPython.display import HTML
HTML('<img src="data:image/gif;base64,{0}"/>'.format(r.json['images'][0]))

mix1009 avatar Aug 01 '24 09:08 mix1009

thank you sooo much!! did you update last week. cuz I have not found the api 2 weks ago

Louis24 avatar Aug 01 '24 10:08 Louis24

It was added today :)

mix1009 avatar Aug 01 '24 10:08 mix1009

It was added today :)

Haha, thanks, by the way, how about lora, does it still need to be loaded through style.csv?

And style.csv should be prepared before the server starts, otherwise it cannot be refreshed.

Louis24 avatar Aug 01 '24 15:08 Louis24

new issue here, with r.image.save('puppy.gif', save_all=True) can only save 1 frame.

Louis24 avatar Aug 02 '24 05:08 Louis24

Could you check your PIL library version?

import PIL
print(PIL.__version__)

I'm on 10.2.0. It saved 4.8 MB gif file with 24 512x512 frames.

mix1009 avatar Aug 02 '24 07:08 mix1009

Could you check your PIL library version?

import PIL
print(PIL.__version__)

I'm on 10.2.0. It saved 4.8 MB gif file with 24 512x512 frames.

Thank you, I have updated the animatediff extension and solved!

Louis24 avatar Aug 02 '24 13:08 Louis24