"torchvision/vscode:/vscode.git/clone" did not exist on "26ed129d530f8ca48113adf62166545a4331c322"
Unverified Commit 8974c50b authored by YiYi Xu's avatar YiYi Xu Committed by GitHub
Browse files

[SVD] fix a bug when passing image as tensor (#6999)



* fix

* update docstring

---------
Co-authored-by: default avataryiyixuxu <yixu310@gmail,com>
parent c18058b4
......@@ -132,15 +132,15 @@ class StableVideoDiffusionPipeline(DiffusionPipeline):
image = _resize_with_antialiasing(image, (224, 224))
image = (image + 1.0) / 2.0
# Normalize the image with for CLIP input
image = self.feature_extractor(
images=image,
do_normalize=True,
do_center_crop=False,
do_resize=False,
do_rescale=False,
return_tensors="pt",
).pixel_values
# Normalize the image with for CLIP input
image = self.feature_extractor(
images=image,
do_normalize=True,
do_center_crop=False,
do_resize=False,
do_rescale=False,
return_tensors="pt",
).pixel_values
image = image.to(device=device, dtype=dtype)
image_embeddings = self.image_encoder(image).image_embeds
......@@ -333,8 +333,7 @@ class StableVideoDiffusionPipeline(DiffusionPipeline):
Args:
image (`PIL.Image.Image` or `List[PIL.Image.Image]` or `torch.FloatTensor`):
Image or images to guide image generation. If you provide a tensor, it needs to be compatible with
[`CLIPImageProcessor`](https://huggingface.co/lambdalabs/sd-image-variations-diffusers/blob/main/feature_extractor/preprocessor_config.json).
Image or images to guide image generation. If you provide a tensor, the expected value range is between `[0,1]`.
height (`int`, *optional*, defaults to `self.unet.config.sample_size * self.vae_scale_factor`):
The height in pixels of the generated image.
width (`int`, *optional*, defaults to `self.unet.config.sample_size * self.vae_scale_factor`):
......
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