diff --git a/src/diffusers/pipelines/ddim/pipeline_ddim.py b/src/diffusers/pipelines/ddim/pipeline_ddim.py index dc92b34a7565..6634fb1b0e27 100644 --- a/src/diffusers/pipelines/ddim/pipeline_ddim.py +++ b/src/diffusers/pipelines/ddim/pipeline_ddim.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +import logging + import torch from ...models import UNet2DModel @@ -21,6 +23,9 @@ from ..pipeline_utils import DiffusionPipeline, ImagePipelineOutput +logger = logging.getLogger(__name__) + + if is_torch_xla_available(): import torch_xla.core.xla_model as xm @@ -129,6 +134,13 @@ def __call__( else: image_shape = (batch_size, self.unet.config.in_channels, *self.unet.config.sample_size) + if not 0.0 <= eta <= 1.0: + logger.warning( + f"`eta` should be between 0 and 1 (inclusive), but received {eta}. " + "A value of 0 corresponds to DDIM and 1 corresponds to DDPM. " + "Unexpected results may occur for values outside this range." + ) + if isinstance(generator, list) and len(generator) != batch_size: raise ValueError( f"You have passed a list of generators of length {len(generator)}, but requested an effective batch"