question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RePaintPipeline always returns black image when pipe.to("mps") is called

See original GitHub issue

Describe the bug

When I try to do the inpainting with RePaintPipeline on the MPS backend it only returns black image. It works fine with CPU, but very slow.

Reproduction

scheduler = RePaintScheduler.from_config("google/ddpm-ema-celebahq-256")
pipe = RePaintPipeline.from_pretrained("google/ddpm-ema-celebahq-256", scheduler=scheduler)
device = torch.device("mps")
pipe = pipe.to(device)
def inpaint(image, mask):
    output = pipe(
        original_image=image,
        mask_image=mask,
        num_inference_steps=20,
        eta=0.0,
        jump_length=1,
        jump_n_sample=2,
        return_dict=False,
    )
    print(output)
    image.paste(output[0][0], (x, y))
    return np.array(image)

Logs

No response

System Info

  • diffusers version: 0.7.2
  • Platform: macOS-12.6-arm64-arm-64bit
  • Python version: 3.9.12
  • PyTorch version (GPU?): 1.13.0.dev20221002 (False)
  • Huggingface_hub version: 0.10.0
  • Transformers version: 4.24.0
  • Using GPU in script?: yes
  • Using distributed or parallel set-up in script?: no

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
patrickvonplatencommented, Dec 1, 2022

@anton-l could you take a look?

0reactions
GaidamakUAcommented, Nov 29, 2022

Hi, @pcuenca, any chances for a fix?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does StableDiffusionPipeline return black images when ...
When I try to generate 1 image from 1 prompt, the output looks fine, but when I try to generate multiple images using...
Read more >
Releases · huggingface/diffusers - GitHub
Diffusers: State-of-the-art diffusion models for image and audio generation in ... Ensure Flax pipeline always returns numpy array by @pcuenca in #1435 ...
Read more >
patrickvonplaten - PullAnswer
diffusers 0.5.1 crashs on MPS with unexpected keyword argument 'device_map' ... RePaintPipeline always returns black image when pipe.to("mps") is called.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found