From c37f15f98ef152fbd9e95fe49311019503145d6b Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Wed, 26 Feb 2025 08:56:23 -0500 Subject: [PATCH] Add fast preview support for Wan models. --- comfy/latent_formats.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/comfy/latent_formats.py b/comfy/latent_formats.py index 8299ecd1b92..622c1df547e 100644 --- a/comfy/latent_formats.py +++ b/comfy/latent_formats.py @@ -412,6 +412,27 @@ class Wan21(LatentFormat): latent_channels = 16 latent_dimensions = 3 + latent_rgb_factors = [ + [-0.1299, -0.1692, 0.2932], + [ 0.0671, 0.0406, 0.0442], + [ 0.3568, 0.2548, 0.1747], + [ 0.0372, 0.2344, 0.1420], + [ 0.0313, 0.0189, -0.0328], + [ 0.0296, -0.0956, -0.0665], + [-0.3477, -0.4059, -0.2925], + [ 0.0166, 0.1902, 0.1975], + [-0.0412, 0.0267, -0.1364], + [-0.1293, 0.0740, 0.1636], + [ 0.0680, 0.3019, 0.1128], + [ 0.0032, 0.0581, 0.0639], + [-0.1251, 0.0927, 0.1699], + [ 0.0060, -0.0633, 0.0005], + [ 0.3477, 0.2275, 0.2950], + [ 0.1984, 0.0913, 0.1861] + ] + + latent_rgb_factors_bias = [-0.1835, -0.0868, -0.3360] + def __init__(self): self.scale_factor = 1.0 self.latents_mean = torch.tensor([