diff --git a/NOTICE.MD b/NOTICE.MD index 62837e7..6d3e36e 100755 --- a/NOTICE.MD +++ b/NOTICE.MD @@ -7,4 +7,4 @@ The MIT license applies to the files in: file: "src/novelai_python/sdk/ai/generate_image.py" from https://github.com/HanaokaYuzu/NovelAI-API file: "src/novelai_python/tokenizer/novelai.model" from https://github.com/NovelAI/novelai-tokenizer file: "src/novelai_python/tokenizer/novelai_v2.model from https://github.com/NovelAI/novelai-tokenizer - file: "src/novelai_python/tool/image_metadata/lsb_injector.py" from https://github.com/NovelAI/novelai-image-metadata \ No newline at end of file + file: "src/novelai_python/tool/image_metadata/lsb_injector.py" from https://github.com/NovelAI/novelai-image-metadata diff --git a/README.md b/README.md index 36d0961..8b49e3c 100755 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![PyPI version](https://badge.fury.io/py/novelai-python.svg)](https://badge.fury.io/py/novelai-python) [![Downloads](https://pepy.tech/badge/novelai_python)](https://pepy.tech/project/novelai_python) -✨ NovelAI api python sdk with Pydantic +✨ NovelAI api python sdk with Pydantic. The goal of this repository is to use Pydantic to build legitimate requests to access the NovelAI API service. @@ -26,6 +26,11 @@ The goal of this repository is to use Pydantic to build legitimate requests to a - [ ] /ai/generate - [ ] /ai/generate-voice +> GenerateImageInfer.calculate_cost is correct in most cases, but please request account information to get accurate +> consumption information. + +> This repo is maintained by me personally now. If you have any questions, please feel free to open an issue. + ### Usage 🖥️ ```shell diff --git a/playground/generate_image.py b/playground/generate_image.py index 30f9106..4767225 100755 --- a/playground/generate_image.py +++ b/playground/generate_image.py @@ -11,7 +11,7 @@ from novelai_python import APIError, Login from novelai_python import GenerateImageInfer, ImageGenerateResp, JwtCredential -from novelai_python.sdk.ai.generate_image import Action, Sampler +from novelai_python.sdk.ai.generate_image import Action, Sampler, Model from novelai_python.utils.useful import enum_to_list @@ -30,14 +30,15 @@ async def generate(prompt="1girl, year 2023, dynamic angle, best quality, amazin try: agent = GenerateImageInfer.build( prompt=prompt, + model=Model.NAI_DIFFUSION_3, action=Action.GENERATE, - sampler=Sampler.K_DPMPP_SDE, + sampler=Sampler.DDIM, qualityToggle=True, ) print(f"charge: {agent.calculate_cost(is_opus=True)} if you are vip3") print(f"charge: {agent.calculate_cost(is_opus=False)} if you are not vip3") result = await agent.request( - session=credential, remove_sign=True + session=credential ) except APIError as e: print(f"Error: {e.message}") diff --git a/playground/image_metadata/read_nai_tag.py b/playground/image_metadata/read_nai_tag.py index 291fa1e..0967ab8 100644 --- a/playground/image_metadata/read_nai_tag.py +++ b/playground/image_metadata/read_nai_tag.py @@ -17,3 +17,13 @@ print(meta.Title) print(meta.Description) print(meta.Comment) + +image = Path(__file__).parent.joinpath("sample-0317.png") +try: + meta = ImageMetadata.load_image(image) +except ValueError: + raise LookupError("Cant find a MetaData") + +print(meta.Title) +print(meta.Description) +print(meta.Comment) diff --git a/playground/image_metadata/sample-0317.png b/playground/image_metadata/sample-0317.png new file mode 100644 index 0000000..39d86dc Binary files /dev/null and b/playground/image_metadata/sample-0317.png differ diff --git a/pyproject.toml b/pyproject.toml index 1021699..7ff735c 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "novelai-python" -version = "0.4.1" +version = "0.4.2" description = "NovelAI Python Binding With Pydantic" authors = [ { name = "sudoskys", email = "coldlando@hotmail.com" }, diff --git a/src/novelai_python/sdk/ai/generate_image/__init__.py b/src/novelai_python/sdk/ai/generate_image/__init__.py index 0f7f28e..25d94d7 100755 --- a/src/novelai_python/sdk/ai/generate_image/__init__.py +++ b/src/novelai_python/sdk/ai/generate_image/__init__.py @@ -21,6 +21,7 @@ from tenacity import retry, stop_after_attempt, wait_random, retry_if_exception from typing_extensions import override +from ._const import len_values, tempmin_value, sm_value, dyn_value, map_value from ._enum import Model, Sampler, NoiseSchedule, ControlNetModel, Action, UCPreset, INPAINTING_MODEL_LIST from ...schema import ApiBaseModel from ...._exceptions import APIError, AuthError, ConcurrentGenerationError, SessionHttpError @@ -33,6 +34,14 @@ class GenerateImageInfer(ApiBaseModel): _endpoint: str = PrivateAttr("https://image.novelai.net") + @property + def endpoint(self): + return self._endpoint + + @endpoint.setter + def endpoint(self, value): + self._endpoint = value + class Params(BaseModel): add_original_image: Optional[bool] = Field(True, description="Overlay Original Image") """ @@ -186,6 +195,17 @@ def add_image_to_black_background(image: Union[str, bytes], width: int = 448, he # Validators @model_validator(mode="after") def image_validator(self): + if self.sampler: + if self.sampler in [Sampler.DDIM, Sampler.DDIM_V3]: + self.sm = False + self.sm_dyn = False + if self.sm_dyn or self.sm: + logger.warning("sm and sm_dyn is disabled when using ddim sampler.") + if self.sampler in [Sampler.NAI_SMEA_DYN]: + self.sm = True + self.sm_dyn = True + if not self.sm_dyn: + logger.warning("sm and sm_dyn is enabled when using nai_smea_dyn sampler.") if isinstance(self.image, str) and self.image.startswith("data:"): raise ValueError("Invalid `image` format, must be base64 encoded directly.") if isinstance(self.reference_image, str) and self.reference_image.startswith("data:"): @@ -232,14 +252,6 @@ def height_validator(cls, v: int): parameters: Params = Params() model_config = ConfigDict(extra="ignore") - @property - def endpoint(self): - return self._endpoint - - @endpoint.setter - def endpoint(self, value): - self._endpoint = value - @override def model_post_init(self, *args) -> None: """ @@ -323,37 +335,65 @@ def calculate_cost(self, is_opus: bool = False): is_opus: `bool`, optional If the subscription tier is Opus. Opus accounts have access to free generations. """ - steps: int = self.parameters.steps n_samples: int = self.parameters.n_samples uncond_scale: float = self.parameters.uncond_scale - strength: float = self.action == "img2img" and self.parameters.strength or 1.0 - smea_factor = self.parameters.sm_dyn and 1.4 or self.parameters.sm and 1.2 or 1.0 + strength: float = self.action == Action.IMG2IMG and self.parameters.strength or 1.0 + sm: bool = self.parameters.sm + sm_dyn: bool = self.parameters.sm_dyn + sampler: Sampler = self.parameters.sampler resolution = max(self.parameters.width * self.parameters.height, 65536) + # Determine smea_factor + smea_factor = 1.4 if sm_dyn else 1.2 if sm else 1.0 - # For normal resolutions, squre is adjusted to the same price as portrait/landscape - if math.prod( - (832, 1216) - ) < resolution <= math.prod((1024, 1024)): + # For normal resolutions, square is adjusted to the same price as portrait/landscape + if resolution < math.prod((832, 1216)) or resolution <= math.prod((1024, 1024)): resolution = math.prod((832, 1216)) - per_sample = ( - math.ceil( - 2951823174884865e-21 * resolution - + 5.753298233447344e-7 * resolution * steps + + # Discount for Opus subscription + opus_discount = is_opus and steps <= 28 and resolution <= 1048576 + if opus_discount: + n_samples -= 1 + + if sampler == Sampler.DDIM_V3: + per_sample = ( + math.ceil( + 2.951823174884865E-6 * resolution + + 5.753298233447344E-7 * resolution * steps + ) + * smea_factor + ) + elif resolution <= 1048576 and sampler in [Sampler.PLMS, Sampler.DDIM, Sampler.K_EULER, + Sampler.K_EULER_ANCESTRAL, Sampler.K_LMS]: + per_sample = ( + (15.266497014243718 * math.exp( + resolution / 1048576 * 0.6326248927474729) - 15.225164493059737) / 28 * steps + ) + else: + try: + min_value = sm_value + if sampler in [Sampler.NAI_SMEA, Sampler.NAI_SMEA_DYN, Sampler.K_EULER_ANCESTRAL, Sampler.DDIM]: + min_value = dyn_value if sm_dyn else tempmin_value if sm else sm_value + if sampler == Sampler.DDIM: + min_value = len_values + # FIXME: This is a bug, the row should be calculated by steps and resolution + row = map_value[int(steps / 64) * int(resolution / 64)] + per_sample = min_value[row] * resolution + min_value[row + 1] + except Exception as e: + logger.warning(f"Error when calculate cost: {e}") + per_sample = ( + math.ceil( + 2.951823174884865E-6 * resolution + + 5.753298233447344E-7 * resolution * steps + ) + * smea_factor ) - * smea_factor - ) per_sample = max(math.ceil(per_sample * strength), 2) if uncond_scale != 1.0: per_sample = math.ceil(per_sample * 1.3) - opus_discount = ( - is_opus - and steps <= 28 - and (resolution <= math.prod((1024, 1024))) - ) - return per_sample * (n_samples - int(opus_discount)) + return per_sample * n_samples @classmethod def build(cls, diff --git a/src/novelai_python/sdk/ai/generate_image/_const.py b/src/novelai_python/sdk/ai/generate_image/_const.py new file mode 100644 index 0000000..117e37b --- /dev/null +++ b/src/novelai_python/sdk/ai/generate_image/_const.py @@ -0,0 +1,487 @@ +map_value = [1, 2, 4, 3, 6, 9, 8, 12, 16, 5, 10, 15, 20, 25, 18, 24, 30, 36, 7, 14, 21, 28, 35, 42, 49, 32, 40, 48, + 56, 64, 27, 45, 54, 63, 72, 81, 50, 60, 70, 80, 90, 100, 11, 22, 33, 44, 55, 66, 77, 88, 99, 110, 121, + 84, 96, 108, 120, 132, 144, 13, 26, 39, 52, 65, 78, 91, 104, 117, 130, 143, 156, 169, 98, 112, 126, 140, + 154, 168, 182, 196, 75, 105, 135, 150, 165, 180, 195, 210, 225, 128, 160, 176, 192, 208, 224, 240, 256, + 17, 34, 51, 68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238, 255, 272, + 289, 162, 198, 216, 234, 252, 270, 288, 306, 324, 19, 38, 57, 76, 95, 114, 133, 152, 171, 190, 209, 228, + 247, 266, 285, 304, 323, 342, 361, 200, 220, 260, 280, 300, 320, 340, 360, 380, 400, 147, 189, 231, 273, + 294, 315, 336, 357, 378, 399, 420, 441, 242, 264, 286, 308, 330, 352, 374, 396, 418, 440, 462, 484, 23, + 46, 69, 92, 115, 138, 161, 184, 207, 230, 253, 276, 299, 322, 345, 368, 391, 414, 437, 460, 483, 506, + 529, 312, 384, 408, 432, 456, 480, 504, 528, 552, 576, 125, 175, 250, 275, 325, 350, + 375, 425, 450, 475, 500, 525, 550, 575, 600, 625, 338, 364, 390, 416, 442, 468, 494, 520, 546, 572, 598, + 624, 650, 676, 243, 297, 351, 405, 459, 486, 513, 540, 567, 594, 621, 648, 675, 702, 729, 392, 448, 476, + 532, 560, 588, 616, 644, 672, 700, 728, 756, 29, 58, 87, 116, 145, 174, 203, 232, 261, 290, 319, 348, + 377, 406, 435, 464, 493, 522, 551, 580, 609, 638, 667, 696, 725, 754, 510, 570, 630, 660, 690, 720, 750, + 31, 62, 93, 124, 155, 186, 217, 248, 279, 310, 341, 372, 403, 434, 465, 496, 527, + 558, 589, 620, 651, 682, 713, 744, 512, 544, 608, 640, 704, 736, 768, 363, 429, 495, 561, 627, 693, 726, + 759, 578, 612, 646, 680, 714, 748, 245, 385, 455, 490, 595, 665, 735, 684, 37, 74, 111, 148, 185, 222, + 259, 296, 333, 370, 407, 444, 481, 518, 555, 592, 629, 666, 703, 740, 722, 760, 507, 585, 663, 741, 41, + 82, 123, 164, 205, 246, 287, 328, 369, 410, 451, 492, 533, 574, 615, 656, 697, 738, 43, 86, 129, 172, + 215, 258, 301, 344, 387, 430, 473, 516, 559, 602, 645, 688, 731, 765, 47, 94, 141, + 188, 235, 282, 329, 376, 423, 470, 517, 564, 611, 658, 705, 752, 343, 539, 637, 686, 53, 106, 159, 212, + 265, 318, 371, 424, 477, 530, 583, 636, 689, 742, 605, 715, 59, 118, 177, 236, 295, 354, 413, 472, 531, + 590, 649, 708, 767, 61, 122, 183, 244, 305, 366, 427, 488, 549, 610, 671, 732, 67, 134, 201, 268, 335, + 402, 469, 536, 603, 670, 737, 71, 142, 213, 284, 355, 426, 497, 568, 639, 710, 73, 146, 219, 292, 365, + 438, 511, 584, 657, 730, 79, 158, 237, 316, 395, 474, 553, 632, 711, 83, 166, 249, + 332, 415, 498, 581, 664, 747, 89, 178, 267, 356, 445, 534, 623, 712, 97, 194, 291, 388, 485, 582, 679, + 101, 202, 303, 404, 505, 606, 707, 103, 206, 309, 412, 515, 618, 721, 107, 214, 321, 428, 535, 642, 749, + 109, 218, 327, 436, 545, 654, 763, 113, 226, 339, 452, 565, 678, 127, 254, 381, 508, 635, 762, 131, 262, + 393, 524, 655, 137, 274, 411, 548, 685, 139, 278, 417, 556, 695, 149, 298, 447, 596, 745, 151, 302, 453, + 604, 755, 157, 314, 471, 628, 163, 326, 489, 652, 167, 334, 501, 668, 173, 346, + 519, 692, 179, 358, 537, 716, 181, 362, 543, 724, 191, 382, 573, 764, 193, 386, 579, 197, 394, 591, 199, + 398, 597, 211, 422, 633, 223, 446, 669, 227, 454, 681, 229, 458, 687, 233, 466, 699, 239, 478, 717, 241, + 482, 723, 251, 502, 753, 257, 514, 263, 526, 269, 538, 271, 542, 277, 554, 281, 562, 283, 566, 293, 586, + 307, 614, 311, 622, 313, 626, 317, 634, 331, 662, 337, 674, 347, 694, 349, 698, 353, 706, 359, 718, 367, + 734, 373, 746, 379, 758, 383, 766, 389, 397, 401, 409, 419, 421, 431, 433, 439, + 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, + 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, + 719, 727, 733, 739, 743, 751, 757, 761] + +tempmin_value = [0.124, 0.11, 0.124, 0.205, 0.121, 0.307, 0.121, 0.227, 0.12, 0.31, 0.121, 0.257, 0.121, 0.251, 0.123, + 0.297, 0.121, 0.298, 0.12, 0.305, 0.128, 0.195, 0.12, 0.327, 0.117, 0.34, 0.122, 0.244, 0.12, 0.28, + 0.119, 0.344, 0.125, 0.216, 0.135, 0.149, 0.12, 0.314, 0.121, 0.314, 0.122, 0.253, 0.118, 0.286, + 0.119, 0.364, 0.125, 0.319, 0.127, 0.327, 0.119, 0.281, 0.122, 0.305, 0.126, 0.331, 0.133, 0.333, + 0.142, 0.366, 0.117, 0.355, 0.126, 0.328, 0.131, 0.362, 0.14, 0.38, 0.16, 0.401, 0.168, + 0.43, 0.127, 0.353, 0.137, 0.355, 0.157, 0.393, 0.17, 0.398, 0.181, 0.437, 0.201, 0.458, 0.122, + 0.313, 0.118, 0.412, 0.12, 0.319, 0.123, 0.431, 0.132, 0.355, 0.153, 0.371, 0.164, 0.424, 0.181, + 0.451, 0.199, 0.463, 0.218, 0.502, 0.223, 0.511, 0.172, 0.426, 0.191, 0.454, 0.214, 0.499, 0.235, + 0.509, 0.245, 0.538, 0.27, 0.561, 0.131, 0.163, 0.119, 0.31, 0.124, 0.346, 0.134, 0.362, 0.154, + 0.389, 0.164, 0.417, 0.184, 0.445, 0.213, 0.484, 0.231, 0.509, 0.259, 0.556, 0.269, 0.559, 0.289, + 0.59, 0.318, + 0.648, 0.2, 0.472, 0.226, 0.509, 0.245, 0.553, 0.29, 0.626, 0.288, 0.601, 0.31, 0.641, 0.342, 0.7, + 0.37, 0.729, 0.166, 0.465, 0.211, 0.481, 0.268, 0.581, 0.308, 0.642, 0.307, 0.645, 0.337, 0.693, + 0.371, 0.728, 0.403, 0.765, 0.446, 0.83, 0.262, 0.575, 0.327, 0.677, 0.329, 0.665, 0.357, 0.713, + 0.403, 0.782, 0.432, 0.81, 0.467, 0.878, 0.495, 1.108, 0.124, 0.353, 0.118, 0.376, 0.132, 0.415, + 0.163, 0.453, 0.183, 0.455, 0.206, 0.463, 0.237, 0.562, 0.288, 0.623, 0.316, 0.659, 0.352, 0.704, + 0.354, 0.72, + 0.394, 0.767, 0.435, 0.824, 0.473, 0.859, 0.518, 0.944, 0.608, 1.004, 0.657, 1.046, 0.33, 0.677, + 0.378, 0.743, 0.418, 0.787, 0.459, 0.851, 0.495, 0.915, 0.598, 1, 0.649, 1.032, 0.695, 1.097, 0.74, + 1.155, 0.118, 0.336, 0.123, 0.352, 0.139, 0.423, 0.179, 0.488, 0.202, 0.493, 0.226, 0.518, 0.278, + 0.576, 0.318, 0.655, 0.353, 0.702, 0.396, 0.782, 0.408, 0.778, 0.445, 0.829, 0.497, 0.91, 0.587, + 0.967, 0.645, 1.031, 0.694, 1.083, 0.747, 1.149, 0.807, 1.214, 0.882, 1.277, 0.427, 0.829, 0.427, + 0.806, + 0.564, 0.962, 0.619, 1.011, 0.679, 1.071, 0.727, 1.13, 0.792, 1.198, 0.859, 1.258, 0.919, 1.509, + 0.99, 1.387, 0.304, 0.663, 0.387, 0.781, 0.46, 0.86, 0.613, 0.983, 0.663, 1.044, 0.721, 1.131, 0.779, + 1.175, 0.864, 1.265, 0.923, 1.312, 1.001, 1.4, 1.063, 1.456, 1.147, 1.531, 0.487, 0.886, 0.569, + 0.957, 0.641, 1.036, 0.698, 1.08, 0.76, 1.166, 0.827, 1.24, 0.91, 1.317, 0.979, 1.374, 1.062, 1.457, + 1.124, 1.515, 1.216, 1.598, 1.282, 1.888, 0.118, 0.363, 0.128, 0.359, 0.169, 0.421, 0.215, 0.507, + 0.251, + 0.558, 0.277, 0.589, 0.334, 0.706, 0.389, 0.792, 0.439, 0.835, 0.502, 0.941, 0.514, 0.933, 0.614, + 1.001, 0.681, 1.076, 0.735, 1.135, 0.822, 1.243, 0.881, 1.283, 0.975, 1.383, 1.05, 1.434, 1.131, + 1.535, 1.206, 1.588, 1.304, 1.672, 1.383, 1.751, 1.517, 1.836, 0.708, 1.106, 0.929, 1.33, 1.034, + 1.421, 1.112, 1.486, 1.192, 1.568, 1.273, 1.653, 1.369, 1.732, 1.477, 1.809, 1.598, 1.918, 1.685, + 2.405, 0.266, 0.62, 0.366, 0.725, 0.553, 1.015, 0.614, 0.993, 0.753, 1.168, 0.827, 1.251, 0.918, + 1.322, 1.093, + 1.48, 1.174, 1.548, 1.276, 1.653, 1.351, 1.723, 1.495, 1.82, 1.592, 1.896, 1.71, 1.991, 1.803, 2.082, + 1.949, 2.17, 0.791, 1.182, 0.869, 1.266, 0.966, 1.358, 1.057, 1.445, 1.145, 1.521, 1.234, 1.615, + 1.335, 1.709, 1.444, 1.775, 1.578, 1.877, 1.676, 1.957, 1.804, 2.064, 1.911, 2.146, 2.046, 2.589, + 2.177, 2.305, 0.526, 0.984, 0.679, 1.072, 0.843, 1.229, 1.031, 1.418, 1.211, 1.586, 1.296, 1.666, + 1.447, 1.789, 1.545, 1.856, 1.677, 1.954, 1.789, 2.035, 1.929, 2.148, 2.039, 2.218, 2.196, 2.324, + 2.318, + 2.412, 2.461, 3.092, 0.962, 1.356, 1.164, 1.536, 1.266, 1.643, 1.509, 1.832, 1.619, 1.906, 1.758, + 2.025, 1.876, 2.117, 2.024, 2.21, 2.143, 2.306, 2.308, 2.4, 2.441, 2.479, 2.607, 2.599, 0.122, 0.298, + 0.138, 0.44, 0.207, 0.522, 0.271, 0.613, 0.325, 0.658, 0.359, 0.722, 0.44, 0.853, 0.516, 0.965, + 0.619, 1.057, 0.726, 1.162, 0.733, 1.151, 0.821, 1.226, 0.927, 1.333, 1.026, 1.427, 1.125, 1.518, + 1.218, 1.601, 1.345, 1.725, 1.467, 1.793, 1.608, 1.918, 1.717, 1.998, 1.869, 2.107, 1.992, 2.191, + 2.143, + 2.304, 2.282, 2.399, 2.451, 2.51, 2.603, 2.567, 1.403, 1.76, 1.68, 1.958, 1.953, 2.159, 2.089, 2.245, + 2.263, 2.348, 2.397, 2.443, 2.579, 2.569, 0.127, 0.297, 0.145, 0.444, 0.215, 0.553, 0.288, 0.632, + 0.346, 0.706, 0.384, 0.777, 0.472, 0.892, 0.554, 1.006, 0.676, 1.088, 0.786, 1.24, 0.81, 1.227, + 0.896, 1.306, 1.026, 1.417, 1.112, 1.508, 1.238, 1.629, 1.332, 1.692, 1.498, 1.841, 1.627, 1.938, + 1.777, 2.056, 1.901, 2.124, 2.069, 2.254, 2.219, 2.342, 2.397, 2.451, 2.534, 2.532, 1.391, 1.748, + 1.567, + 1.879, 1.846, 2.099, 1.987, 2.183, 2.318, 2.394, 2.49, 2.517, 2.655, 2.846, 0.888, 1.271, 1.106, + 1.503, 1.347, 1.719, 1.658, 1.947, 1.952, 2.163, 2.293, 2.408, 2.443, 2.48, 2.638, 2.641, 1.722, + 2.012, 1.858, 2.103, 2.039, 2.222, 2.192, 2.322, 2.389, 2.45, 2.555, 2.534, 0.544, 1.001, 0.959, + 1.358, 1.195, 1.585, 1.313, 1.682, 1.803, 2.055, 2.141, 2.291, 2.5, 2.548, 2.233, 2.358, 0.12, 0.401, + 0.173, 0.466, 0.256, 0.596, 0.356, 0.725, 0.422, 0.821, 0.474, 0.891, 0.62, 1.024, 0.753, 1.209, + 0.85, 1.303, + 0.993, 1.488, 1.039, 1.441, 1.146, 1.555, 1.304, 1.675, 1.455, 1.791, 1.628, 1.944, 1.77, 2.057, + 1.971, 2.193, 2.135, 2.294, 2.335, 2.44, 2.514, 2.556, 2.428, 2.465, 2.608, 2.598, 1.4, 1.78, 1.76, + 2.016, 2.127, 2.291, 2.545, 2.565, 0.123, 0.388, 0.193, 0.502, 0.286, 0.636, 0.395, 0.788, 0.48, + 0.907, 0.536, 0.976, 0.72, 1.159, 0.853, 1.328, 0.984, 1.434, 1.156, 1.626, 1.186, 1.572, 1.319, + 1.677, 1.536, 1.863, 1.696, 1.993, 1.893, 2.143, 2.072, 2.251, 2.309, 2.423, 2.516, 2.527, 0.127, + 0.394, 0.203, + 0.51, 0.308, 0.644, 0.426, 0.831, 0.506, 0.959, 0.608, 1.045, 0.764, 1.198, 0.917, 1.382, 1.046, + 1.523, 1.223, 1.701, 1.274, 1.655, 1.436, 1.791, 1.643, 1.951, 1.821, 2.073, 2.045, 2.237, 2.24, + 2.365, 2.488, 2.53, 2.675, 2.647, 0.129, 0.395, 0.216, 0.524, 0.339, 0.691, 0.468, 0.906, 0.565, + 1.04, 0.689, 1.11, 0.849, 1.313, 1.028, 1.538, 1.185, 1.637, 1.391, 1.869, 1.467, 1.823, 1.652, + 1.942, 1.88, 2.122, 2.092, 2.249, 2.352, 2.446, 2.574, 2.58, 0.906, 1.364, 1.564, 1.875, 2.007, + 2.209, 2.237, + 2.35, 0.134, 0.383, 0.246, 0.549, 0.385, 0.768, 0.547, 1.009, 0.71, 1.157, 0.801, 1.259, 1.005, + 1.472, 1.225, 1.726, 1.407, 1.886, 1.667, 2.113, 1.755, 2.026, 1.977, 2.176, 2.276, 2.397, 2.529, + 2.537, 1.856, 2.118, 2.406, 2.485, 0.139, 0.441, 0.272, 0.613, 0.442, 0.851, 0.616, 1.122, 0.806, + 1.297, 0.929, 1.378, 1.17, 1.653, 1.417, 1.91, 1.656, 2.097, 1.996, 2.433, 2.071, 2.271, 2.35, 2.434, + 2.684, 2.679, 0.142, 0.454, 0.278, 0.623, 0.45, 0.877, 0.641, 1.17, 0.841, 1.33, 0.964, 1.419, 1.217, + 1.709, + 1.48, 1.978, 1.744, 2.158, 2.098, 2.514, 2.17, 2.34, 2.473, 2.522, 0.16, 0.37, 0.312, 0.661, 0.508, + 0.92, 0.777, 1.263, 0.946, 1.468, 1.107, 1.557, 1.39, 1.861, 1.753, 2.252, 2.027, 2.886, 2.413, + 2.751, 2.534, 2.584, 0.154, 0.911, 0.337, 0.696, 0.542, 1.012, 0.834, 1.35, 1.03, 1.549, 1.187, + 1.656, 1.502, 1.978, 1.923, 2.383, 2.229, 2.574, 2.655, 2.937, 0.169, 0.477, 0.347, 0.707, 0.564, + 1.037, 0.863, 1.391, 1.07, 1.589, 1.234, 1.701, 1.561, 2.03, 1.999, 2.441, 2.329, 2.671, 2.786, + 3.033, 0.178, + 0.491, 0.375, 0.753, 0.619, 1.118, 0.953, 1.516, 1.194, 1.733, 1.388, 1.862, 1.834, 2.27, 2.247, + 2.66, 2.628, 2.863, 0.193, 0.476, 0.402, 0.791, 0.662, 1.185, 1.055, 1.651, 1.316, 1.883, 1.483, + 1.96, 1.968, 2.387, 2.43, 2.809, 2.829, 3.682, 0.207, 0.527, 0.442, 0.849, 0.777, 1.263, 1.174, + 1.788, 1.453, 2.055, 1.667, 2.072, 2.188, 2.572, 2.724, 3.038, 0.223, 0.55, 0.483, 0.918, 0.865, + 1.386, 1.31, 1.945, 1.629, 2.214, 1.926, 2.321, 2.5, 2.798, 0.232, 0.558, 0.512, 0.96, 0.91, 1.439, + 1.393, 2.038, + 1.73, 2.332, 2.055, 2.458, 2.656, 2.946, 0.235, 0.536, 0.521, 0.965, 0.935, 1.477, 1.426, 2.075, + 1.799, 2.374, 2.121, 2.491, 2.751, 3.017, 0.244, 0.583, 0.548, 1.007, 1.015, 1.567, 1.51, 2.182, + 1.907, 2.486, 2.253, 2.603, 2.922, 3.117, 0.249, 0.59, 0.559, 1.017, 1.032, 1.611, 1.544, 2.212, + 1.971, 2.513, 2.314, 2.621, 2.998, 3.511, 0.26, 0.592, 0.582, 1.079, 1.099, 1.669, 1.626, 2.321, + 2.079, 2.649, 2.466, 2.754, 0.288, 0.646, 0.679, 1.203, 1.285, 1.917, 1.939, 2.649, 2.492, 3.013, + 2.942, 3.098, + 0.304, 0.651, 0.75, 1.235, 1.346, 1.968, 2.038, 2.736, 2.602, 3.111, 0.322, 0.673, 0.795, 1.298, + 1.431, 2.063, 2.176, 2.861, 2.79, 3.255, 0.327, 0.677, 0.816, 1.323, 1.456, 2.088, 2.234, 2.962, + 2.866, 3.318, 0.355, 0.723, 0.892, 1.4, 1.605, 2.271, 2.475, 3.172, 3.189, 3.608, 0.358, 0.732, + 0.905, 1.423, 1.644, 2.317, 2.524, 3.227, 3.254, 3.644, 0.371, 0.752, 0.946, 1.478, 1.735, 2.407, + 2.682, 3.376, 0.392, 0.777, 1.032, 1.594, 1.835, 2.53, 2.866, 3.557, 0.403, 0.807, 1.067, 1.639, 1.9, + 2.604, + 2.972, 3.652, 0.428, 0.838, 1.138, 1.721, 2.022, 2.702, 3.156, 3.844, 0.446, 0.86, 1.19, 1.771, 2.13, + 2.806, 3.331, 4.018, 0.452, 0.859, 1.204, 1.803, 2.163, 2.827, 3.384, 4.062, 0.475, 0.905, 1.286, + 1.927, 2.345, 3.023, 3.691, 4.356, 0.486, 0.916, 1.313, 1.944, 2.386, 3.062, 0.496, 0.935, 1.347, + 1.961, 2.458, 3.14, 0.501, 0.942, 1.363, 1.987, 2.493, 3.16, 0.538, 1.003, 1.48, 2.124, 2.738, 3.393, + 0.575, 1.056, 1.601, 2.287, 3.003, 3.665, 0.588, 1.067, 1.642, 2.303, 3.099, 3.74, 0.594, 1.093, + 1.662, 2.317, 3.127, 3.758, 0.615, 1.094, 1.714, 2.388, 3.24, 3.892, 0.626, 1.123, 1.771, 2.454, + 3.364, 4.001, 0.641, 1.14, 1.799, 2.48, 3.406, 4.043, 0.673, 1.193, 1.913, 2.617, 3.644, 4.258, + 0.734, 1.205, 1.999, 2.657, 0.752, 1.241, 2.063, 2.744, 0.782, 1.278, 2.15, 2.816, 0.785, 1.285, + 2.162, 2.824, 0.806, 1.305, 2.233, 2.897, 0.828, 1.326, 2.282, 2.96, 0.835, 1.334, 2.313, 2.962, + 0.875, 1.39, 2.441, 3.105, 0.928, 1.464, 2.616, 3.288, 0.943, 1.509, 2.671, 3.336, 0.951, 1.48, + 2.696, 3.348, + 0.967, 1.494, 2.755, 3.403, 1.059, 1.632, 2.958, 3.607, 1.086, 1.663, 3.061, 3.699, 1.135, 1.713, + 3.202, 3.836, 1.143, 1.726, 3.228, 3.858, 1.17, 1.757, 3.289, 3.936, 1.191, 1.776, 3.375, 3.993, + 1.218, 1.843, 3.495, 4.12, 1.251, 1.851, 3.591, 4.197, 1.275, 1.898, 3.681, 4.276, 1.294, 1.924, + 3.725, 4.949, 1.323, 1.949, 1.366, 1.975, 1.396, 2.009, 1.429, 2.07, 1.465, 2.11, 1.481, 2.112, + 1.529, 2.185, 1.542, 2.209, 1.563, 2.229, 1.592, 2.251, 1.623, 2.281, 1.661, 2.331, 1.687, 2.378, + 1.696, 2.384, + 1.715, 2.399, 1.771, 2.453, 1.82, 2.506, 1.852, 2.536, 1.888, 2.568, 1.921, 2.618, 1.958, 2.637, + 2.044, 2.715, 2.054, 2.715, 2.166, 2.832, 2.194, 2.873, 2.252, 2.925, 2.299, 2.98, 2.333, 2.988, + 2.345, 3.014, 2.384, 3.066, 2.441, 3.126, 2.488, 3.167, 2.513, 3.184, 2.538, 3.215, 2.565, 3.252, + 2.617, 3.276, 2.641, 3.313, 2.649, 3.324, 2.729, 3.399, 2.824, 3.5, 2.833, 3.527, 2.851, 3.539, + 2.905, 3.587, 2.934, 3.61, 2.956, 3.648, 3.061, 3.745, 3.078, 3.759, 3.116, 3.8, 3.176, 3.835, 3.248, + 3.917, + 3.303, 3.949, 3.366, 4.011, 3.424, 4.059, 3.493, 4.067, 3.529, 4.156, 3.565, 4.197, 3.626, 4.261, + 3.675, 4.312, 3.712, 4.344] + +dyn_value = [0.111, 0.306, 0.11, 0.435, 0.113, 0.372, 0.111, 0.418, 0.113, 0.354, 0.11, 0.431, 0.112, 0.354, 0.116, + 0.379, 0.112, 0.341, 0.113, 0.43, 0.114, 0.428, 0.113, 0.363, 0.112, 0.411, 0.109, 0.49, 0.107, 0.472, + 0.111, 0.422, 0.106, 0.449, 0.129, 0.197, 0.113, 0.454, 0.113, 0.479, 0.108, 0.417, 0.112, 0.436, 0.109, + 0.472, 0.112, 0.48, 0.119, 0.452, 0.108, 0.476, 0.117, 0.407, 0.118, 0.489, 0.121, 0.498, 0.131, 0.521, + 0.109, 0.443, 0.117, 0.466, 0.121, 0.511, 0.13, 0.499, 0.15, 0.556, 0.158, + 0.569, 0.116, 0.527, 0.128, 0.488, 0.146, 0.532, 0.158, 0.547, 0.17, 0.61, 0.19, 0.648, 0.109, 0.527, + 0.107, 0.521, 0.109, 0.453, 0.114, 0.559, 0.121, 0.517, 0.141, 0.532, 0.154, 0.566, 0.17, 0.62, 0.189, + 0.617, 0.206, 0.677, 0.213, 0.667, 0.162, 0.565, 0.181, 0.606, 0.201, 0.665, 0.222, 0.683, 0.235, 0.655, + 0.26, 0.711, 0.112, 0.523, 0.106, 0.508, 0.112, 0.496, 0.123, 0.511, 0.142, 0.561, 0.156, 0.553, 0.172, + 0.626, 0.201, 0.651, 0.218, 0.684, 0.246, 0.738, 0.259, 0.712, 0.278, 0.749, 0.306, + 0.809, 0.188, 0.635, 0.213, 0.685, 0.231, 0.741, 0.273, 0.841, 0.277, 0.77, 0.299, 0.797, 0.331, 0.867, + 0.359, 0.884, 0.154, 0.619, 0.199, 0.659, 0.255, 0.767, 0.291, 0.887, 0.296, 0.8, 0.326, 0.851, 0.359, + 0.901, 0.389, 0.956, 0.432, 1.036, 0.246, 0.788, 0.309, 0.908, 0.317, 0.831, 0.346, 0.873, 0.391, 0.95, + 0.42, 1.014, 0.454, 1.061, 0.482, 1.304, 0.108, 0.487, 0.108, 0.511, 0.12, 0.574, 0.152, 0.614, 0.171, + 0.624, 0.194, 0.644, 0.223, 0.765, 0.271, 0.854, 0.299, 0.886, 0.332, 0.967, 0.341, + 0.892, 0.382, 0.927, 0.421, 1.017, 0.46, 1.052, 0.501, 1.185, 0.592, 1.234, 0.758, 1.901, 0.313, 0.914, + 0.366, 0.922, 0.405, 0.979, 0.446, 1.05, 0.481, 1.106, 0.582, 1.227, 0.753, 1.898, 0.812, 2.058, 0.871, + 2.202, 0.111, 0.484, 0.11, 0.543, 0.128, 0.566, 0.165, 0.675, 0.189, 0.681, 0.215, 0.688, 0.263, 0.784, + 0.301, 0.898, 0.336, 0.943, 0.377, 1.05, 0.395, 0.967, 0.432, 1.014, 0.481, 1.134, 0.571, 1.199, 0.743, + 1.887, 0.807, 2.022, 0.87, 2.164, 0.955, 2.318, 1.033, 2.44, 0.406, 1.115, 0.413, + 1.007, 0.548, 1.181, 0.719, 1.83, 0.787, 1.972, 0.856, 2.13, 0.934, 2.335, 1.021, 2.464, 1.085, 2.954, + 1.175, 2.804, 0.288, 0.888, 0.369, 1.029, 0.445, 1.07, 0.594, 1.24, 0.768, 1.942, 0.84, 2.142, 0.917, + 2.299, 1.014, 2.454, 1.092, 2.656, 1.18, 2.797, 1.264, 2.968, 1.36, 3.171, 0.47, 1.109, 0.554, 1.169, + 0.741, 1.866, 0.822, 2.049, 0.893, 2.232, 0.987, 2.371, 1.075, 2.572, 1.168, 2.76, 1.261, 2.923, 1.346, + 3.112, 1.452, 3.285, 1.546, 3.637, 0.109, 0.445, 0.117, 0.508, 0.156, 0.59, 0.198, 0.736, + 0.234, 0.783, 0.264, 0.776, 0.316, 0.944, 0.368, 1.067, 0.418, 1.121, 0.477, 1.27, 0.497, 1.165, 0.597, + 1.239, 0.786, 1.946, 0.871, 2.128, 0.969, 2.323, 1.048, 2.488, 1.15, 2.694, 1.248, 2.917, 1.345, 3.039, + 1.441, 3.219, 1.551, 3.478, 1.658, 3.621, 1.802, 3.796, 0.831, 2.058, 1.112, 2.647, 1.228, 2.837, 1.331, + 3.028, 1.425, 3.207, 1.531, 3.446, 1.639, 3.688, 1.779, 3.806, 1.91, 4.044, 2.025, 4.749, 0.249, 0.859, + 0.347, 0.988, 0.528, 1.35, 0.598, 1.236, 0.886, 2.204, 0.984, 2.38, 1.085, 2.623, + 1.299, 2.98, 1.408, 3.189, 1.521, 3.399, 1.624, 3.622, 1.778, 3.871, 1.908, 4.028, 2.044, 4.218, 2.168, + 4.501, 2.334, 4.787, 0.935, 2.334, 1.039, 2.53, 1.144, 2.761, 1.267, 2.919, 1.368, 3.141, 1.486, 3.364, + 1.6, 3.578, 1.737, 3.815, 1.884, 4.089, 2.016, 4.254, 2.165, 4.434, 2.306, 4.743, 2.458, 5.442, 2.628, + 5.303, 0.505, 1.273, 0.784, 1.984, 0.988, 2.464, 1.221, 2.896, 1.447, 3.327, 1.561, 3.575, 1.721, 3.772, + 1.848, 4.056, 1.993, 4.339, 2.141, 4.509, 2.303, 4.759, 2.449, 5.024, 2.63, 5.295, + 2.784, 5.665, 2.954, 6.446, 1.153, 2.729, 1.402, 3.164, 1.521, 3.474, 1.803, 3.918, 1.945, 4.196, 2.102, + 4.488, 2.257, 4.696, 2.435, 4.908, 2.591, 5.223, 2.78, 5.515, 2.946, 5.892, 3.135, 6.253, 0.107, 0.514, + 0.127, 0.604, 0.191, 0.747, 0.251, 0.89, 0.304, 0.95, 0.343, 0.977, 0.42, 1.152, 0.492, 1.319, 0.596, + 1.398, 0.801, 2.2, 0.861, 2.132, 0.982, 2.325, 1.097, 2.629, 1.226, 2.853, 1.343, 3.067, 1.471, 3.284, + 1.604, 3.6, 1.762, 3.871, 1.917, 4.087, 2.062, 4.331, 2.235, 4.653, 2.4, 4.852, 2.573, + 5.081, 2.756, 5.446, 2.948, 5.749, 3.137, 6.11, 1.682, 3.809, 2.011, 4.342, 2.346, 4.97, 2.523, 5.187, + 2.721, 5.469, 2.898, 5.82, 3.106, 6.178, 0.107, 0.512, 0.134, 0.602, 0.199, 0.771, 0.267, 0.926, 0.324, + 1.02, 0.367, 1.037, 0.45, 1.214, 0.528, 1.379, 0.763, 2.128, 0.871, 2.322, 0.956, 2.33, 1.073, 2.55, 1.218, + 2.824, 1.338, 3.036, 1.479, 3.324, 1.606, 3.61, 1.786, 3.884, 1.952, 4.204, 2.121, 4.421, 2.278, 4.699, + 2.472, 5.048, 2.669, 5.267, 2.873, 5.565, 3.055, 5.913, 1.684, 3.748, 1.874, 4.034, + 2.212, 4.612, 2.394, 4.865, 2.798, 5.508, 3.001, 5.842, 3.209, 6.535, 1.041, 2.513, 1.318, 3.039, 1.607, + 3.605, 1.977, 4.175, 2.33, 4.796, 2.742, 5.503, 2.942, 5.751, 3.163, 6.061, 2.06, 4.369, 2.24, 4.726, + 2.443, 5.011, 2.643, 5.344, 2.866, 5.806, 3.086, 6.029, 0.518, 1.359, 1.132, 2.668, 1.43, 3.269, 1.591, + 3.562, 2.155, 4.494, 2.56, 5.137, 2.998, 5.937, 2.68, 5.409, 0.112, 0.51, 0.16, 0.648, 0.237, 0.854, 0.33, + 1.088, 0.397, 1.184, 0.454, 1.182, 0.594, 1.422, 0.833, 2.349, 0.97, 2.642, 1.141, + 3.038, 1.228, 2.886, 1.379, 3.133, 1.552, 3.543, 1.745, 3.838, 1.943, 4.217, 2.129, 4.478, 2.352, 4.868, + 2.569, 5.252, 2.799, 5.578, 3.028, 5.981, 2.918, 5.764, 3.154, 6.14, 1.671, 3.793, 2.099, 4.509, 2.544, + 5.231, 3.044, 6.03, 0.112, 0.535, 0.178, 0.698, 0.264, 0.931, 0.367, 1.195, 0.452, 1.301, 0.514, 1.306, + 0.812, 2.267, 0.948, 2.614, 1.132, 3.091, 1.32, 3.39, 1.414, 3.239, 1.597, 3.54, 1.828, 3.995, 2.038, + 4.365, 2.264, 4.754, 2.498, 5.084, 2.766, 5.538, 3.03, 5.989, 0.114, 0.556, 0.187, + 0.729, 0.285, 0.964, 0.395, 1.257, 0.475, 1.391, 0.586, 1.376, 0.87, 2.411, 1.032, 2.83, 1.209, 3.244, + 1.402, 3.606, 1.515, 3.423, 1.733, 3.787, 1.96, 4.216, 2.189, 4.601, 2.446, 5.046, 2.703, 5.415, 2.982, + 5.907, 3.207, 6.265, 0.118, 0.543, 0.2, 0.751, 0.314, 1.039, 0.433, 1.381, 0.53, 1.518, 0.797, 2.251, + 0.971, 2.691, 1.165, 3.179, 1.366, 3.615, 1.597, 4.02, 1.743, 3.827, 1.987, 4.229, 2.246, 4.77, 2.526, + 5.18, 2.822, 5.666, 3.112, 6.181, 1.04, 2.838, 1.857, 4.081, 2.4, 5.025, 2.699, 5.505, + 0.123, 0.529, 0.229, 0.804, 0.357, 1.17, 0.507, 1.559, 0.671, 1.714, 0.944, 2.663, 1.159, 3.125, 1.38, + 3.653, 1.623, 4.191, 1.923, 4.692, 2.088, 4.445, 2.387, 4.882, 2.723, 5.52, 3.056, 6.062, 2.211, 4.638, + 2.883, 5.815, 0.128, 0.586, 0.253, 0.879, 0.409, 1.323, 0.572, 1.733, 0.886, 2.589, 1.099, 3.002, 1.354, + 3.605, 1.612, 4.215, 1.926, 4.81, 2.259, 5.386, 2.47, 5.116, 2.842, 5.633, 3.221, 6.399, 0.131, 0.604, + 0.257, 0.918, 0.417, 1.332, 0.593, 1.809, 0.925, 2.675, 1.145, 3.129, 1.409, 3.75, + 1.685, 4.404, 2.025, 5.058, 2.373, 5.661, 2.594, 5.369, 2.991, 5.9, 0.147, 0.544, 0.29, 0.964, 0.47, 1.44, + 0.724, 1.995, 1.037, 3.001, 1.326, 3.533, 1.606, 4.764, 1.963, 4.943, 2.324, 6.118, 2.763, 6.436, 3.029, + 6.077, 0.154, 0.65, 0.313, 1.037, 0.504, 1.547, 0.815, 2.348, 1.133, 3.209, 1.425, 3.795, 1.754, 4.551, + 2.145, 5.343, 2.542, 6.145, 3.036, 6.988, 0.158, 0.645, 0.322, 1.069, 0.523, 1.608, 0.865, 2.473, 1.176, + 3.319, 1.483, 3.918, 1.829, 4.66, 2.239, 5.529, 2.667, 6.374, 3.178, 7.245, + 0.165, 0.676, 0.348, 1.133, 0.574, 1.742, 0.962, 2.798, 1.319, 3.681, 1.667, 4.318, 2.092, 5.167, 2.526, + 6.168, 3.03, 7.174, 0.178, 0.677, 0.371, 1.211, 0.615, 1.841, 1.023, 2.954, 1.409, 3.868, 1.785, 4.571, + 2.258, 5.517, 2.734, 6.496, 3.274, 8.097, 0.191, 0.751, 0.409, 1.313, 0.724, 2, 1.133, 3.173, 1.56, 4.245, + 2.006, 5.021, 2.516, 6.092, 3.074, 7.279, 0.206, 0.777, 0.449, 1.393, 0.868, 2.505, 1.28, 3.592, 1.762, + 4.737, 2.291, 5.699, 2.882, 6.891, 0.214, 0.803, 0.475, 1.47, 0.921, 2.639, 1.363, + 3.758, 1.874, 5.012, 2.441, 6.031, 3.074, 7.254, 0.218, 0.774, 0.483, 1.485, 0.941, 2.715, 1.393, 3.833, + 1.949, 5.129, 2.523, 6.197, 3.177, 7.536, 0.225, 0.835, 0.509, 1.551, 0.991, 2.843, 1.471, 4.045, 2.061, + 5.359, 2.679, 6.473, 3.384, 7.857, 0.23, 0.839, 0.518, 1.589, 1.01, 2.918, 1.507, 4.124, 2.127, 5.496, + 2.758, 6.672, 3.468, 8.518, 0.24, 0.878, 0.54, 1.639, 1.064, 3.035, 1.589, 4.358, 2.245, 5.776, 2.93, + 6.995, 0.267, 0.95, 0.629, 1.88, 1.251, 3.491, 1.879, 5.02, 2.706, 6.873, 3.534, 8.253, + 0.282, 0.957, 0.698, 1.936, 1.318, 3.674, 1.988, 5.194, 2.839, 7.162, 0.299, 1.002, 0.741, 2.022, 1.402, + 3.817, 2.13, 5.525, 3.056, 7.647, 0.303, 1.003, 0.79, 2.229, 1.424, 3.894, 2.174, 5.621, 3.126, 7.774, + 0.329, 1.072, 0.899, 2.57, 1.566, 4.291, 2.435, 6.232, 3.498, 8.589, 0.331, 1.098, 0.912, 2.637, 1.604, + 4.36, 2.489, 6.375, 3.577, 8.772, 0.344, 1.113, 0.956, 2.769, 1.693, 4.535, 2.646, 6.725, 0.363, 1.168, + 1.004, 2.885, 1.781, 4.756, 2.809, 7.077, 0.373, 1.216, 1.037, 2.961, 1.843, 4.9, + 2.915, 7.321, 0.396, 1.259, 1.101, 3.11, 1.97, 5.128, 3.093, 7.713, 0.413, 1.308, 1.149, 3.202, 2.077, + 5.374, 3.266, 8.1, 0.417, 1.315, 1.166, 3.231, 2.115, 5.437, 3.325, 8.21, 0.44, 1.389, 1.254, 3.49, 2.302, + 5.883, 3.633, 8.908, 0.451, 1.402, 1.281, 3.538, 2.344, 5.997, 0.46, 1.425, 1.32, 3.655, 2.416, 6.188, + 0.464, 1.443, 1.337, 3.656, 2.457, 6.268, 0.499, 1.533, 1.44, 3.931, 2.699, 6.816, 0.533, 1.628, 1.559, + 4.244, 2.939, 7.324, 0.545, 1.656, 1.609, 4.348, 3.039, 7.52, 0.55, 1.661, 1.63, + 4.4, 3.073, 7.62, 0.57, 1.706, 1.674, 4.467, 3.177, 7.809, 0.58, 1.74, 1.733, 4.607, 3.307, 8.116, 0.594, + 1.781, 1.75, 4.65, 3.347, 8.175, 0.623, 1.869, 1.859, 4.911, 3.583, 8.732, 0.683, 1.907, 1.95, 5.08, 0.701, + 1.943, 2.019, 5.262, 0.729, 2.001, 2.1, 5.418, 0.733, 1.999, 2.119, 5.443, 0.752, 2.051, 2.192, 5.611, + 0.805, 2.292, 2.238, 5.716, 0.811, 2.303, 2.262, 5.781, 0.874, 2.536, 2.397, 6.108, 0.931, 2.702, 2.58, + 6.542, 0.944, 2.726, 2.632, 6.658, 0.956, 2.744, 2.655, 6.719, 0.968, 2.8, 2.714, + 6.822, 1.026, 2.924, 2.902, 7.246, 1.055, 2.992, 2.999, 7.435, 1.102, 3.115, 3.141, 7.738, 1.111, 3.127, + 3.169, 7.831, 1.133, 3.179, 3.221, 7.923, 1.153, 3.253, 3.313, 8.146, 1.184, 3.314, 3.431, 8.397, 1.213, + 3.385, 3.523, 8.564, 1.238, 3.464, 3.616, 8.82, 1.257, 3.517, 3.661, 9.465, 1.295, 3.578, 1.335, 3.672, + 1.362, 3.73, 1.396, 3.805, 1.432, 3.882, 1.441, 3.918, 1.485, 4.063, 1.501, 4.092, 1.527, 4.152, 1.55, + 4.212, 1.587, 4.309, 1.628, 4.396, 1.649, 4.449, 1.658, 4.459, 1.676, 4.51, 1.734, + 4.651, 1.773, 4.753, 1.799, 4.783, 1.84, 4.883, 1.863, 4.939, 1.903, 5.026, 1.996, 5.188, 2.007, 5.205, + 2.117, 5.45, 2.148, 5.513, 2.208, 5.649, 2.25, 5.72, 2.287, 5.833, 2.299, 5.88, 2.344, 5.967, 2.405, 6.118, + 2.453, 6.217, 2.483, 6.334, 2.504, 6.358, 2.532, 6.484, 2.582, 6.557, 2.606, 6.581, 2.615, 6.62, 2.691, + 6.781, 2.767, 6.949, 2.782, 6.956, 2.801, 7.054, 2.846, 7.22, 2.879, 7.245, 2.895, 7.242, 2.995, 7.462, + 3.016, 7.503, 3.058, 7.585, 3.113, 7.712, 3.187, 7.861, 3.242, 8.028, 3.311, + 8.162, 3.364, 8.307, 3.427, 8.384, 3.465, 8.516, 3.491, 8.6, 3.553, 8.705, 3.607, 8.804, 3.639, + 8.894] + +sm_value = [0.07, 0.067, 0.07, 0.138, 0.074, 0.121, 0.069, 0.165, 0.069, 0.172, 0.068, 0.229, 0.07, 0.13, 0.071, 0.21, + 0.068, 0.153, 0.069, 0.149, 0.071, 0.127, 0.068, 0.185, 0.062, 0.389, 0.067, 0.206, 0.067, 0.18, 0.068, + 0.179, 0.067, 0.222, 0.083, 0.028, 0.069, 0.155, 0.068, 0.204, 0.067, 0.206, 0.066, 0.21, 0.07, 0.221, + 0.072, 0.234, 0.075, 0.273, 0.067, 0.215, 0.072, 0.22, 0.075, 0.243, 0.081, 0.275, 0.09, 0.285, 0.067, + 0.199, 0.074, 0.251, 0.081, 0.268, 0.09, 0.29, 0.109, 0.307, 0.118, 0.323, + 0.079, 0.244, 0.087, 0.27, 0.106, 0.305, 0.116, 0.314, 0.129, 0.344, 0.146, 0.355, 0.072, 0.145, 0.072, + 0.156, 0.068, 0.248, 0.074, 0.259, 0.079, 0.283, 0.102, 0.298, 0.113, 0.319, 0.127, 0.35, 0.145, 0.373, + 0.158, 0.39, 0.173, 0.416, 0.119, 0.356, 0.137, 0.352, 0.158, 0.391, 0.174, 0.411, 0.194, 0.442, 0.22, + 0.475, 0.07, 0.172, 0.066, 0.21, 0.072, 0.23, 0.079, 0.269, 0.1, 0.293, 0.113, 0.321, 0.13, 0.348, 0.153, + 0.38, 0.17, 0.415, 0.191, 0.446, 0.217, 0.475, 0.236, 0.515, 0.261, 0.552, 0.143, + 0.378, 0.161, 0.397, 0.18, 0.44, 0.211, 0.481, 0.236, 0.511, 0.257, 0.557, 0.286, 0.603, 0.313, 0.633, + 0.111, 0.322, 0.154, 0.388, 0.203, 0.472, 0.228, 0.515, 0.252, 0.554, 0.281, 0.602, 0.31, 0.642, 0.342, + 0.678, 0.378, 0.726, 0.186, 0.443, 0.243, 0.534, 0.273, 0.581, 0.302, 0.621, 0.342, 0.673, 0.372, 0.719, + 0.4, 0.765, 0.428, 1.007, 0.073, 0.142, 0.069, 0.243, 0.079, 0.264, 0.105, 0.305, 0.123, 0.346, 0.15, + 0.383, 0.173, 0.425, 0.207, 0.473, 0.235, 0.524, 0.261, 0.572, 0.294, 0.617, 0.333, + 0.681, 0.368, 0.706, 0.406, 0.754, 0.436, 0.809, 0.527, 0.848, 0.571, 0.891, 0.247, 0.548, 0.318, 0.641, + 0.358, 0.69, 0.393, 0.735, 0.427, 0.801, 0.517, 0.846, 0.568, 0.895, 0.611, 0.936, 0.653, 1, 0.069, 0.18, + 0.072, 0.256, 0.084, 0.286, 0.113, 0.324, 0.135, 0.378, 0.167, 0.412, 0.203, 0.465, 0.235, 0.507, 0.269, + 0.567, 0.3, 0.619, 0.343, 0.677, 0.379, 0.73, 0.418, 0.779, 0.508, 0.849, 0.559, 0.892, 0.608, 0.944, + 0.653, 0.984, 0.713, 1.058, 0.775, 1.103, 0.322, 0.656, 0.361, 0.695, 0.485, 0.821, + 0.54, 0.876, 0.594, 0.94, 0.638, 1.001, 0.696, 1.043, 0.763, 1.108, 0.812, 1.355, 0.884, 1.204, 0.226, + 0.505, 0.299, 0.614, 0.384, 0.734, 0.529, 0.854, 0.581, 0.901, 0.629, 0.964, 0.685, 1.031, 0.758, 1.096, + 0.815, 1.169, 0.885, 1.2, 0.947, 1.266, 1.021, 1.318, 0.41, 0.776, 0.494, 0.83, 0.558, 0.894, 0.615, 0.959, + 0.666, 1.02, 0.735, 1.074, 0.804, 1.143, 0.872, 1.205, 0.947, 1.257, 1.009, 1.317, 1.089, 1.386, 1.154, + 1.712, 0.068, 0.206, 0.075, 0.259, 0.107, 0.31, 0.132, 0.362, 0.168, 0.412, 0.21, + 0.476, 0.249, 0.539, 0.288, 0.604, 0.337, 0.673, 0.383, 0.732, 0.432, 0.818, 0.533, 0.868, 0.592, 0.928, + 0.647, 0.991, 0.722, 1.064, 0.78, 1.127, 0.858, 1.206, 0.934, 1.246, 1.005, 1.315, 1.079, 1.382, 1.161, + 1.458, 1.242, 1.508, 1.355, 1.593, 0.621, 0.963, 0.827, 1.174, 0.919, 1.228, 0.995, 1.303, 1.066, 1.366, + 1.147, 1.421, 1.228, 1.503, 1.337, 1.57, 1.437, 1.668, 1.527, 2.106, 0.181, 0.441, 0.275, 0.577, 0.425, + 0.794, 0.531, 0.879, 0.659, 0.994, 0.733, 1.072, 0.807, 1.161, 0.969, 1.281, 1.049, + 1.357, 1.135, 1.43, 1.212, 1.509, 1.337, 1.555, 1.435, 1.635, 1.537, 1.723, 1.633, 1.782, 1.757, 1.862, + 0.697, 1.04, 0.774, 1.123, 0.854, 1.185, 0.947, 1.246, 1.02, 1.334, 1.111, 1.396, 1.197, 1.468, 1.306, + 1.561, 1.422, 1.607, 1.522, 1.682, 1.634, 1.771, 1.742, 1.865, 1.86, 2.242, 1.991, 1.983, 0.41, 0.772, + 0.591, 0.929, 0.737, 1.079, 0.914, 1.228, 1.08, 1.379, 1.166, 1.453, 1.295, 1.528, 1.392, 1.615, 1.505, + 1.677, 1.618, 1.76, 1.742, 1.836, 1.854, 1.914, 1.992, 1.972, 2.114, 2.073, 2.238, + 2.623, 0.858, 1.188, 1.046, 1.336, 1.137, 1.421, 1.356, 1.585, 1.468, 1.653, 1.589, 1.737, 1.706, 1.818, + 1.837, 1.916, 1.958, 1.982, 2.101, 2.075, 2.236, 2.15, 2.382, 2.218, 0.068, 0.216, 0.084, 0.29, 0.126, + 0.352, 0.17, 0.416, 0.222, 0.497, 0.272, 0.58, 0.333, 0.661, 0.388, 0.731, 0.491, 0.823, 0.569, 0.898, + 0.639, 0.986, 0.726, 1.088, 0.815, 1.146, 0.914, 1.232, 0.997, 1.323, 1.093, 1.396, 1.197, 1.471, 1.32, + 1.569, 1.445, 1.645, 1.555, 1.709, 1.689, 1.794, 1.811, 1.904, 1.94, 1.977, 2.08, + 2.047, 2.23, 2.134, 2.38, 2.203, 1.254, 1.533, 1.515, 1.703, 1.769, 1.863, 1.907, 1.951, 2.059, 2.023, + 2.194, 2.124, 2.353, 2.202, 0.07, 0.206, 0.089, 0.298, 0.134, 0.354, 0.179, 0.445, 0.238, 0.521, 0.294, + 0.602, 0.359, 0.686, 0.419, 0.782, 0.543, 0.866, 0.62, 0.966, 0.711, 1.044, 0.796, 1.122, 0.908, 1.221, + 0.996, 1.29, 1.103, 1.387, 1.197, 1.481, 1.339, 1.558, 1.469, 1.671, 1.601, 1.749, 1.725, 1.836, 1.873, + 1.915, 2.024, 1.992, 2.179, 2.084, 2.32, 2.18, 1.258, 1.529, 1.408, 1.608, 1.671, + 1.796, 1.814, 1.9, 2.123, 2.079, 2.275, 2.151, 2.436, 2.589, 0.777, 1.115, 0.982, 1.291, 1.197, 1.481, + 1.489, 1.665, 1.762, 1.839, 2.083, 2.034, 2.233, 2.136, 2.398, 2.219, 1.554, 1.717, 1.689, 1.816, 1.851, + 1.906, 2.006, 1.996, 2.178, 2.086, 2.344, 2.199, 0.415, 0.778, 0.843, 1.184, 1.066, 1.367, 1.184, 1.474, + 1.625, 1.753, 1.938, 1.953, 2.273, 2.155, 2.03, 2.008, 0.073, 0.228, 0.11, 0.321, 0.161, 0.403, 0.227, + 0.501, 0.293, 0.603, 0.366, 0.729, 0.487, 0.808, 0.584, 0.913, 0.682, 1.032, 0.792, + 1.142, 0.917, 1.227, 1.025, 1.349, 1.156, 1.437, 1.308, 1.543, 1.46, 1.659, 1.602, 1.741, 1.775, 1.862, + 1.942, 1.952, 2.121, 2.059, 2.3, 2.174, 2.212, 2.101, 2.394, 2.229, 1.246, 1.521, 1.583, 1.717, 1.922, + 1.949, 2.313, 2.16, 0.072, 0.249, 0.119, 0.337, 0.178, 0.432, 0.251, 0.548, 0.336, 0.663, 0.417, 0.764, + 0.563, 0.885, 0.662, 1.001, 0.793, 1.119, 0.925, 1.238, 1.054, 1.351, 1.187, 1.467, 1.373, 1.598, 1.535, + 1.689, 1.706, 1.814, 1.884, 1.945, 2.094, 2.059, 2.299, 2.158, 0.073, 0.255, 0.126, + 0.346, 0.193, 0.446, 0.269, 0.571, 0.35, 0.693, 0.485, 0.81, 0.6, 0.943, 0.718, 1.043, 0.846, 1.164, 0.978, + 1.296, 1.134, 1.415, 1.296, 1.541, 1.471, 1.679, 1.65, 1.782, 1.845, 1.905, 2.043, 2.015, 2.258, 2.141, + 2.432, 2.248, 0.075, 0.264, 0.134, 0.364, 0.215, 0.485, 0.294, 0.613, 0.391, 0.751, 0.551, 0.886, 0.67, + 1.013, 0.804, 1.169, 0.961, 1.286, 1.116, 1.421, 1.307, 1.545, 1.491, 1.681, 1.692, 1.817, 1.905, 1.939, + 2.133, 2.071, 2.355, 2.216, 0.718, 1.068, 1.399, 1.605, 1.81, 1.888, 2.039, + 2.063, 0.079, 0.286, 0.153, 0.391, 0.242, 0.528, 0.347, 0.687, 0.51, 0.835, 0.639, 0.978, 0.796, 1.131, + 0.959, 1.279, 1.142, 1.442, 1.352, 1.58, 1.574, 1.719, 1.796, 1.877, 2.06, 2.034, 2.313, 2.177, 1.669, + 1.791, 2.178, 2.109, 0.085, 0.29, 0.172, 0.417, 0.279, 0.589, 0.393, 0.747, 0.584, 0.92, 0.75, 1.084, + 0.932, 1.264, 1.12, 1.422, 1.362, 1.576, 1.596, 1.751, 1.864, 1.932, 2.142, 2.092, 2.434, 2.27, 0.087, + 0.298, 0.175, 0.429, 0.285, 0.598, 0.41, 0.777, 0.61, 0.949, 0.779, 1.125, 0.97, 1.293, + 1.172, 1.471, 1.438, 1.628, 1.683, 1.812, 1.956, 2.003, 2.259, 2.173, 0.1, 0.264, 0.198, 0.473, 0.324, + 0.634, 0.51, 0.831, 0.681, 1.005, 0.901, 1.208, 1.116, 1.404, 1.371, 1.616, 1.652, 2.134, 1.953, 1.967, + 2.294, 2.168, 0.105, 0.315, 0.215, 0.486, 0.345, 0.672, 0.557, 0.89, 0.754, 1.079, 0.969, 1.27, 1.201, + 1.778, 1.506, 1.699, 1.812, 1.884, 2.151, 2.084, 0.108, 0.319, 0.221, 0.49, 0.357, 0.696, 0.573, 0.912, + 0.78, 1.115, 1.008, 1.31, 1.26, 1.53, 1.57, 1.741, 1.9, 1.934, 2.252, 2.149, 0.113, + 0.338, 0.239, 0.534, 0.396, 0.743, 0.632, 0.978, 0.872, 1.2, 1.133, 1.421, 1.457, 1.637, 1.775, 1.858, + 2.156, 2.087, 0.118, 0.343, 0.252, 0.549, 0.42, 0.784, 0.673, 1.015, 0.935, 1.257, 1.213, 1.485, 1.568, + 1.74, 1.922, 1.966, 2.321, 2.81, 0.128, 0.358, 0.279, 0.594, 0.513, 0.826, 0.75, 1.082, 1.03, 1.342, 1.371, + 1.582, 1.746, 1.838, 2.158, 2.099, 0.14, 0.393, 0.309, 0.62, 0.575, 0.897, 0.847, 1.172, 1.166, 1.472, + 1.566, 1.713, 2.009, 1.999, 0.145, 0.384, 0.329, 0.648, 0.608, 0.917, 0.905, 1.231, + 1.244, 1.495, 1.666, 1.796, 2.138, 2.105, 0.148, 0.378, 0.333, 0.657, 0.623, 0.941, 0.924, 1.248, 1.298, + 1.543, 1.726, 1.825, 2.211, 2.131, 0.152, 0.398, 0.349, 0.679, 0.652, 0.982, 0.977, 1.287, 1.374, 1.593, + 1.832, 1.888, 2.358, 2.174, 0.155, 0.401, 0.356, 0.685, 0.664, 0.991, 0.998, 1.311, 1.423, 1.636, 1.888, + 1.92, 2.418, 2.556, 0.164, 0.408, 0.372, 0.715, 0.704, 1.033, 1.05, 1.365, 1.503, 1.676, 2.017, 1.99, 0.18, + 0.448, 0.431, 0.791, 0.827, 1.161, 1.25, 1.513, 1.804, 1.89, 2.425, 2.252, + 0.194, 0.453, 0.495, 0.818, 0.874, 1.182, 1.327, 1.573, 1.894, 1.93, 0.207, 0.473, 0.53, 0.847, 0.93, + 1.244, 1.428, 1.625, 2.045, 2.009, 0.21, 0.477, 0.542, 0.858, 0.946, 1.24, 1.457, 1.642, 2.087, 2.062, + 0.228, 0.506, 0.595, 0.926, 1.033, 1.33, 1.622, 1.77, 2.336, 2.189, 0.229, 0.511, 0.603, 0.924, 1.061, + 1.34, 1.659, 1.781, 2.392, 2.21, 0.238, 0.526, 0.632, 0.967, 1.122, 1.392, 1.764, 1.858, 0.248, 0.55, + 0.663, 0.998, 1.182, 1.45, 1.876, 1.928, 0.254, 0.56, 0.685, 1.012, 1.224, 1.475, 1.947, + 1.965, 0.273, 0.569, 0.732, 1.045, 1.318, 1.524, 2.071, 2.023, 0.284, 0.585, 0.767, 1.083, 1.392, 1.585, + 2.184, 2.086, 0.287, 0.593, 0.777, 1.091, 1.42, 1.59, 2.222, 2.128, 0.302, 0.611, 0.829, 1.151, 1.54, + 1.668, 2.428, 2.239, 0.311, 0.623, 0.85, 1.144, 1.566, 1.7, 0.32, 0.627, 0.877, 1.176, 1.612, 1.728, 0.322, + 0.637, 0.887, 1.184, 1.639, 1.763, 0.343, 0.677, 0.956, 1.273, 1.804, 1.845, 0.364, 0.712, 1.03, 1.315, + 1.963, 1.934, 0.376, 0.716, 1.064, 1.344, 2.036, 1.972, 0.381, 0.719, 1.079, 1.366, + 2.053, 1.995, 0.395, 0.732, 1.112, 1.379, 2.128, 2.009, 0.403, 0.749, 1.154, 1.412, 2.215, 2.077, 0.41, + 0.757, 1.165, 1.419, 2.241, 2.094, 0.427, 0.791, 1.238, 1.472, 2.401, 2.187, 0.483, 0.805, 1.307, 1.499, + 0.497, 0.812, 1.351, 1.549, 0.518, 0.836, 1.411, 1.558, 0.521, 0.838, 1.421, 1.585, 0.537, 0.854, 1.47, + 1.618, 0.55, 0.87, 1.5, 1.637, 0.554, 0.874, 1.517, 1.665, 0.581, 0.896, 1.6, 1.714, 0.617, 0.94, 1.721, + 1.797, 0.626, 0.953, 1.756, 1.84, 0.634, 0.966, 1.772, 1.824, 0.638, 0.983, 1.813, + 1.834, 0.678, 1.008, 1.94, 1.926, 0.7, 1.024, 2.01, 1.945, 0.732, 1.052, 2.103, 2.003, 0.74, 1.056, 2.121, + 2.04, 0.756, 1.087, 2.156, 2.05, 0.769, 1.086, 2.217, 2.09, 0.786, 1.124, 2.298, 2.131, 0.808, 1.133, 2.36, + 2.153, 0.822, 1.147, 2.424, 2.2, 0.834, 1.153, 2.448, 2.689, 0.859, 1.166, 0.886, 1.209, 0.907, 1.21, + 0.932, 1.236, 0.951, 1.253, 0.959, 1.258, 0.986, 1.286, 0.998, 1.288, 1.011, 1.317, 1.027, 1.328, 1.051, + 1.341, 1.077, 1.359, 1.094, 1.368, 1.099, 1.394, 1.113, 1.392, 1.152, 1.43, + 1.18, 1.438, 1.197, 1.458, 1.225, 1.483, 1.239, 1.481, 1.268, 1.509, 1.338, 1.547, 1.345, 1.54, 1.422, + 1.593, 1.441, 1.621, 1.483, 1.644, 1.512, 1.655, 1.535, 1.67, 1.541, 1.687, 1.567, 1.699, 1.604, 1.714, + 1.637, 1.733, 1.653, 1.754, 1.668, 1.775, 1.684, 1.793, 1.721, 1.8, 1.739, 1.808, 1.747, 1.807, 1.795, + 1.849, 1.849, 1.866, 1.855, 1.871, 1.866, 1.888, 1.904, 1.926, 1.924, 1.946, 1.937, 1.946, 2.01, 1.984, + 2.022, 2.004, 2.048, 2.012, 2.084, 2.022, 2.134, 2.039, 2.173, 2.069, 2.215, 2.1, 2.248, + 2.115, 2.296, 2.145, 2.319, 2.174, 2.337, 2.173, 2.376, 2.186, 2.416, 2.204, 2.437, 2.221] + +len_values = [0.072, 0.086, 0.072, 0.183, 0.069, 0.278, 0.073, 0.151, 0.069, 0.246, 0.07, 0.202, 0.069, 0.203, 0.07, + 0.233, 0.068, 0.222, 0.071, 0.185, 0.069, 0.237, 0.074, 0.142, 0.068, 0.237, 0.069, 0.257, 0.07, 0.224, + 0.074, 0.188, 0.069, 0.258, 0.072, 0.255, 0.062, 0.602, 0.075, 0.192, 0.07, 0.226, 0.071, 0.207, 0.073, + 0.25, 0.072, 0.298, 0.076, 0.328, 0.069, 0.271, 0.076, 0.266, 0.075, 0.31, 0.08, 0.331, 0.089, 0.344, + 0.069, 0.24, 0.078, 0.308, 0.081, 0.333, 0.089, 0.348, 0.109, 0.377, 0.117, + 0.405, 0.078, 0.31, 0.087, 0.32, 0.106, 0.376, 0.115, 0.391, 0.128, 0.437, 0.145, 0.45, 0.07, 0.278, + 0.068, 0.236, 0.068, 0.326, 0.073, 0.308, 0.079, 0.334, 0.101, 0.365, 0.112, 0.395, 0.126, 0.429, 0.144, + 0.469, 0.157, 0.494, 0.172, 0.529, 0.121, 0.39, 0.136, 0.443, 0.158, 0.486, 0.173, 0.526, 0.193, 0.574, + 0.218, 0.621, 0.071, 0.212, 0.067, 0.245, 0.073, 0.289, 0.079, 0.322, 0.099, 0.359, 0.112, 0.395, 0.128, + 0.442, 0.152, 0.476, 0.17, 0.504, 0.19, 0.57, 0.215, 0.619, 0.234, 0.663, 0.26, 0.719, + 0.142, 0.472, 0.16, 0.497, 0.178, 0.561, 0.209, 0.615, 0.235, 0.663, 0.256, 0.724, 0.284, 0.785, 0.311, + 0.839, 0.11, 0.399, 0.153, 0.49, 0.202, 0.6, 0.227, 0.655, 0.251, 0.713, 0.279, 0.792, 0.309, 0.835, + 0.339, 0.899, 0.376, 0.96, 0.184, 0.569, 0.241, 0.693, 0.272, 0.752, 0.3, 0.818, 0.34, 0.89, 0.369, + 0.956, 0.397, 1.014, 0.425, 1.292, 0.074, 0.205, 0.069, 0.275, 0.078, 0.322, 0.104, 0.379, 0.122, 0.431, + 0.149, 0.478, 0.172, 0.54, 0.205, 0.602, 0.233, 0.668, 0.26, 0.737, 0.293, 0.793, 0.332, + 0.877, 0.366, 0.946, 0.404, 1.018, 0.433, 1.086, 0.486, 1.158, 0.528, 1.241, 0.246, 0.705, 0.316, 0.85, + 0.357, 0.915, 0.391, 0.988, 0.424, 1.071, 0.482, 1.157, 0.524, 1.244, 0.57, 1.313, 0.616, 1.403, 0.069, + 0.22, 0.072, 0.283, 0.083, 0.342, 0.112, 0.403, 0.134, 0.46, 0.167, 0.521, 0.201, 0.594, 0.233, 0.667, + 0.268, 0.742, 0.298, 0.814, 0.341, 0.898, 0.377, 0.973, 0.415, 1.057, 0.47, 1.155, 0.518, 1.22, 0.562, + 1.307, 0.616, 1.359, 0.668, 1.482, 0.718, 1.557, 0.32, 0.854, 0.359, 0.931, 0.454, + 1.108, 0.503, 1.196, 0.552, 1.276, 0.605, 1.369, 0.661, 1.474, 0.714, 1.558, 0.765, 1.824, 0.841, 1.764, + 0.225, 0.651, 0.297, 0.803, 0.382, 0.985, 0.488, 1.17, 0.539, 1.256, 0.59, 1.371, 0.644, 1.432, 0.708, + 1.53, 0.766, 1.651, 0.827, 1.748, 0.912, 1.846, 0.974, 1.951, 0.409, 1.026, 0.462, 1.124, 0.52, 1.231, + 0.573, 1.32, 0.632, 1.424, 0.692, 1.523, 0.756, 1.616, 0.83, 1.735, 0.908, 1.852, 0.965, 1.952, 1.043, + 2.057, 1.113, 2.402, 0.073, 0.214, 0.078, 0.27, 0.106, 0.375, 0.131, 0.453, 0.167, + 0.524, 0.209, 0.609, 0.247, 0.718, 0.286, 0.788, 0.336, 0.887, 0.381, 0.969, 0.43, 1.073, 0.494, 1.191, + 0.549, 1.287, 0.614, 1.385, 0.675, 1.482, 0.734, 1.587, 0.801, 1.702, 0.894, 1.845, 0.961, 1.933, 1.035, + 2.05, 1.115, 2.143, 1.2, 2.285, 1.301, 2.422, 0.583, 1.346, 0.784, 1.657, 0.872, 1.793, 0.95, 1.914, + 1.02, 2.027, 1.107, 2.139, 1.19, 2.283, 1.28, 2.407, 1.386, 2.551, 1.477, 2.953, 0.179, 0.575, 0.273, + 0.756, 0.423, 1.067, 0.491, 1.179, 0.62, 1.379, 0.688, 1.518, 0.754, 1.629, 0.919, 1.884, + 1.004, 1.997, 1.088, 2.125, 1.174, 2.251, 1.275, 2.409, 1.382, 2.54, 1.481, 2.645, 1.582, 2.803, 1.696, + 2.957, 0.659, 1.458, 0.726, 1.57, 0.813, 1.703, 0.898, 1.834, 0.978, 1.943, 1.063, 2.084, 1.156, 2.211, + 1.251, 2.355, 1.367, 2.512, 1.469, 2.634, 1.581, 2.769, 1.685, 2.931, 1.797, 3.457, 1.931, 3.247, 0.407, + 1.056, 0.547, 1.27, 0.688, 1.509, 0.857, 1.79, 1.032, 2.039, 1.128, 2.181, 1.232, 2.32, 1.343, 2.477, + 1.451, 2.617, 1.563, 2.762, 1.682, 2.905, 1.792, 3.063, 1.927, 3.215, 2.058, 3.403, + 2.187, 4.05, 0.818, 1.726, 0.992, 1.989, 1.093, 2.129, 1.306, 2.441, 1.416, 2.572, 1.532, 2.718, 1.65, + 2.89, 1.777, 3.051, 1.901, 3.208, 2.043, 3.389, 2.182, 3.56, 2.326, 3.709, 0.066, 0.286, 0.083, 0.344, + 0.125, 0.434, 0.169, 0.527, 0.22, 0.644, 0.271, 0.753, 0.33, 0.873, 0.385, 0.995, 0.456, 1.124, 0.529, + 1.24, 0.6, 1.37, 0.682, 1.499, 0.765, 1.634, 0.871, 1.798, 0.952, 1.919, 1.046, 2.065, 1.151, 2.227, + 1.265, 2.385, 1.386, 2.527, 1.5, 2.68, 1.632, 2.857, 1.752, 3.016, 1.881, 3.189, 2.02, + 3.365, 2.172, 3.536, 2.32, 3.705, 1.216, 2.297, 1.465, 2.636, 1.714, 2.983, 1.849, 3.115, 2.002, 3.311, + 2.141, 3.499, 2.297, 3.69, 0.067, 0.275, 0.088, 0.354, 0.132, 0.448, 0.179, 0.563, 0.236, 0.683, 0.292, + 0.8, 0.355, 0.921, 0.416, 1.057, 0.5, 1.189, 0.58, 1.331, 0.664, 1.471, 0.749, 1.613, 0.851, 1.773, + 0.964, 1.909, 1.053, 2.07, 1.16, 2.216, 1.281, 2.386, 1.414, 2.58, 1.544, 2.733, 1.673, 2.901, 1.808, + 3.065, 1.966, 3.25, 2.116, 3.447, 2.264, 3.627, 1.223, 2.301, 1.36, 2.492, 1.621, 2.851, + 1.755, 3.019, 2.06, 3.404, 2.215, 3.586, 2.38, 4.085, 0.721, 1.566, 0.936, 1.896, 1.154, 2.227, 1.431, + 2.581, 1.706, 2.934, 2.017, 3.336, 2.18, 3.53, 2.342, 3.722, 1.497, 2.663, 1.639, 2.857, 1.79, 3.05, + 1.948, 3.257, 2.125, 3.468, 2.29, 3.652, 0.412, 1.047, 0.788, 1.691, 1.018, 2.021, 1.145, 2.183, 1.567, + 2.76, 1.875, 3.162, 2.216, 3.585, 1.971, 3.297, 0.071, 0.293, 0.109, 0.392, 0.159, 0.501, 0.225, 0.649, + 0.29, 0.792, 0.363, 0.95, 0.453, 1.094, 0.541, 1.272, 0.64, 1.429, 0.745, 1.595, 0.864, + 1.783, 0.983, 1.955, 1.111, 2.159, 1.252, 2.325, 1.401, 2.574, 1.548, 2.741, 1.717, 2.979, 1.879, 3.176, + 2.057, 3.4, 2.247, 3.637, 2.163, 3.526, 2.349, 3.719, 1.204, 2.289, 1.523, 2.731, 1.858, 3.165, 2.256, + 3.627, 0.075, 0.294, 0.118, 0.418, 0.176, 0.559, 0.249, 0.712, 0.333, 0.875, 0.413, 1.042, 0.52, 1.227, + 0.624, 1.424, 0.741, 1.603, 0.884, 1.799, 1.005, 1.995, 1.148, 2.196, 1.316, 2.423, 1.482, 2.672, 1.647, + 2.887, 1.827, 3.102, 2.037, 3.368, 2.245, 3.613, 0.074, 0.293, 0.125, 0.428, 0.192, + 0.571, 0.268, 0.733, 0.347, 0.911, 0.451, 1.105, 0.554, 1.296, 0.672, 1.474, 0.792, 1.69, 0.949, 1.897, + 1.085, 2.112, 1.24, 2.322, 1.416, 2.577, 1.599, 2.813, 1.784, 3.068, 1.985, 3.302, 2.199, 3.585, 2.372, + 3.763, 0.08, 0.275, 0.132, 0.457, 0.212, 0.619, 0.291, 0.802, 0.388, 0.998, 0.509, 1.195, 0.627, 1.408, + 0.754, 1.623, 0.908, 1.864, 1.072, 2.098, 1.244, 2.348, 1.437, 2.603, 1.633, 2.853, 1.843, 3.114, 2.075, + 3.411, 2.304, 3.673, 0.664, 1.479, 1.341, 2.472, 1.75, 2.989, 1.983, 3.295, 0.079, + 0.347, 0.151, 0.495, 0.24, 0.687, 0.344, 0.903, 0.466, 1.127, 0.597, 1.39, 0.744, 1.612, 0.924, 1.855, + 1.099, 2.134, 1.301, 2.409, 1.51, 2.682, 1.74, 2.987, 2.001, 3.293, 2.261, 3.654, 1.611, 2.827, 2.12, + 3.455, 0.083, 0.358, 0.17, 0.529, 0.277, 0.759, 0.39, 1.007, 0.536, 1.249, 0.697, 1.532, 0.879, 1.819, + 1.079, 2.122, 1.301, 2.42, 1.542, 2.75, 1.803, 3.094, 2.089, 3.452, 2.378, 3.791, 0.086, 0.357, 0.173, + 0.544, 0.282, 0.778, 0.407, 1.036, 0.562, 1.305, 0.729, 1.586, 0.922, 1.886, 1.133, 2.2, + 1.38, 2.522, 1.63, 2.853, 1.89, 3.195, 2.201, 3.57, 0.099, 0.331, 0.197, 0.592, 0.323, 0.824, 0.467, + 1.143, 0.635, 1.432, 0.855, 1.748, 1.07, 2.073, 1.322, 2.442, 1.588, 3.247, 1.895, 3.182, 2.238, 3.591, + 0.105, 0.381, 0.213, 0.623, 0.342, 0.903, 0.512, 1.207, 0.695, 1.542, 0.929, 1.884, 1.159, 2.494, 1.451, + 2.627, 1.751, 2.993, 2.099, 3.424, 0.107, 0.389, 0.219, 0.636, 0.354, 0.922, 0.53, 1.241, 0.725, 1.579, + 0.962, 1.945, 1.214, 2.313, 1.514, 2.69, 1.841, 3.111, 2.198, 3.543, 0.112, 0.414, + 0.237, 0.682, 0.392, 1.001, 0.589, 1.35, 0.811, 1.726, 1.086, 2.121, 1.393, 2.554, 1.718, 2.967, 2.096, + 3.425, 0.117, 0.427, 0.25, 0.712, 0.418, 1.039, 0.632, 1.428, 0.881, 1.824, 1.169, 2.243, 1.506, 2.678, + 1.863, 3.14, 2.266, 4.232, 0.127, 0.443, 0.277, 0.76, 0.467, 1.134, 0.699, 1.532, 0.982, 1.971, 1.316, + 2.441, 1.681, 2.911, 2.102, 3.433, 0.139, 0.467, 0.306, 0.821, 0.526, 1.23, 0.793, 1.702, 1.121, 2.172, + 1.509, 2.699, 1.943, 3.254, 0.144, 0.478, 0.327, 0.848, 0.554, 1.288, 0.853, 1.768, + 1.193, 2.279, 1.615, 2.82, 2.083, 3.4, 0.146, 0.487, 0.331, 0.87, 0.573, 1.321, 0.874, 1.812, 1.232, + 2.328, 1.665, 2.898, 2.154, 3.495, 0.151, 0.506, 0.347, 0.902, 0.605, 1.361, 0.926, 1.884, 1.317, 2.432, + 1.77, 3.036, 2.295, 3.671, 0.154, 0.5, 0.353, 0.925, 0.619, 1.394, 0.95, 1.926, 1.362, 2.515, 1.825, + 3.103, 2.355, 3.935, 0.163, 0.517, 0.369, 0.959, 0.658, 1.456, 1.006, 1.991, 1.449, 2.597, 1.942, 3.238, + 0.178, 0.563, 0.428, 1.062, 0.773, 1.639, 1.204, 2.28, 1.739, 2.979, 2.359, 3.732, 0.191, + 0.582, 0.454, 1.104, 0.812, 1.697, 1.264, 2.378, 1.827, 3.11, 0.205, 0.607, 0.486, 1.155, 0.874, 1.798, + 1.37, 2.507, 1.985, 3.291, 0.208, 0.615, 0.494, 1.172, 0.897, 1.808, 1.399, 2.557, 2.022, 3.343, 0.226, + 0.651, 0.542, 1.281, 0.991, 1.966, 1.564, 2.777, 2.282, 3.659, 0.228, 0.659, 0.552, 1.285, 1.016, 1.996, + 1.599, 2.817, 2.324, 3.711, 0.236, 0.68, 0.584, 1.343, 1.075, 2.087, 1.702, 2.944, 0.246, 0.703, 0.615, + 1.38, 1.141, 2.18, 1.81, 3.09, 0.253, 0.715, 0.636, 1.426, 1.183, 2.243, 1.881, + 3.181, 0.27, 0.747, 0.671, 1.485, 1.253, 2.337, 2.005, 3.333, 0.282, 0.776, 0.703, 1.533, 1.342, 2.433, + 2.123, 3.449, 0.285, 0.778, 0.714, 1.55, 1.358, 2.476, 2.159, 3.519, 0.299, 0.808, 0.771, 1.656, 1.481, + 2.632, 2.362, 3.762, 0.309, 0.823, 0.785, 1.664, 1.503, 2.673, 0.317, 0.836, 0.817, 1.7, 1.549, 2.727, + 0.318, 0.862, 0.828, 1.721, 1.582, 2.771, 0.34, 0.895, 0.911, 1.829, 1.735, 2.969, 0.36, 0.959, 0.987, + 1.953, 1.9, 3.171, 0.373, 0.96, 1.016, 2.01, 1.964, 3.226, 0.378, 0.964, 1.03, 2.013, + 1.989, 3.262, 0.391, 0.999, 1.058, 2.072, 2.051, 3.366, 0.4, 1.01, 1.106, 2.133, 2.145, 3.482, 0.407, + 1.029, 1.117, 2.145, 2.167, 3.5, 0.425, 1.05, 1.188, 2.252, 2.321, 3.672, 0.453, 1.096, 1.234, 2.308, + 0.462, 1.102, 1.278, 2.376, 0.481, 1.151, 1.338, 2.456, 0.483, 1.16, 1.356, 2.47, 0.499, 1.18, 1.398, + 2.543, 0.51, 1.199, 1.433, 2.586, 0.513, 1.206, 1.449, 2.6, 0.538, 1.247, 1.526, 2.719, 0.572, 1.308, + 1.651, 2.856, 0.581, 1.349, 1.686, 2.89, 0.59, 1.337, 1.701, 2.914, 0.598, 1.364, 1.734, + 2.97, 0.634, 1.418, 1.863, 3.132, 0.657, 1.461, 1.929, 3.194, 0.681, 1.495, 2.023, 3.31, 0.688, 1.503, + 2.039, 3.347, 0.697, 1.525, 2.082, 3.37, 0.712, 1.55, 2.14, 3.475, 0.735, 1.605, 2.219, 3.544, 0.755, + 1.615, 2.28, 3.637, 0.771, 1.65, 2.342, 3.72, 0.781, 1.649, 2.369, 4.084, 0.801, 1.698, 0.828, 1.727, + 0.846, 1.749, 0.87, 1.781, 0.895, 1.824, 0.903, 1.833, 0.93, 1.883, 0.942, 1.89, 0.957, 1.932, 0.972, + 1.933, 0.995, 1.979, 1.022, 2.008, 1.036, 2.045, 1.041, 2.044, 1.057, 2.055, 1.101, 2.133, + 1.128, 2.168, 1.141, 2.207, 1.172, 2.226, 1.183, 2.252, 1.209, 2.293, 1.258, 2.347, 1.262, 2.361, 1.348, + 2.464, 1.368, 2.488, 1.408, 2.55, 1.432, 2.591, 1.461, 2.625, 1.463, 2.615, 1.49, 2.663, 1.525, 2.721, + 1.556, 2.745, 1.578, 2.769, 1.59, 2.779, 1.614, 2.816, 1.645, 2.856, 1.665, 2.899, 1.672, 2.9, 1.715, + 2.953, 1.767, 2.998, 1.771, 3.017, 1.79, 3.033, 1.821, 3.076, 1.846, 3.107, 1.856, 3.115, 1.924, 3.201, + 1.943, 3.214, 1.966, 3.262, 2.003, 3.299, 2.055, 3.368, 2.1, 3.412, 2.138, 3.468, 2.175, + 3.526, 2.211, 3.566, 2.242, 3.611, 2.256, 3.612, 2.294, 3.664, 2.337, 3.701, 2.355, 3.746] diff --git a/src/novelai_python/sdk/ai/generate_image/_enum.py b/src/novelai_python/sdk/ai/generate_image/_enum.py index 3d0b084..28da946 100755 --- a/src/novelai_python/sdk/ai/generate_image/_enum.py +++ b/src/novelai_python/sdk/ai/generate_image/_enum.py @@ -14,6 +14,18 @@ class Sampler(Enum): K_DPMPP_SDE = "k_dpmpp_sde" DDIM_V3 = "ddim_v3" + DDIM = "ddim" + PLMS = "plms" + K_DPM_2 = "k_dpm_2" + K_DPM_2_ANCESTRAL = "k_dpm_2_ancestral" + K_LMS = "k_lms" + K_DPM_ADAPTIVE = "k_dpm_adaptive" + K_DPM_FAST = "k_dpm_fast" + K_DPMPP_2M_SDE = "k_dpmpp_2m_sde" + K_DPMPP_3M_SDE = "k_dpmpp_3m_sde" + NAI_SMEA = "nai_smea" + NAI_SMEA_DYN = "nai_smea_dyn" + class NoiseSchedule(Enum): NATIVE = "native" @@ -45,11 +57,23 @@ class ControlNetModel(Enum): """景深""" FAKE_SCRIBBLE = "fake_scribble" """伪涂鸦""" - M_LSD = "mlsd" - """(建筑)线条检测""" - LANDSCAPER = "uniformer" + UNIFORMER = "uniformer" """风景生成""" + # Unusable + CANNY = "canny" + """边缘检测方法之一""" + DEPTH = "depth" + """深度信息提取""" + MLSD = "mlsd" + """(建筑)线条检测""" + NORMAL = "normal" + """法线信息提取""" + SCRIBBLE = "scribble" + """手绘涂鸦风格生成""" + SEG = "seg" + """分割算法""" + class Resolution(Enum): RES_512_768 = (512, 768) @@ -77,8 +101,11 @@ class Model(Enum): SAFE_DIFFUSION_INPAINTING = "safe-diffusion-inpainting" NAI_DIFFUSION_FURRY = "nai-diffusion-furry" + # NAI_DIFFUSION_FURRY2 = "nai-diffusion-furry2" FURRY_DIFFUSION_INPAINTING = "furry-diffusion-inpainting" + CUSTOM = "custom" + INPAINTING_MODEL_LIST = [Model.NAI_DIFFUSION_3_INPAINTING, Model.NAI_DIFFUSION_INPAINTING, diff --git a/src/novelai_python/tool/image_metadata/__init__.py b/src/novelai_python/tool/image_metadata/__init__.py index 68619e4..1d32483 100644 --- a/src/novelai_python/tool/image_metadata/__init__.py +++ b/src/novelai_python/tool/image_metadata/__init__.py @@ -85,6 +85,8 @@ def reset_alpha(input_img: BytesIO) -> BytesIO: :param input_img: :return: """ + if isinstance(input_img, BytesIO): + input_img.seek(0) image = Image.open(input_img).convert('RGBA') data = np.array(image) data[..., 3] = 254 @@ -130,6 +132,8 @@ def load_image(cls, :return: ImageMetadata :raises ValidationError: Data extraction failed """ + if isinstance(image_io, BytesIO): + image_io.seek(0) try: image_data = ImageLsbDataExtractor().extract_data(image_io) model = cls(**image_data)