add cheap approximation for flux

This commit is contained in:
Won-Kyu Park 2024-08-31 18:07:57 +09:00
parent 9e57c722b2
commit 789bfc7db4
No known key found for this signature in database
GPG key ID: 53AA79C8C9535D15

View file

@ -44,6 +44,8 @@ def model():
model_name = "vaeapprox-sd3.pt"
elif shared.sd_model.is_sdxl:
model_name = "vaeapprox-sdxl.pt"
elif shared.sd_model.is_flux1:
model_name = "vaeapprox-sd3.pt"
else:
model_name = "model.pt"
@ -81,6 +83,18 @@ def cheap_approximation(sample):
[ 0.0815, 0.0846, 0.1207], [-0.0120, -0.0055, -0.0867],
[-0.0749, -0.0634, -0.0456], [-0.1418, -0.1457, -0.1259],
]
elif shared.sd_model.is_flux1:
coeffs = [
# from comfy
[-0.0404, 0.0159, 0.0609], [ 0.0043, 0.0298, 0.0850],
[ 0.0328, -0.0749, -0.0503], [-0.0245, 0.0085, 0.0549],
[ 0.0966, 0.0894, 0.0530], [ 0.0035, 0.0399, 0.0123],
[ 0.0583, 0.1184, 0.1262], [-0.0191, -0.0206, -0.0306],
[-0.0324, 0.0055, 0.1001], [ 0.0955, 0.0659, -0.0545],
[-0.0504, 0.0231, -0.0013], [ 0.0500, -0.0008, -0.0088],
[ 0.0982, 0.0941, 0.0976], [-0.1233, -0.0280, -0.0897],
[-0.0005, -0.0530, -0.0020], [-0.1273, -0.0932, -0.0680],
]
elif shared.sd_model.is_sdxl:
coeffs = [
[ 0.3448, 0.4168, 0.4395],