valhalla commited on
Commit
e6cf6b8
1 Parent(s): 254cdee

add styles in utils

Browse files
Files changed (1) hide show
  1. utils.py +56 -0
utils.py CHANGED
@@ -5,6 +5,62 @@ import numpy as np
5
  MAX_SEED = np.iinfo(np.int32).max
6
 
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  def randomize_seed_fn(seed: int, randomize_seed: bool) -> int:
9
  if randomize_seed:
10
  seed = random.randint(0, MAX_SEED)
 
5
  MAX_SEED = np.iinfo(np.int32).max
6
 
7
 
8
+ style_list = [
9
+ {
10
+ "name": "Cinematic",
11
+ "prompt": "cinematic still {prompt} . emotional, harmonious, vignette, highly detailed, high budget, bokeh, cinemascope, moody, epic, gorgeous, film grain, grainy",
12
+ "negative_prompt": "anime, cartoon, graphic, text, painting, crayon, graphite, abstract, glitch, deformed, mutated, ugly, disfigured",
13
+ },
14
+ {
15
+ "name": "3D Model",
16
+ "prompt": "professional 3d model {prompt} . octane render, highly detailed, volumetric, dramatic lighting",
17
+ "negative_prompt": "ugly, deformed, noisy, low poly, blurry, painting",
18
+ },
19
+ {
20
+ "name": "Anime",
21
+ "prompt": "anime artwork {prompt} . anime style, key visual, vibrant, studio anime, highly detailed",
22
+ "negative_prompt": "photo, deformed, black and white, realism, disfigured, low contrast",
23
+ },
24
+ {
25
+ "name": "Digital Art",
26
+ "prompt": "concept art {prompt} . digital artwork, illustrative, painterly, matte painting, highly detailed",
27
+ "negative_prompt": "photo, photorealistic, realism, ugly",
28
+ },
29
+ {
30
+ "name": "Photographic",
31
+ "prompt": "cinematic photo {prompt} . 35mm photograph, film, bokeh, professional, 4k, highly detailed",
32
+ "negative_prompt": "drawing, painting, crayon, sketch, graphite, impressionist, noisy, blurry, soft, deformed, ugly",
33
+ },
34
+ {
35
+ "name": "Pixel art",
36
+ "prompt": "pixel-art {prompt} . low-res, blocky, pixel art style, 8-bit graphics",
37
+ "negative_prompt": "sloppy, messy, blurry, noisy, highly detailed, ultra textured, photo, realistic",
38
+ },
39
+ {
40
+ "name": "Fantasy art",
41
+ "prompt": "ethereal fantasy concept art of {prompt} . magnificent, celestial, ethereal, painterly, epic, majestic, magical, fantasy art, cover art, dreamy",
42
+ "negative_prompt": "photographic, realistic, realism, 35mm film, dslr, cropped, frame, text, deformed, glitch, noise, noisy, off-center, deformed, cross-eyed, closed eyes, bad anatomy, ugly, disfigured, sloppy, duplicate, mutated, black and white",
43
+ },
44
+ {
45
+ "name": "Neonpunk",
46
+ "prompt": "neonpunk style {prompt} . cyberpunk, vaporwave, neon, vibes, vibrant, stunningly beautiful, crisp, detailed, sleek, ultramodern, magenta highlights, dark purple shadows, high contrast, cinematic, ultra detailed, intricate, professional",
47
+ "negative_prompt": "painting, drawing, illustration, glitch, deformed, mutated, cross-eyed, ugly, disfigured"
48
+ },
49
+ {
50
+ "name": "Manga",
51
+ "prompt": "manga style {prompt} . vibrant, high-energy, detailed, iconic, Japanese comic style",
52
+ "negative_prompt": "ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, Western comic style"
53
+ },
54
+ ]
55
+
56
+ styles = {k["name"]: (k["prompt"], k["negative_prompt"]) for k in style_list}
57
+ style_names = list(styles.keys())
58
+
59
+ def apply_style(style_name: str, positive: str, negative: str = "") -> tuple[str, str]:
60
+ p, n = styles.get(style_name, default_style)
61
+ return p.replace("{prompt}", positive), n + negative
62
+
63
+
64
  def randomize_seed_fn(seed: int, randomize_seed: bool) -> int:
65
  if randomize_seed:
66
  seed = random.randint(0, MAX_SEED)