Skip to content
Open
Show file tree
Hide file tree
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
7 changes: 5 additions & 2 deletions src/diffusers/models/autoencoders/vae.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import torch
import torch.nn as nn

from ...utils import BaseOutput
from ...utils import BaseOutput, logging
from ...utils.torch_utils import randn_tensor
from ..activations import get_activation
from ..attention_processor import SpatialNorm
Expand All @@ -29,6 +29,9 @@
)


logger = logging.get_logger(__name__)


@dataclass
class EncoderOutput(BaseOutput):
r"""
Expand Down Expand Up @@ -599,7 +602,7 @@ def __init__(
if self.unknown_index == "extra":
self.unknown_index = self.re_embed
self.re_embed = self.re_embed + 1
print(
logger.info(
f"Remapping {self.n_e} indices to {self.re_embed} indices. "
f"Using {self.unknown_index} for unknown indices."
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ def prepare_pos_ids(modality_id=0, type="text", start=(0, 0), num_token=None, he
if type == "text":
assert num_token
if height or width:
print('Warning: The parameters of height and width will be ignored in "text" type.')
logger.warning('The parameters of height and width will be ignored in "text" type.')
pos_ids = torch.zeros(num_token, 3)
pos_ids[..., 0] = modality_id
pos_ids[..., 1] = torch.arange(num_token) + start[0]
pos_ids[..., 2] = torch.arange(num_token) + start[1]
elif type == "image":
assert height and width
if num_token:
print('Warning: The parameter of num_token will be ignored in "image" type.')
logger.warning('The parameter of num_token will be ignored in "image" type.')
pos_ids = torch.zeros(height, width, 3)
pos_ids[..., 0] = modality_id
pos_ids[..., 1] = pos_ids[..., 1] + torch.arange(height)[:, None] + start[0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ def prepare_pos_ids(modality_id=0, type="text", start=(0, 0), num_token=None, he
if type == "text":
assert num_token
if height or width:
print('Warning: The parameters of height and width will be ignored in "text" type.')
logger.warning('The parameters of height and width will be ignored in "text" type.')
pos_ids = torch.zeros(num_token, 3)
pos_ids[..., 0] = modality_id
pos_ids[..., 1] = torch.arange(num_token) + start[0]
pos_ids[..., 2] = torch.arange(num_token) + start[1]
elif type == "image":
assert height and width
if num_token:
print('Warning: The parameter of num_token will be ignored in "image" type.')
logger.warning('The parameter of num_token will be ignored in "image" type.')
pos_ids = torch.zeros(height, width, 3)
pos_ids[..., 0] = modality_id
pos_ids[..., 1] = pos_ids[..., 1] + torch.arange(height)[:, None] + start[0]
Expand Down
2 changes: 1 addition & 1 deletion src/diffusers/pipelines/wan/pipeline_wan_animate.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ def prepare_prev_segment_cond_latents(
latent_height = height // self.vae_scale_factor_spatial
latent_width = width // self.vae_scale_factor_spatial
if segment_height != height or segment_width != width:
print(
logger.warning(
f"Interpolating prev segment cond video from ({segment_width}, {segment_height}) to ({width}, {height})"
)
# Perform a 4D (spatial) rather than a 5D (spatiotemporal) reshape, following the original code
Expand Down
Loading