huggingface / diffusers

🤗 Diffusers: State-of-the-art diffusion models for image and audio generation in PyTorch and FLAX.
https://huggingface.co/docs/diffusers
Apache License 2.0
23.8k stars 4.91k forks source link

i2vgen-xl keep produce black gif #8655

Open xalteropsx opened 1 week ago

xalteropsx commented 1 week ago

import torch
from diffusers import I2VGenXLPipeline
from diffusers.utils import export_to_gif, load_image

pipeline = I2VGenXLPipeline.from_pretrained(
    "ali-vilab/i2vgen-xl", torch_dtype=torch.float16
)
pipeline.enable_model_cpu_offload()

image_url = (
    "https://huggingface.co/datasets/diffusers/docs-images/resolve/main/i2vgen_xl_images/img_0009.png"
)
image = load_image(image_url).convert("RGB")

prompt = "Papers were floating in the air on a table in the library"
negative_prompt = "Distorted, discontinuous, Ugly, blurry, low resolution, motionless, static, disfigured, disconnected limbs, Ugly faces, incomplete arms"
generator = torch.manual_seed(8888)

frames = pipeline(
    prompt=prompt,
    image=image,
    num_inference_steps=50,
    negative_prompt=negative_prompt,
    guidance_scale=9.0,
    generator=generator,
).frames[0]
video_path = export_to_gif(frames, "i2v.gif")

i2v

xalteropsx commented 1 week ago

Z:\software\python11\Lib\site-packages\diffusers\image_processor.py:111: RuntimeWarning: invalid value encountered in cast images = (images * 255).round().astype("uint8")

sayakpaul commented 1 week ago

That is strange. Was this happening with an earlier version of the library?

Cc: @DN6

xalteropsx commented 1 week ago

do u guys have AnimateDiffPipeline singlefile pipeline for it ?

sayakpaul commented 1 week ago

It's an unrelated issue and you should open a new issue thread for it.

shauray8 commented 1 day ago

@xalteropsx I failed to reproduce this on dev, might be an issue with the earlier versions.