Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/diffusers/pipelines/ddim/pipeline_ddim.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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"
Expand Down
Loading