baiango commited on
Commit
528532c
1 Parent(s): f59cabb

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +93 -90
README.md CHANGED
@@ -19,98 +19,101 @@ Examples:
19
  import random
20
  import functools
21
 
22
- # Time
23
- year_range = {"both": {"newest", "recent", "mid", "early", "oldest"}}
24
-
25
- # --- Subject
26
- # Head
27
- haircuts = {"both": {"bob", "pixie", "cut", "shaggy", "layers", "mullet", "afro", "fringe", "bangs", "quiff", "undercut", "braids", "knot", "ponytail", "curls", "blunt", "perm", "fade", "crop", "bowl", "curtain", "top", "balayage", "shag", "bang", "waves"},
28
- "male": {"mohawk", "dreadlocks"}}
29
- eye_colors = {"both": {"blue", "red", "yellow", "green", "orange", "red-orange", "yellow-orange", "yellow-green", "blue-green"} | {"gray", "amber", "hazel", "gold", "silver"},
30
- "female": {"pink", "purple", "red-purple", "blue-purple"}}
31
- eye_shapes = {"both": {"normal", "large", "moe", "realistic", "cat", "wolf", "dog", "bird", "no irises", "heterochromia", "glowing", "small", "starburst pupils", "googly", "tearful", "chibi"}, "female": {"shoujo"}}
32
- blush = {"female": {"blush"}}
33
- eyebrow_shapes = {"both": {"straight", "curved", "angular", "thick", "thin", "high arched", "low arched", "rounded", "uneven"}}
34
- lips_shapes = {"both": {"small", "wide", "round"}}
35
- nose_shapes = {"both": {"aquiline", "straight", "bulbous", "button", "hooked", "flat", "snub", "roman", "turned up", "pointy"}}
36
- earrings = {"both": {"earrings"}}
37
-
38
- # Outfit
39
- outfit_colors = {"both": {"orange and white", "pale lilac and medium lavender", "hunter green and medium brown", "red and green", "navy blue and mustard yellow", "dark green and tan", "navy and white", "burgundy and gray", "burgundy and light brown", "navy blue and tan", "golden yellow and medium blue", "red and mustard yellow", "yellow and white", "maroon and gray", "black and white", "seal brown and tan", "charcoal gray and white", "blue-green and coral", "sky blue and charcoal gray", "red and light blue", "medium blue and chocolate brown", "medium green and white", "red and taupe", "red and mint green", "slate blue and warm white", "beige and maroon", "yellow and blue", "blue and orange", "pastel blue and yellow-orange", "bright blue and soft gray", "red and gray", "red and cyan", "red and yellow", "cerulean and neon green", "neon green and neon yellow", "navy blue and red", "sherbet orange and cool gray", "olive green and yellow", "yellow and deep sky blue", "dark brown and light blue", "magenta and charcoal", "red and white", "yellow and forest green", "light blue and navy blue", "orange and yellow", "charcoal grey and light blue", "pale coral and tan", "mauve-gray and olive", "yellow-orange and burnt orange", "orange and brown", "navy and light blue", "red and orange", "green and yellow", "gray and black", "green and blue", "teal and navy blue", "magenta and yellow", "yellow and brown", "red and black", "orange and green", "clay red and cerulean", "bright red and army green", "black and gray", "orange and black", "sage green and tan", "blue and turquoise", "beige and brown", "red and earthy browns", "dark green and gray", "blue and cyan", "olive green and navy blue", "olive green and maroon", "yellow and warm gray", "green and earthy browns", "burgundy and light blue", "khaki and pastel yellow", "taupe and white", "sky blue and royal blue", "orange and gray", "olive green and beige", "beige and blue", "burnt orange and hunter green", "blue and red", "navy blue and khaki"},
40
- "female": {"blush pink and white", "pink and red", "pink and orange", "gray and light pink", "dark green and pink", "pink and warm black", "pink and blue", "medium pink and red", "rose pink and periwinkle", "yellow and pink", "purple and pink", "pink and turquoise", "pink and green", "navy blue and pink", "purple and charcoal gray", "turquoise and purple", "purple and yellow", "electric purple and black", "purple and orange", "green and purple", "red and purple"}}
41
- tops = {"female": {"t-shirts", "blouses", "tunics", "camisoles", "tank tops", "crewneck", "v-neck", "cardigan", "turtleneck", "pullovers", "henleys", "crop tops", "off-the-shoulder tops", "cold shoulder tops", "peplum tops"}}
42
- bottoms = {"both": {"shorts", "chinos", "cargo pants"},
43
- "female": {"skinny jeans", "straight jeans", "bootcut jeans", "flare jeans", "wide-leg jeans", "bermuda shorts", "hotpants", "A-line skirts", "pencil skirts", "maxi skirts", "midi skirts", "mini skirts", "dress pants", "linen pants", "capris"} | \
44
- {"stockings", "tights", "fishnets", "leggings", "yoga pants"}}
45
- one_piece = {"female": {"jumpsuits", "rompers", "swimsuits", "bodysuits"}}
46
-
47
- # Personality
48
- personality_traits = {"both": {"creative", "determined", "enthusiastic", "friendly", "generous", "humorous", "intelligent", "kind", "loyal", "motivated", "optimistic", "persistent", "resilient", "sincere", "thoughtful", "trustworthy", "versatile", "compassionate", "ambitious", "confident", "honest", "brave", "patient", "reliable", "adventurous", "charismatic", "gracious", "insightful", "perceptive", "resourceful", "selfless", "talented", "witty", "zealous"}}
49
-
50
- # Actions
51
- actions = {"both": {"walking", "running", "squatting", "crawling", "riding", "speaking", "dancing", "waving", "listening", "reading", "pulling", "carrying", "studying", "bending", "writing", "lifting", "sleeping", "lying down", "pushing", "drinking", "clapping", "playing", "typing", "reaching", "working", "climbing", "jumping", "swimming", "kneeling", "watching", "standing", "eating"}}
52
- # ---
53
-
54
- # Camera angles
55
- camera_angels = {"both": {"low-angle", "eye level", "high-angle", "hip level", "knee level", "ground level", "shoulder level", "dutch angle", "overhead", "aerial"}}
56
-
57
- # Places and eras
58
- places = {"both": {"school", "skyscrapers", "neon lights", "crowded streets", "medieval kingdoms", "magical forests", "post-apocalyptic wastelands", "spaceships", "colonies on other planets", "vinland saga", "haunted houses", "cursed islands", "mystical dimensions", "training grounds", "stadiums", "arenas"}}
59
- eras = {"both": {"meiji period", "edo period"}}
60
-
61
- # Styles
62
- resolution = {"both": {"sharp focus", "8k"}}
63
- lighting = {"both": {"rim lighting", "flat lighting", "cinematic lighting", "crepuscular rays"}}
64
-
65
- def main():
66
- def get_random_x(x, gender=["both"]):
67
- concat = sum([list(x.get(ge, [])) for ge in gender], [])
68
- return concat[random.randint(0, len(concat) - 1)] if len(concat) else ""
69
-
70
- rand50 = lambda: random.randint(1, 100) < 50
71
- rand85 = lambda: random.randint(1, 100) < 85
72
-
73
- gender = "1girl" if rand50() else "1boy"
74
- gender_selection = ["both"] + ["female" if gender == "1girl" else "male"]
75
- get_random_x_by_gender = functools.partial(get_random_x, gender=gender_selection)
76
-
77
- commands = (
78
- # You must put trailing comma to convert a parenthesized expression into a tuple
79
- (year_range,),
80
- (personality_traits if rand50() else None,),
81
- (actions,),
82
-
83
- (eye_colors, haircuts, "haircut",),
84
- (eye_colors, eye_shapes, "eyes",),
85
- (blush if rand50() else None,),
86
- # (eyebrow_shapes, "eyebrows",), # Diffusers are bad at drawing eyebrows
87
- # (lips_shapes, "lips",), # Diffusers are bad at drawing lips
88
- # (nose_shapes, "nose",), # Diffusers are bad at drawing nose
89
- (earrings if rand50() else None,),
90
-
91
- (outfit_colors, "outfit",),
92
- *(((one_piece,),) if rand50() else ((tops,), (bottoms,))),
93
-
94
- (camera_angels, "shot",),
95
- ((places,) if rand85() else (eras,)),
96
-
97
- # ("masterpiece",), ("best quality",), ("very aesthetic",), ("absurdres",), # Already prepended
98
- (resolution if rand50() else None,),
99
- (lighting if rand50() else None,),
100
- )
101
-
102
- output = [gender] + [
103
- " ".join(
104
- get_random_x_by_gender(elem) if isinstance(elem, dict) else elem
105
- for elem in cmd
106
- if elem is not None and isinstance(elem, (str, dict))
107
- ) for cmd in commands
108
- ]
109
-
110
- print(", ".join([s for s in output if s != ""]))
 
 
111
 
