Unverified Commit 35db2fde authored by Abhinav Gopal's avatar Abhinav Gopal Committed by GitHub
Browse files

Update pipeline_animatediff_video2video.py (#7457)

* Update pipeline_animatediff_video2video.py

* commit with test for whether latent input can be passed into animatediffvid2vid
parent ad55ce61
...@@ -638,7 +638,7 @@ class AnimateDiffVideoToVideoPipeline( ...@@ -638,7 +638,7 @@ class AnimateDiffVideoToVideoPipeline(
# video must be a list of list of images # 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 # the outer list denotes having multiple videos as input, whereas inner list means the frames of the video
# as a list of images # as a list of images
if not isinstance(video[0], list): if video and not isinstance(video[0], list):
video = [video] video = [video]
if latents is None: if latents is None:
video = torch.cat( video = torch.cat(
......
...@@ -269,6 +269,17 @@ class AnimateDiffVideoToVideoPipelineFastTests( ...@@ -269,6 +269,17 @@ class AnimateDiffVideoToVideoPipelineFastTests(
inputs["prompt_embeds"] = torch.randn((1, 4, 32), device=torch_device) inputs["prompt_embeds"] = torch.randn((1, 4, 32), device=torch_device)
pipe(**inputs) 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( @unittest.skipIf(
torch_device != "cuda" or not is_xformers_available(), torch_device != "cuda" or not is_xformers_available(),
reason="XFormers attention is only available with CUDA and `xformers` installed", reason="XFormers attention is only available with CUDA and `xformers` installed",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment