Skip to content

Commit 94781b6

Browse files
make style
1 parent 928c6d3 commit 94781b6

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

src/diffusers/models/autoencoder_kl.py

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ def __init__(
111111

112112
def enable_tiling(self, use_tiling: bool = True):
113113
r"""
114-
Enable tiled VAE decoding.
115-
When this option is enabled, the VAE will split the input tensor into tiles to compute decoding and encoding in
116-
several steps. This is useful to save a large amount of memory and to allow the processing of larger images.
114+
Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to
115+
compute decoding and encoding in several steps. This is useful to save a large amount of memory and to allow
116+
the processing of larger images.
117117
"""
118118
self.use_tiling = use_tiling
119119

@@ -126,9 +126,8 @@ def disable_tiling(self):
126126

127127
def enable_slicing(self):
128128
r"""
129-
Enable sliced VAE decoding.
130-
When this option is enabled, the VAE will split the input tensor in slices to compute decoding in several
131-
steps. This is useful to save some memory and allow larger batch sizes.
129+
Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
130+
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.
132131
"""
133132
self.use_slicing = True
134133

@@ -190,12 +189,12 @@ def blend_h(self, a, b, blend_width):
190189

191190
def tiled_encode(self, x: torch.FloatTensor, return_dict: bool = True) -> AutoencoderKLOutput:
192191
r"""Encode a batch of images using a tiled encoder.
193-
When this option is enabled, the VAE will split the input tensor into tiles to compute encoding in several
194-
steps. This is useful to keep memory use constant regardless of image size.
195-
The end result of tiled encoding is different from non-tiled encoding due to each tile using a different
196-
encoder. To avoid tiling artifacts, the tiles overlap and are blended together to form a smooth output. You may
197-
still see tile-sized changes in the look of the output, but they should be much less noticeable.
198192
Args:
193+
When this option is enabled, the VAE will split the input tensor into tiles to compute encoding in several
194+
steps. This is useful to keep memory use constant regardless of image size. The end result of tiled encoding is
195+
different from non-tiled encoding due to each tile using a different encoder. To avoid tiling artifacts, the
196+
tiles overlap and are blended together to form a smooth output. You may still see tile-sized changes in the
197+
look of the output, but they should be much less noticeable.
199198
x (`torch.FloatTensor`): Input batch of images.
200199
return_dict (`bool`, *optional*, defaults to `True`):
201200
Whether or not to return a [`AutoencoderKLOutput`] instead of a plain tuple.
@@ -233,12 +232,12 @@ def tiled_encode(self, x: torch.FloatTensor, return_dict: bool = True) -> Autoen
233232

234233
def tiled_decode(self, z: torch.FloatTensor, return_dict: bool = True) -> Union[DecoderOutput, torch.FloatTensor]:
235234
r"""Decode a batch of images using a tiled decoder.
236-
When this option is enabled, the VAE will split the input tensor into tiles to compute decoding in several
237-
steps. This is useful to keep memory use constant regardless of image size.
238-
The end result of tiled decoding is different from non-tiled decoding due to each tile using a different
239-
decoder. To avoid tiling artifacts, the tiles overlap and are blended together to form a smooth output. You may
240-
still see tile-sized changes in the look of the output, but they should be much less noticeable.
241235
Args:
236+
When this option is enabled, the VAE will split the input tensor into tiles to compute decoding in several
237+
steps. This is useful to keep memory use constant regardless of image size. The end result of tiled decoding is
238+
different from non-tiled decoding due to each tile using a different decoder. To avoid tiling artifacts, the
239+
tiles overlap and are blended together to form a smooth output. You may still see tile-sized changes in the
240+
look of the output, but they should be much less noticeable.
242241
z (`torch.FloatTensor`): Input batch of latent vectors.
243242
return_dict (`bool`, *optional*, defaults to `True`):
244243
Whether or not to return a [`DecoderOutput`] instead of a plain tuple.

0 commit comments

Comments
 (0)