novelai-python 0.4.11__tar.gz → 0.4.13__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {novelai_python-0.4.11 → novelai_python-0.4.13}/PKG-INFO +2 -1
- {novelai_python-0.4.11 → novelai_python-0.4.13}/README.md +1 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/pyproject.toml +1 -1
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/__init__.py +3 -0
- novelai_python-0.4.13/src/novelai_python/credential/ApiToken.py +41 -0
- novelai_python-0.4.13/src/novelai_python/credential/JwtToken.py +40 -0
- novelai_python-0.4.13/src/novelai_python/credential/UserAuth.py +47 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/sdk/__init__.py +1 -0
- novelai_python-0.4.13/src/novelai_python/sdk/ai/_const.py +5 -0
- novelai_python-0.4.13/src/novelai_python/sdk/ai/_cost.py +162 -0
- {novelai_python-0.4.11/src/novelai_python/sdk/ai/generate_image → novelai_python-0.4.13/src/novelai_python/sdk/ai}/_enum.py +34 -3
- novelai_python-0.4.13/src/novelai_python/sdk/ai/augment_image/__init__.py +305 -0
- novelai_python-0.4.13/src/novelai_python/sdk/ai/augment_image/_enum.py +43 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/sdk/ai/generate/__init__.py +70 -73
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/sdk/ai/generate_image/__init__.py +109 -157
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/sdk/ai/generate_image/suggest_tags.py +2 -2
- novelai_python-0.4.13/src/novelai_python/sdk/ai/generate_stream.py +170 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/sdk/ai/generate_voice/__init__.py +52 -55
- novelai_python-0.4.13/src/novelai_python/sdk/ai/upscale.py +198 -0
- novelai_python-0.4.13/src/novelai_python/sdk/user/information.py +112 -0
- novelai_python-0.4.13/src/novelai_python/sdk/user/login.py +122 -0
- novelai_python-0.4.13/src/novelai_python/sdk/user/subscription.py +120 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/tool/image_metadata/__init__.py +13 -6
- {novelai_python-0.4.11 → novelai_python-0.4.13}/tests/test_generate_voice.py +11 -4
- {novelai_python-0.4.11 → novelai_python-0.4.13}/tests/test_upscale.py +14 -4
- {novelai_python-0.4.11 → novelai_python-0.4.13}/tests/test_user_information.py +15 -4
- {novelai_python-0.4.11 → novelai_python-0.4.13}/tests/test_user_login.py +28 -12
- {novelai_python-0.4.11 → novelai_python-0.4.13}/tests/test_user_subscription.py +15 -3
- novelai_python-0.4.11/src/novelai_python/credential/ApiToken.py +0 -41
- novelai_python-0.4.11/src/novelai_python/credential/JwtToken.py +0 -42
- novelai_python-0.4.11/src/novelai_python/credential/UserAuth.py +0 -43
- novelai_python-0.4.11/src/novelai_python/sdk/ai/generate_image/_const.py +0 -487
- novelai_python-0.4.11/src/novelai_python/sdk/ai/generate_stream.py +0 -173
- novelai_python-0.4.11/src/novelai_python/sdk/ai/upscale.py +0 -201
- novelai_python-0.4.11/src/novelai_python/sdk/user/information.py +0 -115
- novelai_python-0.4.11/src/novelai_python/sdk/user/login.py +0 -132
- novelai_python-0.4.11/src/novelai_python/sdk/user/subscription.py +0 -122
- {novelai_python-0.4.11 → novelai_python-0.4.13}/LICENSE +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/NOTICE.MD +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/_exceptions.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/_response/__init__.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/_response/ai/__init__.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/_response/ai/generate.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/_response/ai/generate_image.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/_response/ai/generate_stream.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/_response/ai/generate_voice.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/_response/ai/upscale.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/_response/schema.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/_response/user/__init__.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/_response/user/information.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/_response/user/login.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/_response/user/subscription.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/credential/__init__.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/credential/_base.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/sdk/ai/LICENSE +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/sdk/ai/__init__.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/sdk/ai/generate/_const.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/sdk/ai/generate/_enum.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/sdk/ai/generate/_preset.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/sdk/ai/generate_voice/_enum.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/sdk/schema.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/sdk/user/__init__.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/server.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/tokenizer/NOTICE.MD +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/tokenizer/__init__.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/tokenizer/bpe_simple_vocab_16e6.txt.gz +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/tokenizer/gpt2-genji_tokenizer.json +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/tokenizer/gpt2_tokenizer.json +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/tokenizer/nerdstash_v1.model +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/tokenizer/nerdstash_v2.model +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/tokenizer/novelai.model +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/tokenizer/novelai_v2.model +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/tokenizer/pile_tokenizer.json +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/tokenizer/simple_tokenizer.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/tool/__init__.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/tool/image_metadata/lsb_extractor.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/tool/image_metadata/lsb_injector.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/tool/paint_mask/__init__.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/tool/random_prompt/__init__.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/tool/random_prompt/tag.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/tool/random_prompt/tag_character.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/tool/random_prompt/tag_nsfw.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/utils/__init__.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/utils/encode.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/src/novelai_python/utils/useful.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/tests/__init__.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/tests/test_random_prompt.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/tests/test_server.py +0 -0
- {novelai_python-0.4.11 → novelai_python-0.4.13}/tests/test_server_run.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: novelai-python
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.13
|
|
4
4
|
Summary: NovelAI Python Binding With Pydantic
|
|
5
5
|
Author-Email: sudoskys <coldlando@hotmail.com>
|
|
6
6
|
License: Apache License 2.0
|
|
@@ -59,6 +59,7 @@ The goal of this repository is to use Pydantic to build legitimate requests to a
|
|
|
59
59
|
- [x] /ai/generate-voice
|
|
60
60
|
- [x] /ai/generate-stream
|
|
61
61
|
- [x] /ai/generate
|
|
62
|
+
- [x] /ai/augment-image
|
|
62
63
|
- [ ] /ai/annotate-image
|
|
63
64
|
- [ ] /ai/classify
|
|
64
65
|
- [ ] /ai/generate-prompt
|
|
@@ -25,6 +25,7 @@ The goal of this repository is to use Pydantic to build legitimate requests to a
|
|
|
25
25
|
- [x] /ai/generate-voice
|
|
26
26
|
- [x] /ai/generate-stream
|
|
27
27
|
- [x] /ai/generate
|
|
28
|
+
- [x] /ai/augment-image
|
|
28
29
|
- [ ] /ai/annotate-image
|
|
29
30
|
- [ ] /ai/classify
|
|
30
31
|
- [ ] /ai/generate-prompt
|
|
@@ -11,6 +11,7 @@ from ._exceptions import (
|
|
|
11
11
|
SessionHttpError
|
|
12
12
|
)
|
|
13
13
|
from .credential import JwtCredential, LoginCredential, ApiCredential
|
|
14
|
+
from .sdk import AugmentImageInfer
|
|
14
15
|
from .sdk import GenerateImageInfer, ImageGenerateResp
|
|
15
16
|
from .sdk import Information, InformationResp
|
|
16
17
|
from .sdk import LLM, LLMResp
|
|
@@ -31,6 +32,8 @@ __all__ = [
|
|
|
31
32
|
"GenerateImageInfer",
|
|
32
33
|
"ImageGenerateResp",
|
|
33
34
|
|
|
35
|
+
"AugmentImageInfer",
|
|
36
|
+
|
|
34
37
|
"VoiceGenerate",
|
|
35
38
|
"VoiceResponse",
|
|
36
39
|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# @Time : 2024/2/8 下午3:05
|
|
3
|
+
# @Author : sudoskys
|
|
4
|
+
# @File : ApiToken.py
|
|
5
|
+
# @Software: PyCharm
|
|
6
|
+
|
|
7
|
+
from curl_cffi.requests import AsyncSession
|
|
8
|
+
from loguru import logger
|
|
9
|
+
from pydantic import SecretStr, Field, field_validator
|
|
10
|
+
|
|
11
|
+
from ._base import CredentialBase, FAKE_UA
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class ApiCredential(CredentialBase):
|
|
15
|
+
"""
|
|
16
|
+
ApiCredential is the base class for all credential.
|
|
17
|
+
"""
|
|
18
|
+
api_token: SecretStr = Field(None, description="api token")
|
|
19
|
+
|
|
20
|
+
async def get_session(self, timeout: int = 180, update_headers: dict = None):
|
|
21
|
+
headers = {
|
|
22
|
+
"Accept": "*/*",
|
|
23
|
+
"Accept-Encoding": "gzip, deflate, br",
|
|
24
|
+
"User-Agent": FAKE_UA.edge,
|
|
25
|
+
"Authorization": f"Bearer {self.api_token.get_secret_value()}",
|
|
26
|
+
"Content-Type": "application/json",
|
|
27
|
+
"Origin": "https://novelai.net",
|
|
28
|
+
"Referer": "https://novelai.net/",
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if update_headers:
|
|
32
|
+
assert isinstance(update_headers, dict), "update_headers must be a dict"
|
|
33
|
+
headers.update(update_headers)
|
|
34
|
+
|
|
35
|
+
return AsyncSession(timeout=timeout, headers=headers, impersonate="edge101")
|
|
36
|
+
|
|
37
|
+
@field_validator('api_token')
|
|
38
|
+
def check_api_token(cls, v: SecretStr):
|
|
39
|
+
if not v.get_secret_value().startswith("pst"):
|
|
40
|
+
logger.warning("api token should start with pst-")
|
|
41
|
+
return v
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# @Time : 2024/1/26 上午11:04
|
|
3
|
+
# @Author : sudoskys
|
|
4
|
+
# @File : JwtToken.py
|
|
5
|
+
# @Software: PyCharm
|
|
6
|
+
from curl_cffi.requests import AsyncSession
|
|
7
|
+
from loguru import logger
|
|
8
|
+
from pydantic import SecretStr, Field, field_validator
|
|
9
|
+
|
|
10
|
+
from ._base import CredentialBase, FAKE_UA
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class JwtCredential(CredentialBase):
|
|
14
|
+
"""
|
|
15
|
+
JwtCredential is the base class for all credential.
|
|
16
|
+
"""
|
|
17
|
+
jwt_token: SecretStr = Field(None, description="jwt token")
|
|
18
|
+
|
|
19
|
+
async def get_session(self, timeout: int = 180, update_headers: dict = None):
|
|
20
|
+
headers = {
|
|
21
|
+
"Accept": "*/*",
|
|
22
|
+
"User-Agent": FAKE_UA.edge,
|
|
23
|
+
"Accept-Encoding": "gzip, deflate, br",
|
|
24
|
+
"Authorization": f"Bearer {self.jwt_token.get_secret_value()}",
|
|
25
|
+
"Content-Type": "application/json",
|
|
26
|
+
"Origin": "https://novelai.net",
|
|
27
|
+
"Referer": "https://novelai.net/",
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if update_headers:
|
|
31
|
+
assert isinstance(update_headers, dict), "update_headers must be a dict"
|
|
32
|
+
headers.update(update_headers)
|
|
33
|
+
|
|
34
|
+
return AsyncSession(timeout=timeout, headers=headers, impersonate="edge101")
|
|
35
|
+
|
|
36
|
+
@field_validator('jwt_token')
|
|
37
|
+
def check_jwt_token(cls, v: SecretStr):
|
|
38
|
+
if not v.get_secret_value().startswith("ey"):
|
|
39
|
+
logger.warning("jwt_token should start with ey")
|
|
40
|
+
return v
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# @Time : 2024/2/7 下午12:14
|
|
3
|
+
# @Author : sudoskys
|
|
4
|
+
# @File : UserAuth.py
|
|
5
|
+
import time
|
|
6
|
+
from typing import Optional
|
|
7
|
+
|
|
8
|
+
from curl_cffi.requests import AsyncSession
|
|
9
|
+
from pydantic import SecretStr, Field
|
|
10
|
+
|
|
11
|
+
from ._base import CredentialBase, FAKE_UA
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class LoginCredential(CredentialBase):
|
|
15
|
+
"""
|
|
16
|
+
JwtCredential is the base class for all credential.
|
|
17
|
+
"""
|
|
18
|
+
username: str = Field(None, description="username")
|
|
19
|
+
password: SecretStr = Field(None, description="password")
|
|
20
|
+
_session_headers: dict = {}
|
|
21
|
+
_update_at: Optional[int] = None
|
|
22
|
+
|
|
23
|
+
async def get_session(self, timeout: int = 180, update_headers: dict = None):
|
|
24
|
+
headers = {
|
|
25
|
+
"Accept": "*/*",
|
|
26
|
+
"User-Agent": FAKE_UA.edge,
|
|
27
|
+
"Accept-Encoding": "gzip, deflate, br",
|
|
28
|
+
"Authorization": "Bearer ",
|
|
29
|
+
"Content-Type": "application/json",
|
|
30
|
+
"Origin": "https://novelai.net",
|
|
31
|
+
"Referer": "https://novelai.net/",
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
# 30 天有效期
|
|
35
|
+
if not self._session_headers or int(time.time()) - self._update_at > 29 * 24 * 60 * 60:
|
|
36
|
+
from ..sdk import Login
|
|
37
|
+
resp = await Login.build(user_name=self.username, password=self.password.get_secret_value()).request()
|
|
38
|
+
headers["Authorization"] = f"Bearer {resp.accessToken}"
|
|
39
|
+
self._session_headers = headers
|
|
40
|
+
self._update_at = int(time.time())
|
|
41
|
+
else:
|
|
42
|
+
headers.update(self._session_headers)
|
|
43
|
+
|
|
44
|
+
if update_headers:
|
|
45
|
+
headers.update(update_headers)
|
|
46
|
+
|
|
47
|
+
return AsyncSession(timeout=timeout, headers=headers, impersonate="edge101")
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
# @File : __init__.py.py
|
|
5
5
|
# @Software: PyCharm
|
|
6
6
|
|
|
7
|
+
from .ai.augment_image import AugmentImageInfer # noqa 401
|
|
7
8
|
from .ai.generate import LLM, LLMResp # noqa 401
|
|
8
9
|
from .ai.generate_image import GenerateImageInfer, ImageGenerateResp # noqa 401
|
|
9
10
|
from .ai.generate_image.suggest_tags import SuggestTags, SuggestTagsResp # noqa 401
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
map = [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]
|
|
2
|
+
newN = [.124, .11, .124, .205, .121, .307, .121, .227, .12, .31, .121, .257, .121, .251, .123, .297, .121, .298, .12, .305, .128, .195, .12, .327, .117, .34, .122, .244, .12, .28, .119, .344, .125, .216, .135, .149, .12, .314, .121, .314, .122, .253, .118, .286, .119, .364, .125, .319, .127, .327, .119, .281, .122, .305, .126, .331, .133, .333, .142, .366, .117, .355, .126, .328, .131, .362, .14, .38, .16, .401, .168, .43, .127, .353, .137, .355, .157, .393, .17, .398, .181, .437, .201, .458, .122, .313, .118, .412, .12, .319, .123, .431, .132, .355, .153, .371, .164, .424, .181, .451, .199, .463, .218, .502, .223, .511, .172, .426, .191, .454, .214, .499, .235, .509, .245, .538, .27, .561, .131, .163, .119, .31, .124, .346, .134, .362, .154, .389, .164, .417, .184, .445, .213, .484, .231, .509, .259, .556, .269, .559, .289, .59, .318, .648, .2, .472, .226, .509, .245, .553, .29, .626, .288, .601, .31, .641, .342, .7, .37, .729, .166, .465, .211, .481, .268, .581, .308, .642, .307, .645, .337, .693, .371, .728, .403, .765, .446, .83, .262, .575, .327, .677, .329, .665, .357, .713, .403, .782, .432, .81, .467, .878, .495, 1.108, .124, .353, .118, .376, .132, .415, .163, .453, .183, .455, .206, .463, .237, .562, .288, .623, .316, .659, .352, .704, .354, .72, .394, .767, .435, .824, .473, .859, .518, .944, .608, 1.004, .657, 1.046, .33, .677, .378, .743, .418, .787, .459, .851, .495, .915, .598, 1, .649, 1.032, .695, 1.097, .74, 1.155, .118, .336, .123, .352, .139, .423, .179, .488, .202, .493, .226, .518, .278, .576, .318, .655, .353, .702, .396, .782, .408, .778, .445, .829, .497, .91, .587, .967, .645, 1.031, .694, 1.083, .747, 1.149, .807, 1.214, .882, 1.277, .427, .829, .427, .806, .564, .962, .619, 1.011, .679, 1.071, .727, 1.13, .792, 1.198, .859, 1.258, .919, 1.509, .99, 1.387, .304, .663, .387, .781, .46, .86, .613, .983, .663, 1.044, .721, 1.131, .779, 1.175, .864, 1.265, .923, 1.312, 1.001, 1.4, 1.063, 1.456, 1.147, 1.531, .487, .886, .569, .957, .641, 1.036, .698, 1.08, .76, 1.166, .827, 1.24, .91, 1.317, .979, 1.374, 1.062, 1.457, 1.124, 1.515, 1.216, 1.598, 1.282, 1.888, .118, .363, .128, .359, .169, .421, .215, .507, .251, .558, .277, .589, .334, .706, .389, .792, .439, .835, .502, .941, .514, .933, .614, 1.001, .681, 1.076, .735, 1.135, .822, 1.243, .881, 1.283, .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, .708, 1.106, .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, .266, .62, .366, .725, .553, 1.015, .614, .993, .753, 1.168, .827, 1.251, .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, .791, 1.182, .869, 1.266, .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, .526, .984, .679, 1.072, .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, .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, .122, .298, .138, .44, .207, .522, .271, .613, .325, .658, .359, .722, .44, .853, .516, .965, .619, 1.057, .726, 1.162, .733, 1.151, .821, 1.226, .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, .127, .297, .145, .444, .215, .553, .288, .632, .346, .706, .384, .777, .472, .892, .554, 1.006, .676, 1.088, .786, 1.24, .81, 1.227, .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, .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, .544, 1.001, .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, .12, .401, .173, .466, .256, .596, .356, .725, .422, .821, .474, .891, .62, 1.024, .753, 1.209, .85, 1.303, .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, .123, .388, .193, .502, .286, .636, .395, .788, .48, .907, .536, .976, .72, 1.159, .853, 1.328, .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, .127, .394, .203, .51, .308, .644, .426, .831, .506, .959, .608, 1.045, .764, 1.198, .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, .129, .395, .216, .524, .339, .691, .468, .906, .565, 1.04, .689, 1.11, .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, .906, 1.364, 1.564, 1.875, 2.007, 2.209, 2.237, 2.35, .134, .383, .246, .549, .385, .768, .547, 1.009, .71, 1.157, .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, .139, .441, .272, .613, .442, .851, .616, 1.122, .806, 1.297, .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, .142, .454, .278, .623, .45, .877, .641, 1.17, .841, 1.33, .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, .16, .37, .312, .661, .508, .92, .777, 1.263, .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, .154, .911, .337, .696, .542, 1.012, .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, .169, .477, .347, .707, .564, 1.037, .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, .178, .491, .375, .753, .619, 1.118, .953, 1.516, 1.194, 1.733, 1.388, 1.862, 1.834, 2.27, 2.247, 2.66, 2.628, 2.863, .193, .476, .402, .791, .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, .207, .527, .442, .849, .777, 1.263, 1.174, 1.788, 1.453, 2.055, 1.667, 2.072, 2.188, 2.572, 2.724, 3.038, .223, .55, .483, .918, .865, 1.386, 1.31, 1.945, 1.629, 2.214, 1.926, 2.321, 2.5, 2.798, .232, .558, .512, .96, .91, 1.439, 1.393, 2.038, 1.73, 2.332, 2.055, 2.458, 2.656, 2.946, .235, .536, .521, .965, .935, 1.477, 1.426, 2.075, 1.799, 2.374, 2.121, 2.491, 2.751, 3.017, .244, .583, .548, 1.007, 1.015, 1.567, 1.51, 2.182, 1.907, 2.486, 2.253, 2.603, 2.922, 3.117, .249, .59, .559, 1.017, 1.032, 1.611, 1.544, 2.212, 1.971, 2.513, 2.314, 2.621, 2.998, 3.511, .26, .592, .582, 1.079, 1.099, 1.669, 1.626, 2.321, 2.079, 2.649, 2.466, 2.754, .288, .646, .679, 1.203, 1.285, 1.917, 1.939, 2.649, 2.492, 3.013, 2.942, 3.098, .304, .651, .75, 1.235, 1.346, 1.968, 2.038, 2.736, 2.602, 3.111, .322, .673, .795, 1.298, 1.431, 2.063, 2.176, 2.861, 2.79, 3.255, .327, .677, .816, 1.323, 1.456, 2.088, 2.234, 2.962, 2.866, 3.318, .355, .723, .892, 1.4, 1.605, 2.271, 2.475, 3.172, 3.189, 3.608, .358, .732, .905, 1.423, 1.644, 2.317, 2.524, 3.227, 3.254, 3.644, .371, .752, .946, 1.478, 1.735, 2.407, 2.682, 3.376, .392, .777, 1.032, 1.594, 1.835, 2.53, 2.866, 3.557, .403, .807, 1.067, 1.639, 1.9, 2.604, 2.972, 3.652, .428, .838, 1.138, 1.721, 2.022, 2.702, 3.156, 3.844, .446, .86, 1.19, 1.771, 2.13, 2.806, 3.331, 4.018, .452, .859, 1.204, 1.803, 2.163, 2.827, 3.384, 4.062, .475, .905, 1.286, 1.927, 2.345, 3.023, 3.691, 4.356, .486, .916, 1.313, 1.944, 2.386, 3.062, .496, .935, 1.347, 1.961, 2.458, 3.14, .501, .942, 1.363, 1.987, 2.493, 3.16, .538, 1.003, 1.48, 2.124, 2.738, 3.393, .575, 1.056, 1.601, 2.287, 3.003, 3.665, .588, 1.067, 1.642, 2.303, 3.099, 3.74, .594, 1.093, 1.662, 2.317, 3.127, 3.758, .615, 1.094, 1.714, 2.388, 3.24, 3.892, .626, 1.123, 1.771, 2.454, 3.364, 4.001, .641, 1.14, 1.799, 2.48, 3.406, 4.043, .673, 1.193, 1.913, 2.617, 3.644, 4.258, .734, 1.205, 1.999, 2.657, .752, 1.241, 2.063, 2.744, .782, 1.278, 2.15, 2.816, .785, 1.285, 2.162, 2.824, .806, 1.305, 2.233, 2.897, .828, 1.326, 2.282, 2.96, .835, 1.334, 2.313, 2.962, .875, 1.39, 2.441, 3.105, .928, 1.464, 2.616, 3.288, .943, 1.509, 2.671, 3.336, .951, 1.48, 2.696, 3.348, .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]
|
|
3
|
+
initialN = [.111, .306, .11, .435, .113, .372, .111, .418, .113, .354, .11, .431, .112, .354, .116, .379, .112, .341, .113, .43, .114, .428, .113, .363, .112, .411, .109, .49, .107, .472, .111, .422, .106, .449, .129, .197, .113, .454, .113, .479, .108, .417, .112, .436, .109, .472, .112, .48, .119, .452, .108, .476, .117, .407, .118, .489, .121, .498, .131, .521, .109, .443, .117, .466, .121, .511, .13, .499, .15, .556, .158, .569, .116, .527, .128, .488, .146, .532, .158, .547, .17, .61, .19, .648, .109, .527, .107, .521, .109, .453, .114, .559, .121, .517, .141, .532, .154, .566, .17, .62, .189, .617, .206, .677, .213, .667, .162, .565, .181, .606, .201, .665, .222, .683, .235, .655, .26, .711, .112, .523, .106, .508, .112, .496, .123, .511, .142, .561, .156, .553, .172, .626, .201, .651, .218, .684, .246, .738, .259, .712, .278, .749, .306, .809, .188, .635, .213, .685, .231, .741, .273, .841, .277, .77, .299, .797, .331, .867, .359, .884, .154, .619, .199, .659, .255, .767, .291, .887, .296, .8, .326, .851, .359, .901, .389, .956, .432, 1.036, .246, .788, .309, .908, .317, .831, .346, .873, .391, .95, .42, 1.014, .454, 1.061, .482, 1.304, .108, .487, .108, .511, .12, .574, .152, .614, .171, .624, .194, .644, .223, .765, .271, .854, .299, .886, .332, .967, .341, .892, .382, .927, .421, 1.017, .46, 1.052, .501, 1.185, .592, 1.234, .758, 1.901, .313, .914, .366, .922, .405, .979, .446, 1.05, .481, 1.106, .582, 1.227, .753, 1.898, .812, 2.058, .871, 2.202, .111, .484, .11, .543, .128, .566, .165, .675, .189, .681, .215, .688, .263, .784, .301, .898, .336, .943, .377, 1.05, .395, .967, .432, 1.014, .481, 1.134, .571, 1.199, .743, 1.887, .807, 2.022, .87, 2.164, .955, 2.318, 1.033, 2.44, .406, 1.115, .413, 1.007, .548, 1.181, .719, 1.83, .787, 1.972, .856, 2.13, .934, 2.335, 1.021, 2.464, 1.085, 2.954, 1.175, 2.804, .288, .888, .369, 1.029, .445, 1.07, .594, 1.24, .768, 1.942, .84, 2.142, .917, 2.299, 1.014, 2.454, 1.092, 2.656, 1.18, 2.797, 1.264, 2.968, 1.36, 3.171, .47, 1.109, .554, 1.169, .741, 1.866, .822, 2.049, .893, 2.232, .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, .109, .445, .117, .508, .156, .59, .198, .736, .234, .783, .264, .776, .316, .944, .368, 1.067, .418, 1.121, .477, 1.27, .497, 1.165, .597, 1.239, .786, 1.946, .871, 2.128, .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, .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, .249, .859, .347, .988, .528, 1.35, .598, 1.236, .886, 2.204, .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, .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, .505, 1.273, .784, 1.984, .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, .107, .514, .127, .604, .191, .747, .251, .89, .304, .95, .343, .977, .42, 1.152, .492, 1.319, .596, 1.398, .801, 2.2, .861, 2.132, .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, .107, .512, .134, .602, .199, .771, .267, .926, .324, 1.02, .367, 1.037, .45, 1.214, .528, 1.379, .763, 2.128, .871, 2.322, .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, .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, .112, .51, .16, .648, .237, .854, .33, 1.088, .397, 1.184, .454, 1.182, .594, 1.422, .833, 2.349, .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, .112, .535, .178, .698, .264, .931, .367, 1.195, .452, 1.301, .514, 1.306, .812, 2.267, .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, .114, .556, .187, .729, .285, .964, .395, 1.257, .475, 1.391, .586, 1.376, .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, .118, .543, .2, .751, .314, 1.039, .433, 1.381, .53, 1.518, .797, 2.251, .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, .123, .529, .229, .804, .357, 1.17, .507, 1.559, .671, 1.714, .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, .128, .586, .253, .879, .409, 1.323, .572, 1.733, .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, .131, .604, .257, .918, .417, 1.332, .593, 1.809, .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, .147, .544, .29, .964, .47, 1.44, .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, .154, .65, .313, 1.037, .504, 1.547, .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, .158, .645, .322, 1.069, .523, 1.608, .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, .165, .676, .348, 1.133, .574, 1.742, .962, 2.798, 1.319, 3.681, 1.667, 4.318, 2.092, 5.167, 2.526, 6.168, 3.03, 7.174, .178, .677, .371, 1.211, .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, .191, .751, .409, 1.313, .724, 2, 1.133, 3.173, 1.56, 4.245, 2.006, 5.021, 2.516, 6.092, 3.074, 7.279, .206, .777, .449, 1.393, .868, 2.505, 1.28, 3.592, 1.762, 4.737, 2.291, 5.699, 2.882, 6.891, .214, .803, .475, 1.47, .921, 2.639, 1.363, 3.758, 1.874, 5.012, 2.441, 6.031, 3.074, 7.254, .218, .774, .483, 1.485, .941, 2.715, 1.393, 3.833, 1.949, 5.129, 2.523, 6.197, 3.177, 7.536, .225, .835, .509, 1.551, .991, 2.843, 1.471, 4.045, 2.061, 5.359, 2.679, 6.473, 3.384, 7.857, .23, .839, .518, 1.589, 1.01, 2.918, 1.507, 4.124, 2.127, 5.496, 2.758, 6.672, 3.468, 8.518, .24, .878, .54, 1.639, 1.064, 3.035, 1.589, 4.358, 2.245, 5.776, 2.93, 6.995, .267, .95, .629, 1.88, 1.251, 3.491, 1.879, 5.02, 2.706, 6.873, 3.534, 8.253, .282, .957, .698, 1.936, 1.318, 3.674, 1.988, 5.194, 2.839, 7.162, .299, 1.002, .741, 2.022, 1.402, 3.817, 2.13, 5.525, 3.056, 7.647, .303, 1.003, .79, 2.229, 1.424, 3.894, 2.174, 5.621, 3.126, 7.774, .329, 1.072, .899, 2.57, 1.566, 4.291, 2.435, 6.232, 3.498, 8.589, .331, 1.098, .912, 2.637, 1.604, 4.36, 2.489, 6.375, 3.577, 8.772, .344, 1.113, .956, 2.769, 1.693, 4.535, 2.646, 6.725, .363, 1.168, 1.004, 2.885, 1.781, 4.756, 2.809, 7.077, .373, 1.216, 1.037, 2.961, 1.843, 4.9, 2.915, 7.321, .396, 1.259, 1.101, 3.11, 1.97, 5.128, 3.093, 7.713, .413, 1.308, 1.149, 3.202, 2.077, 5.374, 3.266, 8.1, .417, 1.315, 1.166, 3.231, 2.115, 5.437, 3.325, 8.21, .44, 1.389, 1.254, 3.49, 2.302, 5.883, 3.633, 8.908, .451, 1.402, 1.281, 3.538, 2.344, 5.997, .46, 1.425, 1.32, 3.655, 2.416, 6.188, .464, 1.443, 1.337, 3.656, 2.457, 6.268, .499, 1.533, 1.44, 3.931, 2.699, 6.816, .533, 1.628, 1.559, 4.244, 2.939, 7.324, .545, 1.656, 1.609, 4.348, 3.039, 7.52, .55, 1.661, 1.63, 4.4, 3.073, 7.62, .57, 1.706, 1.674, 4.467, 3.177, 7.809, .58, 1.74, 1.733, 4.607, 3.307, 8.116, .594, 1.781, 1.75, 4.65, 3.347, 8.175, .623, 1.869, 1.859, 4.911, 3.583, 8.732, .683, 1.907, 1.95, 5.08, .701, 1.943, 2.019, 5.262, .729, 2.001, 2.1, 5.418, .733, 1.999, 2.119, 5.443, .752, 2.051, 2.192, 5.611, .805, 2.292, 2.238, 5.716, .811, 2.303, 2.262, 5.781, .874, 2.536, 2.397, 6.108, .931, 2.702, 2.58, 6.542, .944, 2.726, 2.632, 6.658, .956, 2.744, 2.655, 6.719, .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]
|
|
4
|
+
step = [.07, .067, .07, .138, .074, .121, .069, .165, .069, .172, .068, .229, .07, .13, .071, .21, .068, .153, .069, .149, .071, .127, .068, .185, .062, .389, .067, .206, .067, .18, .068, .179, .067, .222, .083, .028, .069, .155, .068, .204, .067, .206, .066, .21, .07, .221, .072, .234, .075, .273, .067, .215, .072, .22, .075, .243, .081, .275, .09, .285, .067, .199, .074, .251, .081, .268, .09, .29, .109, .307, .118, .323, .079, .244, .087, .27, .106, .305, .116, .314, .129, .344, .146, .355, .072, .145, .072, .156, .068, .248, .074, .259, .079, .283, .102, .298, .113, .319, .127, .35, .145, .373, .158, .39, .173, .416, .119, .356, .137, .352, .158, .391, .174, .411, .194, .442, .22, .475, .07, .172, .066, .21, .072, .23, .079, .269, .1, .293, .113, .321, .13, .348, .153, .38, .17, .415, .191, .446, .217, .475, .236, .515, .261, .552, .143, .378, .161, .397, .18, .44, .211, .481, .236, .511, .257, .557, .286, .603, .313, .633, .111, .322, .154, .388, .203, .472, .228, .515, .252, .554, .281, .602, .31, .642, .342, .678, .378, .726, .186, .443, .243, .534, .273, .581, .302, .621, .342, .673, .372, .719, .4, .765, .428, 1.007, .073, .142, .069, .243, .079, .264, .105, .305, .123, .346, .15, .383, .173, .425, .207, .473, .235, .524, .261, .572, .294, .617, .333, .681, .368, .706, .406, .754, .436, .809, .527, .848, .571, .891, .247, .548, .318, .641, .358, .69, .393, .735, .427, .801, .517, .846, .568, .895, .611, .936, .653, 1, .069, .18, .072, .256, .084, .286, .113, .324, .135, .378, .167, .412, .203, .465, .235, .507, .269, .567, .3, .619, .343, .677, .379, .73, .418, .779, .508, .849, .559, .892, .608, .944, .653, .984, .713, 1.058, .775, 1.103, .322, .656, .361, .695, .485, .821, .54, .876, .594, .94, .638, 1.001, .696, 1.043, .763, 1.108, .812, 1.355, .884, 1.204, .226, .505, .299, .614, .384, .734, .529, .854, .581, .901, .629, .964, .685, 1.031, .758, 1.096, .815, 1.169, .885, 1.2, .947, 1.266, 1.021, 1.318, .41, .776, .494, .83, .558, .894, .615, .959, .666, 1.02, .735, 1.074, .804, 1.143, .872, 1.205, .947, 1.257, 1.009, 1.317, 1.089, 1.386, 1.154, 1.712, .068, .206, .075, .259, .107, .31, .132, .362, .168, .412, .21, .476, .249, .539, .288, .604, .337, .673, .383, .732, .432, .818, .533, .868, .592, .928, .647, .991, .722, 1.064, .78, 1.127, .858, 1.206, .934, 1.246, 1.005, 1.315, 1.079, 1.382, 1.161, 1.458, 1.242, 1.508, 1.355, 1.593, .621, .963, .827, 1.174, .919, 1.228, .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, .181, .441, .275, .577, .425, .794, .531, .879, .659, .994, .733, 1.072, .807, 1.161, .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, .697, 1.04, .774, 1.123, .854, 1.185, .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, .41, .772, .591, .929, .737, 1.079, .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, .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, .068, .216, .084, .29, .126, .352, .17, .416, .222, .497, .272, .58, .333, .661, .388, .731, .491, .823, .569, .898, .639, .986, .726, 1.088, .815, 1.146, .914, 1.232, .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, .07, .206, .089, .298, .134, .354, .179, .445, .238, .521, .294, .602, .359, .686, .419, .782, .543, .866, .62, .966, .711, 1.044, .796, 1.122, .908, 1.221, .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, .777, 1.115, .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, .415, .778, .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, .073, .228, .11, .321, .161, .403, .227, .501, .293, .603, .366, .729, .487, .808, .584, .913, .682, 1.032, .792, 1.142, .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, .072, .249, .119, .337, .178, .432, .251, .548, .336, .663, .417, .764, .563, .885, .662, 1.001, .793, 1.119, .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, .073, .255, .126, .346, .193, .446, .269, .571, .35, .693, .485, .81, .6, .943, .718, 1.043, .846, 1.164, .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, .075, .264, .134, .364, .215, .485, .294, .613, .391, .751, .551, .886, .67, 1.013, .804, 1.169, .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, .718, 1.068, 1.399, 1.605, 1.81, 1.888, 2.039, 2.063, .079, .286, .153, .391, .242, .528, .347, .687, .51, .835, .639, .978, .796, 1.131, .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, .085, .29, .172, .417, .279, .589, .393, .747, .584, .92, .75, 1.084, .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, .087, .298, .175, .429, .285, .598, .41, .777, .61, .949, .779, 1.125, .97, 1.293, 1.172, 1.471, 1.438, 1.628, 1.683, 1.812, 1.956, 2.003, 2.259, 2.173, .1, .264, .198, .473, .324, .634, .51, .831, .681, 1.005, .901, 1.208, 1.116, 1.404, 1.371, 1.616, 1.652, 2.134, 1.953, 1.967, 2.294, 2.168, .105, .315, .215, .486, .345, .672, .557, .89, .754, 1.079, .969, 1.27, 1.201, 1.778, 1.506, 1.699, 1.812, 1.884, 2.151, 2.084, .108, .319, .221, .49, .357, .696, .573, .912, .78, 1.115, 1.008, 1.31, 1.26, 1.53, 1.57, 1.741, 1.9, 1.934, 2.252, 2.149, .113, .338, .239, .534, .396, .743, .632, .978, .872, 1.2, 1.133, 1.421, 1.457, 1.637, 1.775, 1.858, 2.156, 2.087, .118, .343, .252, .549, .42, .784, .673, 1.015, .935, 1.257, 1.213, 1.485, 1.568, 1.74, 1.922, 1.966, 2.321, 2.81, .128, .358, .279, .594, .513, .826, .75, 1.082, 1.03, 1.342, 1.371, 1.582, 1.746, 1.838, 2.158, 2.099, .14, .393, .309, .62, .575, .897, .847, 1.172, 1.166, 1.472, 1.566, 1.713, 2.009, 1.999, .145, .384, .329, .648, .608, .917, .905, 1.231, 1.244, 1.495, 1.666, 1.796, 2.138, 2.105, .148, .378, .333, .657, .623, .941, .924, 1.248, 1.298, 1.543, 1.726, 1.825, 2.211, 2.131, .152, .398, .349, .679, .652, .982, .977, 1.287, 1.374, 1.593, 1.832, 1.888, 2.358, 2.174, .155, .401, .356, .685, .664, .991, .998, 1.311, 1.423, 1.636, 1.888, 1.92, 2.418, 2.556, .164, .408, .372, .715, .704, 1.033, 1.05, 1.365, 1.503, 1.676, 2.017, 1.99, .18, .448, .431, .791, .827, 1.161, 1.25, 1.513, 1.804, 1.89, 2.425, 2.252, .194, .453, .495, .818, .874, 1.182, 1.327, 1.573, 1.894, 1.93, .207, .473, .53, .847, .93, 1.244, 1.428, 1.625, 2.045, 2.009, .21, .477, .542, .858, .946, 1.24, 1.457, 1.642, 2.087, 2.062, .228, .506, .595, .926, 1.033, 1.33, 1.622, 1.77, 2.336, 2.189, .229, .511, .603, .924, 1.061, 1.34, 1.659, 1.781, 2.392, 2.21, .238, .526, .632, .967, 1.122, 1.392, 1.764, 1.858, .248, .55, .663, .998, 1.182, 1.45, 1.876, 1.928, .254, .56, .685, 1.012, 1.224, 1.475, 1.947, 1.965, .273, .569, .732, 1.045, 1.318, 1.524, 2.071, 2.023, .284, .585, .767, 1.083, 1.392, 1.585, 2.184, 2.086, .287, .593, .777, 1.091, 1.42, 1.59, 2.222, 2.128, .302, .611, .829, 1.151, 1.54, 1.668, 2.428, 2.239, .311, .623, .85, 1.144, 1.566, 1.7, .32, .627, .877, 1.176, 1.612, 1.728, .322, .637, .887, 1.184, 1.639, 1.763, .343, .677, .956, 1.273, 1.804, 1.845, .364, .712, 1.03, 1.315, 1.963, 1.934, .376, .716, 1.064, 1.344, 2.036, 1.972, .381, .719, 1.079, 1.366, 2.053, 1.995, .395, .732, 1.112, 1.379, 2.128, 2.009, .403, .749, 1.154, 1.412, 2.215, 2.077, .41, .757, 1.165, 1.419, 2.241, 2.094, .427, .791, 1.238, 1.472, 2.401, 2.187, .483, .805, 1.307, 1.499, .497, .812, 1.351, 1.549, .518, .836, 1.411, 1.558, .521, .838, 1.421, 1.585, .537, .854, 1.47, 1.618, .55, .87, 1.5, 1.637, .554, .874, 1.517, 1.665, .581, .896, 1.6, 1.714, .617, .94, 1.721, 1.797, .626, .953, 1.756, 1.84, .634, .966, 1.772, 1.824, .638, .983, 1.813, 1.834, .678, 1.008, 1.94, 1.926, .7, 1.024, 2.01, 1.945, .732, 1.052, 2.103, 2.003, .74, 1.056, 2.121, 2.04, .756, 1.087, 2.156, 2.05, .769, 1.086, 2.217, 2.09, .786, 1.124, 2.298, 2.131, .808, 1.133, 2.36, 2.153, .822, 1.147, 2.424, 2.2, .834, 1.153, 2.448, 2.689, .859, 1.166, .886, 1.209, .907, 1.21, .932, 1.236, .951, 1.253, .959, 1.258, .986, 1.286, .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]
|
|
5
|
+
initial_n = [.072, .086, .072, .183, .069, .278, .073, .151, .069, .246, .07, .202, .069, .203, .07, .233, .068, .222, .071, .185, .069, .237, .074, .142, .068, .237, .069, .257, .07, .224, .074, .188, .069, .258, .072, .255, .062, .602, .075, .192, .07, .226, .071, .207, .073, .25, .072, .298, .076, .328, .069, .271, .076, .266, .075, .31, .08, .331, .089, .344, .069, .24, .078, .308, .081, .333, .089, .348, .109, .377, .117, .405, .078, .31, .087, .32, .106, .376, .115, .391, .128, .437, .145, .45, .07, .278, .068, .236, .068, .326, .073, .308, .079, .334, .101, .365, .112, .395, .126, .429, .144, .469, .157, .494, .172, .529, .121, .39, .136, .443, .158, .486, .173, .526, .193, .574, .218, .621, .071, .212, .067, .245, .073, .289, .079, .322, .099, .359, .112, .395, .128, .442, .152, .476, .17, .504, .19, .57, .215, .619, .234, .663, .26, .719, .142, .472, .16, .497, .178, .561, .209, .615, .235, .663, .256, .724, .284, .785, .311, .839, .11, .399, .153, .49, .202, .6, .227, .655, .251, .713, .279, .792, .309, .835, .339, .899, .376, .96, .184, .569, .241, .693, .272, .752, .3, .818, .34, .89, .369, .956, .397, 1.014, .425, 1.292, .074, .205, .069, .275, .078, .322, .104, .379, .122, .431, .149, .478, .172, .54, .205, .602, .233, .668, .26, .737, .293, .793, .332, .877, .366, .946, .404, 1.018, .433, 1.086, .486, 1.158, .528, 1.241, .246, .705, .316, .85, .357, .915, .391, .988, .424, 1.071, .482, 1.157, .524, 1.244, .57, 1.313, .616, 1.403, .069, .22, .072, .283, .083, .342, .112, .403, .134, .46, .167, .521, .201, .594, .233, .667, .268, .742, .298, .814, .341, .898, .377, .973, .415, 1.057, .47, 1.155, .518, 1.22, .562, 1.307, .616, 1.359, .668, 1.482, .718, 1.557, .32, .854, .359, .931, .454, 1.108, .503, 1.196, .552, 1.276, .605, 1.369, .661, 1.474, .714, 1.558, .765, 1.824, .841, 1.764, .225, .651, .297, .803, .382, .985, .488, 1.17, .539, 1.256, .59, 1.371, .644, 1.432, .708, 1.53, .766, 1.651, .827, 1.748, .912, 1.846, .974, 1.951, .409, 1.026, .462, 1.124, .52, 1.231, .573, 1.32, .632, 1.424, .692, 1.523, .756, 1.616, .83, 1.735, .908, 1.852, .965, 1.952, 1.043, 2.057, 1.113, 2.402, .073, .214, .078, .27, .106, .375, .131, .453, .167, .524, .209, .609, .247, .718, .286, .788, .336, .887, .381, .969, .43, 1.073, .494, 1.191, .549, 1.287, .614, 1.385, .675, 1.482, .734, 1.587, .801, 1.702, .894, 1.845, .961, 1.933, 1.035, 2.05, 1.115, 2.143, 1.2, 2.285, 1.301, 2.422, .583, 1.346, .784, 1.657, .872, 1.793, .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, .179, .575, .273, .756, .423, 1.067, .491, 1.179, .62, 1.379, .688, 1.518, .754, 1.629, .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, .659, 1.458, .726, 1.57, .813, 1.703, .898, 1.834, .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, .407, 1.056, .547, 1.27, .688, 1.509, .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, .818, 1.726, .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, .066, .286, .083, .344, .125, .434, .169, .527, .22, .644, .271, .753, .33, .873, .385, .995, .456, 1.124, .529, 1.24, .6, 1.37, .682, 1.499, .765, 1.634, .871, 1.798, .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, .067, .275, .088, .354, .132, .448, .179, .563, .236, .683, .292, .8, .355, .921, .416, 1.057, .5, 1.189, .58, 1.331, .664, 1.471, .749, 1.613, .851, 1.773, .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, .721, 1.566, .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, .412, 1.047, .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, .071, .293, .109, .392, .159, .501, .225, .649, .29, .792, .363, .95, .453, 1.094, .541, 1.272, .64, 1.429, .745, 1.595, .864, 1.783, .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, .075, .294, .118, .418, .176, .559, .249, .712, .333, .875, .413, 1.042, .52, 1.227, .624, 1.424, .741, 1.603, .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, .074, .293, .125, .428, .192, .571, .268, .733, .347, .911, .451, 1.105, .554, 1.296, .672, 1.474, .792, 1.69, .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, .08, .275, .132, .457, .212, .619, .291, .802, .388, .998, .509, 1.195, .627, 1.408, .754, 1.623, .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, .664, 1.479, 1.341, 2.472, 1.75, 2.989, 1.983, 3.295, .079, .347, .151, .495, .24, .687, .344, .903, .466, 1.127, .597, 1.39, .744, 1.612, .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, .083, .358, .17, .529, .277, .759, .39, 1.007, .536, 1.249, .697, 1.532, .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, .086, .357, .173, .544, .282, .778, .407, 1.036, .562, 1.305, .729, 1.586, .922, 1.886, 1.133, 2.2, 1.38, 2.522, 1.63, 2.853, 1.89, 3.195, 2.201, 3.57, .099, .331, .197, .592, .323, .824, .467, 1.143, .635, 1.432, .855, 1.748, 1.07, 2.073, 1.322, 2.442, 1.588, 3.247, 1.895, 3.182, 2.238, 3.591, .105, .381, .213, .623, .342, .903, .512, 1.207, .695, 1.542, .929, 1.884, 1.159, 2.494, 1.451, 2.627, 1.751, 2.993, 2.099, 3.424, .107, .389, .219, .636, .354, .922, .53, 1.241, .725, 1.579, .962, 1.945, 1.214, 2.313, 1.514, 2.69, 1.841, 3.111, 2.198, 3.543, .112, .414, .237, .682, .392, 1.001, .589, 1.35, .811, 1.726, 1.086, 2.121, 1.393, 2.554, 1.718, 2.967, 2.096, 3.425, .117, .427, .25, .712, .418, 1.039, .632, 1.428, .881, 1.824, 1.169, 2.243, 1.506, 2.678, 1.863, 3.14, 2.266, 4.232, .127, .443, .277, .76, .467, 1.134, .699, 1.532, .982, 1.971, 1.316, 2.441, 1.681, 2.911, 2.102, 3.433, .139, .467, .306, .821, .526, 1.23, .793, 1.702, 1.121, 2.172, 1.509, 2.699, 1.943, 3.254, .144, .478, .327, .848, .554, 1.288, .853, 1.768, 1.193, 2.279, 1.615, 2.82, 2.083, 3.4, .146, .487, .331, .87, .573, 1.321, .874, 1.812, 1.232, 2.328, 1.665, 2.898, 2.154, 3.495, .151, .506, .347, .902, .605, 1.361, .926, 1.884, 1.317, 2.432, 1.77, 3.036, 2.295, 3.671, .154, .5, .353, .925, .619, 1.394, .95, 1.926, 1.362, 2.515, 1.825, 3.103, 2.355, 3.935, .163, .517, .369, .959, .658, 1.456, 1.006, 1.991, 1.449, 2.597, 1.942, 3.238, .178, .563, .428, 1.062, .773, 1.639, 1.204, 2.28, 1.739, 2.979, 2.359, 3.732, .191, .582, .454, 1.104, .812, 1.697, 1.264, 2.378, 1.827, 3.11, .205, .607, .486, 1.155, .874, 1.798, 1.37, 2.507, 1.985, 3.291, .208, .615, .494, 1.172, .897, 1.808, 1.399, 2.557, 2.022, 3.343, .226, .651, .542, 1.281, .991, 1.966, 1.564, 2.777, 2.282, 3.659, .228, .659, .552, 1.285, 1.016, 1.996, 1.599, 2.817, 2.324, 3.711, .236, .68, .584, 1.343, 1.075, 2.087, 1.702, 2.944, .246, .703, .615, 1.38, 1.141, 2.18, 1.81, 3.09, .253, .715, .636, 1.426, 1.183, 2.243, 1.881, 3.181, .27, .747, .671, 1.485, 1.253, 2.337, 2.005, 3.333, .282, .776, .703, 1.533, 1.342, 2.433, 2.123, 3.449, .285, .778, .714, 1.55, 1.358, 2.476, 2.159, 3.519, .299, .808, .771, 1.656, 1.481, 2.632, 2.362, 3.762, .309, .823, .785, 1.664, 1.503, 2.673, .317, .836, .817, 1.7, 1.549, 2.727, .318, .862, .828, 1.721, 1.582, 2.771, .34, .895, .911, 1.829, 1.735, 2.969, .36, .959, .987, 1.953, 1.9, 3.171, .373, .96, 1.016, 2.01, 1.964, 3.226, .378, .964, 1.03, 2.013, 1.989, 3.262, .391, .999, 1.058, 2.072, 2.051, 3.366, .4, 1.01, 1.106, 2.133, 2.145, 3.482, .407, 1.029, 1.117, 2.145, 2.167, 3.5, .425, 1.05, 1.188, 2.252, 2.321, 3.672, .453, 1.096, 1.234, 2.308, .462, 1.102, 1.278, 2.376, .481, 1.151, 1.338, 2.456, .483, 1.16, 1.356, 2.47, .499, 1.18, 1.398, 2.543, .51, 1.199, 1.433, 2.586, .513, 1.206, 1.449, 2.6, .538, 1.247, 1.526, 2.719, .572, 1.308, 1.651, 2.856, .581, 1.349, 1.686, 2.89, .59, 1.337, 1.701, 2.914, .598, 1.364, 1.734, 2.97, .634, 1.418, 1.863, 3.132, .657, 1.461, 1.929, 3.194, .681, 1.495, 2.023, 3.31, .688, 1.503, 2.039, 3.347, .697, 1.525, 2.082, 3.37, .712, 1.55, 2.14, 3.475, .735, 1.605, 2.219, 3.544, .755, 1.615, 2.28, 3.637, .771, 1.65, 2.342, 3.72, .781, 1.649, 2.369, 4.084, .801, 1.698, .828, 1.727, .846, 1.749, .87, 1.781, .895, 1.824, .903, 1.833, .93, 1.883, .942, 1.89, .957, 1.932, .972, 1.933, .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]
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import math
|
|
2
|
+
import random
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel
|
|
6
|
+
|
|
7
|
+
from novelai_python.sdk.ai._const import map, initialN, initial_n, step, newN
|
|
8
|
+
from novelai_python.sdk.ai._enum import Sampler, Model, ModelGroups, get_model_group
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Args(BaseModel):
|
|
12
|
+
height: int
|
|
13
|
+
width: int
|
|
14
|
+
image: Optional[str]
|
|
15
|
+
n_samples: int
|
|
16
|
+
strength: float
|
|
17
|
+
steps: int
|
|
18
|
+
sm: bool
|
|
19
|
+
sm_dyn: bool
|
|
20
|
+
sampler: Optional[Sampler] = None
|
|
21
|
+
tool: Optional[str] = None
|
|
22
|
+
defry: int = 0
|
|
23
|
+
extra: str = ""
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def generate_random_seed() -> int:
|
|
27
|
+
return random.randint(0, 2 ** 32 - 1)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class CostCalculator:
|
|
31
|
+
|
|
32
|
+
@staticmethod
|
|
33
|
+
def calculate(
|
|
34
|
+
width: int,
|
|
35
|
+
height: int,
|
|
36
|
+
steps: int,
|
|
37
|
+
image: str,
|
|
38
|
+
n_samples: int,
|
|
39
|
+
account_tier: int,
|
|
40
|
+
strength: float,
|
|
41
|
+
|
|
42
|
+
is_sm_enabled: bool,
|
|
43
|
+
is_sm_dynamic: bool,
|
|
44
|
+
is_account_active: bool,
|
|
45
|
+
sampler: Optional[Sampler],
|
|
46
|
+
model: Optional[Model],
|
|
47
|
+
tool: str = None,
|
|
48
|
+
is_tool_active: bool = False) -> int:
|
|
49
|
+
return CostCalculator.calculate_cost(
|
|
50
|
+
Args(
|
|
51
|
+
height=height,
|
|
52
|
+
width=width,
|
|
53
|
+
image=image,
|
|
54
|
+
n_samples=n_samples,
|
|
55
|
+
strength=strength,
|
|
56
|
+
steps=steps,
|
|
57
|
+
sm=is_sm_enabled,
|
|
58
|
+
sm_dyn=is_sm_dynamic,
|
|
59
|
+
sampler=sampler,
|
|
60
|
+
tool=tool
|
|
61
|
+
),
|
|
62
|
+
model_group=get_model_group(model.value) if model else None,
|
|
63
|
+
is_account_active=is_account_active,
|
|
64
|
+
account_tier=account_tier,
|
|
65
|
+
is_tool_active=is_tool_active
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
@staticmethod
|
|
69
|
+
def calculate_cost(
|
|
70
|
+
params: Args,
|
|
71
|
+
*,
|
|
72
|
+
is_account_active: bool,
|
|
73
|
+
account_tier: int,
|
|
74
|
+
model_group: ModelGroups = None,
|
|
75
|
+
is_tool_active: bool = False) -> int:
|
|
76
|
+
def calculate_steps_cost(width: int,
|
|
77
|
+
height: int,
|
|
78
|
+
steps: int) -> float:
|
|
79
|
+
multiplier = width * height
|
|
80
|
+
return (15.266497014243718 * math.exp(
|
|
81
|
+
multiplier / 1048576 * 0.6326248927474729) - 15.225164493059737) / 28 * steps
|
|
82
|
+
|
|
83
|
+
def calculate_dimension_cost(width: int,
|
|
84
|
+
height: int,
|
|
85
|
+
steps: int,
|
|
86
|
+
is_sm_enabled: bool,
|
|
87
|
+
is_sm_dynamic: bool) -> int:
|
|
88
|
+
multiplier = width * height
|
|
89
|
+
factor = 1.4 if is_sm_dynamic else 1.2 if is_sm_enabled else 1
|
|
90
|
+
return math.ceil(2951823174884865e-21 * multiplier + 5.753298233447344e-7 * multiplier * steps) * factor
|
|
91
|
+
|
|
92
|
+
def calculate_sampling_cost(width: int,
|
|
93
|
+
height: int,
|
|
94
|
+
steps: int,
|
|
95
|
+
sampler_type: Optional[Sampler],
|
|
96
|
+
is_sm_enabled: bool,
|
|
97
|
+
is_sm_dynamic: bool) -> int:
|
|
98
|
+
sampling_factor: List[int]
|
|
99
|
+
if sampler_type == Sampler.K_EULER_ANCESTRAL:
|
|
100
|
+
sampling_factor = step
|
|
101
|
+
elif sampler_type == Sampler.NAI_SMEA:
|
|
102
|
+
sampling_factor = newN
|
|
103
|
+
elif sampler_type == Sampler.NAI_SMEA_DYN:
|
|
104
|
+
sampling_factor = initialN
|
|
105
|
+
elif sampler_type == Sampler.DDIM:
|
|
106
|
+
sampling_factor = initial_n
|
|
107
|
+
else:
|
|
108
|
+
sampling_factor = step
|
|
109
|
+
|
|
110
|
+
if is_sm_dynamic:
|
|
111
|
+
sampling_factor = initialN
|
|
112
|
+
elif is_sm_enabled:
|
|
113
|
+
sampling_factor = newN
|
|
114
|
+
|
|
115
|
+
def prepare_array() -> List[int]:
|
|
116
|
+
result_array: List[int] = []
|
|
117
|
+
map_iterator = enumerate(map)
|
|
118
|
+
try:
|
|
119
|
+
for key, value in map_iterator:
|
|
120
|
+
# 确保 result_array 的大小足够大
|
|
121
|
+
while len(result_array) <= value:
|
|
122
|
+
result_array.append(0)
|
|
123
|
+
result_array[value] = 2 * key
|
|
124
|
+
except Exception as error:
|
|
125
|
+
# 处理错误(如果有必要)
|
|
126
|
+
raise error
|
|
127
|
+
return result_array
|
|
128
|
+
|
|
129
|
+
index = prepare_array()[math.floor(width / 64) * math.floor(height / 64)]
|
|
130
|
+
return (sampling_factor[index] if index < len(sampling_factor) else 0) * steps + (
|
|
131
|
+
sampling_factor[index + 1] if index + 1 < len(sampling_factor) else 0)
|
|
132
|
+
|
|
133
|
+
img_height = params.height
|
|
134
|
+
img_width = params.width
|
|
135
|
+
dimension = img_width * img_height
|
|
136
|
+
if dimension < 65536:
|
|
137
|
+
dimension = 65536
|
|
138
|
+
|
|
139
|
+
base_dimension = 1048576
|
|
140
|
+
strength_multiplier = params.strength if params.image else 1
|
|
141
|
+
steps = params.steps
|
|
142
|
+
samples = params.n_samples
|
|
143
|
+
|
|
144
|
+
if steps <= 28 and dimension <= base_dimension and account_tier >= 3 and is_account_active and not is_tool_active:
|
|
145
|
+
samples -= 1
|
|
146
|
+
|
|
147
|
+
if model_group and model_group in [ModelGroups.STABLE_DIFFUSION_XL, ModelGroups.STABLE_DIFFUSION_XL_FURRY]:
|
|
148
|
+
cost = calculate_dimension_cost(img_width, img_height, steps, params.sm, params.sm_dyn)
|
|
149
|
+
elif dimension <= base_dimension and params.sampler in [
|
|
150
|
+
Sampler.PLMS, Sampler.DDIM,
|
|
151
|
+
Sampler.K_EULER, Sampler.K_EULER_ANCESTRAL,
|
|
152
|
+
Sampler.K_LMS
|
|
153
|
+
]:
|
|
154
|
+
cost = calculate_steps_cost(img_width, img_height, steps)
|
|
155
|
+
else:
|
|
156
|
+
cost = calculate_sampling_cost(img_width, img_height, steps, params.sampler, params.sm, params.sm_dyn)
|
|
157
|
+
|
|
158
|
+
final_cost = max(math.ceil(cost * strength_multiplier), 2)
|
|
159
|
+
if final_cost > 140:
|
|
160
|
+
return -3
|
|
161
|
+
|
|
162
|
+
return final_cost * samples
|
|
@@ -92,10 +92,8 @@ class Resolution(Enum):
|
|
|
92
92
|
class Model(Enum):
|
|
93
93
|
NAI_DIFFUSION_3 = "nai-diffusion-3"
|
|
94
94
|
NAI_DIFFUSION_3_INPAINTING = "nai-diffusion-3-inpainting"
|
|
95
|
-
|
|
96
95
|
NAI_DIFFUSION_FURRY_3 = "nai-diffusion-furry-3"
|
|
97
96
|
NAI_DIFFUSION_FURRY_3_INPAINTING = "nai-diffusion-furry-3-inpainting"
|
|
98
|
-
|
|
99
97
|
NAI_DIFFUSION = "nai-diffusion"
|
|
100
98
|
NAI_DIFFUSION_2 = "nai-diffusion-2"
|
|
101
99
|
NAI_DIFFUSION_INPAINTING = "nai-diffusion-inpainting"
|
|
@@ -104,10 +102,43 @@ class Model(Enum):
|
|
|
104
102
|
SAFE_DIFFUSION_INPAINTING = "safe-diffusion-inpainting"
|
|
105
103
|
|
|
106
104
|
NAI_DIFFUSION_FURRY = "nai-diffusion-furry"
|
|
107
|
-
|
|
105
|
+
|
|
108
106
|
FURRY_DIFFUSION_INPAINTING = "furry-diffusion-inpainting"
|
|
109
107
|
|
|
110
108
|
CUSTOM = "custom"
|
|
109
|
+
STABLE_DIFFUSION = "stable-diffusion"
|
|
110
|
+
WAIFU_DIFFUSION = "waifu-diffusion"
|
|
111
|
+
CURATED_DIFFUSION_TEST = "curated-diffusion-test"
|
|
112
|
+
NAI_DIFFUSION_XL = "nai-diffusion-xl"
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
class ModelGroups(Enum):
|
|
116
|
+
STABLE_DIFFUSION = "stable_diffusion"
|
|
117
|
+
STABLE_DIFFUSION_GROUP_2 = "stable_diffusion_group2"
|
|
118
|
+
STABLE_DIFFUSION_XL = "stable_diffusion_xl"
|
|
119
|
+
STABLE_DIFFUSION_XL_FURRY = "stable_diffusion_xl_furry"
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
def get_model_group(model: str) -> ModelGroups:
|
|
123
|
+
mapping = {
|
|
124
|
+
"stable-diffusion": ModelGroups.STABLE_DIFFUSION,
|
|
125
|
+
"nai-diffusion": ModelGroups.STABLE_DIFFUSION,
|
|
126
|
+
"safe-diffusion": ModelGroups.STABLE_DIFFUSION,
|
|
127
|
+
"waifu-diffusion": ModelGroups.STABLE_DIFFUSION,
|
|
128
|
+
"nai-diffusion-furry": ModelGroups.STABLE_DIFFUSION,
|
|
129
|
+
"curated-diffusion-test": ModelGroups.STABLE_DIFFUSION,
|
|
130
|
+
"nai-diffusion-inpainting": ModelGroups.STABLE_DIFFUSION,
|
|
131
|
+
"safe-diffusion-inpainting": ModelGroups.STABLE_DIFFUSION,
|
|
132
|
+
"furry-diffusion-inpainting": ModelGroups.STABLE_DIFFUSION,
|
|
133
|
+
"nai-diffusion-2": ModelGroups.STABLE_DIFFUSION_GROUP_2,
|
|
134
|
+
"nai-diffusion-xl": ModelGroups.STABLE_DIFFUSION_XL,
|
|
135
|
+
"nai-diffusion-3": ModelGroups.STABLE_DIFFUSION_XL,
|
|
136
|
+
"nai-diffusion-3-inpainting": ModelGroups.STABLE_DIFFUSION_XL,
|
|
137
|
+
"custom": ModelGroups.STABLE_DIFFUSION_XL,
|
|
138
|
+
"nai-diffusion-furry-3": ModelGroups.STABLE_DIFFUSION_XL_FURRY,
|
|
139
|
+
"nai-diffusion-furry-3-inpainting": ModelGroups.STABLE_DIFFUSION_XL_FURRY,
|
|
140
|
+
}
|
|
141
|
+
return mapping.get(model, ModelGroups.STABLE_DIFFUSION)
|
|
111
142
|
|
|
112
143
|
|
|
113
144
|
INPAINTING_MODEL_LIST = [
|