# Copyright 2026 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Per-channel latent statistics of the LTX-2 autoencoders, the `latents_mean` / `latents_std` buffers of the `vae`
# and `audio_vae` of `Lightricks/LTX-2` rounded to six decimals (the buffers are bfloat16, so this is well inside
# their resolution). `LTX2ModularPipeline` serves them from its `latents_mean` / `latents_std` /
# `audio_latents_mean` / `audio_latents_std` properties when the autoencoder they belong to is not loaded, the same
# fallback the compression-ratio properties make for their components.

# fmt: off

LTX2_LATENTS_MEAN = [
    -0.077637, -0.062012, 0.073242, 0.089355, 0.002945, 0.002457, 0.013428, -0.054199,
    0.022461, 0.037354, -0.025757, 0.055176, -0.050293, 0.017212, 0.009949, 0.042236,
    -0.032715, 0.055908, -0.048584, -0.005981, -0.008545, 0.008911, -0.006714, 0.010742,
    -0.040039, 0.030762, -0.003494, 0.019775, -0.058105, -0.030029, -0.049316, -0.040771,
    0.011536, -0.009338, 0.029175, 0.004547, -0.013245, 0.029541, -0.019897, 0.026123,
    -0.064453, 0.018555, -0.100098, -0.032715, 0.05249, 0.125, -0.010498, 0.031494,
    0.166016, -0.044434, -0.016357, 0.012451, 0.01239, -0.034424, -0.016724, 0.041992,
    -0.003189, -0.005249, -0.040527, -0.018066, -0.058105, 0.020874, 0.034668, 0.002426,
    -0.09375, -0.050537, 0.074219, -0.041016, -0.077148, 0.0019, -0.097168, -0.004639,
    -0.005859, 0.006744, 0.040771, -0.003418, 0.062012, 0.083008, 0.092773, -0.003708,
    0.031494, -0.048828, -0.02063, -0.005127, -0.054932, -0.068359, 0.000687, -0.032471,
    -0.018677, 0.010193, 0.005707, -0.042236, 0.109375, 0.013367, -0.041504, -0.009399,
    -0.050293, 0.019043, 0.040527, 0.036377, -0.005127, 0.009338, -0.00206, 0.006805,
    0.023315, -0.008728, 0.010986, -0.015625, -0.154297, -0.003021, -0.012573, -0.030273,
    0.017944, 0.005249, 0.039551, -0.096191, -0.031494, 0.009033, -0.002014, -0.039795,
    -0.047119, -0.003555, -0.016479, -0.09082, 0.007996, -0.064941, 0.142578, 0.023315,
]

LTX2_LATENTS_STD = [
    0.161133, 0.12793, 0.168945, 0.189453, 0.135742, 0.12207, 0.150391, 0.193359,
    0.099121, 0.120117, 0.124023, 0.117676, 0.160156, 0.244141, 0.143555, 0.136719,
    0.113281, 0.128906, 0.222656, 0.150391, 0.120605, 0.092773, 0.296875, 0.12793,
    0.141602, 0.179688, 0.144531, 0.125, 0.144531, 0.096191, 0.191406, 0.114258,
    0.178711, 0.131836, 0.103516, 0.099609, 0.129883, 0.166992, 0.105469, 0.103027,
    0.126953, 0.103027, 0.205078, 0.239258, 0.167969, 0.1875, 0.104492, 0.253906,
    0.170898, 0.129883, 0.158203, 0.099121, 0.117188, 0.147461, 0.129883, 0.209961,
    0.141602, 0.124512, 0.15332, 0.132812, 0.116699, 0.140625, 0.220703, 0.108887,
    0.351562, 0.115723, 0.15332, 0.114258, 0.217773, 0.121582, 0.144531, 0.167969,
    0.198242, 0.134766, 0.138672, 0.120605, 0.118652, 0.200195, 0.106934, 0.126953,
    0.116211, 0.144531, 0.253906, 0.116699, 0.181641, 0.141602, 0.146484, 0.126953,
    0.107422, 0.121094, 0.106445, 0.21582, 0.433594, 0.105957, 0.186523, 0.130859,
    0.112793, 0.121094, 0.111816, 0.132812, 0.161133, 0.108398, 0.15332, 0.12793,
    0.121094, 0.104492, 0.107422, 0.09668, 0.349609, 0.103027, 0.108887, 0.208984,
    0.150391, 0.228516, 0.112793, 0.15918, 0.15625, 0.110352, 0.10498, 0.130859,
    0.095215, 0.112793, 0.137695, 0.166016, 0.150391, 0.125977, 0.279297, 0.107422,
]

