Expose the VAE tile_size on the VAE encode and decode invocations.

This commit is contained in:
Ryan Dick
2024-06-28 11:30:09 -04:00
parent a1b7dbfa54
commit 3752509066
4 changed files with 42 additions and 20 deletions

View File

@ -11,6 +11,12 @@ def patch_vae_tiling_params(
tile_latent_min_size: int,
tile_overlap_factor: float,
):
"""Patch the parameters that control the VAE tiling tile size and overlap.
These parameters are not explicitly exposed in the VAE's API, but they have a significant impact on the quality of
the outputs. As a general rule, bigger tiles produce better results, but this comes at the cost of higher memory
usage.
"""
# Record initial config.
orig_tile_sample_min_size = vae.tile_sample_min_size
orig_tile_latent_min_size = vae.tile_latent_min_size