Skip to content

Commit

Permalink
🎨 chore(utils): Update random_prompt module
Browse files Browse the repository at this point in the history
The random_prompt module in the utils package of the novelai_python
repository has been updated. Changes include adding the possibility of
nsfw["footForeplay"] action, and adding tags "explicit" and "lewd" with
a random chance of 0.1 when nsfw_enabled is true. Additionally, tags
"penis", "analSex", "sex", "pussy", and "sexMod" have a random chance
of being added with certain probabilities.
  • Loading branch information
sudoskys committed Jan 27, 2024
1 parent 10b52ae commit f932d01
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/novelai_python/utils/random_prompt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ def character_features(self, gender, camera_angle, nsfw_enabled, num_characters)
possible_actions = action
if nsfw_enabled:
possible_actions += nsfw["action"] + nsfw["analForeplay"] + nsfw["pussyForeplay"]
if random.random() < 0.5:
possible_actions += nsfw["footForeplay"]
features.append(self.get_weighted_choice(possible_actions, features))
if any('sleeping' in feature for feature in features) \
or any('zzz' in feature for feature in features) \
Expand All @@ -160,6 +162,9 @@ def random_prompt(self):
tags = []
if self.nsfw_enabled:
tags.append('nsfw')
if random.random() < 0.1:
tags.append('explicit')
tags.append('lewd')
irs = self.get_weighted_choice([[1, 70], [2, 20], [3, 7], [0, 5]], tags)
if self.nsfw_enabled:
irs = self.get_weighted_choice([[1, 35], [2, 20], [3, 7]], tags)
Expand Down Expand Up @@ -216,11 +221,21 @@ def random_prompt(self):
g_count = c_count + u_count if c_count >= 2 and d_count == 0 and random.random() < 0.7 else 0
if g_count == 0 and d_count >= 2 and c_count == 0:
tags.append(nsfw["ya"])
if d_count > 0:
if random.random() < 0.4:
tags.append(self.get_weighted_choice(nsfw["penis"], tags))
if d_count > 0 and g_count > 0:
if random.random() < 0.5:
tags.append(self.get_weighted_choice(nsfw["analSex"], tags))
if g_count > 0:
if random.random() < 0.6:
features = self.character_features(nsfw['fu'], None, True, irs)
else:
features = self.character_features(nsfw['yu'], None, True, irs)
if random.random() < 0.2:
tags.append(self.get_weighted_choice(nsfw["sex"], tags))
if random.random() < 0.2:
tags.append(self.get_weighted_choice(nsfw["pussy"], tags))
if random.random() < 0.6:
tags.append(self.get_weighted_choice(nsfw["sexMod"], tags))
if random.random() < 0.6:
Expand Down

0 comments on commit f932d01

Please sign in to comment.