LTX2_AUDIO_LATENTS_MEAN = [
    1.539062, 2.84375, 2.359375, 1.992188, 1.539062, 1.296875, 1.085938, 0.871094,
    0.628906, 0.404297, 0.197266, -0.102051, -0.431641, -0.734375, -1.054688, -0.652344,
    0.4375, -0.679688, -0.429688, -0.296875, -0.112793, 0.035645, 0.145508, 0.211914,
    0.294922, 0.388672, 0.462891, 0.574219, 0.660156, 0.894531, 0.490234, 0.707031,
    0.753906, 0.412109, 0.365234, 0.149414, -0.007996, -0.122559, -0.193359, -0.310547,
    -0.431641, -0.486328, -0.644531, -0.738281, -0.878906, -1.070312, -0.941406, -0.976562,
    0.064453, -0.373047, -0.138672, -0.257812, -0.384766, -0.498047, -0.5625, -0.59375,
    -0.691406, -0.765625, -0.785156, -0.878906, -0.898438, -0.976562, -1.085938, -0.507812,
    1.617188, 1.671875, 1.789062, 1.742188, 1.710938, 1.6875, 1.664062, 1.609375,
    1.546875, 1.546875, 1.507812, 1.429688, 1.390625, 1.203125, 1.3125, 0.773438,
    -0.242188, -1.960938, -1.328125, -1.203125, -0.992188, -0.796875, -0.703125, -0.574219,
    -0.466797, -0.363281, -0.227539, -0.101074, 0.016602, 0.231445, 0.375, 0.15625,
    0.960938, 0.523438, 0.589844, 0.3125, 0.164062, 0.067871, 0.006317, -0.093262,
    -0.174805, -0.224609, -0.316406, -0.376953, -0.474609, -0.703125, -0.824219, -1.484375,
    0.21875, 0.111816, 0.289062, 0.00705, -0.234375, -0.408203, -0.527344, -0.671875,
    -0.789062, -0.949219, -1.070312, -1.257812, -1.390625, -1.585938, -1.671875, -1.804688,
]

LTX2_AUDIO_LATENTS_STD = [
    1.992188, 2.125, 2.078125, 2.046875, 2.046875, 2.03125, 2.015625, 1.976562,
    1.984375, 1.96875, 1.96875, 1.945312, 1.929688, 1.90625, 1.945312, 1.726562,
    1.09375, 1.265625, 1.242188, 1.203125, 1.171875, 1.148438, 1.117188, 1.085938,
    1.085938, 1.054688, 1.023438, 1.007812, 0.980469, 0.964844, 0.90625, 0.882812,
    1.3125, 1.328125, 1.289062, 1.234375, 1.21875, 1.179688, 1.179688, 1.117188,
    1.0625, 1.039062, 1.046875, 1.015625, 0.996094, 0.980469, 1.007812, 1.015625,
    1.429688, 1.210938, 1.148438, 1.101562, 1.078125, 1.039062, 0.988281, 0.980469,
    0.949219, 0.902344, 0.902344, 0.875, 0.867188, 0.847656, 0.820312, 0.914062,
    0.769531, 1.109375, 1.109375, 1.09375, 1.078125, 1.070312, 1.039062, 1.007812,
    0.960938, 0.914062, 0.871094, 0.824219, 0.792969, 0.777344, 0.773438, 0.753906,
    1.320312, 1.382812, 1.296875, 1.296875, 1.257812, 1.242188, 1.234375, 1.203125,
    1.179688, 1.171875, 1.179688, 1.125, 1.125, 1.101562, 1.109375, 1.171875,
    1.46875, 1.28125, 1.242188, 1.210938, 1.210938, 1.1875, 1.140625, 1.132812,
    1.109375, 1.09375, 1.085938, 1.0625, 1.054688, 1.0625, 1.101562, 1.351562,
    1.203125, 1.5625, 1.460938, 1.445312, 1.398438, 1.390625, 1.359375, 1.328125,
    1.3125, 1.289062, 1.296875, 1.242188, 1.234375, 1.21875, 1.226562, 1.054688,
]
# fmt: on
