Skip to content
This repository was archived by the owner on Sep 14, 2022. It is now read-only.

[Feature] Generate and display GIF from denoising process #1

Merged
merged 1 commit into from
Sep 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/diffusers_interpret/generated_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,18 @@ def show(self, width: Union[str, int] = "100%", height: Union[str, int] = "400px
self.image_slider_iframe.width = width
self.image_slider_iframe.height = height
display.update(self.image_slider_iframe)

def gif(self, file_name = "diffusion_process.gif", duration = 400, show = True):
'''
Generate and display a GIF from the denoising process
'''
self[0].save(file_name,
save_all = True,
append_images = self,
optimize = False,
duration = duration,
loop = 0)
if show == True:
return IPython.display.Image(file_name)
else:
return None