# Diffusion Models Course - Unit 3

**URL:** <https://discuss.huggingface.co/t/diffusion-models-course-unit-3/28647>\
**Category:** 🧨 Diffusers\
**Created:** [December 30, 2022, 4:47pm UTC](https://discuss.huggingface.co/t/diffusion-models-course-unit-3/28647 "2022-12-30T16:47:40Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![royam0820](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/royam0820/32/18342_2.png) [@royam0820](https://discuss.huggingface.co/u/royam0820)\
**Post date:** [December 30, 2022, 4:47pm UTC](https://discuss.huggingface.co/t/diffusion-models-course-unit-3/28647/1 "2022-12-30T16:47:40Z")

</div>

I am testing the following notebook [diffusion-models-class/01\_stable\_diffusion\_introduction.ipynb at main · huggingface/diffusion-models-class · GitHub](https://github.com/huggingface/diffusion-models-class/blob/main/unit3/01_stable_diffusion_introduction.ipynb), regarding the section Additional Pipelines / Inpainting, the following code: image = pipe(prompt=prompt, image=init\_image, mask\_image=mask\_image).images[0] generates the following error " TypeError: **call** () got an unexpected keyword argument ‘image’" Any ideas how to fix it?

---

<div class="post-metadata">

**Author:** ![pcuenq](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/pcuenq/32/32135_2.png) [@pcuenq](https://discuss.huggingface.co/u/pcuenq)\
**Post date:** [December 30, 2022, 5:53pm UTC](https://discuss.huggingface.co/t/diffusion-models-course-unit-3/28647/2 "2022-12-30T17:53:55Z")

</div>

Hi @royam0820! The name of the `image` parameter was recently renamed, so you might need to upgrade to a newer version of `diffusers`. Could you please try to run `pip install --upgrade diffusers`?

---

<div class="post-metadata">

**Author:** ![royam0820](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/royam0820/32/18342_2.png) [@royam0820](https://discuss.huggingface.co/u/royam0820)\
**Post date:** [January 2, 2023, 4:46pm UTC](https://discuss.huggingface.co/t/diffusion-models-course-unit-3/28647/3 "2023-01-02T16:46:34Z")

</div>

> [@pcuenq](#):
>
> pip install --upgrade diffusers

Hi, first of all, Happy New Year to you and my best wishes to you.  
I did try your suggestion to upgrade to a newer version, but the same error is popping:  
image = pipe(prompt=prompt, image=init\_image, mask\_image=mask\_image).images[0] generates the following error " TypeError: **call** () got an unexpected keyword argument ‘image’"

---

<div class="post-metadata">

**Author:** ![pcuenq](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/pcuenq/32/32135_2.png) [@pcuenq](https://discuss.huggingface.co/u/pcuenq)\
**Post date:** [January 2, 2023, 5:17pm UTC](https://discuss.huggingface.co/t/diffusion-models-course-unit-3/28647/4 "2023-01-02T17:17:30Z")

</div>

Thanks a lot, and Happy New Year to you too 🙂

That’s strange. Did you try to uninstall `diffusers` first? If you didn’t, you can use `pip uninstall -y diffusers` and then issue the install command again, just to verify there’s nothing weird going on.

If that doesn’t work, you can also run `diffusers-cli env` and post the output here so I can try to replicate in a similar environment. Are you running the notebook on Colab or somewhere else?

I hope we can sort this out 🙂

---

<div class="post-metadata">

**Author:** ![royam0820](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/royam0820/32/18342_2.png) [@royam0820](https://discuss.huggingface.co/u/royam0820)\
**Post date:** [January 2, 2023, 5:51pm UTC](https://discuss.huggingface.co/t/diffusion-models-course-unit-3/28647/5 "2023-01-02T17:51:51Z")

</div>

> [@pcuenq](#):
>
> pip install --upgrade diffusers

Hi! I did try to uninstall and reinstall + upgrade and I have the same error.

---

<div class="post-metadata">

**Author:** ![royam0820](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/royam0820/32/18342_2.png) [@royam0820](https://discuss.huggingface.co/u/royam0820)\
**Post date:** [January 2, 2023, 5:56pm UTC](https://discuss.huggingface.co/t/diffusion-models-course-unit-3/28647/6 "2023-01-02T17:56:23Z")

</div>

Here is the environment infos- I am on Colab

- `diffusers` version: 0.11.1
- Platform: Linux-5.10.133±x86\_64-with-glibc2.27
- Python version: 3.8.16
- PyTorch version (GPU?): 1.13.0+cu116 (True)
- Huggingface\_hub version: 0.11.1
- Transformers version: 4.26.0.dev0
- Using GPU in script?: 
- Using distributed or parallel set-up in script?: 

 ![diffusers_error](https://us1.discourse-cdn.com/hellohellohello/original/2X/b/b6cff1f111efcfcf5877934b1c403f27f73a6e7b.png)

---

<div class="post-metadata">

**Author:** ![pcuenq](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/pcuenq/32/32135_2.png) [@pcuenq](https://discuss.huggingface.co/u/pcuenq)\
**Post date:** [January 2, 2023, 6:52pm UTC](https://discuss.huggingface.co/t/diffusion-models-course-unit-3/28647/7 "2023-01-02T18:52:04Z")

</div>

Oh, I see the problem now! You are importing `StableDiffusionInpaintPipeline` but then you are instantiating your pipeline using `StableDiffusionPipeline`, which doesn’t know how to deal with input images. You need to create your in-painting pipeline like this:

```plaintext
pipe = StableDiffusionInpaintPipeline.from_pretrained(model_id).to(device)

```

Let me know if that works 🙂

---

<div class="post-metadata">

**Author:** ![royam0820](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/royam0820/32/18342_2.png) [@royam0820](https://discuss.huggingface.co/u/royam0820)\
**Post date:** [January 3, 2023, 1:45pm UTC](https://discuss.huggingface.co/t/diffusion-models-course-unit-3/28647/8 "2023-01-03T13:45:05Z")

</div>

> [@pcuenq](#):
>
> `pipe = StableDiffusionInpaintPipeline.from_pretrained(model_id).to(device)`

Good catch! I have been testing multiple features and this issue stemmed from various cut and paste. Thank you for pointing out this stupid mistake on my part and many thanks for your prompt help and support!

---

<div class="post-metadata">

**Author:** ![pcuenq](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/pcuenq/32/32135_2.png) [@pcuenq](https://discuss.huggingface.co/u/pcuenq)\
**Post date:** [January 3, 2023, 4:55pm UTC](https://discuss.huggingface.co/t/diffusion-models-course-unit-3/28647/9 "2023-01-03T16:55:47Z")

</div>

No stupid mistake at all! It’s great that you are exploring everything, don’t hesitate to keep asking questions 🙂

---

<div class="post-metadata">

**Author:** ![royam0820](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/royam0820/32/18342_2.png) [@royam0820](https://discuss.huggingface.co/u/royam0820)\
**Post date:** [January 4, 2023, 4:42pm UTC](https://discuss.huggingface.co/t/diffusion-models-course-unit-3/28647/10 "2023-01-04T16:42:00Z")

</div>

Thank you! 😃
