We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[Error] got an unexpected keyword argument `eta`
### Describe the bug

When I try to make a sampling using DDIM pipeline, an error occurs
```bash
python utils/ddim.py
  0%|                                                                                                                                                                      | 0/50 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "utils/ddim.py", line 10, in <module>
    image = ddim(num_inference_steps=50).images[0]
  File "/home/sr5/se91.kim/.venv/diffusers/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 28, in decorate_context
    return func(*args, **kwargs)
  File "/home/sr5/se91.kim/.venv/diffusers/lib/python3.8/site-packages/diffusers/pipelines/ddim/pipeline_ddim.py", line 129, in __call__
    image = self.scheduler.step(
  File "/home/sr5/se91.kim/.venv/diffusers/lib/python3.8/site-packages/diffusers/schedulers/scheduling_ddpm.py", line 259, in step
    predict_epsilon = deprecate("predict_epsilon", "0.12.0", message, take_from=kwargs)
  File "/home/sr5/se91.kim/.venv/diffusers/lib/python3.8/site-packages/diffusers/utils/deprecation_utils.py", line 43, in deprecate
    raise TypeError(f"{function} in {filename} line {line_number-1} got an unexpected keyword argument `{key}`")
TypeError: step in /home/sr5/se91.kim/.venv/diffusers/lib/python3.8/site-packages/diffusers/schedulers/scheduling_ddpm.py line 258 got an unexpected keyword argument `eta`
```

Is there anything I can do? 

Thnaks!

### Reproduction

I used code lines the same as the typical example code:
```python
from diffusers import DDIMPipeline

model_id = "/home/sr5/se91.kim/AMP/Diffusers/models/google/ddpm-cifar10-32"

# load model and scheduler
ddim = DDIMPipeline.from_pretrained(model_id)

# run pipeline in inference (sample random noise and denoise)
image = ddim(num_inference_steps=50).images[0]

# save image
image.save("ddim_generated_image.png")
```

### Logs

_No response_

### System Info

