Skip to content

Commit 8216b65

Browse files
committed
Added NoobAI model support.
1 parent fc0a887 commit 8216b65

File tree

9 files changed

+30
-6
lines changed

9 files changed

+30
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### 2024-11-04
2+
3+
* Added support for [NoobAI v1.0](https://civitai.com/models/833294/noobai-xl-nai-xl) model
4+
15
### 2024-10-29
26

37
**1.1.0** release

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ E621 + [EasyFluff](https://civitai.com/models/129996/easyfluff) samples:
3535
* One of recommended models (these are the "officially" supported models, but LPP should work well for other tag-based models as long as their "native" booru is used as tag source):
3636
* [Pony Diffusion V6 XL](https://civitai.com/models/257749?modelVersionId=290640);
3737
* [Pony Diffusion V5(.5)](https://civitai.com/models/95367/pony-diffusion-v5);
38+
* [NoobAI v1.0](https://civitai.com/models/833294/noobai-xl-nai-xl)
3839
* [EasyFluff](https://civitai.com/models/129996/easyfluff);
3940
* [SeaArt Furry XL V1](https://civitai.com/models/391781/seaart-furry-xl-10);
4041
* [AutismMix](https://civitai.com/models/288584);

lpp/data.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,16 @@ class Models(enum.Enum):
3737
EF = "EasyFluff"
3838
SEAART = "SeaArt Furry v1.0"
3939
ANIME = "Generic Anime"
40+
NOOBAI = "NoobAI XL v1.0"
4041

4142
def get_default_template(model: str) -> str:
4243
if model == Models.SEAART.value:
4344
return "{species}, {character}, {artist}, {general}, {meta}"
4445
if model == Models.ANIME.value:
4546
return "{character}, {general}, {artist}, {meta}"
46-
else:
47-
return "{rating}, {character}, {species}, {artist}, {general}, {meta}"
47+
if model == Models.NOOBAI.value:
48+
return "{character}, {meta}, {artist}, {species}, {general}"
49+
return "{rating}, {character}, {species}, {artist}, {general}, {meta}"
4850

4951

5052
class Ratings(enum.Enum):

lpp/sources/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ def __init__(self,
5454

5555
def _send_api_request(
5656
self, endpoint: str, query_params: dict[str:str],
57-
user_agent: str = "lazy-pony-prompter (by user Siberpone)/v1.1.1"
57+
user_agent: str = "lazy-pony-prompter (by user Siberpone)/v1.1.x"
5858
) -> dict[str:object]:
59-
TIMEOUTS = (6.1, 9.1)
59+
TIMEOUTS = (9.1, 15.1)
6060
req = requests.get(
6161
endpoint,
6262
query_params,

lpp/sources/danbooru.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,11 @@ def pdv5_format(self, raw_image_tags: dict[str:list[str]]) -> TagGroups:
109109
.filter(self.filter)\
110110
.replace_underscores(exclude=["rating"])\
111111
.as_tag_groups()
112+
113+
@formatter(Models.NOOBAI.value)
114+
def noobai_fomat(self, raw_image_tags: dict[str:list[str]]) -> TagGroups:
115+
return Tags(self._convert_raw_tags(raw_image_tags))\
116+
.select("character", "general", "artist", "meta")\
117+
.filter(self.filter)\
118+
.replace_underscores()\
119+
.as_tag_groups()

lpp/sources/e621.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,11 @@ def seaart_format(self, raw_image_tags: dict[str:list[str]]) -> TagGroups:
122122
.select("character", "species", "general", "artist", "meta")\
123123
.filter(self.filter)\
124124
.as_tag_groups()
125+
126+
@formatter(Models.NOOBAI.value)
127+
def noobai_fomat(self, raw_image_tags: dict[str:list[str]]) -> TagGroups:
128+
return Tags(self._convert_raw_tags(raw_image_tags))\
129+
.select("character", "species", "general", "artist", "meta")\
130+
.filter(self.filter)\
131+
.replace_underscores()\
132+
.as_tag_groups()

lpp/ui/a1111.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def try_choose_prompts(self,
200200
def try_export_json(self):
201201
try:
202202
payload = {
203-
"version": "1.1.1",
203+
"version": "1.1.x",
204204
"prompts": self.__cache_manager.export_data(),
205205
"filters": self.__filters_manager.export_data()
206206
}

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "lazy-pony-prompter"
33
description = "A booru API powered prompt generator for A1111 and ComfyUI with flexible tag filtering system and customizable prompt templates."
4-
version = "1.1.1"
4+
version = "1.1.2"
55
license = { file = "LICENSE" }
66
dependencies = ["tqdm", "requests"]
77

scripts/lpp_extension.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,7 @@ def process(self, p, enabled, prompts_format, allowed_ratings,
649649
"461c3bbd5c": Models.SEAART.value, # SeaArt Furry v1.0
650650
"821aa5537f": Models.PDV56.value, # AutismMix_pony
651651
"ac006fdd7e": Models.PDV56.value, # AutismMix_confetti
652+
"ff827fc345": Models.NOOBAI.value # NoobAI XL v1.0
652653
}
653654
if p.sd_model_hash not in model_hashes:
654655
prompts_format = Models.PDV56.value

0 commit comments

Comments
 (0)