We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
issue with DDIM scheduler for google/ddpm-celebahq-256 example
### Describe the bug

Referring to the example "Unconditional Diffusion with discrete scheduler" at https://github.com/huggingface/diffusers#running-code
The comment says you can use `DDIMPipeline` but this fails to run on
(got an unexpected keyword argument `eta`).
Also, the `PNDMPipeline` runs but just returns noise.

### Reproduction

```

# !pip install diffusers["torch"]
from diffusers import DDPMPipeline, DDIMPipeline, PNDMPipeline

model_id = "google/ddpm-celebahq-256"
device = "cuda"

# load model and scheduler

#ddpm = DDPMPipeline.from_pretrained(model_id)
ddpm = DDIMPipeline.from_pretrained(model_id)
#ddpm = PNDMPipeline.from_pretrained(model_id)

# you can replace DDPMPipeline with DDIMPipeline or PNDMPipeline for faster inference
ddpm.to(device)

# run pipeline in inference (sample random noise and denoise)
image = ddpm().images[0]
image
```

### Logs

```shell
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Input In [21], in <cell line: 17>()
     14 ddpm.to(device)
     16 # run pipeline in inference (sample random noise and denoise)
---> 17 image = ddpm().images[0]
     18 image

File /usr/local/lib/python3.9/dist-packages/torch/autograd/grad_mode.py:27, in _DecoratorContextManager.__call__.<locals>.decorate_context(*args, **kwargs)
     24 @functools.wraps(func)
     25 def decorate_context(*args, **kwargs):
     26     with self.clone():
---> 27         return func(*args, **kwargs)

File /usr/local/lib/python3.9/dist-packages/diffusers/pipelines/ddim/pipeline_ddim.py:114, in DDIMPipeline.__call__(self, batch_size, generator, eta, num_inference_steps, use_clipped_model_output, output_type, return_dict, **kwargs)
    109     model_output = self.unet(image, t).sample
    111     # 2. predict previous mean of image x_t-1 and add variance depending on eta
    112     # eta corresponds to η in paper and should be between [0, 1]
    113     # do x_t -> x_t-1
--> 114     image = self.scheduler.step(
    115         model_output, t, image, eta=eta, use_clipped_model_output=use_clipped_model_output, generator=generator
    116     ).prev_sample
    118 image = (image / 2 + 0.5).clamp(0, 1)
    119 image = image.cpu().permute(0, 2, 3, 1).numpy()

File /usr/local/lib/python3.9/dist-packages/diffusers/schedulers/scheduling_ddpm.py:259, in DDPMScheduler.step(self, model_output, timestep, sample, generator, return_dict, **kwargs)
    237 """
    238 Predict the sample at the previous timestep by reversing the SDE. Core function to propagate the diffusion
    239 process from the learned model outputs (most often the predicted noise).
   (...)
    253 
    254 """
    255 message = (
    256     "Please make sure to instantiate your scheduler with `prediction_type` instead. E.g. `scheduler ="
    257     " DDPMScheduler.from_pretrained(<model_id>, prediction_type='epsilon')`."
    258 )
--> 259 predict_epsilon = deprecate("predict_epsilon", "0.11.0", message, take_from=kwargs)
    260 if predict_epsilon is not None:
    261     new_config = dict(self.config)

File /usr/local/lib/python3.9/dist-packages/diffusers/utils/deprecation_utils.py:43, in deprecate(take_from, standard_warn, *args)
     41     function = call_frame.function
     42     key, value = next(iter(deprecated_kwargs.items()))
---> 43     raise TypeError(f"{function} in {filename} line {line_number-1} got an unexpected keyword argument `{key}`")
     45 if len(values) == 0:
     46     return

TypeError: step in /usr/local/lib/python3.9/dist-packages/diffusers/schedulers/scheduling_ddpm.py line 258 got an unexpected keyword argument `eta`

```
```


### System Info



