Skip to content

lpw_stable_diffusion community pipeline passes invalid combination of arguments to torch.randn #3008

@sertdfyguhi

Description

@sertdfyguhi

Describe the bug

When using lpw_stable_diffusion pipeline, it passes an invalid combination of arguments into torch.randn. Problem still persists while using cpu.

Reproduction

from diffusers import DiffusionPipeline
import torch

pipe = DiffusionPipeline.from_pretrained('Linaqruf/anything-v3.0', custom_pipeline="lpw_stable_diffusion").to("mps")
image = pipe(
    prompt='test',
    width=512,
    height=512,
    num_inference_steps=10,
    num_images_per_prompt=3,
    generator=[torch.Generator(device="mps").manual_seed(i) for i in range(3)]
).images[0]

Logs

File "/Users/test/.cache/huggingface/modules/diffusers_modules/git/lpw_stable_diffusion.py", line 638, in prepare_latents
    latents = torch.randn(shape, generator=generator, device="cpu", dtype=dtype).to(device)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: randn() received an invalid combination of arguments - got (tuple, dtype=torch.dtype, device=str, generator=list), but expected one of:
 * (tuple of ints size, *, torch.Generator generator, tuple of names names, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)
 * (tuple of ints size, *, torch.Generator generator, Tensor out, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)
 * (tuple of ints size, *, Tensor out, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)
 * (tuple of ints size, *, tuple of names names, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)

System Info

diffusers 0.14.0, pytorch 2.0.0, MacOS M1, python 3.11.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions