@@ -111,9 +111,9 @@ def __init__(
111
111
112
112
def enable_tiling (self , use_tiling : bool = True ):
113
113
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.
117
117
"""
118
118
self .use_tiling = use_tiling
119
119
@@ -126,9 +126,8 @@ def disable_tiling(self):
126
126
127
127
def enable_slicing (self ):
128
128
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.
132
131
"""
133
132
self .use_slicing = True
134
133
@@ -190,12 +189,12 @@ def blend_h(self, a, b, blend_width):
190
189
191
190
def tiled_encode (self , x : torch .FloatTensor , return_dict : bool = True ) -> AutoencoderKLOutput :
192
191
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.
198
192
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.
199
198
x (`torch.FloatTensor`): Input batch of images.
200
199
return_dict (`bool`, *optional*, defaults to `True`):
201
200
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
233
232
234
233
def tiled_decode (self , z : torch .FloatTensor , return_dict : bool = True ) -> Union [DecoderOutput , torch .FloatTensor ]:
235
234
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.
241
235
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.
242
241
z (`torch.FloatTensor`): Input batch of latent vectors.
243
242
return_dict (`bool`, *optional*, defaults to `True`):
244
243
Whether or not to return a [`DecoderOutput`] instead of a plain tuple.
0 commit comments