- `diffusers` version: 0.10.2
- Platform: Linux-5.4.0-122-generic-x86_64-with-glibc2.31
- Python version: 3.9.13
- PyTorch version (GPU?): 1.12.0+cu116 (True)
- Huggingface_hub version: 0.11.1
- Transformers version: 4.20.1
- Using GPU in script?: Yes. P6000
- Using distributed or parallel set-up in script?: No

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/diffusers/pipelines/pndm/pipeline_pndm.py`
Content:
```
1 # Copyright 2022 The HuggingFace Team. All rights reserved.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 
15 
16 from typing import List, Optional, Tuple, Union
17 
18 import torch
19 
20 from ...models import UNet2DModel
21 from ...schedulers import PNDMScheduler
22 from ...utils import randn_tensor
23 from ..pipeline_utils import DiffusionPipeline, ImagePipelineOutput
24 
25 
26 class PNDMPipeline(DiffusionPipeline):
27     r"""
28     This model inherits from [`DiffusionPipeline`]. Check the superclass documentation for the generic methods the
29     library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)
30 
31     Parameters:
32         unet (`UNet2DModel`): U-Net architecture to denoise the encoded image latents.
33         scheduler ([`SchedulerMixin`]):
34             The `PNDMScheduler` to be used in combination with `unet` to denoise the encoded image.
35     """
36 
37     unet: UNet2DModel
38     scheduler: PNDMScheduler
39 
40     def __init__(self, unet: UNet2DModel, scheduler: PNDMScheduler):
41         super().__init__()
42         self.register_modules(unet=unet, scheduler=scheduler)
43 
44     @torch.no_grad()
45     def __call__(
46         self,
47         batch_size: int = 1,
48         num_inference_steps: int = 50,
49         generator: Optional[Union[torch.Generator, List[torch.Generator]]] = None,
50         output_type: Optional[str] = "pil",
51         return_dict: bool = True,
52         **kwargs,
53     ) -> Union[ImagePipelineOutput, Tuple]:
54         r"""
55         Args:
56             batch_size (`int`, `optional`, defaults to 1): The number of images to generate.
57             num_inference_steps (`int`, `optional`, defaults to 50):
58                 The number of denoising steps. More denoising steps usually lead to a higher quality image at the
59                 expense of slower inference.
60             generator (`torch.Generator`, `optional`): A [torch
61                 generator](https://pytorch.org/docs/stable/generated/torch.Generator.html) to make generation
62                 deterministic.
63             output_type (`str`, `optional`, defaults to `"pil"`): The output format of the generate image. Choose
64                 between [PIL](https://pillow.readthedocs.io/en/stable/): `PIL.Image.Image` or `np.array`.
65             return_dict (`bool`, `optional`, defaults to `True`): Whether or not to return a
66                 [`~pipelines.ImagePipelineOutput`] instead of a plain tuple.
67 
68         Returns:
69             [`~pipelines.ImagePipelineOutput`] or `tuple`: [`~pipelines.utils.ImagePipelineOutput`] if `return_dict` is
70             True, otherwise a `tuple. When returning a tuple, the first element is a list with the generated images.
71         """
72         # For more information on the sampling method you can take a look at Algorithm 2 of
73         # the official paper: https://arxiv.org/pdf/2202.09778.pdf
74 
75         # Sample gaussian noise to begin loop
76         image = randn_tensor(
77             (batch_size, self.unet.in_channels, self.unet.sample_size, self.unet.sample_size),
78             generator=generator,
79             device=self.device,
80         )
81 
82         self.scheduler.set_timesteps(num_inference_steps)
83         for t in self.progress_bar(self.scheduler.timesteps):
84             model_output = self.unet(image, t).sample
85 
86             image = self.scheduler.step(model_output, t, image).prev_sample
87 
88         image = (image / 2 + 0.5).clamp(0, 1)
89         image = image.cpu().permute(0, 2, 3, 1).numpy()
90         if output_type == "pil":
91             image = self.numpy_to_pil(image)
92 
93         if not return_dict:
94             return (image,)
95 
96         return ImagePipelineOutput(images=image)
97
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/src/diffusers/pipelines/pndm/pipeline_pndm.py b/src/diffusers/pipelines/pndm/pipeline_pndm.py
--- a/src/diffusers/pipelines/pndm/pipeline_pndm.py
+++ b/src/diffusers/pipelines/pndm/pipeline_pndm.py
@@ -39,6 +39,9 @@
 
     def __init__(self, unet: UNet2DModel, scheduler: PNDMScheduler):
         super().__init__()
+
+        scheduler = PNDMScheduler.from_config(scheduler.config)
+
         self.register_modules(unet=unet, scheduler=scheduler)
 
     @torch.no_grad()

