Spaces:
Runtime error
Runtime error
Update app_base.py
Browse files- app_base.py +1 -50
app_base.py
CHANGED
@@ -4,60 +4,11 @@ import gradio as gr
|
|
4 |
import PIL.Image
|
5 |
|
6 |
from model import ADAPTER_NAMES, Model
|
7 |
-
from utils import MAX_SEED, randomize_seed_fn
|
8 |
|
9 |
-
style_list = [
|
10 |
-
{
|
11 |
-
"name": "Cinematic",
|
12 |
-
"prompt": "cinematic still {prompt} . emotional, harmonious, vignette, highly detailed, high budget, bokeh, cinemascope, moody, epic, gorgeous, film grain, grainy",
|
13 |
-
"negative_prompt": "anime, cartoon, graphic, text, painting, crayon, graphite, abstract, glitch, deformed, mutated, ugly, disfigured",
|
14 |
-
},
|
15 |
-
{
|
16 |
-
"name": "3D Model",
|
17 |
-
"prompt": "professional 3d model {prompt} . octane render, highly detailed, volumetric, dramatic lighting",
|
18 |
-
"negative_prompt": "ugly, deformed, noisy, low poly, blurry, painting",
|
19 |
-
},
|
20 |
-
{
|
21 |
-
"name": "Anime",
|
22 |
-
"prompt": "anime artwork {prompt} . anime style, key visual, vibrant, studio anime, highly detailed",
|
23 |
-
"negative_prompt": "photo, deformed, black and white, realism, disfigured, low contrast",
|
24 |
-
},
|
25 |
-
{
|
26 |
-
"name": "Digital Art",
|
27 |
-
"prompt": "concept art {prompt} . digital artwork, illustrative, painterly, matte painting, highly detailed",
|
28 |
-
"negative_prompt": "photo, photorealistic, realism, ugly",
|
29 |
-
},
|
30 |
-
{
|
31 |
-
"name": "Photographic",
|
32 |
-
"prompt": "cinematic photo {prompt} . 35mm photograph, film, bokeh, professional, 4k, highly detailed",
|
33 |
-
"negative_prompt": "drawing, painting, crayon, sketch, graphite, impressionist, noisy, blurry, soft, deformed, ugly",
|
34 |
-
},
|
35 |
-
{
|
36 |
-
"name": "Pixel art",
|
37 |
-
"prompt": "pixel-art {prompt} . low-res, blocky, pixel art style, 8-bit graphics",
|
38 |
-
"negative_prompt": "sloppy, messy, blurry, noisy, highly detailed, ultra textured, photo, realistic",
|
39 |
-
},
|
40 |
-
{
|
41 |
-
"name": "Fantasy art",
|
42 |
-
"prompt": "ethereal fantasy concept art of {prompt} . magnificent, celestial, ethereal, painterly, epic, majestic, magical, fantasy art, cover art, dreamy",
|
43 |
-
"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",
|
44 |
-
},
|
45 |
-
{
|
46 |
-
"name": "Neonpunk",
|
47 |
-
"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",
|
48 |
-
"negative_prompt": "painting, drawing, illustration, glitch, deformed, mutated, cross-eyed, ugly, disfigured"
|
49 |
-
},
|
50 |
-
{
|
51 |
-
"name": "Manga",
|
52 |
-
"prompt": "manga style {prompt} . vibrant, high-energy, detailed, iconic, Japanese comic style",
|
53 |
-
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, Western comic style"
|
54 |
-
},
|
55 |
-
]
|
56 |
|
57 |
-
styles = {k["name"]: (k["prompt"], k["negative_prompt"]) for k in style_list}
|
58 |
default_style_name = "Photographic"
|
59 |
default_style = styles[default_style_name]
|
60 |
-
style_names = list(styles.keys())
|
61 |
|
62 |
|
63 |
def apply_style(style_name: str, positive: str, negative: str = "") -> tuple[str, str]:
|
|
|
4 |
import PIL.Image
|
5 |
|
6 |
from model import ADAPTER_NAMES, Model
|
7 |
+
from utils import MAX_SEED, randomize_seed_fn, styles, style_names, apply_style
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
|
|
10 |
default_style_name = "Photographic"
|
11 |
default_style = styles[default_style_name]
|
|
|
12 |
|
13 |
|
14 |
def apply_style(style_name: str, positive: str, negative: str = "") -> tuple[str, str]:
|