I saw a closed issue (https://github.com/huggingface/diffusers/issues/170) but the diffusers in my virtual env. is already of the latest version (0.12.dev):
```bash
$ pip list
Package            Version
------------------ ------------
accelerate         0.15.0
certifi            2020.12.5
chardet            4.0.0
diffusers          0.12.0.dev0
filelock           3.0.12
fsspec             2022.11.0
huggingface-hub    0.11.1
idna               2.10
importlib-metadata 3.7.3
numpy              1.20.1
packaging          20.9
Pillow             8.1.2
pip                21.0.1
psutil             5.8.0
pyarrow            10.0.1
pyparsing          2.4.7
PyYAML             5.4.1
regex              2021.3.17
requests           2.25.1
setuptools         54.1.2
torch              1.9.1+cu111
torchaudio         0.9.1
torchvision        0.10.1+cu111
tqdm               4.64.1
typing-extensions  3.7.4.3
urllib3            1.26.4
wheel              0.36.2
zipp               3.4.1
```
I tried under two versions of diffusers; 0.12.dev and 0.11.1, and both give the same error message.

--- 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/ddim/pipeline_ddim.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 from typing import List, Optional, Tuple, Union
16 
17 import torch
18 
19 from ...utils import deprecate, randn_tensor
20 from ..pipeline_utils import DiffusionPipeline, ImagePipelineOutput
21 
22 
23 class DDIMPipeline(DiffusionPipeline):
24     r"""
25     This model inherits from [`DiffusionPipeline`]. Check the superclass documentation for the generic methods the
26     library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)
27 
28     Parameters:
29         unet ([`UNet2DModel`]): U-Net architecture to denoise the encoded image.
30         scheduler ([`SchedulerMixin`]):
31             A scheduler to be used in combination with `unet` to denoise the encoded image. Can be one of
32             [`DDPMScheduler`], or [`DDIMScheduler`].
33     """
34 
35     def __init__(self, unet, scheduler):
36         super().__init__()
37         self.register_modules(unet=unet, scheduler=scheduler)
38 
39     @torch.no_grad()
40     def __call__(
41         self,
42         batch_size: int = 1,
43         generator: Optional[Union[torch.Generator, List[torch.Generator]]] = None,
44         eta: float = 0.0,
45         num_inference_steps: int = 50,
46         use_clipped_model_output: Optional[bool] = None,
47         output_type: Optional[str] = "pil",
48         return_dict: bool = True,
49     ) -> Union[ImagePipelineOutput, Tuple]:
50         r"""
51         Args:
52             batch_size (`int`, *optional*, defaults to 1):
53                 The number of images to generate.
54             generator (`torch.Generator`, *optional*):
55                 One or a list of [torch generator(s)](https://pytorch.org/docs/stable/generated/torch.Generator.html)
56                 to make generation deterministic.
57             eta (`float`, *optional*, defaults to 0.0):
58                 The eta parameter which controls the scale of the variance (0 is DDIM and 1 is one type of DDPM).
59             num_inference_steps (`int`, *optional*, defaults to 50):
60                 The number of denoising steps. More denoising steps usually lead to a higher quality image at the
61                 expense of slower inference.
62             use_clipped_model_output (`bool`, *optional*, defaults to `None`):
63                 if `True` or `False`, see documentation for `DDIMScheduler.step`. If `None`, nothing is passed
64                 downstream to the scheduler. So use `None` for schedulers which don't support this argument.
65             output_type (`str`, *optional*, defaults to `"pil"`):
66                 The output format of the generate image. Choose between
67                 [PIL](https://pillow.readthedocs.io/en/stable/): `PIL.Image.Image` or `np.array`.
68             return_dict (`bool`, *optional*, defaults to `True`):
69                 Whether or not to return a [`~pipelines.ImagePipelineOutput`] instead of a plain tuple.
70 
71         Returns:
72             [`~pipelines.ImagePipelineOutput`] or `tuple`: [`~pipelines.utils.ImagePipelineOutput`] if `return_dict` is
73             True, otherwise a `tuple. When returning a tuple, the first element is a list with the generated images.
74         """
75 
76         if (
77             generator is not None
78             and isinstance(generator, torch.Generator)
79             and generator.device.type != self.device.type
80             and self.device.type != "mps"
81         ):
82             message = (
83                 f"The `generator` device is `{generator.device}` and does not match the pipeline "
84                 f"device `{self.device}`, so the `generator` will be ignored. "
85                 f'Please use `generator=torch.Generator(device="{self.device}")` instead.'
86             )
87             deprecate(
88                 "generator.device == 'cpu'",
89                 "0.13.0",
90                 message,
91             )
92             generator = None
93 
94         # Sample gaussian noise to begin loop
95         if isinstance(self.unet.sample_size, int):
96             image_shape = (batch_size, self.unet.in_channels, self.unet.sample_size, self.unet.sample_size)
97         else:
98             image_shape = (batch_size, self.unet.in_channels, *self.unet.sample_size)
99 
100         if isinstance(generator, list) and len(generator) != batch_size:
101             raise ValueError(
102                 f"You have passed a list of generators of length {len(generator)}, but requested an effective batch"
103                 f" size of {batch_size}. Make sure the batch size matches the length of the generators."
104             )
105 
106         image = randn_tensor(image_shape, generator=generator, device=self.device, dtype=self.unet.dtype)
107 
108         # set step values
109         self.scheduler.set_timesteps(num_inference_steps)
110 
111         for t in self.progress_bar(self.scheduler.timesteps):
112             # 1. predict noise model_output
113             model_output = self.unet(image, t).sample
114 
115             # 2. predict previous mean of image x_t-1 and add variance depending on eta
116             # eta corresponds to η in paper and should be between [0, 1]
117             # do x_t -> x_t-1
118             image = self.scheduler.step(
119                 model_output, t, image, eta=eta, use_clipped_model_output=use_clipped_model_output, generator=generator
120             ).prev_sample
121 
122         image = (image / 2 + 0.5).clamp(0, 1)
123         image = image.cpu().permute(0, 2, 3, 1).numpy()
124         if output_type == "pil":
125             image = self.numpy_to_pil(image)
126 
127         if not return_dict:
128             return (image,)
129 
130         return ImagePipelineOutput(images=image)
131
```
--- 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/ddim/pipeline_ddim.py b/src/diffusers/pipelines/ddim/pipeline_ddim.py
--- a/src/diffusers/pipelines/ddim/pipeline_ddim.py
+++ b/src/diffusers/pipelines/ddim/pipeline_ddim.py
@@ -16,6 +16,7 @@
 
 import torch
 
+from ...schedulers import DDIMScheduler
 from ...utils import deprecate, randn_tensor
 from ..pipeline_utils import DiffusionPipeline, ImagePipelineOutput
 
@@ -34,6 +35,10 @@
 
     def __init__(self, unet, scheduler):
         super().__init__()
+
+        # make sure scheduler can always be converted to DDIM
+        scheduler = DDIMScheduler.from_config(scheduler.config)
+
         self.register_modules(unet=unet, scheduler=scheduler)
 
     @torch.no_grad()

{"golden_diff": "diff --git a/src/diffusers/pipelines/ddim/pipeline_ddim.py b/src/diffusers/pipelines/ddim/pipeline_ddim.py\n--- a/src/diffusers/pipelines/ddim/pipeline_ddim.py\n+++ b/src/diffusers/pipelines/ddim/pipeline_ddim.py\n@@ -16,6 +16,7 @@\n \n import torch\n \n+from ...schedulers import DDIMScheduler\n from ...utils import deprecate, randn_tensor\n from ..pipeline_utils import DiffusionPipeline, ImagePipelineOutput\n \n@@ -34,6 +35,10 @@\n \n     def __init__(self, unet, scheduler):\n         super().__init__()\n+\n+        # make sure scheduler can always be converted to DDIM\n+        scheduler = DDIMScheduler.from_config(scheduler.config)\n+\n         self.register_modules(unet=unet, scheduler=scheduler)\n \n     @torch.no_grad()\n", "issue": "[Error] got an unexpected keyword argument `eta`\n### Describe the bug\n\nWhen I try to make a sampling using DDIM pipeline, an error occurs\r\n```bash\r\npython utils/ddim.py\r\n  0%|                                                                                                                                                                      | 0/50 [00:00<?, ?it/s]\r\nTraceback (most recent call last):\r\n  File \"utils/ddim.py\", line 10, in <module>\r\n    image = ddim(num_inference_steps=50).images[0]\r\n  File \"/home/sr5/se91.kim/.venv/diffusers/lib/python3.8/site-packages/torch/autograd/grad_mode.py\", line 28, in decorate_context\r\n    return func(*args, **kwargs)\r\n  File \"/home/sr5/se91.kim/.venv/diffusers/lib/python3.8/site-packages/diffusers/pipelines/ddim/pipeline_ddim.py\", line 129, in __call__\r\n    image = self.scheduler.step(\r\n  File \"/home/sr5/se91.kim/.venv/diffusers/lib/python3.8/site-packages/diffusers/schedulers/scheduling_ddpm.py\", line 259, in step\r\n    predict_epsilon = deprecate(\"predict_epsilon\", \"0.12.0\", message, take_from=kwargs)\r\n  File \"/home/sr5/se91.kim/.venv/diffusers/lib/python3.8/site-packages/diffusers/utils/deprecation_utils.py\", line 43, in deprecate\r\n    raise TypeError(f\"{function} in {filename} line {line_number-1} got an unexpected keyword argument `{key}`\")\r\nTypeError: step in /home/sr5/se91.kim/.venv/diffusers/lib/python3.8/site-packages/diffusers/schedulers/scheduling_ddpm.py line 258 got an unexpected keyword argument `eta`\r\n```\r\n\r\nIs there anything I can do? \r\n\r\nThnaks!\n\n### Reproduction\n\nI used code lines the same as the typical example code:\r\n```python\r\nfrom diffusers import DDIMPipeline\r\n\r\nmodel_id = \"/home/sr5/se91.kim/AMP/Diffusers/models/google/ddpm-cifar10-32\"\r\n\r\n# load model and scheduler\r\nddim = DDIMPipeline.from_pretrained(model_id)\r\n\r\n# run pipeline in inference (sample random noise and denoise)\r\nimage = ddim(num_inference_steps=50).images[0]\r\n\r\n# save image\r\nimage.save(\"ddim_generated_image.png\")\r\n```\n\n### Logs\n\n_No response_\n\n### System Info\n\nI saw a closed issue (https://github.com/huggingface/diffusers/issues/170) but the diffusers in my virtual env. is already of the latest version (0.12.dev):\r\n```bash\r\n$ pip list\r\nPackage            Version\r\n------------------ ------------\r\naccelerate         0.15.0\r\ncertifi            2020.12.5\r\nchardet            4.0.0\r\ndiffusers          0.12.0.dev0\r\nfilelock           3.0.12\r\nfsspec             2022.11.0\r\nhuggingface-hub    0.11.1\r\nidna               2.10\r\nimportlib-metadata 3.7.3\r\nnumpy              1.20.1\r\npackaging          20.9\r\nPillow             8.1.2\r\npip                21.0.1\r\npsutil             5.8.0\r\npyarrow            10.0.1\r\npyparsing          2.4.7\r\nPyYAML             5.4.1\r\nregex              2021.3.17\r\nrequests           2.25.1\r\nsetuptools         54.1.2\r\ntorch              1.9.1+cu111\r\ntorchaudio         0.9.1\r\ntorchvision        0.10.1+cu111\r\ntqdm               4.64.1\r\ntyping-extensions  3.7.4.3\r\nurllib3            1.26.4\r\nwheel              0.36.2\r\nzipp               3.4.1\r\n```\r\nI tried under two versions of diffusers; 0.12.dev and 0.11.1, and both give the same error message.\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\nfrom typing import List, Optional, Tuple, Union\n\nimport torch\n\nfrom ...utils import deprecate, randn_tensor\nfrom ..pipeline_utils import DiffusionPipeline, ImagePipelineOutput\n\n\nclass DDIMPipeline(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.\n        scheduler ([`SchedulerMixin`]):\n            A scheduler to be used in combination with `unet` to denoise the encoded image. Can be one of\n            [`DDPMScheduler`], or [`DDIMScheduler`].\n    \"\"\"\n\n    def __init__(self, unet, scheduler):\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        generator: Optional[Union[torch.Generator, List[torch.Generator]]] = None,\n        eta: float = 0.0,\n        num_inference_steps: int = 50,\n        use_clipped_model_output: Optional[bool] = None,\n        output_type: Optional[str] = \"pil\",\n        return_dict: bool = True,\n    ) -> Union[ImagePipelineOutput, Tuple]:\n        r\"\"\"\n        Args:\n            batch_size (`int`, *optional*, defaults to 1):\n                The number of images to generate.\n            generator (`torch.Generator`, *optional*):\n                One or a list of [torch generator(s)](https://pytorch.org/docs/stable/generated/torch.Generator.html)\n                to make generation deterministic.\n            eta (`float`, *optional*, defaults to 0.0):\n                The eta parameter which controls the scale of the variance (0 is DDIM and 1 is one type of DDPM).\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            use_clipped_model_output (`bool`, *optional*, defaults to `None`):\n                if `True` or `False`, see documentation for `DDIMScheduler.step`. If `None`, nothing is passed\n                downstream to the scheduler. So use `None` for schedulers which don't support this argument.\n            output_type (`str`, *optional*, defaults to `\"pil\"`):\n                The output format of the generate image. Choose between\n                [PIL](https://pillow.readthedocs.io/en/stable/): `PIL.Image.Image` or `np.array`.\n            return_dict (`bool`, *optional*, defaults to `True`):\n                Whether or not to return a [`~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\n        if (\n            generator is not None\n            and isinstance(generator, torch.Generator)\n            and generator.device.type != self.device.type\n            and self.device.type != \"mps\"\n        ):\n            message = (\n                f\"The `generator` device is `{generator.device}` and does not match the pipeline \"\n                f\"device `{self.device}`, so the `generator` will be ignored. \"\n                f'Please use `generator=torch.Generator(device=\"{self.device}\")` instead.'\n            )\n            deprecate(\n                \"generator.device == 'cpu'\",\n                \"0.13.0\",\n                message,\n            )\n            generator = None\n\n        # Sample gaussian noise to begin loop\n        if isinstance(self.unet.sample_size, int):\n            image_shape = (batch_size, self.unet.in_channels, self.unet.sample_size, self.unet.sample_size)\n        else:\n            image_shape = (batch_size, self.unet.in_channels, *self.unet.sample_size)\n\n        if isinstance(generator, list) and len(generator) != batch_size:\n            raise ValueError(\n                f\"You have passed a list of generators of length {len(generator)}, but requested an effective batch\"\n                f\" size of {batch_size}. Make sure the batch size matches the length of the generators.\"\n            )\n\n        image = randn_tensor(image_shape, generator=generator, device=self.device, dtype=self.unet.dtype)\n\n        # set step values\n        self.scheduler.set_timesteps(num_inference_steps)\n\n        for t in self.progress_bar(self.scheduler.timesteps):\n            # 1. predict noise model_output\n            model_output = self.unet(image, t).sample\n\n            # 2. predict previous mean of image x_t-1 and add variance depending on eta\n            # eta corresponds to \u03b7 in paper and should be between [0, 1]\n            # do x_t -> x_t-1\n            image = self.scheduler.step(\n                model_output, t, image, eta=eta, use_clipped_model_output=use_clipped_model_output, generator=generator\n            ).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/ddim/pipeline_ddim.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\nfrom typing import List, Optional, Tuple, Union\n\nimport torch\n\nfrom ...schedulers import DDIMScheduler\nfrom ...utils import deprecate, randn_tensor\nfrom ..pipeline_utils import DiffusionPipeline, ImagePipelineOutput\n\n\nclass DDIMPipeline(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.\n        scheduler ([`SchedulerMixin`]):\n            A scheduler to be used in combination with `unet` to denoise the encoded image. Can be one of\n            [`DDPMScheduler`], or [`DDIMScheduler`].\n    \"\"\"\n\n    def __init__(self, unet, scheduler):\n        super().__init__()\n\n        # make sure scheduler can always be converted to DDIM\n        scheduler = DDIMScheduler.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        generator: Optional[Union[torch.Generator, List[torch.Generator]]] = None,\n        eta: float = 0.0,\n        num_inference_steps: int = 50,\n        use_clipped_model_output: Optional[bool] = None,\n        output_type: Optional[str] = \"pil\",\n        return_dict: bool = True,\n    ) -> Union[ImagePipelineOutput, Tuple]:\n        r\"\"\"\n        Args:\n            batch_size (`int`, *optional*, defaults to 1):\n                The number of images to generate.\n            generator (`torch.Generator`, *optional*):\n                One or a list of [torch generator(s)](https://pytorch.org/docs/stable/generated/torch.Generator.html)\n                to make generation deterministic.\n            eta (`float`, *optional*, defaults to 0.0):\n                The eta parameter which controls the scale of the variance (0 is DDIM and 1 is one type of DDPM).\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            use_clipped_model_output (`bool`, *optional*, defaults to `None`):\n                if `True` or `False`, see documentation for `DDIMScheduler.step`. If `None`, nothing is passed\n                downstream to the scheduler. So use `None` for schedulers which don't support this argument.\n            output_type (`str`, *optional*, defaults to `\"pil\"`):\n                The output format of the generate image. Choose between\n                [PIL](https://pillow.readthedocs.io/en/stable/): `PIL.Image.Image` or `np.array`.\n            return_dict (`bool`, *optional*, defaults to `True`):\n                Whether or not to return a [`~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\n        if (\n            generator is not None\n            and isinstance(generator, torch.Generator)\n            and generator.device.type != self.device.type\n            and self.device.type != \"mps\"\n        ):\n            message = (\n                f\"The `generator` device is `{generator.device}` and does not match the pipeline \"\n                f\"device `{self.device}`, so the `generator` will be ignored. \"\n                f'Please use `generator=torch.Generator(device=\"{self.device}\")` instead.'\n            )\n            deprecate(\n                \"generator.device == 'cpu'\",\n                \"0.13.0\",\n                message,\n            )\n            generator = None\n\n        # Sample gaussian noise to begin loop\n        if isinstance(self.unet.sample_size, int):\n            image_shape = (batch_size, self.unet.in_channels, self.unet.sample_size, self.unet.sample_size)\n        else:\n            image_shape = (batch_size, self.unet.in_channels, *self.unet.sample_size)\n\n        if isinstance(generator, list) and len(generator) != batch_size:\n            raise ValueError(\n                f\"You have passed a list of generators of length {len(generator)}, but requested an effective batch\"\n                f\" size of {batch_size}. Make sure the batch size matches the length of the generators.\"\n            )\n\n        image = randn_tensor(image_shape, generator=generator, device=self.device, dtype=self.unet.dtype)\n\n        # set step values\n        self.scheduler.set_timesteps(num_inference_steps)\n\n        for t in self.progress_bar(self.scheduler.timesteps):\n            # 1. predict noise model_output\n            model_output = self.unet(image, t).sample\n\n            # 2. predict previous mean of image x_t-1 and add variance depending on eta\n            # eta corresponds to \u03b7 in paper and should be between [0, 1]\n            # do x_t -> x_t-1\n            image = self.scheduler.step(\n                model_output, t, image, eta=eta, use_clipped_model_output=use_clipped_model_output, generator=generator\n            ).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/ddim/pipeline_ddim.py"}]}