mirror of
https://github.com/huggingface/diffusers.git
synced 2026-01-27 17:22:53 +03:00
Add fps argument to export_to_gif function. (#6786)
This commit is contained in:
committed by
GitHub
parent
3ac2357794
commit
8de78001df
@@ -28,7 +28,7 @@ def buffered_writer(raw_f):
|
||||
f.flush()
|
||||
|
||||
|
||||
def export_to_gif(image: List[PIL.Image.Image], output_gif_path: str = None) -> str:
|
||||
def export_to_gif(image: List[PIL.Image.Image], output_gif_path: str = None, fps: int = 10) -> str:
|
||||
if output_gif_path is None:
|
||||
output_gif_path = tempfile.NamedTemporaryFile(suffix=".gif").name
|
||||
|
||||
@@ -37,7 +37,7 @@ def export_to_gif(image: List[PIL.Image.Image], output_gif_path: str = None) ->
|
||||
save_all=True,
|
||||
append_images=image[1:],
|
||||
optimize=False,
|
||||
duration=100,
|
||||
duration=1000 // fps,
|
||||
loop=0,
|
||||
)
|
||||
return output_gif_path
|
||||
|
||||
Reference in New Issue
Block a user