1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-01-27 17:22:53 +03:00

Update pipeline_animatediff_video2video.py (#7457)

* Update pipeline_animatediff_video2video.py

* commit with test for whether latent input can be passed into animatediffvid2vid
This commit is contained in:
Abhinav Gopal
2024-04-03 07:04:28 -07:00
committed by GitHub
parent ad55ce6100
commit 35db2fdea9
2 changed files with 12 additions and 1 deletions

View File

@@ -638,7 +638,7 @@ class AnimateDiffVideoToVideoPipeline(
# video must be a list of list of images
# the outer list denotes having multiple videos as input, whereas inner list means the frames of the video
# as a list of images
if not isinstance(video[0], list):
if video and not isinstance(video[0], list):
video = [video]
if latents is None:
video = torch.cat(

View File

@@ -269,6 +269,17 @@ class AnimateDiffVideoToVideoPipelineFastTests(
inputs["prompt_embeds"] = torch.randn((1, 4, 32), device=torch_device)
pipe(**inputs)
def test_latent_inputs(self):
components = self.get_dummy_components()
pipe = self.pipeline_class(**components)
pipe.set_progress_bar_config(disable=None)
pipe.to(torch_device)
inputs = self.get_dummy_inputs(torch_device)
inputs["latents"] = torch.randn((1, 4, 1, 32, 32), device=torch_device)
inputs.pop("video")
pipe(**inputs)
@unittest.skipIf(
torch_device != "cuda" or not is_xformers_available(),
reason="XFormers attention is only available with CUDA and `xformers` installed",