Skip to content

Commit 657b4b0

Browse files
author
huangfeice
committed
[fix] remove deprecated method decode_latents
1 parent 001f7d3 commit 657b4b0

1 file changed

Lines changed: 0 additions & 28 deletions

File tree

src/diffusers/pipelines/joyimage/pipeline_joyimage_edit.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -618,34 +618,6 @@ def encode_prompt(
618618

619619
return prompt_embeds, prompt_embeds_mask
620620

621-
def decode_latents(self, latents: torch.Tensor, enable_tiling: bool = True) -> torch.Tensor:
622-
"""
623-
Decode latents to pixel values.
624-
625-
.. deprecated:: 1.0.0
626-
Use the VAE directly instead of calling this method.
627-
628-
Args:
629-
latents: Latent tensor to decode.
630-
enable_tiling: Whether to enable tiled decoding to save memory.
631-
632-
Returns:
633-
Float tensor of shape (..., H, W, C) with values in [0, 1].
634-
"""
635-
deprecation_message = "The decode_latents method is deprecated."
636-
deprecate("decode_latents", "1.0.0", deprecation_message, standard_warn=False)
637-
638-
latents = 1 / self.vae.config.scaling_factor * latents
639-
if enable_tiling:
640-
self.vae.enable_tiling()
641-
image = self.vae.decode(latents, return_dict=False)[0]
642-
image = (image / 2 + 0.5).clamp(0, 1)
643-
if image.ndim == 4:
644-
image = image.cpu().permute(0, 2, 3, 1).float()
645-
else:
646-
image = image.cpu().float()
647-
return image
648-
649621
def check_inputs(
650622
self,
651623
prompt,

0 commit comments

Comments
 (0)