112
  if __name__ == "__main__":
113
- [main() for _ in range(1)]
 
114
  ```
115
 
116
 
 
19
  import random
20
  import functools
21
 
22
+ class REMSleepPrmAnime:
23
+ def __init__(self):
24
+ # Time
25
+ self.year_range = {"both": {"newest", "recent", "mid", "early", "oldest"}}
26
+
27
+ # --- Subject
28
+ # Head
29
+ self.haircuts = {"both": {"bob", "pixie", "cut", "shaggy", "layers", "mullet", "afro", "fringe", "bangs", "quiff", "undercut", "braids", "knot", "ponytail", "curls", "blunt", "perm", "fade", "crop", "bowl", "curtain", "top", "balayage", "shag", "bang", "waves"},
30
+ "male": {"mohawk", "dreadlocks"}}
31
+ self.eye_colors = {"both": {"blue", "red", "yellow", "green", "orange", "red-orange", "yellow-orange", "yellow-green", "blue-green"} | {"gray", "amber", "hazel", "gold", "silver"},
32
+ "female": {"pink", "purple", "red-purple", "blue-purple"}}
33
+ self.eye_shapes = {"both": {"normal", "large", "moe", "realistic", "cat", "wolf", "dog", "bird", "no irises", "heterochromia", "glowing", "small", "starburst pupils", "googly", "tearful", "chibi"}, "female": {"shoujo"}}
34
+ self.blush = {"female": {"blush"}}
35
+ self.eyebrow_shapes = {"both": {"straight", "curved", "angular", "thick", "thin", "high arched", "low arched", "rounded", "uneven"}}
36
+ self.lips_shapes = {"both": {"small", "wide", "round"}}
37
+ self.nose_shapes = {"both": {"aquiline", "straight", "bulbous", "button", "hooked", "flat", "snub", "roman", "turned up", "pointy"}}
38
+ self.earrings = {"both": {"earrings"}}
39
+
40
+ # Outfit
41
+ self.outfit_colors = {"both": {"orange and white", "pale lilac and medium lavender", "hunter green and medium brown", "red and green", "navy blue and mustard yellow", "dark green and tan", "navy and white", "burgundy and gray", "burgundy and light brown", "navy blue and tan", "golden yellow and medium blue", "red and mustard yellow", "yellow and white", "maroon and gray", "black and white", "seal brown and tan", "charcoal gray and white", "blue-green and coral", "sky blue and charcoal gray", "red and light blue", "medium blue and chocolate brown", "medium green and white", "red and taupe", "red and mint green", "slate blue and warm white", "beige and maroon", "yellow and blue", "blue and orange", "pastel blue and yellow-orange", "bright blue and soft gray", "red and gray", "red and cyan", "red and yellow", "cerulean and neon green", "neon green and neon yellow", "navy blue and red", "sherbet orange and cool gray", "olive green and yellow", "yellow and deep sky blue", "dark brown and light blue", "magenta and charcoal", "red and white", "yellow and forest green", "light blue and navy blue", "orange and yellow", "charcoal grey and light blue", "pale coral and tan", "mauve-gray and olive", "yellow-orange and burnt orange", "orange and brown", "navy and light blue", "red and orange", "green and yellow", "gray and black", "green and blue", "teal and navy blue", "magenta and yellow", "yellow and brown", "red and black", "orange and green", "clay red and cerulean", "bright red and army green", "black and gray", "orange and black", "sage green and tan", "blue and turquoise", "beige and brown", "red and earthy browns", "dark green and gray", "blue and cyan", "olive green and navy blue", "olive green and maroon", "yellow and warm gray", "green and earthy browns", "burgundy and light blue", "khaki and pastel yellow", "taupe and white", "sky blue and royal blue", "orange and gray", "olive green and beige", "beige and blue", "burnt orange and hunter green", "blue and red", "navy blue and khaki"},
42
+ "female": {"blush pink and white", "pink and red", "pink and orange", "gray and light pink", "dark green and pink", "pink and warm black", "pink and blue", "medium pink and red", "rose pink and periwinkle", "yellow and pink", "purple and pink", "pink and turquoise", "pink and green", "navy blue and pink", "purple and charcoal gray", "turquoise and purple", "purple and yellow", "electric purple and black", "purple and orange", "green and purple", "red and purple"}}
43
+ self.tops = {"female": {"t-shirts", "blouses", "tunics", "camisoles", "tank tops", "crewneck", "v-neck", "cardigan", "turtleneck", "pullovers", "henleys", "crop tops", "off-the-shoulder tops", "cold shoulder tops", "peplum tops"}}
44
+ self.bottoms = {"both": {"shorts", "chinos", "cargo pants"},
45
+ "female": {"skinny jeans", "straight jeans", "bootcut jeans", "flare jeans", "wide-leg jeans", "bermuda shorts", "hotpants", "A-line skirts", "pencil skirts", "maxi skirts", "midi skirts", "mini skirts", "dress pants", "linen pants", "capris"} | \
46
+ {"stockings", "tights", "fishnets", "leggings", "yoga pants"}}
47
+ self.one_piece = {"female": {"jumpsuits", "rompers", "swimsuits", "bodysuits"}}
48
+
49
+ # Personality
50
+ self.personality_traits = {"both": {"creative", "determined", "enthusiastic", "friendly", "generous", "humorous", "intelligent", "kind", "loyal", "motivated", "optimistic", "persistent", "resilient", "sincere", "thoughtful", "trustworthy", "versatile", "compassionate", "ambitious", "confident", "honest", "brave", "patient", "reliable", "adventurous", "charismatic", "gracious", "insightful", "perceptive", "resourceful", "selfless", "talented", "witty", "zealous"}}
51
+
52
+ # Actions
53
+ self.actions = {"both": {"walking", "running", "squatting", "crawling", "riding", "speaking", "dancing", "waving", "listening", "reading", "pulling", "carrying", "studying", "bending", "writing", "lifting", "sleeping", "lying down", "pushing", "drinking", "clapping", "playing", "typing", "reaching", "working", "climbing", "jumping", "swimming", "kneeling", "watching", "standing", "eating"}}
54
+ # ---
55
+
56
+ # Camera angles
57
+ self.camera_angels = {"both": {"low-angle", "eye level", "high-angle", "hip level", "knee level", "ground level", "shoulder level", "dutch angle", "overhead", "aerial"}}
58
+
59
+ # Places and eras
60
+ self.places = {"both": {"school", "skyscrapers", "neon lights", "crowded streets", "medieval kingdoms", "magical forests", "post-apocalyptic wastelands", "spaceships", "colonies on other planets", "vinland saga", "haunted houses", "cursed islands", "mystical dimensions", "training grounds", "stadiums", "arenas"}}
61
+ self.eras = {"both": {"meiji period", "edo period"}}
62
+
63
+ # Styles
64
+ self.resolution = {"both": {"sharp focus", "8k"}}
65
+ self.lighting = {"both": {"rim lighting", "flat lighting", "cinematic lighting", "crepuscular rays"}}
66
+
67
+ def main(self):
68
+ def get_random_x(x, gender=["both"]):
69
+ concat = sum([list(x.get(ge, [])) for ge in gender], [])
70
+ return concat[random.randint(0, len(concat) - 1)] if len(concat) else ""
71
+
72
+ rand50 = lambda: random.randint(1, 100) <= 50
73
+ rand85 = lambda: random.randint(1, 100) <= 85
74
+
75
+ gender = "1girl" if rand50() else "1boy"
76
+ gender_selection = ["both"] + ["female" if gender == "1girl" else "male"]
77
+ get_random_x_by_gender = functools.partial(get_random_x, gender=gender_selection)
78
+
79
+ commands = (
80
+ # You must put trailing comma to convert a parenthesized expression into a tuple
81
+ (self.year_range,),
82
+ (self.personality_traits if rand50() else None,),
83
+ (self.actions,),
84
+
85
+ (self.eye_colors, self.haircuts, "haircut",),
86
+ (self.eye_colors, self.eye_shapes, "eyes",),
87
+ (self.blush if rand50() else None,),
88
+ # (self.eyebrow_shapes, "eyebrows",), # Diffusers are bad at drawing eyebrows
89
+ # (self.lips_shapes, "lips",), # Diffusers are bad at drawing lips
90
+ # (self.nose_shapes, "nose",), # Diffusers are bad at drawing nose
91
+ (self.earrings if rand50() else None,),
92
+
93
+ (self.outfit_colors, "outfit",),
94
+ *(((self.one_piece,),) if rand50() else ((self.tops,), (self.bottoms,))),
95
+
96
+ (self.camera_angels, "shot",),
97
+ ((self.places,) if rand85() else (self.eras,)),
98
+
99
+ # ("masterpiece",), ("best quality",), ("very aesthetic",), ("absurdres",), # Already prepended
100
+ (self.resolution if rand50() else None,),
101
+ (self.lighting if rand50() else None,),
102
+ )
103
+
104
+ output = [gender] + [
105
+ " ".join(
106
+ get_random_x_by_gender(elem) if isinstance(elem, dict) else elem
107
+ for elem in cmd
108
+ if elem is not None and isinstance(elem, (str, dict))
109
+ ) for cmd in commands
110
+ ]
111
+
112
+ return ", ".join([s for s in output if s != ""])
113
 
114
  if __name__ == "__main__":
115
+ prompt_generator = REMSleepPrmAnime()
116
+ [print(prompt_generator.main()) for _ in range(1)]
117
  ```
118
 
119