Skip to content

Commit 8974c50

Browse files
yiyixuxuyiyixuxu
andauthored
[SVD] fix a bug when passing image as tensor (#6999)
* fix * update docstring --------- Co-authored-by: yiyixuxu <yixu310@gmail,com>
1 parent c18058b commit 8974c50

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/diffusers/pipelines/stable_video_diffusion/pipeline_stable_video_diffusion.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,15 @@ def _encode_image(self, image, device, num_videos_per_prompt, do_classifier_free
132132
image = _resize_with_antialiasing(image, (224, 224))
133133
image = (image + 1.0) / 2.0
134134

135-
# Normalize the image with for CLIP input
136-
image = self.feature_extractor(
137-
images=image,
138-
do_normalize=True,
139-
do_center_crop=False,
140-
do_resize=False,
141-
do_rescale=False,
142-
return_tensors="pt",
143-
).pixel_values
135+
# Normalize the image with for CLIP input
136+
image = self.feature_extractor(
137+
images=image,
138+
do_normalize=True,
139+
do_center_crop=False,
140+
do_resize=False,
141+
do_rescale=False,
142+
return_tensors="pt",
143+
).pixel_values
144144

145145
image = image.to(device=device, dtype=dtype)
146146
image_embeddings = self.image_encoder(image).image_embeds
@@ -333,8 +333,7 @@ def __call__(
333333
334334
Args:
335335
image (`PIL.Image.Image` or `List[PIL.Image.Image]` or `torch.FloatTensor`):
336-
Image or images to guide image generation. If you provide a tensor, it needs to be compatible with
337-
[`CLIPImageProcessor`](https://huggingface.co/lambdalabs/sd-image-variations-diffusers/blob/main/feature_extractor/preprocessor_config.json).
336+
Image or images to guide image generation. If you provide a tensor, the expected value range is between `[0,1]`.
338337
height (`int`, *optional*, defaults to `self.unet.config.sample_size * self.vae_scale_factor`):
339338
The height in pixels of the generated image.
340339
width (`int`, *optional*, defaults to `self.unet.config.sample_size * self.vae_scale_factor`):

0 commit comments

Comments
 (0)