Skip to content

Commit 024163c

Browse files
authored
Merge pull request #117 from LlmKira/dev
feat: Aligning logic
2 parents 46edbe9 + 751fbba commit 024163c

File tree

8 files changed

+823
-454
lines changed

8 files changed

+823
-454
lines changed

playground/generate_image.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ async def generate(
8484
# Recommended, using preset negative_prompt depends on selected model
8585
qualityToggle=True,
8686
decrisp_mode=False,
87-
variety_boost=True,
87+
variety_boost=False,
8888
# Checkbox in novelai.net
8989
).set_mutual_exclusion(True)
9090
print(f"charge: {agent.calculate_cost(is_opus=True)} if you are vip3")
@@ -118,8 +118,7 @@ async def direct_use():
118118
height=1216,
119119
characterPrompts=[],
120120
seed=random.randint(0, 4294967295 - 7),
121-
scale=5,
122-
negative_prompt="lowres",
121+
scale=6,
123122
qualityToggle=True,
124123
sampler=Sampler.K_EULER_ANCESTRAL,
125124
ucPreset=UCPreset.TYPE0,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "novelai-python"
3-
version = "0.7.8"
3+
version = "0.7.9"
44
description = "NovelAI Python Binding With Pydantic"
55
authors = [
66
{ name = "sudoskys", email = "[email protected]" },
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"credentials": "include",
3+
"headers": {
4+
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:138.0) Gecko/20100101 Firefox/138.0",
5+
"Accept": "*/*",
6+
"Accept-Language": "zh-CN,en-US;q=0.7,en;q=0.3",
7+
"Content-Type": "application/json",
8+
"Authorization": "Secret",
9+
"x-correlation-id": "ABCD",
10+
"x-initiated-at": "2025-05-01T00:00:00.000Z",
11+
"Sec-GPC": "1",
12+
"Sec-Fetch-Dest": "empty",
13+
"Sec-Fetch-Mode": "cors",
14+
"Sec-Fetch-Site": "same-site",
15+
"Priority": "u=0",
16+
"Pragma": "no-cache",
17+
"Cache-Control": "no-cache"
18+
},
19+
"referrer": "https://novelai.net/",
20+
"body": "{\"input\":\"1boy, 1girl, very aesthetic, location, masterpiece, no text, -0.8::feet::, rating:general\",\"model\":\"nai-diffusion-4-5-curated\",\"action\":\"generate\",\"parameters\":{\"params_version\":3,\"width\":832,\"height\":1216,\"scale\":4.5,\"sampler\":\"k_euler_ancestral\",\"steps\":23,\"n_samples\":1,\"ucPreset\":0,\"qualityToggle\":true,\"autoSmea\":false,\"dynamic_thresholding\":false,\"controlnet_strength\":1,\"legacy\":false,\"add_original_image\":true,\"cfg_rescale\":0,\"noise_schedule\":\"karras\",\"legacy_v3_extend\":false,\"skip_cfg_above_sigma\":null,\"use_coords\":false,\"legacy_uc\":false,\"normalize_reference_strength_multiple\":true,\"seed\":1688743194,\"characterPrompts\":[{\"prompt\":\"girl, tan, pink eyes, medium hair, braided ponytail, light blue hair, spiked hair, small breasts, mole under eye, hooded cloak, spread fingers, bodypaint\",\"uc\":\"lowres, aliasing, \",\"center\":{\"x\":0,\"y\":0},\"enabled\":true},{\"prompt\":\"boy, very dark skin, medium hair, asymmetrical hair, hair flaps, mole under eye, tuxedo, licking lips, prosthetic arm\",\"uc\":\"lowres, aliasing, \",\"center\":{\"x\":0,\"y\":0},\"enabled\":true}],\"v4_prompt\":{\"caption\":{\"base_caption\":\"1boy, 1girl, silver background, cowboy shot, love letter, very aesthetic, location, masterpiece, no text, -0.8::feet::, rating:general\",\"char_captions\":[{\"char_caption\":\"girl, tan, pink eyes, medium hair, braided ponytail, light blue hair, spiked hair, small breasts, mole under eye, hooded cloak, spread fingers, bodypaint\",\"centers\":[{\"x\":0,\"y\":0}]},{\"char_caption\":\"boy, very dark skin, medium hair, asymmetrical hair, hair flaps, mole under eye, tuxedo, licking lips, prosthetic arm\",\"centers\":[{\"x\":0,\"y\":0}]}]},\"use_coords\":false,\"use_order\":true},\"v4_negative_prompt\":{\"caption\":{\"base_caption\":\"blurry, lowres, upscaled, artistic error, film grain, scan artifacts, worst quality, bad quality, jpeg artifacts, very displeasing, chromatic aberration, halftone, multiple views, logo, too many watermarks, negative space, blank page\",\"char_captions\":[{\"char_caption\":\"lowres, aliasing, \",\"centers\":[{\"x\":0,\"y\":0}]},{\"char_caption\":\"lowres, aliasing, \",\"centers\":[{\"x\":0,\"y\":0}]}]},\"legacy_uc\":false},\"negative_prompt\":\"blurry, lowres, upscaled, artistic error, film grain, scan artifacts, worst quality, bad quality, jpeg artifacts, very displeasing, chromatic aberration, halftone, multiple views, logo, too many watermarks, negative space, blank page\",\"deliberate_euler_ancestral_bug\":false,\"prefer_brownian\":true}}",
21+
"method": "POST",
22+
"mode": "cors"
23+
}
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
{
2+
"input": "1boy, 1girl, silver background, cowboy shot, love letter, very aesthetic, location, masterpiece, no text, -0.8::feet::, rating:general",
3+
"model": "nai-diffusion-4-5-curated",
4+
"action": "generate",
5+
"parameters": {
6+
"params_version": 3,
7+
"width": 832,
8+
"height": 1216,
9+
"scale": 4.5,
10+
"sampler": "k_euler_ancestral",
11+
"steps": 23,
12+
"n_samples": 1,
13+
"ucPreset": 0,
14+
"qualityToggle": true,
15+
"autoSmea": false,
16+
"dynamic_thresholding": false,
17+
"controlnet_strength": 1,
18+
"legacy": false,
19+
"add_original_image": true,
20+
"cfg_rescale": 0,
21+
"noise_schedule": "karras",
22+
"legacy_v3_extend": false,
23+
"skip_cfg_above_sigma": null,
24+
"use_coords": false,
25+
"legacy_uc": false,
26+
"normalize_reference_strength_multiple": true,
27+
"seed": 168874300,
28+
"characterPrompts": [
29+
{
30+
"prompt": "girl, tan, pink eyes, medium hair, braided ponytail, light blue hair, spiked hair, small breasts, mole under eye, hooded cloak, spread fingers, bodypaint",
31+
"uc": "lowres, aliasing, ",
32+
"center": {
33+
"x": 0,
34+
"y": 0
35+
},
36+
"enabled": true
37+
},
38+
{
39+
"prompt": "boy, very dark skin, medium hair, asymmetrical hair, hair flaps, mole under eye, tuxedo, licking lips, prosthetic arm",
40+
"uc": "lowres, aliasing, ",
41+
"center": {
42+
"x": 0,
43+
"y": 0
44+
},
45+
"enabled": true
46+
}
47+
],
48+
"v4_prompt": {
49+
"caption": {
50+
"base_caption": "1boy, 1girl, silver background, cowboy shot, love letter, very aesthetic, location, masterpiece, no text, -0.8::feet::, rating:general",
51+
"char_captions": [
52+
{
53+
"char_caption": "girl, tan, pink eyes, medium hair, braided ponytail, light blue hair, spiked hair, small breasts, mole under eye, hooded cloak, spread fingers, bodypaint",
54+
"centers": [
55+
{
56+
"x": 0,
57+
"y": 0
58+
}
59+
]
60+
},
61+
{
62+
"char_caption": "boy, very dark skin, medium hair, asymmetrical hair, hair flaps, mole under eye, tuxedo, licking lips, prosthetic arm",
63+
"centers": [
64+
{
65+
"x": 0,
66+
"y": 0
67+
}
68+
]
69+
}
70+
]
71+
},
72+
"use_coords": false,
73+
"use_order": true
74+
},
75+
"v4_negative_prompt": {
76+
"caption": {
77+
"base_caption": "blurry, lowres, upscaled, artistic error, film grain, scan artifacts, worst quality, bad quality, jpeg artifacts, very displeasing, chromatic aberration, halftone, multiple views, logo, too many watermarks, negative space, blank page",
78+
"char_captions": [
79+
{
80+
"char_caption": "lowres, aliasing, ",
81+
"centers": [
82+
{
83+
"x": 0,
84+
"y": 0
85+
}
86+
]
87+
},
88+
{
89+
"char_caption": "lowres, aliasing, ",
90+
"centers": [
91+
{
92+
"x": 0,
93+
"y": 0
94+
}
95+
]
96+
}
97+
]
98+
},
99+
"legacy_uc": false
100+
},
101+
"negative_prompt": "blurry, lowres, upscaled, artistic error, film grain, scan artifacts, worst quality, bad quality, jpeg artifacts, very displeasing, chromatic aberration, halftone, multiple views, logo, too many watermarks, negative space, blank page",
102+
"deliberate_euler_ancestral_bug": false,
103+
"prefer_brownian": true
104+
}
105+
}

src/novelai_python/sdk/ai/_enum.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ def get_modifiers(model: Model) -> Modifier:
419419
]:
420420
return Modifier(
421421
qualityTags="",
422-
suffix=", location, masterpiece, no text, -0.8::feet::, rating:general"
422+
suffix=", very aesthetic, location, masterpiece, no text, -0.8::feet::, rating:general"
423423
)
424424
if model in [
425425
Model.NAI_DIFFUSION_4_FULL,

0 commit comments

Comments
 (0)