{"golden_diff": "diff --git a/src/diffusers/pipelines/pndm/pipeline_pndm.py b/src/diffusers/pipelines/pndm/pipeline_pndm.py\n--- a/src/diffusers/pipelines/pndm/pipeline_pndm.py\n+++ b/src/diffusers/pipelines/pndm/pipeline_pndm.py\n@@ -39,6 +39,9 @@\n \n     def __init__(self, unet: UNet2DModel, scheduler: PNDMScheduler):\n         super().__init__()\n+\n+        scheduler = PNDMScheduler.from_config(scheduler.config)\n+\n         self.register_modules(unet=unet, scheduler=scheduler)\n \n     @torch.no_grad()\n", "issue": "issue with DDIM scheduler for google/ddpm-celebahq-256 example\n### Describe the bug\r\n\r\nReferring to the example \"Unconditional Diffusion with discrete scheduler\" at https://github.com/huggingface/diffusers#running-code\r\nThe comment says you can use `DDIMPipeline` but this fails to run on\r\n(got an unexpected keyword argument `eta`).\r\nAlso, the `PNDMPipeline` runs but just returns noise.\r\n\r\n### Reproduction\r\n\r\n```\r\n\r\n# !pip install diffusers[\"torch\"]\r\nfrom diffusers import DDPMPipeline, DDIMPipeline, PNDMPipeline\r\n\r\nmodel_id = \"google/ddpm-celebahq-256\"\r\ndevice = \"cuda\"\r\n\r\n# load model and scheduler\r\n\r\n#ddpm = DDPMPipeline.from_pretrained(model_id)\r\nddpm = DDIMPipeline.from_pretrained(model_id)\r\n#ddpm = PNDMPipeline.from_pretrained(model_id)\r\n\r\n# you can replace DDPMPipeline with DDIMPipeline or PNDMPipeline for faster inference\r\nddpm.to(device)\r\n\r\n# run pipeline in inference (sample random noise and denoise)\r\nimage = ddpm().images[0]\r\nimage\r\n```\r\n\r\n### Logs\r\n\r\n```shell\r\n---------------------------------------------------------------------------\r\nTypeError                                 Traceback (most recent call last)\r\nInput In [21], in <cell line: 17>()\r\n     14 ddpm.to(device)\r\n     16 # run pipeline in inference (sample random noise and denoise)\r\n---> 17 image = ddpm().images[0]\r\n     18 image\r\n\r\nFile /usr/local/lib/python3.9/dist-packages/torch/autograd/grad_mode.py:27, in _DecoratorContextManager.__call__.<locals>.decorate_context(*args, **kwargs)\r\n     24 @functools.wraps(func)\r\n     25 def decorate_context(*args, **kwargs):\r\n     26     with self.clone():\r\n---> 27         return func(*args, **kwargs)\r\n\r\nFile /usr/local/lib/python3.9/dist-packages/diffusers/pipelines/ddim/pipeline_ddim.py:114, in DDIMPipeline.__call__(self, batch_size, generator, eta, num_inference_steps, use_clipped_model_output, output_type, return_dict, **kwargs)\r\n    109     model_output = self.unet(image, t).sample\r\n    111     # 2. predict previous mean of image x_t-1 and add variance depending on eta\r\n    112     # eta corresponds to \u03b7 in paper and should be between [0, 1]\r\n    113     # do x_t -> x_t-1\r\n--> 114     image = self.scheduler.step(\r\n    115         model_output, t, image, eta=eta, use_clipped_model_output=use_clipped_model_output, generator=generator\r\n    116     ).prev_sample\r\n    118 image = (image / 2 + 0.5).clamp(0, 1)\r\n    119 image = image.cpu().permute(0, 2, 3, 1).numpy()\r\n\r\nFile /usr/local/lib/python3.9/dist-packages/diffusers/schedulers/scheduling_ddpm.py:259, in DDPMScheduler.step(self, model_output, timestep, sample, generator, return_dict, **kwargs)\r\n    237 \"\"\"\r\n    238 Predict the sample at the previous timestep by reversing the SDE. Core function to propagate the diffusion\r\n    239 process from the learned model outputs (most often the predicted noise).\r\n   (...)\r\n    253 \r\n    254 \"\"\"\r\n    255 message = (\r\n    256     \"Please make sure to instantiate your scheduler with `prediction_type` instead. E.g. `scheduler =\"\r\n    257     \" DDPMScheduler.from_pretrained(<model_id>, prediction_type='epsilon')`.\"\r\n    258 )\r\n--> 259 predict_epsilon = deprecate(\"predict_epsilon\", \"0.11.0\", message, take_from=kwargs)\r\n    260 if predict_epsilon is not None:\r\n    261     new_config = dict(self.config)\r\n\r\nFile /usr/local/lib/python3.9/dist-packages/diffusers/utils/deprecation_utils.py:43, in deprecate(take_from, standard_warn, *args)\r\n     41     function = call_frame.function\r\n     42     key, value = next(iter(deprecated_kwargs.items()))\r\n---> 43     raise TypeError(f\"{function} in {filename} line {line_number-1} got an unexpected keyword argument `{key}`\")\r\n     45 if len(values) == 0:\r\n     46     return\r\n\r\nTypeError: step in /usr/local/lib/python3.9/dist-packages/diffusers/schedulers/scheduling_ddpm.py line 258 got an unexpected keyword argument `eta`\r\n\r\n```\r\n```\r\n\r\n\r\n### System Info\r\n\r\n\r\n\r\n- `diffusers` version: 0.10.2\r\n- Platform: Linux-5.4.0-122-generic-x86_64-with-glibc2.31\r\n- Python version: 3.9.13\r\n- PyTorch version (GPU?): 1.12.0+cu116 (True)\r\n- Huggingface_hub version: 0.11.1\r\n- Transformers version: 4.20.1\r\n- Using GPU in script?: Yes. P6000\r\n- Using distributed or parallel set-up in script?: No\n", "before_files": [{"content": "# Copyright 2022 The HuggingFace Team. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\nfrom typing import List, Optional, Tuple, Union\n\nimport torch\n\nfrom ...models import UNet2DModel\nfrom ...schedulers import PNDMScheduler\nfrom ...utils import randn_tensor\nfrom ..pipeline_utils import DiffusionPipeline, ImagePipelineOutput\n\n\nclass PNDMPipeline(DiffusionPipeline):\n    r\"\"\"\n    This model inherits from [`DiffusionPipeline`]. Check the superclass documentation for the generic methods the\n    library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)\n\n    Parameters:\n        unet (`UNet2DModel`): U-Net architecture to denoise the encoded image latents.\n        scheduler ([`SchedulerMixin`]):\n            The `PNDMScheduler` to be used in combination with `unet` to denoise the encoded image.\n    \"\"\"\n\n    unet: UNet2DModel\n    scheduler: PNDMScheduler\n\n    def __init__(self, unet: UNet2DModel, scheduler: PNDMScheduler):\n        super().__init__()\n        self.register_modules(unet=unet, scheduler=scheduler)\n\n    @torch.no_grad()\n    def __call__(\n        self,\n        batch_size: int = 1,\n        num_inference_steps: int = 50,\n        generator: Optional[Union[torch.Generator, List[torch.Generator]]] = None,\n        output_type: Optional[str] = \"pil\",\n        return_dict: bool = True,\n        **kwargs,\n    ) -> Union[ImagePipelineOutput, Tuple]:\n        r\"\"\"\n        Args:\n            batch_size (`int`, `optional`, defaults to 1): The number of images to generate.\n            num_inference_steps (`int`, `optional`, defaults to 50):\n                The number of denoising steps. More denoising steps usually lead to a higher quality image at the\n                expense of slower inference.\n            generator (`torch.Generator`, `optional`): A [torch\n                generator](https://pytorch.org/docs/stable/generated/torch.Generator.html) to make generation\n                deterministic.\n            output_type (`str`, `optional`, defaults to `\"pil\"`): The output format of the generate image. Choose\n                between [PIL](https://pillow.readthedocs.io/en/stable/): `PIL.Image.Image` or `np.array`.\n            return_dict (`bool`, `optional`, defaults to `True`): Whether or not to return a\n                [`~pipelines.ImagePipelineOutput`] instead of a plain tuple.\n\n        Returns:\n            [`~pipelines.ImagePipelineOutput`] or `tuple`: [`~pipelines.utils.ImagePipelineOutput`] if `return_dict` is\n            True, otherwise a `tuple. When returning a tuple, the first element is a list with the generated images.\n        \"\"\"\n        # For more information on the sampling method you can take a look at Algorithm 2 of\n        # the official paper: https://arxiv.org/pdf/2202.09778.pdf\n\n        # Sample gaussian noise to begin loop\n        image = randn_tensor(\n            (batch_size, self.unet.in_channels, self.unet.sample_size, self.unet.sample_size),\n            generator=generator,\n            device=self.device,\n        )\n\n        self.scheduler.set_timesteps(num_inference_steps)\n        for t in self.progress_bar(self.scheduler.timesteps):\n            model_output = self.unet(image, t).sample\n\n            image = self.scheduler.step(model_output, t, image).prev_sample\n\n        image = (image / 2 + 0.5).clamp(0, 1)\n        image = image.cpu().permute(0, 2, 3, 1).numpy()\n        if output_type == \"pil\":\n            image = self.numpy_to_pil(image)\n\n        if not return_dict:\n            return (image,)\n\n        return ImagePipelineOutput(images=image)\n", "path": "src/diffusers/pipelines/pndm/pipeline_pndm.py"}], "after_files": [{"content": "# Copyright 2022 The HuggingFace Team. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\nfrom typing import List, Optional, Tuple, Union\n\nimport torch\n\nfrom ...models import UNet2DModel\nfrom ...schedulers import PNDMScheduler\nfrom ...utils import randn_tensor\nfrom ..pipeline_utils import DiffusionPipeline, ImagePipelineOutput\n\n\nclass PNDMPipeline(DiffusionPipeline):\n    r\"\"\"\n    This model inherits from [`DiffusionPipeline`]. Check the superclass documentation for the generic methods the\n    library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)\n\n    Parameters:\n        unet (`UNet2DModel`): U-Net architecture to denoise the encoded image latents.\n        scheduler ([`SchedulerMixin`]):\n            The `PNDMScheduler` to be used in combination with `unet` to denoise the encoded image.\n    \"\"\"\n\n    unet: UNet2DModel\n    scheduler: PNDMScheduler\n\n    def __init__(self, unet: UNet2DModel, scheduler: PNDMScheduler):\n        super().__init__()\n\n        scheduler = PNDMScheduler.from_config(scheduler.config)\n\n        self.register_modules(unet=unet, scheduler=scheduler)\n\n    @torch.no_grad()\n    def __call__(\n        self,\n        batch_size: int = 1,\n        num_inference_steps: int = 50,\n        generator: Optional[Union[torch.Generator, List[torch.Generator]]] = None,\n        output_type: Optional[str] = \"pil\",\n        return_dict: bool = True,\n        **kwargs,\n    ) -> Union[ImagePipelineOutput, Tuple]:\n        r\"\"\"\n        Args:\n            batch_size (`int`, `optional`, defaults to 1): The number of images to generate.\n            num_inference_steps (`int`, `optional`, defaults to 50):\n                The number of denoising steps. More denoising steps usually lead to a higher quality image at the\n                expense of slower inference.\n            generator (`torch.Generator`, `optional`): A [torch\n                generator](https://pytorch.org/docs/stable/generated/torch.Generator.html) to make generation\n                deterministic.\n            output_type (`str`, `optional`, defaults to `\"pil\"`): The output format of the generate image. Choose\n                between [PIL](https://pillow.readthedocs.io/en/stable/): `PIL.Image.Image` or `np.array`.\n            return_dict (`bool`, `optional`, defaults to `True`): Whether or not to return a\n                [`~pipelines.ImagePipelineOutput`] instead of a plain tuple.\n\n        Returns:\n            [`~pipelines.ImagePipelineOutput`] or `tuple`: [`~pipelines.utils.ImagePipelineOutput`] if `return_dict` is\n            True, otherwise a `tuple. When returning a tuple, the first element is a list with the generated images.\n        \"\"\"\n        # For more information on the sampling method you can take a look at Algorithm 2 of\n        # the official paper: https://arxiv.org/pdf/2202.09778.pdf\n\n        # Sample gaussian noise to begin loop\n        image = randn_tensor(\n            (batch_size, self.unet.in_channels, self.unet.sample_size, self.unet.sample_size),\n            generator=generator,\n            device=self.device,\n        )\n\n        self.scheduler.set_timesteps(num_inference_steps)\n        for t in self.progress_bar(self.scheduler.timesteps):\n            model_output = self.unet(image, t).sample\n\n            image = self.scheduler.step(model_output, t, image).prev_sample\n\n        image = (image / 2 + 0.5).clamp(0, 1)\n        image = image.cpu().permute(0, 2, 3, 1).numpy()\n        if output_type == \"pil\":\n            image = self.numpy_to_pil(image)\n\n        if not return_dict:\n            return (image,)\n\n        return ImagePipelineOutput(images=image)\n", "path": "src/diffusers/pipelines/pndm/pipeline_pndm.py"}]}