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
25.7k stars 5.31k forks source link

Starting cogview3-plus-3b reported an error #9692

Closed Malowking closed 6 days ago

Malowking commented 1 week ago

### Describe the bug

Starting the cogview3-plus model diffusers/models/modeling_utils.py line 774 yields an error TypeError: load_checkpoint_and_dispatch() got an unexpected keyword argument 'strict'. Line 783 exegesis 'strict=True,' can start the model

Reproduction

from diffusers import CogView3PlusPipeline
import torch

pipe = CogView3PlusPipeline.from_pretrained("F:/CogView3-Plus-3B", torch_dtype=torch.bfloat16).to("cuda")

# Open it for reduce GPU memory usage
# pipe.enable_model_cpu_offload()
# pipe.vae.enable_slicing()
# pipe.vae.enable_tiling()

prompt = "A vibrant cherry red sports car sits proudly under the gleaming sun, its polished exterior smooth and flawless, casting a mirror-like reflection. The car features a low, aerodynamic body, angular headlights that gaze forward like predatory eyes, and a set of black, high-gloss racing rims that contrast starkly with the red. A subtle hint of chrome embellishes the grille and exhaust, while the tinted windows suggest a luxurious and private interior. The scene conveys a sense of speed and elegance, the car appearing as if it's about to burst into a sprint along a coastal road, with the ocean's azure waves crashing in the background."
image = pipe(
    prompt=prompt,
    guidance_scale=7.0,
    num_images_per_prompt=1,
    num_inference_steps=1,
    width=512,
    height=512,
).images[0]

image.save("F:/cogview3.png")

Logs

No response

System Info

diffusers-0.31.0.dev0

Who can help?

No response

a-r-r-o-w commented 1 week ago

This looks like a problem with accelerate version in your environment as support for strict was added a few months ago here.

Could you update accelerate to latest and try again?

Malowking commented 1 week ago

这看起来像是您环境中的加速版本存在问题,因为几个月前在此处添加了对 的支持。strict

您能否将 accelerate 更新到最新版本并重试?

Thanks this issue is solved