diff --git a/src/diffusers/pipelines/pipeline_utils.py b/src/diffusers/pipelines/pipeline_utils.py index a504184ea2f2..774d6c75a3b1 100644 --- a/src/diffusers/pipelines/pipeline_utils.py +++ b/src/diffusers/pipelines/pipeline_utils.py @@ -21,7 +21,7 @@ import sys from dataclasses import dataclass from pathlib import Path -from typing import Any, Callable, Dict, List, Optional, Union, get_args, get_origin +from typing import Any, Callable, Dict, List, Optional, Self, Union, get_args, get_origin import numpy as np import PIL.Image @@ -317,7 +317,7 @@ def is_saveable_module(name, value): create_pr=create_pr, ) - def to(self, *args, **kwargs): + def to(self, *args, **kwargs) -> Self: r""" Performs Pipeline dtype and/or device conversion. A torch.dtype and torch.device are inferred from the arguments of `self.to(*args, **kwargs).`