AttributeError: 'AutoencoderKLCogVideoX' object has no attribute 'enable_tiling'

#11
by celsowm - opened

code:

import torch
from diffusers import CogVideoXPipeline
from diffusers.utils import export_to_video

prompt = "A panda, dressed in a small, red jacket and a tiny hat, sits on a wooden stool in a serene bamboo forest. The panda's fluffy paws strum a miniature acoustic guitar, producing soft, melodic tunes. Nearby, a few other pandas gather, watching curiously and some clapping in rhythm. Sunlight filters through the tall bamboo, casting a gentle glow on the scene. The panda's face is expressive, showing concentration and joy as it plays. The background includes a small, flowing stream and vibrant green foliage, enhancing the peaceful and magical atmosphere of this unique musical performance."

pipe = CogVideoXPipeline.from_pretrained(
    "THUDM/CogVideoX-2b",
    torch_dtype=torch.float16
)

pipe.enable_model_cpu_offload()
pipe.vae.enable_tiling()

video = pipe(
    prompt=prompt,
    num_videos_per_prompt=1,
    num_inference_steps=50,
    num_frames=49,
    guidance_scale=6,
    generator=torch.Generator(device="cuda").manual_seed(42),
).frames[0]

export_to_video(video, "output.mp4", fps=8)

error:

Traceback (most recent call last):
File "/home/celso/ia/test_cog_videox.py", line 13, in
pipe.vae.enable_tiling()
^^^^^^^^^^^^^^^^^^^^^^
File "/home/celso/.local/lib/python3.12/site-packages/diffusers/models/modeling_utils.py", line 151, in getattr
return super().getattr(name)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/celso/.local/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1729, in getattr
raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'")
AttributeError: 'AutoencoderKLCogVideoX' object has no attribute 'enable_tiling'

Knowledge Engineering Group (KEG) & Data Mining at Tsinghua University org

did you use diffusers>=0.30.1

did you use diffusers>=0.30.1

thanks !

celsowm changed discussion status to closed

Sign up or log in to comment