Commit
·
34a218b
1
Parent(s):
19cf25c
basic UI (english)
Browse files- modules/async_worker.py +34 -59
- modules/html.py +20 -11
- modules/sdxl_styles.py +77 -421
- webui.py +35 -92
modules/async_worker.py
CHANGED
|
@@ -3,10 +3,11 @@ import threading
|
|
| 3 |
|
| 4 |
buffer = []
|
| 5 |
outputs = []
|
|
|
|
| 6 |
|
| 7 |
|
| 8 |
def worker():
|
| 9 |
-
global buffer, outputs
|
| 10 |
|
| 11 |
import time
|
| 12 |
import shared
|
|
@@ -28,80 +29,54 @@ def worker():
|
|
| 28 |
print(e)
|
| 29 |
|
| 30 |
def handler(task):
|
| 31 |
-
prompt,
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
|
|
|
|
|
|
| 37 |
modules.patch.sharpness = sharpness
|
| 38 |
-
|
| 39 |
-
pipeline.
|
| 40 |
-
pipeline.refresh_refiner_model(refiner_model_name)
|
| 41 |
pipeline.refresh_loras(loras)
|
| 42 |
pipeline.clean_prompt_cond_caches()
|
| 43 |
|
| 44 |
-
p_txt, n_txt = apply_style(
|
| 45 |
-
|
| 46 |
-
if performance_selction == 'Speed':
|
| 47 |
-
steps = 30
|
| 48 |
-
switch = 20
|
| 49 |
-
else:
|
| 50 |
-
steps = 60
|
| 51 |
-
switch = 40
|
| 52 |
-
|
| 53 |
-
width, height = aspect_ratios[aspect_ratios_selction]
|
| 54 |
-
|
| 55 |
results = []
|
| 56 |
-
|
| 57 |
-
max_seed = int(1024*1024*1024)
|
| 58 |
-
|
| 59 |
-
if not isinstance(seed, int):
|
| 60 |
-
seed = random.randint(1, max_seed)
|
| 61 |
-
if seed < 0:
|
| 62 |
-
seed = - seed
|
| 63 |
-
seed = seed % max_seed
|
| 64 |
-
|
| 65 |
-
all_steps = steps * image_number
|
| 66 |
-
|
| 67 |
def callback(step, x0, x, total_steps, y):
|
| 68 |
-
done_steps =
|
| 69 |
outputs.append(['preview', (
|
| 70 |
-
int(100.0 * float(done_steps) / float(
|
| 71 |
-
f'
|
| 72 |
y)])
|
| 73 |
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
('
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
]
|
| 89 |
-
for n, w in loras:
|
| 90 |
-
if n != 'None':
|
| 91 |
-
d.append((f'LoRA [{n}] weight', w))
|
| 92 |
-
log(x, d)
|
| 93 |
-
|
| 94 |
-
seed += 1
|
| 95 |
-
results += imgs
|
| 96 |
-
|
| 97 |
-
outputs.append(['results', results])
|
| 98 |
return
|
| 99 |
|
| 100 |
while True:
|
| 101 |
time.sleep(0.01)
|
| 102 |
if len(buffer) > 0:
|
|
|
|
| 103 |
task = buffer.pop(0)
|
| 104 |
handler(task)
|
|
|
|
| 105 |
pass
|
| 106 |
|
| 107 |
|
|
|
|
| 3 |
|
| 4 |
buffer = []
|
| 5 |
outputs = []
|
| 6 |
+
is_working = False
|
| 7 |
|
| 8 |
|
| 9 |
def worker():
|
| 10 |
+
global buffer, outputs, is_working
|
| 11 |
|
| 12 |
import time
|
| 13 |
import shared
|
|
|
|
| 29 |
print(e)
|
| 30 |
|
| 31 |
def handler(task):
|
| 32 |
+
prompt, style_selection = task
|
| 33 |
+
steps = 30
|
| 34 |
+
switch = 20
|
| 35 |
+
aspect_ratios_selection = '1280×768'
|
| 36 |
+
seed = random.randint(1, int(1024*1024*1024))
|
| 37 |
+
sharpness = 10.0
|
| 38 |
+
|
| 39 |
+
loras=[(modules.path.default_lora_name, modules.path.default_lora_weight), ('None', 0.5), ('None', 0.5), ('None', 0.5), ('None', 0.5)]
|
| 40 |
modules.patch.sharpness = sharpness
|
| 41 |
+
pipeline.refresh_base_model(modules.path.default_base_model_name)
|
| 42 |
+
pipeline.refresh_refiner_model(modules.path.default_refiner_model_name)
|
|
|
|
| 43 |
pipeline.refresh_loras(loras)
|
| 44 |
pipeline.clean_prompt_cond_caches()
|
| 45 |
|
| 46 |
+
p_txt, n_txt = apply_style(style_selection, prompt)
|
| 47 |
+
width, height = aspect_ratios[aspect_ratios_selection]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
results = []
|
| 49 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
def callback(step, x0, x, total_steps, y):
|
| 51 |
+
done_steps = step
|
| 52 |
outputs.append(['preview', (
|
| 53 |
+
int(100.0 * float(done_steps) / float(steps)),
|
| 54 |
+
f'{step}/{total_steps}',
|
| 55 |
y)])
|
| 56 |
|
| 57 |
+
img = pipeline.process(p_txt, n_txt, steps, switch, width, height, seed, callback=callback)
|
| 58 |
+
|
| 59 |
+
for x in img:
|
| 60 |
+
d = [
|
| 61 |
+
('Prompt', prompt),
|
| 62 |
+
('Style', style_selection),
|
| 63 |
+
('Seed', seed)
|
| 64 |
+
]
|
| 65 |
+
for n, w in loras:
|
| 66 |
+
if n != 'None':
|
| 67 |
+
d.append((f'LoRA [{n}] weight', w))
|
| 68 |
+
log(x, d)
|
| 69 |
+
|
| 70 |
+
outputs.append(['results', img])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
return
|
| 72 |
|
| 73 |
while True:
|
| 74 |
time.sleep(0.01)
|
| 75 |
if len(buffer) > 0:
|
| 76 |
+
is_working=True
|
| 77 |
task = buffer.pop(0)
|
| 78 |
handler(task)
|
| 79 |
+
is_working=False
|
| 80 |
pass
|
| 81 |
|
| 82 |
|
modules/html.py
CHANGED
|
@@ -9,8 +9,8 @@ css = '''
|
|
| 9 |
border: 8px solid #f3f3f3; /* Light grey */
|
| 10 |
border-top: 8px solid #3498db; /* Blue */
|
| 11 |
border-radius: 50%;
|
| 12 |
-
width:
|
| 13 |
-
height:
|
| 14 |
animation: spin 2s linear infinite;
|
| 15 |
}
|
| 16 |
|
|
@@ -22,16 +22,17 @@ css = '''
|
|
| 22 |
/* Style the progress bar */
|
| 23 |
progress {
|
| 24 |
appearance: none; /* Remove default styling */
|
| 25 |
-
height:
|
| 26 |
border-radius: 5px; /* Round the corners of the progress bar */
|
| 27 |
background-color: #f3f3f3; /* Light grey background */
|
| 28 |
width: 100%;
|
|
|
|
| 29 |
}
|
| 30 |
|
| 31 |
/* Style the progress bar container */
|
| 32 |
.progress-container {
|
| 33 |
-
margin-left:
|
| 34 |
-
margin-right:
|
| 35 |
flex-grow: 1; /* Allow the progress container to take up remaining space */
|
| 36 |
}
|
| 37 |
|
|
@@ -52,7 +53,7 @@ progress::after {
|
|
| 52 |
left: 50%;
|
| 53 |
transform: translate(-50%, -50%);
|
| 54 |
color: white; /* Set text color */
|
| 55 |
-
font-size:
|
| 56 |
}
|
| 57 |
|
| 58 |
/* Style other texts */
|
|
@@ -65,11 +66,19 @@ progress::after {
|
|
| 65 |
}
|
| 66 |
|
| 67 |
.progress-bar{
|
| 68 |
-
height:
|
| 69 |
}
|
| 70 |
|
| 71 |
-
.
|
| 72 |
-
height:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
}
|
| 74 |
|
| 75 |
.scroll-hide{
|
|
@@ -85,7 +94,7 @@ progress::after {
|
|
| 85 |
|
| 86 |
'''
|
| 87 |
progress_html = '''
|
| 88 |
-
<div class="loader-container">
|
| 89 |
<div class="loader"></div>
|
| 90 |
<div class="progress-container">
|
| 91 |
<progress value="*number*" max="100"></progress>
|
|
@@ -96,4 +105,4 @@ progress_html = '''
|
|
| 96 |
|
| 97 |
|
| 98 |
def make_progress_html(number, text):
|
| 99 |
-
return progress_html.replace('*number*', str(number)).replace('*text*', text)
|
|
|
|
| 9 |
border: 8px solid #f3f3f3; /* Light grey */
|
| 10 |
border-top: 8px solid #3498db; /* Blue */
|
| 11 |
border-radius: 50%;
|
| 12 |
+
width: 20px;
|
| 13 |
+
height: 20px;
|
| 14 |
animation: spin 2s linear infinite;
|
| 15 |
}
|
| 16 |
|
|
|
|
| 22 |
/* Style the progress bar */
|
| 23 |
progress {
|
| 24 |
appearance: none; /* Remove default styling */
|
| 25 |
+
height: 15px; /* Set the height of the progress bar */
|
| 26 |
border-radius: 5px; /* Round the corners of the progress bar */
|
| 27 |
background-color: #f3f3f3; /* Light grey background */
|
| 28 |
width: 100%;
|
| 29 |
+
margin-top: 6px;
|
| 30 |
}
|
| 31 |
|
| 32 |
/* Style the progress bar container */
|
| 33 |
.progress-container {
|
| 34 |
+
margin-left: 5px;
|
| 35 |
+
margin-right: 5px;
|
| 36 |
flex-grow: 1; /* Allow the progress container to take up remaining space */
|
| 37 |
}
|
| 38 |
|
|
|
|
| 53 |
left: 50%;
|
| 54 |
transform: translate(-50%, -50%);
|
| 55 |
color: white; /* Set text color */
|
| 56 |
+
font-size: 12px; /* Set font size */
|
| 57 |
}
|
| 58 |
|
| 59 |
/* Style other texts */
|
|
|
|
| 66 |
}
|
| 67 |
|
| 68 |
.progress-bar{
|
| 69 |
+
height: 15px !important;
|
| 70 |
}
|
| 71 |
|
| 72 |
+
.stylebox{
|
| 73 |
+
min-height: 110px !important;
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
.generate_button {
|
| 77 |
+
min-height: 80px !important;
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
.stylebox label span {
|
| 81 |
+
margin-bottom: 22px !important;
|
| 82 |
}
|
| 83 |
|
| 84 |
.scroll-hide{
|
|
|
|
| 94 |
|
| 95 |
'''
|
| 96 |
progress_html = '''
|
| 97 |
+
<div class="loader-container" style="visibility:*visibility*;max-width:1280px;">
|
| 98 |
<div class="loader"></div>
|
| 99 |
<div class="progress-container">
|
| 100 |
<progress value="*number*" max="100"></progress>
|
|
|
|
| 105 |
|
| 106 |
|
| 107 |
def make_progress_html(number, text):
|
| 108 |
+
return progress_html.replace('*number*', str(number)).replace('*text*', text).replace("*visibility*", "visible" if number >= 0 else "hidden")
|
modules/sdxl_styles.py
CHANGED
|
@@ -2,534 +2,190 @@
|
|
| 2 |
|
| 3 |
styles = [
|
| 4 |
{
|
| 5 |
-
"name": "
|
| 6 |
-
"prompt": "{prompt}",
|
| 7 |
-
"negative_prompt": ""
|
| 8 |
-
},
|
| 9 |
-
{
|
| 10 |
-
"name": "cinematic-default",
|
| 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": "
|
| 16 |
-
"prompt": "
|
| 17 |
-
"negative_prompt": "ugly, deformed, noisy, low poly, blurry, painting"
|
| 18 |
-
},
|
| 19 |
-
{
|
| 20 |
-
"name": "sai-analog film",
|
| 21 |
-
"prompt": "analog film photo {prompt} . faded film, desaturated, 35mm photo, grainy, vignette, vintage, Kodachrome, Lomography, stained, highly detailed, found footage",
|
| 22 |
-
"negative_prompt": "painting, drawing, illustration, glitch, deformed, mutated, cross-eyed, ugly, disfigured"
|
| 23 |
-
},
|
| 24 |
-
{
|
| 25 |
-
"name": "sai-anime",
|
| 26 |
-
"prompt": "anime artwork {prompt} . anime style, key visual, vibrant, studio anime, highly detailed",
|
| 27 |
"negative_prompt": "photo, deformed, black and white, realism, disfigured, low contrast"
|
| 28 |
},
|
| 29 |
{
|
| 30 |
-
"name": "
|
| 31 |
-
"prompt": "
|
| 32 |
-
"negative_prompt": "anime, cartoon, graphic, text, painting, crayon, graphite, abstract, glitch, deformed, mutated, ugly, disfigured"
|
| 33 |
-
},
|
| 34 |
-
{
|
| 35 |
-
"name": "sai-comic book",
|
| 36 |
-
"prompt": "comic {prompt} . graphic illustration, comic art, graphic novel art, vibrant, highly detailed",
|
| 37 |
-
"negative_prompt": "photograph, deformed, glitch, noisy, realistic, stock photo"
|
| 38 |
-
},
|
| 39 |
-
{
|
| 40 |
-
"name": "sai-craft clay",
|
| 41 |
-
"prompt": "play-doh style {prompt} . sculpture, clay art, centered composition, Claymation",
|
| 42 |
"negative_prompt": "sloppy, messy, grainy, highly detailed, ultra textured, photo"
|
| 43 |
},
|
| 44 |
{
|
| 45 |
-
"name": "
|
| 46 |
-
"prompt": "
|
| 47 |
-
"negative_prompt": "photo, photorealistic, realism, ugly"
|
| 48 |
-
},
|
| 49 |
-
{
|
| 50 |
-
"name": "sai-enhance",
|
| 51 |
-
"prompt": "breathtaking {prompt} . award-winning, professional, highly detailed",
|
| 52 |
-
"negative_prompt": "ugly, deformed, noisy, blurry, distorted, grainy"
|
| 53 |
-
},
|
| 54 |
-
{
|
| 55 |
-
"name": "sai-fantasy art",
|
| 56 |
-
"prompt": "ethereal fantasy concept art of {prompt} . magnificent, celestial, ethereal, painterly, epic, majestic, magical, fantasy art, cover art, dreamy",
|
| 57 |
-
"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"
|
| 58 |
-
},
|
| 59 |
-
{
|
| 60 |
-
"name": "sai-isometric",
|
| 61 |
-
"prompt": "isometric style {prompt} . vibrant, beautiful, crisp, detailed, ultra detailed, intricate",
|
| 62 |
-
"negative_prompt": "deformed, mutated, ugly, disfigured, blur, blurry, noise, noisy, realistic, photographic"
|
| 63 |
-
},
|
| 64 |
-
{
|
| 65 |
-
"name": "sai-line art",
|
| 66 |
-
"prompt": "line art drawing {prompt} . professional, sleek, modern, minimalist, graphic, line art, vector graphics",
|
| 67 |
"negative_prompt": "anime, photorealistic, 35mm film, deformed, glitch, blurry, noisy, off-center, deformed, cross-eyed, closed eyes, bad anatomy, ugly, disfigured, mutated, realism, realistic, impressionism, expressionism, oil, acrylic"
|
| 68 |
},
|
| 69 |
{
|
| 70 |
-
"name": "
|
| 71 |
-
"prompt": "low-poly style {prompt} . low-poly game art, polygon mesh, jagged, blocky, wireframe edges, centered composition",
|
| 72 |
"negative_prompt": "noisy, sloppy, messy, grainy, highly detailed, ultra textured, photo"
|
| 73 |
},
|
| 74 |
{
|
| 75 |
-
"name": "
|
| 76 |
-
"prompt": "
|
| 77 |
-
"negative_prompt": "painting, drawing, illustration, glitch, deformed, mutated, cross-eyed, ugly, disfigured"
|
| 78 |
-
},
|
| 79 |
-
{
|
| 80 |
-
"name": "sai-origami",
|
| 81 |
-
"prompt": "origami style {prompt} . paper art, pleated paper, folded, origami art, pleats, cut and fold, centered composition",
|
| 82 |
"negative_prompt": "noisy, sloppy, messy, grainy, highly detailed, ultra textured, photo"
|
| 83 |
},
|
| 84 |
{
|
| 85 |
-
"name": "
|
| 86 |
-
"prompt": "
|
| 87 |
-
"negative_prompt": "drawing, painting, crayon, sketch, graphite, impressionist, noisy, blurry, soft, deformed, ugly"
|
| 88 |
-
},
|
| 89 |
-
{
|
| 90 |
-
"name": "sai-pixel art",
|
| 91 |
-
"prompt": "pixel-art {prompt} . low-res, blocky, pixel art style, 8-bit graphics",
|
| 92 |
-
"negative_prompt": "sloppy, messy, blurry, noisy, highly detailed, ultra textured, photo, realistic"
|
| 93 |
-
},
|
| 94 |
-
{
|
| 95 |
-
"name": "sai-texture",
|
| 96 |
-
"prompt": "texture {prompt} top down close-up",
|
| 97 |
-
"negative_prompt": "ugly, deformed, noisy, blurry"
|
| 98 |
-
},
|
| 99 |
-
{
|
| 100 |
-
"name": "ads-advertising",
|
| 101 |
-
"prompt": "Advertising poster style {prompt} . Professional, modern, product-focused, commercial, eye-catching, highly detailed",
|
| 102 |
"negative_prompt": "noisy, blurry, amateurish, sloppy, unattractive"
|
| 103 |
},
|
| 104 |
{
|
| 105 |
-
"name": "
|
| 106 |
-
"prompt": "Automotive advertisement style {prompt} . Sleek, dynamic, professional, commercial, vehicle-focused, high-resolution, highly detailed",
|
| 107 |
"negative_prompt": "noisy, blurry, unattractive, sloppy, unprofessional"
|
| 108 |
},
|
| 109 |
{
|
| 110 |
-
"name": "
|
| 111 |
-
"prompt": "
|
| 112 |
-
"negative_prompt": "noisy, blurry, grungy, sloppy, cluttered, disorganized"
|
| 113 |
-
},
|
| 114 |
-
{
|
| 115 |
-
"name": "ads-fashion editorial",
|
| 116 |
-
"prompt": "Fashion editorial style {prompt} . High fashion, trendy, stylish, editorial, magazine style, professional, highly detailed",
|
| 117 |
"negative_prompt": "outdated, blurry, noisy, unattractive, sloppy"
|
| 118 |
},
|
| 119 |
{
|
| 120 |
-
"name": "
|
| 121 |
-
"prompt": "
|
| 122 |
-
"negative_prompt": "
|
| 123 |
-
},
|
| 124 |
-
{
|
| 125 |
-
"name": "ads-luxury",
|
| 126 |
-
"prompt": "Luxury product style {prompt} . Elegant, sophisticated, high-end, luxurious, professional, highly detailed",
|
| 127 |
-
"negative_prompt": "cheap, noisy, blurry, unattractive, amateurish"
|
| 128 |
-
},
|
| 129 |
-
{
|
| 130 |
-
"name": "ads-real estate",
|
| 131 |
-
"prompt": "Real estate photography style {prompt} . Professional, inviting, well-lit, high-resolution, property-focused, commercial, highly detailed",
|
| 132 |
-
"negative_prompt": "dark, blurry, unappealing, noisy, unprofessional"
|
| 133 |
-
},
|
| 134 |
-
{
|
| 135 |
-
"name": "ads-retail",
|
| 136 |
-
"prompt": "Retail packaging style {prompt} . Vibrant, enticing, commercial, product-focused, eye-catching, professional, highly detailed",
|
| 137 |
-
"negative_prompt": "noisy, blurry, amateurish, sloppy, unattractive"
|
| 138 |
-
},
|
| 139 |
-
{
|
| 140 |
-
"name": "artstyle-abstract",
|
| 141 |
-
"prompt": "abstract style {prompt} . non-representational, colors and shapes, expression of feelings, imaginative, highly detailed",
|
| 142 |
-
"negative_prompt": "realistic, photographic, figurative, concrete"
|
| 143 |
},
|
| 144 |
{
|
| 145 |
-
"name": "
|
| 146 |
-
"prompt": "abstract expressionist painting {prompt} . energetic brushwork, bold colors, abstract forms, expressive, emotional",
|
| 147 |
"negative_prompt": "realistic, photorealistic, low contrast, plain, simple, monochrome"
|
| 148 |
},
|
| 149 |
{
|
| 150 |
-
"name": "
|
| 151 |
-
"prompt": "
|
| 152 |
-
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, modernist, minimalist"
|
| 153 |
-
},
|
| 154 |
-
{
|
| 155 |
-
"name": "artstyle-art nouveau",
|
| 156 |
-
"prompt": "Art Nouveau style {prompt} . elegant, decorative, curvilinear forms, nature-inspired, ornate, detailed",
|
| 157 |
-
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, modernist, minimalist"
|
| 158 |
-
},
|
| 159 |
-
{
|
| 160 |
-
"name": "artstyle-constructivist",
|
| 161 |
-
"prompt": "constructivist style {prompt} . geometric shapes, bold colors, dynamic composition, propaganda art style",
|
| 162 |
-
"negative_prompt": "realistic, photorealistic, low contrast, plain, simple, abstract expressionism"
|
| 163 |
-
},
|
| 164 |
-
{
|
| 165 |
-
"name": "artstyle-cubist",
|
| 166 |
-
"prompt": "cubist artwork {prompt} . geometric shapes, abstract, innovative, revolutionary",
|
| 167 |
-
"negative_prompt": "anime, photorealistic, 35mm film, deformed, glitch, low contrast, noisy"
|
| 168 |
-
},
|
| 169 |
-
{
|
| 170 |
-
"name": "artstyle-expressionist",
|
| 171 |
-
"prompt": "expressionist {prompt} . raw, emotional, dynamic, distortion for emotional effect, vibrant, use of unusual colors, detailed",
|
| 172 |
-
"negative_prompt": "realism, symmetry, quiet, calm, photo"
|
| 173 |
-
},
|
| 174 |
-
{
|
| 175 |
-
"name": "artstyle-graffiti",
|
| 176 |
-
"prompt": "graffiti style {prompt} . street art, vibrant, urban, detailed, tag, mural",
|
| 177 |
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast, realism, photorealistic"
|
| 178 |
},
|
| 179 |
{
|
| 180 |
-
"name": "
|
| 181 |
-
"prompt": "
|
| 182 |
-
"negative_prompt": "simplified, abstract, unrealistic, impressionistic, low resolution"
|
| 183 |
-
},
|
| 184 |
-
{
|
| 185 |
-
"name": "artstyle-impressionist",
|
| 186 |
-
"prompt": "impressionist painting {prompt} . loose brushwork, vibrant color, light and shadow play, captures feeling over form",
|
| 187 |
-
"negative_prompt": "anime, photorealistic, 35mm film, deformed, glitch, low contrast, noisy"
|
| 188 |
-
},
|
| 189 |
-
{
|
| 190 |
-
"name": "artstyle-pointillism",
|
| 191 |
-
"prompt": "pointillism style {prompt} . composed entirely of small, distinct dots of color, vibrant, highly detailed",
|
| 192 |
-
"negative_prompt": "line drawing, smooth shading, large color fields, simplistic"
|
| 193 |
-
},
|
| 194 |
-
{
|
| 195 |
-
"name": "artstyle-pop art",
|
| 196 |
-
"prompt": "Pop Art style {prompt} . bright colors, bold outlines, popular culture themes, ironic or kitsch",
|
| 197 |
-
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, minimalist"
|
| 198 |
-
},
|
| 199 |
-
{
|
| 200 |
-
"name": "artstyle-psychedelic",
|
| 201 |
-
"prompt": "psychedelic style {prompt} . vibrant colors, swirling patterns, abstract forms, surreal, trippy",
|
| 202 |
"negative_prompt": "monochrome, black and white, low contrast, realistic, photorealistic, plain, simple"
|
| 203 |
},
|
| 204 |
{
|
| 205 |
-
"name": "
|
| 206 |
-
"prompt": "
|
| 207 |
-
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast, modernist, minimalist, abstract"
|
| 208 |
-
},
|
| 209 |
-
{
|
| 210 |
-
"name": "artstyle-steampunk",
|
| 211 |
-
"prompt": "steampunk style {prompt} . antique, mechanical, brass and copper tones, gears, intricate, detailed",
|
| 212 |
"negative_prompt": "deformed, glitch, noisy, low contrast, anime, photorealistic"
|
| 213 |
},
|
| 214 |
{
|
| 215 |
-
"name": "
|
| 216 |
-
"prompt": "
|
| 217 |
-
"negative_prompt": "anime, photorealistic, realistic, deformed, glitch, noisy, low contrast"
|
| 218 |
-
},
|
| 219 |
-
{
|
| 220 |
-
"name": "artstyle-typography",
|
| 221 |
-
"prompt": "typographic art {prompt} . stylized, intricate, detailed, artistic, text-based",
|
| 222 |
-
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast, realism, photorealistic"
|
| 223 |
-
},
|
| 224 |
-
{
|
| 225 |
-
"name": "artstyle-watercolor",
|
| 226 |
-
"prompt": "watercolor painting {prompt} . vibrant, beautiful, painterly, detailed, textural, artistic",
|
| 227 |
"negative_prompt": "anime, photorealistic, 35mm film, deformed, glitch, low contrast, noisy"
|
| 228 |
},
|
| 229 |
{
|
| 230 |
-
"name": "
|
| 231 |
-
"prompt": "
|
| 232 |
-
"negative_prompt": "natural, rustic, primitive, organic, simplistic"
|
| 233 |
-
},
|
| 234 |
-
{
|
| 235 |
-
"name": "futuristic-biomechanical cyberpunk",
|
| 236 |
-
"prompt": "biomechanical cyberpunk {prompt} . cybernetics, human-machine fusion, dystopian, organic meets artificial, dark, intricate, highly detailed",
|
| 237 |
-
"negative_prompt": "natural, colorful, deformed, sketch, low contrast, watercolor"
|
| 238 |
-
},
|
| 239 |
-
{
|
| 240 |
-
"name": "futuristic-cybernetic",
|
| 241 |
-
"prompt": "cybernetic style {prompt} . futuristic, technological, cybernetic enhancements, robotics, artificial intelligence themes",
|
| 242 |
-
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, historical, medieval"
|
| 243 |
-
},
|
| 244 |
-
{
|
| 245 |
-
"name": "futuristic-cybernetic robot",
|
| 246 |
-
"prompt": "cybernetic robot {prompt} . android, AI, machine, metal, wires, tech, futuristic, highly detailed",
|
| 247 |
-
"negative_prompt": "organic, natural, human, sketch, watercolor, low contrast"
|
| 248 |
-
},
|
| 249 |
-
{
|
| 250 |
-
"name": "futuristic-cyberpunk cityscape",
|
| 251 |
-
"prompt": "cyberpunk cityscape {prompt} . neon lights, dark alleys, skyscrapers, futuristic, vibrant colors, high contrast, highly detailed",
|
| 252 |
"negative_prompt": "natural, rural, deformed, low contrast, black and white, sketch, watercolor"
|
| 253 |
},
|
| 254 |
{
|
| 255 |
-
"name": "
|
| 256 |
-
"prompt": "
|
| 257 |
-
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, vintage, antique"
|
| 258 |
-
},
|
| 259 |
-
{
|
| 260 |
-
"name": "futuristic-retro cyberpunk",
|
| 261 |
-
"prompt": "retro cyberpunk {prompt} . 80's inspired, synthwave, neon, vibrant, detailed, retro futurism",
|
| 262 |
-
"negative_prompt": "modern, desaturated, black and white, realism, low contrast"
|
| 263 |
-
},
|
| 264 |
-
{
|
| 265 |
-
"name": "futuristic-retro futurism",
|
| 266 |
-
"prompt": "retro-futuristic {prompt} . vintage sci-fi, 50s and 60s style, atomic age, vibrant, highly detailed",
|
| 267 |
-
"negative_prompt": "contemporary, realistic, rustic, primitive"
|
| 268 |
-
},
|
| 269 |
-
{
|
| 270 |
-
"name": "futuristic-sci-fi",
|
| 271 |
-
"prompt": "sci-fi style {prompt} . futuristic, technological, alien worlds, space themes, advanced civilizations",
|
| 272 |
-
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, historical, medieval"
|
| 273 |
-
},
|
| 274 |
-
{
|
| 275 |
-
"name": "futuristic-vaporwave",
|
| 276 |
-
"prompt": "vaporwave style {prompt} . retro aesthetic, cyberpunk, vibrant, neon colors, vintage 80s and 90s style, highly detailed",
|
| 277 |
-
"negative_prompt": "monochrome, muted colors, realism, rustic, minimalist, dark"
|
| 278 |
-
},
|
| 279 |
-
{
|
| 280 |
-
"name": "game-bubble bobble",
|
| 281 |
-
"prompt": "Bubble Bobble style {prompt} . 8-bit, cute, pixelated, fantasy, vibrant, reminiscent of Bubble Bobble game",
|
| 282 |
-
"negative_prompt": "realistic, modern, photorealistic, violent, horror"
|
| 283 |
-
},
|
| 284 |
-
{
|
| 285 |
-
"name": "game-cyberpunk game",
|
| 286 |
-
"prompt": "cyberpunk game style {prompt} . neon, dystopian, futuristic, digital, vibrant, detailed, high contrast, reminiscent of cyberpunk genre video games",
|
| 287 |
"negative_prompt": "historical, natural, rustic, low detailed"
|
| 288 |
},
|
| 289 |
{
|
| 290 |
-
"name": "
|
| 291 |
-
"prompt": "
|
| 292 |
-
"negative_prompt": "peaceful, calm, minimalist, photorealistic"
|
| 293 |
-
},
|
| 294 |
-
{
|
| 295 |
-
"name": "game-gta",
|
| 296 |
-
"prompt": "GTA-style artwork {prompt} . satirical, exaggerated, pop art style, vibrant colors, iconic characters, action-packed",
|
| 297 |
-
"negative_prompt": "realistic, black and white, low contrast, impressionist, cubist, noisy, blurry, deformed"
|
| 298 |
-
},
|
| 299 |
-
{
|
| 300 |
-
"name": "game-mario",
|
| 301 |
-
"prompt": "Super Mario style {prompt} . vibrant, cute, cartoony, fantasy, playful, reminiscent of Super Mario series",
|
| 302 |
"negative_prompt": "realistic, modern, horror, dystopian, violent"
|
| 303 |
},
|
| 304 |
{
|
| 305 |
-
"name": "
|
| 306 |
-
"prompt": "Minecraft style {prompt} . blocky, pixelated, vibrant colors, recognizable characters and objects, game assets",
|
| 307 |
"negative_prompt": "smooth, realistic, detailed, photorealistic, noise, blurry, deformed"
|
| 308 |
},
|
| 309 |
{
|
| 310 |
-
"name": "game
|
| 311 |
-
"prompt": "
|
| 312 |
-
"negative_prompt": "realistic, modern, horror, dystopian, violent"
|
| 313 |
-
},
|
| 314 |
-
{
|
| 315 |
-
"name": "game-retro arcade",
|
| 316 |
-
"prompt": "retro arcade style {prompt} . 8-bit, pixelated, vibrant, classic video game, old school gaming, reminiscent of 80s and 90s arcade games",
|
| 317 |
-
"negative_prompt": "modern, ultra-high resolution, photorealistic, 3D"
|
| 318 |
-
},
|
| 319 |
-
{
|
| 320 |
-
"name": "game-retro game",
|
| 321 |
-
"prompt": "retro game art {prompt} . 16-bit, vibrant colors, pixelated, nostalgic, charming, fun",
|
| 322 |
-
"negative_prompt": "realistic, photorealistic, 35mm film, deformed, glitch, low contrast, noisy"
|
| 323 |
-
},
|
| 324 |
-
{
|
| 325 |
-
"name": "game-rpg fantasy game",
|
| 326 |
-
"prompt": "role-playing game (RPG) style fantasy {prompt} . detailed, vibrant, immersive, reminiscent of high fantasy RPG games",
|
| 327 |
-
"negative_prompt": "sci-fi, modern, urban, futuristic, low detailed"
|
| 328 |
-
},
|
| 329 |
-
{
|
| 330 |
-
"name": "game-strategy game",
|
| 331 |
-
"prompt": "strategy game style {prompt} . overhead view, detailed map, units, reminiscent of real-time strategy video games",
|
| 332 |
"negative_prompt": "first-person view, modern, photorealistic"
|
| 333 |
},
|
| 334 |
{
|
| 335 |
-
"name": "
|
| 336 |
-
"prompt": "
|
| 337 |
-
"negative_prompt": "3D, realistic, modern, photorealistic, turn-based strategy"
|
| 338 |
-
},
|
| 339 |
-
{
|
| 340 |
-
"name": "game-zelda",
|
| 341 |
-
"prompt": "Legend of Zelda style {prompt} . vibrant, fantasy, detailed, epic, heroic, reminiscent of The Legend of Zelda series",
|
| 342 |
-
"negative_prompt": "sci-fi, modern, realistic, horror"
|
| 343 |
-
},
|
| 344 |
-
{
|
| 345 |
-
"name": "misc-architectural",
|
| 346 |
-
"prompt": "architectural style {prompt} . clean lines, geometric shapes, minimalist, modern, architectural drawing, highly detailed",
|
| 347 |
-
"negative_prompt": "curved lines, ornate, baroque, abstract, grunge"
|
| 348 |
-
},
|
| 349 |
-
{
|
| 350 |
-
"name": "misc-disco",
|
| 351 |
-
"prompt": "disco-themed {prompt} . vibrant, groovy, retro 70s style, shiny disco balls, neon lights, dance floor, highly detailed",
|
| 352 |
-
"negative_prompt": "minimalist, rustic, monochrome, contemporary, simplistic"
|
| 353 |
-
},
|
| 354 |
-
{
|
| 355 |
-
"name": "misc-dreamscape",
|
| 356 |
-
"prompt": "dreamscape {prompt} . surreal, ethereal, dreamy, mysterious, fantasy, highly detailed",
|
| 357 |
-
"negative_prompt": "realistic, concrete, ordinary, mundane"
|
| 358 |
-
},
|
| 359 |
-
{
|
| 360 |
-
"name": "misc-dystopian",
|
| 361 |
-
"prompt": "dystopian style {prompt} . bleak, post-apocalyptic, somber, dramatic, highly detailed",
|
| 362 |
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast, cheerful, optimistic, vibrant, colorful"
|
| 363 |
},
|
| 364 |
{
|
| 365 |
-
"name": "
|
| 366 |
-
"prompt": "fairy tale {prompt} . magical, fantastical, enchanting, storybook style, highly detailed",
|
| 367 |
"negative_prompt": "realistic, modern, ordinary, mundane"
|
| 368 |
},
|
| 369 |
{
|
| 370 |
-
"name": "
|
| 371 |
-
"prompt": "gothic style {prompt} . dark, mysterious, haunting, dramatic, ornate, detailed",
|
| 372 |
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, cheerful, optimistic"
|
| 373 |
},
|
| 374 |
{
|
| 375 |
-
"name": "
|
| 376 |
-
"prompt": "
|
| 377 |
-
"negative_prompt": "smooth, clean, minimalist, sleek, modern, photorealistic"
|
| 378 |
-
},
|
| 379 |
-
{
|
| 380 |
-
"name": "misc-horror",
|
| 381 |
-
"prompt": "horror-themed {prompt} . eerie, unsettling, dark, spooky, suspenseful, grim, highly detailed",
|
| 382 |
-
"negative_prompt": "cheerful, bright, vibrant, light-hearted, cute"
|
| 383 |
-
},
|
| 384 |
-
{
|
| 385 |
-
"name": "misc-kawaii",
|
| 386 |
-
"prompt": "kawaii style {prompt} . cute, adorable, brightly colored, cheerful, anime influence, highly detailed",
|
| 387 |
-
"negative_prompt": "dark, scary, realistic, monochrome, abstract"
|
| 388 |
-
},
|
| 389 |
-
{
|
| 390 |
-
"name": "misc-lovecraftian",
|
| 391 |
-
"prompt": "lovecraftian horror {prompt} . eldritch, cosmic horror, unknown, mysterious, surreal, highly detailed",
|
| 392 |
-
"negative_prompt": "light-hearted, mundane, familiar, simplistic, realistic"
|
| 393 |
-
},
|
| 394 |
-
{
|
| 395 |
-
"name": "misc-macabre",
|
| 396 |
-
"prompt": "macabre style {prompt} . dark, gothic, grim, haunting, highly detailed",
|
| 397 |
-
"negative_prompt": "bright, cheerful, light-hearted, cartoonish, cute"
|
| 398 |
-
},
|
| 399 |
-
{
|
| 400 |
-
"name": "misc-manga",
|
| 401 |
-
"prompt": "manga style {prompt} . vibrant, high-energy, detailed, iconic, Japanese comic style",
|
| 402 |
-
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, Western comic style"
|
| 403 |
-
},
|
| 404 |
-
{
|
| 405 |
-
"name": "misc-metropolis",
|
| 406 |
-
"prompt": "metropolis-themed {prompt} . urban, cityscape, skyscrapers, modern, futuristic, highly detailed",
|
| 407 |
"negative_prompt": "rural, natural, rustic, historical, simple"
|
| 408 |
},
|
| 409 |
{
|
| 410 |
-
"name": "
|
| 411 |
-
"prompt": "
|
| 412 |
-
"negative_prompt": "ornate, complicated, highly detailed, cluttered, disordered, messy, noisy"
|
| 413 |
-
},
|
| 414 |
-
{
|
| 415 |
-
"name": "misc-monochrome",
|
| 416 |
-
"prompt": "monochrome {prompt} . black and white, contrast, tone, texture, detailed",
|
| 417 |
"negative_prompt": "colorful, vibrant, noisy, blurry, deformed"
|
| 418 |
},
|
| 419 |
{
|
| 420 |
-
"name": "
|
| 421 |
-
"prompt": "
|
| 422 |
-
"negative_prompt": "landlocked, desert, mountains, urban, rustic"
|
| 423 |
-
},
|
| 424 |
-
{
|
| 425 |
-
"name": "misc-space",
|
| 426 |
-
"prompt": "space-themed {prompt} . cosmic, celestial, stars, galaxies, nebulas, planets, science fiction, highly detailed",
|
| 427 |
"negative_prompt": "earthly, mundane, ground-based, realism"
|
| 428 |
},
|
| 429 |
{
|
| 430 |
-
"name": "
|
| 431 |
-
"prompt": "stained glass style {prompt} . vibrant, beautiful, translucent, intricate, detailed",
|
| 432 |
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast, realism, photorealistic"
|
| 433 |
},
|
| 434 |
{
|
| 435 |
-
"name": "
|
| 436 |
-
"prompt": "
|
| 437 |
-
"negative_prompt": "vintage, rural, colorful, low contrast, realism, sketch, watercolor"
|
| 438 |
-
},
|
| 439 |
-
{
|
| 440 |
-
"name": "misc-tribal",
|
| 441 |
-
"prompt": "tribal style {prompt} . indigenous, ethnic, traditional patterns, bold, natural colors, highly detailed",
|
| 442 |
"negative_prompt": "modern, futuristic, minimalist, pastel"
|
| 443 |
},
|
| 444 |
{
|
| 445 |
-
"name": "
|
| 446 |
-
"prompt": "zentangle {prompt} . intricate, abstract, monochrome, patterns, meditative, highly detailed",
|
| 447 |
"negative_prompt": "colorful, representative, simplistic, large fields of color"
|
| 448 |
},
|
| 449 |
{
|
| 450 |
-
"name": "
|
| 451 |
-
"prompt": "
|
| 452 |
-
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast, realism, photorealistic"
|
| 453 |
-
},
|
| 454 |
-
{
|
| 455 |
-
"name": "papercraft-flat papercut",
|
| 456 |
-
"prompt": "flat papercut style {prompt} . silhouette, clean cuts, paper, sharp edges, minimalist, color block",
|
| 457 |
-
"negative_prompt": "3D, high detail, noise, grainy, blurry, painting, drawing, photo, disfigured"
|
| 458 |
-
},
|
| 459 |
-
{
|
| 460 |
-
"name": "papercraft-kirigami",
|
| 461 |
-
"prompt": "kirigami representation of {prompt} . 3D, paper folding, paper cutting, Japanese, intricate, symmetrical, precision, clean lines",
|
| 462 |
"negative_prompt": "painting, drawing, 2D, noisy, blurry, deformed"
|
| 463 |
},
|
| 464 |
{
|
| 465 |
-
"name": "
|
| 466 |
-
"prompt": "paper mache representation of {prompt} . 3D, sculptural, textured, handmade, vibrant, fun",
|
| 467 |
"negative_prompt": "2D, flat, photo, sketch, digital art, deformed, noisy, blurry"
|
| 468 |
},
|
| 469 |
{
|
| 470 |
-
"name": "
|
| 471 |
-
"prompt": "paper quilling art of {prompt} . intricate, delicate, curling, rolling, shaping, coiling, loops, 3D, dimensional, ornamental",
|
| 472 |
"negative_prompt": "photo, painting, drawing, 2D, flat, deformed, noisy, blurry"
|
| 473 |
},
|
|
|
|
| 474 |
{
|
| 475 |
-
"name": "
|
| 476 |
-
"prompt": "papercut
|
| 477 |
-
"negative_prompt": "photo, 3D, realistic, drawing, painting, high detail, disfigured"
|
| 478 |
-
},
|
| 479 |
-
{
|
| 480 |
-
"name": "papercraft-papercut shadow box",
|
| 481 |
-
"prompt": "3D papercut shadow box of {prompt} . layered, dimensional, depth, silhouette, shadow, papercut, handmade, high contrast",
|
| 482 |
"negative_prompt": "painting, drawing, photo, 2D, flat, high detail, blurry, noisy, disfigured"
|
| 483 |
},
|
| 484 |
{
|
| 485 |
-
"name": "
|
| 486 |
-
"prompt": "stacked papercut art of {prompt} . 3D, layered, dimensional, depth, precision cut, stacked layers, papercut, high contrast",
|
| 487 |
"negative_prompt": "2D, flat, noisy, blurry, painting, drawing, photo, deformed"
|
| 488 |
},
|
| 489 |
{
|
| 490 |
-
"name": "
|
| 491 |
-
"prompt": "
|
| 492 |
-
"negative_prompt": "2D, flat, thin paper, low stack, smooth texture, painting, drawing, photo, deformed"
|
| 493 |
-
},
|
| 494 |
-
{
|
| 495 |
-
"name": "photo-alien",
|
| 496 |
-
"prompt": "alien-themed {prompt} . extraterrestrial, cosmic, otherworldly, mysterious, sci-fi, highly detailed",
|
| 497 |
-
"negative_prompt": "earthly, mundane, common, realistic, simple"
|
| 498 |
-
},
|
| 499 |
-
{
|
| 500 |
-
"name": "photo-film noir",
|
| 501 |
-
"prompt": "film noir style {prompt} . monochrome, high contrast, dramatic shadows, 1940s style, mysterious, cinematic",
|
| 502 |
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, vibrant, colorful"
|
| 503 |
},
|
| 504 |
{
|
| 505 |
-
"name": "
|
| 506 |
-
"prompt": "
|
| 507 |
-
"negative_prompt": "flat, low contrast, oversaturated, underexposed, overexposed, blurred, noisy"
|
| 508 |
-
},
|
| 509 |
-
{
|
| 510 |
-
"name": "photo-long exposure",
|
| 511 |
-
"prompt": "long exposure photo of {prompt} . Blurred motion, streaks of light, surreal, dreamy, ghosting effect, highly detailed",
|
| 512 |
-
"negative_prompt": "static, noisy, deformed, shaky, abrupt, flat, low contrast"
|
| 513 |
-
},
|
| 514 |
-
{
|
| 515 |
-
"name": "photo-neon noir",
|
| 516 |
-
"prompt": "neon noir {prompt} . cyberpunk, dark, rainy streets, neon signs, high contrast, low light, vibrant, highly detailed",
|
| 517 |
"negative_prompt": "bright, sunny, daytime, low contrast, black and white, sketch, watercolor"
|
| 518 |
-
},
|
| 519 |
-
{
|
| 520 |
-
"name": "photo-silhouette",
|
| 521 |
-
"prompt": "silhouette style {prompt} . high contrast, minimalistic, black and white, stark, dramatic",
|
| 522 |
-
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast, color, realism, photorealistic"
|
| 523 |
-
},
|
| 524 |
-
{
|
| 525 |
-
"name": "photo-tilt-shift",
|
| 526 |
-
"prompt": "tilt-shift photo of {prompt} . Selective focus, miniature effect, blurred background, highly detailed, vibrant, perspective control",
|
| 527 |
-
"negative_prompt": "blurry, noisy, deformed, flat, low contrast, unrealistic, oversaturated, underexposed"
|
| 528 |
}
|
| 529 |
]
|
| 530 |
|
| 531 |
styles = {k['name']: (k['prompt'], k['negative_prompt']) for k in styles}
|
| 532 |
-
default_style = styles['
|
| 533 |
style_keys = list(styles.keys())
|
| 534 |
|
| 535 |
|
|
@@ -566,6 +222,6 @@ SD_XL_BASE_RATIOS = {
|
|
| 566 |
aspect_ratios = {str(v[0])+'×'+str(v[1]):v for k, v in SD_XL_BASE_RATIOS.items()}
|
| 567 |
|
| 568 |
|
| 569 |
-
def apply_style(style, positive
|
| 570 |
p, n = styles.get(style, default_style)
|
| 571 |
-
return p.replace('{prompt}', positive), n
|
|
|
|
| 2 |
|
| 3 |
styles = [
|
| 4 |
{
|
| 5 |
+
"name": "Cinematic",
|
| 6 |
+
"prompt": "(((christmas card))), cinematic still {prompt} . emotional, harmonious, vignette, highly detailed, high budget, bokeh, cinemascope, moody, epic, gorgeous, film grain, grainy",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
"negative_prompt": "anime, cartoon, graphic, text, painting, crayon, graphite, abstract, glitch, deformed, mutated, ugly, disfigured"
|
| 8 |
},
|
| 9 |
{
|
| 10 |
+
"name": "Anime",
|
| 11 |
+
"prompt": "(((christmas card))), anime artwork {prompt} . anime style, key visual, vibrant, studio anime, highly detailed",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
"negative_prompt": "photo, deformed, black and white, realism, disfigured, low contrast"
|
| 13 |
},
|
| 14 |
{
|
| 15 |
+
"name": "Clay",
|
| 16 |
+
"prompt": "(((christmas card))), play-doh style {prompt} . sculpture, clay art, centered composition, Claymation",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
"negative_prompt": "sloppy, messy, grainy, highly detailed, ultra textured, photo"
|
| 18 |
},
|
| 19 |
{
|
| 20 |
+
"name": "Line art",
|
| 21 |
+
"prompt": "(((christmas card))), line art drawing {prompt} . professional, sleek, modern, minimalist, graphic, line art, vector graphics",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
"negative_prompt": "anime, photorealistic, 35mm film, deformed, glitch, blurry, noisy, off-center, deformed, cross-eyed, closed eyes, bad anatomy, ugly, disfigured, mutated, realism, realistic, impressionism, expressionism, oil, acrylic"
|
| 23 |
},
|
| 24 |
{
|
| 25 |
+
"name": "Low poly",
|
| 26 |
+
"prompt": "(((christmas card))), low-poly style {prompt} . low-poly game art, polygon mesh, jagged, blocky, wireframe edges, centered composition",
|
| 27 |
"negative_prompt": "noisy, sloppy, messy, grainy, highly detailed, ultra textured, photo"
|
| 28 |
},
|
| 29 |
{
|
| 30 |
+
"name": "Origami",
|
| 31 |
+
"prompt": "(((christmas card))), origami style {prompt} . paper art, pleated paper, folded, origami art, pleats, cut and fold, centered composition",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
"negative_prompt": "noisy, sloppy, messy, grainy, highly detailed, ultra textured, photo"
|
| 33 |
},
|
| 34 |
{
|
| 35 |
+
"name": "Poster",
|
| 36 |
+
"prompt": "(((christmas card))), Advertising poster style {prompt} . Professional, modern, product-focused, commercial, eye-catching, highly detailed",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
"negative_prompt": "noisy, blurry, amateurish, sloppy, unattractive"
|
| 38 |
},
|
| 39 |
{
|
| 40 |
+
"name": "Car",
|
| 41 |
+
"prompt": "(((christmas card))), Automotive advertisement style {prompt} . Sleek, dynamic, professional, commercial, vehicle-focused, high-resolution, highly detailed",
|
| 42 |
"negative_prompt": "noisy, blurry, unattractive, sloppy, unprofessional"
|
| 43 |
},
|
| 44 |
{
|
| 45 |
+
"name": "Fashion",
|
| 46 |
+
"prompt": "(((christmas card))), Fashion editorial style {prompt} . High fashion, trendy, stylish, editorial, magazine style, professional, highly detailed",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
"negative_prompt": "outdated, blurry, noisy, unattractive, sloppy"
|
| 48 |
},
|
| 49 |
{
|
| 50 |
+
"name": "Pixel art",
|
| 51 |
+
"prompt": "(((christmas card))), pixel-art {prompt} . low-res, blocky, pixel art style, 8-bit graphics",
|
| 52 |
+
"negative_prompt": "sloppy, messy, blurry, noisy, highly detailed, ultra textured, photo, realistic"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
},
|
| 54 |
{
|
| 55 |
+
"name": "Abstract",
|
| 56 |
+
"prompt": "(((christmas card))), abstract expressionist painting {prompt} . energetic brushwork, bold colors, abstract forms, expressive, emotional",
|
| 57 |
"negative_prompt": "realistic, photorealistic, low contrast, plain, simple, monochrome"
|
| 58 |
},
|
| 59 |
{
|
| 60 |
+
"name": "Graffiti",
|
| 61 |
+
"prompt": "(((christmas card))), graffiti style {prompt} . street art, vibrant, urban, detailed, tag, mural",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast, realism, photorealistic"
|
| 63 |
},
|
| 64 |
{
|
| 65 |
+
"name": "Psychedelic",
|
| 66 |
+
"prompt": "(((christmas card))), psychedelic style {prompt} . vibrant colors, swirling patterns, abstract forms, surreal, trippy",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
"negative_prompt": "monochrome, black and white, low contrast, realistic, photorealistic, plain, simple"
|
| 68 |
},
|
| 69 |
{
|
| 70 |
+
"name": "Steampunk",
|
| 71 |
+
"prompt": "(((christmas card))), steampunk style {prompt} . antique, mechanical, brass and copper tones, gears, intricate, detailed",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
"negative_prompt": "deformed, glitch, noisy, low contrast, anime, photorealistic"
|
| 73 |
},
|
| 74 |
{
|
| 75 |
+
"name": "Watercolor",
|
| 76 |
+
"prompt": "(((christmas card))), watercolor painting {prompt} . vibrant, beautiful, painterly, detailed, textural, artistic",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
"negative_prompt": "anime, photorealistic, 35mm film, deformed, glitch, low contrast, noisy"
|
| 78 |
},
|
| 79 |
{
|
| 80 |
+
"name": "Cyberpunk city",
|
| 81 |
+
"prompt": "(((christmas card))), cyberpunk cityscape {prompt} . neon lights, dark alleys, skyscrapers, futuristic, vibrant colors, high contrast, highly detailed",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
"negative_prompt": "natural, rural, deformed, low contrast, black and white, sketch, watercolor"
|
| 83 |
},
|
| 84 |
{
|
| 85 |
+
"name": "Cyberpunk game",
|
| 86 |
+
"prompt": "(((christmas card))), cyberpunk game style {prompt} . neon, dystopian, futuristic, digital, vibrant, detailed, high contrast, reminiscent of cyberpunk genre video games",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
"negative_prompt": "historical, natural, rustic, low detailed"
|
| 88 |
},
|
| 89 |
{
|
| 90 |
+
"name": "Mario",
|
| 91 |
+
"prompt": "(((christmas card))), Super Mario style {prompt} . vibrant, cute, cartoony, fantasy, playful, reminiscent of Super Mario series",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
"negative_prompt": "realistic, modern, horror, dystopian, violent"
|
| 93 |
},
|
| 94 |
{
|
| 95 |
+
"name": "Minecraft",
|
| 96 |
+
"prompt": "(((christmas card))), Minecraft style {prompt} . blocky, pixelated, vibrant colors, recognizable characters and objects, game assets",
|
| 97 |
"negative_prompt": "smooth, realistic, detailed, photorealistic, noise, blurry, deformed"
|
| 98 |
},
|
| 99 |
{
|
| 100 |
+
"name": "Strategy game",
|
| 101 |
+
"prompt": "(((christmas card))), strategy game style {prompt} . overhead view, detailed map, units, reminiscent of real-time strategy video games",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
"negative_prompt": "first-person view, modern, photorealistic"
|
| 103 |
},
|
| 104 |
{
|
| 105 |
+
"name": "Dystopian",
|
| 106 |
+
"prompt": "(((christmas card))), dystopian style {prompt} . bleak, post-apocalyptic, somber, dramatic, highly detailed",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast, cheerful, optimistic, vibrant, colorful"
|
| 108 |
},
|
| 109 |
{
|
| 110 |
+
"name": "Fairy tale",
|
| 111 |
+
"prompt": "(((christmas card))), fairy tale {prompt} . magical, fantastical, enchanting, storybook style, highly detailed",
|
| 112 |
"negative_prompt": "realistic, modern, ordinary, mundane"
|
| 113 |
},
|
| 114 |
{
|
| 115 |
+
"name": "Gothic",
|
| 116 |
+
"prompt": "(((christmas card))), gothic style {prompt} . dark, mysterious, haunting, dramatic, ornate, detailed",
|
| 117 |
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, cheerful, optimistic"
|
| 118 |
},
|
| 119 |
{
|
| 120 |
+
"name": "Metropolis",
|
| 121 |
+
"prompt": "(((christmas card))), metropolis-themed {prompt} . urban, cityscape, skyscrapers, modern, futuristic, highly detailed",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
"negative_prompt": "rural, natural, rustic, historical, simple"
|
| 123 |
},
|
| 124 |
{
|
| 125 |
+
"name": "Monochrome",
|
| 126 |
+
"prompt": "(((christmas card))), monochrome {prompt} . black and white, contrast, tone, texture, detailed",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 127 |
"negative_prompt": "colorful, vibrant, noisy, blurry, deformed"
|
| 128 |
},
|
| 129 |
{
|
| 130 |
+
"name": "Space",
|
| 131 |
+
"prompt": "(((christmas card))), space-themed {prompt} . cosmic, celestial, stars, galaxies, nebulas, planets, science fiction, highly detailed",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
"negative_prompt": "earthly, mundane, ground-based, realism"
|
| 133 |
},
|
| 134 |
{
|
| 135 |
+
"name": "Stained glass",
|
| 136 |
+
"prompt": "(((christmas card))), stained glass style {prompt} . vibrant, beautiful, translucent, intricate, detailed",
|
| 137 |
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast, realism, photorealistic"
|
| 138 |
},
|
| 139 |
{
|
| 140 |
+
"name": "Tribal",
|
| 141 |
+
"prompt": "(((christmas card))), tribal style {prompt} . indigenous, ethnic, traditional patterns, bold, natural colors, highly detailed",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
"negative_prompt": "modern, futuristic, minimalist, pastel"
|
| 143 |
},
|
| 144 |
{
|
| 145 |
+
"name": "Zentangle",
|
| 146 |
+
"prompt": "(((christmas card))), zentangle {prompt} . intricate, abstract, monochrome, patterns, meditative, highly detailed",
|
| 147 |
"negative_prompt": "colorful, representative, simplistic, large fields of color"
|
| 148 |
},
|
| 149 |
{
|
| 150 |
+
"name": "Kirigami",
|
| 151 |
+
"prompt": "(((christmas card))), kirigami representation of {prompt} . 3D, paper folding, paper cutting, Japanese, intricate, symmetrical, precision, clean lines",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 152 |
"negative_prompt": "painting, drawing, 2D, noisy, blurry, deformed"
|
| 153 |
},
|
| 154 |
{
|
| 155 |
+
"name": "Paper mache",
|
| 156 |
+
"prompt": "(((christmas card))), paper mache representation of {prompt} . 3D, sculptural, textured, handmade, vibrant, fun",
|
| 157 |
"negative_prompt": "2D, flat, photo, sketch, digital art, deformed, noisy, blurry"
|
| 158 |
},
|
| 159 |
{
|
| 160 |
+
"name": "Paper quilling",
|
| 161 |
+
"prompt": "(((christmas card))), paper quilling art of {prompt} . intricate, delicate, curling, rolling, shaping, coiling, loops, 3D, dimensional, ornamental",
|
| 162 |
"negative_prompt": "photo, painting, drawing, 2D, flat, deformed, noisy, blurry"
|
| 163 |
},
|
| 164 |
+
|
| 165 |
{
|
| 166 |
+
"name": "Papercut shadow box",
|
| 167 |
+
"prompt": "(((christmas card))), 3D papercut shadow box of {prompt} . layered, dimensional, depth, silhouette, shadow, papercut, handmade, high contrast",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
"negative_prompt": "painting, drawing, photo, 2D, flat, high detail, blurry, noisy, disfigured"
|
| 169 |
},
|
| 170 |
{
|
| 171 |
+
"name": "Stacked papercut",
|
| 172 |
+
"prompt": "(((christmas card))), stacked papercut art of {prompt} . 3D, layered, dimensional, depth, precision cut, stacked layers, papercut, high contrast",
|
| 173 |
"negative_prompt": "2D, flat, noisy, blurry, painting, drawing, photo, deformed"
|
| 174 |
},
|
| 175 |
{
|
| 176 |
+
"name": "Film noir",
|
| 177 |
+
"prompt": "(((christmas card))), film noir style {prompt} . monochrome, high contrast, dramatic shadows, 1940s style, mysterious, cinematic",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 178 |
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, vibrant, colorful"
|
| 179 |
},
|
| 180 |
{
|
| 181 |
+
"name": "Neon noir",
|
| 182 |
+
"prompt": "(((christmas card))), neon noir {prompt} . cyberpunk, dark, rainy streets, neon signs, high contrast, low light, vibrant, highly detailed",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 183 |
"negative_prompt": "bright, sunny, daytime, low contrast, black and white, sketch, watercolor"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 184 |
}
|
| 185 |
]
|
| 186 |
|
| 187 |
styles = {k['name']: (k['prompt'], k['negative_prompt']) for k in styles}
|
| 188 |
+
default_style = styles['Cinematic']
|
| 189 |
style_keys = list(styles.keys())
|
| 190 |
|
| 191 |
|
|
|
|
| 222 |
aspect_ratios = {str(v[0])+'×'+str(v[1]):v for k, v in SD_XL_BASE_RATIOS.items()}
|
| 223 |
|
| 224 |
|
| 225 |
+
def apply_style(style, positive):
|
| 226 |
p, n = styles.get(style, default_style)
|
| 227 |
+
return p.replace('{prompt}', positive), n
|
webui.py
CHANGED
|
@@ -10,16 +10,18 @@ import modules.async_worker as worker
|
|
| 10 |
|
| 11 |
from modules.sdxl_styles import style_keys, aspect_ratios
|
| 12 |
|
| 13 |
-
|
| 14 |
-
def generate_clicked(*args):
|
| 15 |
yield gr.update(interactive=False), \
|
| 16 |
-
gr.update(visible=True, value=modules.html.make_progress_html(1,
|
| 17 |
-
gr.update(
|
| 18 |
-
gr.update(visible=False)
|
| 19 |
|
| 20 |
-
worker.
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
| 22 |
|
|
|
|
| 23 |
while not finished:
|
| 24 |
time.sleep(0.01)
|
| 25 |
if len(worker.outputs) > 0:
|
|
@@ -27,96 +29,37 @@ def generate_clicked(*args):
|
|
| 27 |
if flag == 'preview':
|
| 28 |
percentage, title, image = product
|
| 29 |
yield gr.update(interactive=False), \
|
| 30 |
-
gr.update(
|
| 31 |
-
gr.update(
|
| 32 |
-
gr.update(visible=False)
|
| 33 |
if flag == 'results':
|
|
|
|
| 34 |
yield gr.update(interactive=True), \
|
| 35 |
gr.update(visible=False), \
|
| 36 |
-
gr.update(
|
| 37 |
-
gr.update(visible=True, value=product)
|
| 38 |
finished = True
|
| 39 |
return
|
| 40 |
|
| 41 |
|
| 42 |
-
shared.gradio_root = gr.Blocks(title='
|
| 43 |
with shared.gradio_root:
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
def random_checked(r):
|
| 67 |
-
return gr.update(visible=not r)
|
| 68 |
-
|
| 69 |
-
def refresh_seed(r, s):
|
| 70 |
-
if r:
|
| 71 |
-
return random.randint(1, 1024*1024*1024)
|
| 72 |
-
else:
|
| 73 |
-
return s
|
| 74 |
-
|
| 75 |
-
seed_random.change(random_checked, inputs=[seed_random], outputs=[image_seed])
|
| 76 |
-
|
| 77 |
-
with gr.Tab(label='Style'):
|
| 78 |
-
style_selction = gr.Radio(show_label=False, container=True,
|
| 79 |
-
choices=style_keys, value='cinematic-default')
|
| 80 |
-
with gr.Tab(label='Advanced'):
|
| 81 |
-
with gr.Row():
|
| 82 |
-
base_model = gr.Dropdown(label='SDXL Base Model', choices=modules.path.model_filenames, value=modules.path.default_base_model_name, show_label=True)
|
| 83 |
-
refiner_model = gr.Dropdown(label='SDXL Refiner', choices=['None'] + modules.path.model_filenames, value=modules.path.default_refiner_model_name, show_label=True)
|
| 84 |
-
with gr.Accordion(label='LoRAs', open=True):
|
| 85 |
-
lora_ctrls = []
|
| 86 |
-
for i in range(5):
|
| 87 |
-
with gr.Row():
|
| 88 |
-
lora_model = gr.Dropdown(label=f'SDXL LoRA {i+1}', choices=['None'] + modules.path.lora_filenames, value=modules.path.default_lora_name if i == 0 else 'None')
|
| 89 |
-
lora_weight = gr.Slider(label='Weight', minimum=-2, maximum=2, step=0.01, value=modules.path.default_lora_weight)
|
| 90 |
-
lora_ctrls += [lora_model, lora_weight]
|
| 91 |
-
with gr.Row():
|
| 92 |
-
model_refresh = gr.Button(label='Refresh', value='\U0001f504 Refresh All Files', variant='secondary', elem_classes='refresh_button')
|
| 93 |
-
with gr.Accordion(label='Advanced', open=False):
|
| 94 |
-
sharpness = gr.Slider(label='Sampling Sharpness', minimum=0.0, maximum=40.0, step=0.01, value=2.0)
|
| 95 |
-
gr.HTML('<a href="https://github.com/lllyasviel/Fooocus/discussions/117">\U0001F4D4 Document</a>')
|
| 96 |
-
|
| 97 |
-
def model_refresh_clicked():
|
| 98 |
-
modules.path.update_all_model_names()
|
| 99 |
-
results = []
|
| 100 |
-
results += [gr.update(choices=modules.path.model_filenames), gr.update(choices=['None'] + modules.path.model_filenames)]
|
| 101 |
-
for i in range(5):
|
| 102 |
-
results += [gr.update(choices=['None'] + modules.path.lora_filenames), gr.update()]
|
| 103 |
-
return results
|
| 104 |
-
|
| 105 |
-
model_refresh.click(model_refresh_clicked, [], [base_model, refiner_model] + lora_ctrls)
|
| 106 |
-
|
| 107 |
-
advanced_checkbox.change(lambda x: gr.update(visible=x), advanced_checkbox, right_col)
|
| 108 |
-
ctrls = [
|
| 109 |
-
prompt, negative_prompt, style_selction,
|
| 110 |
-
performance_selction, aspect_ratios_selction, image_number, image_seed, sharpness
|
| 111 |
-
]
|
| 112 |
-
ctrls += [base_model, refiner_model] + lora_ctrls
|
| 113 |
-
run_button.click(fn=refresh_seed, inputs=[seed_random, image_seed], outputs=image_seed)\
|
| 114 |
-
.then(fn=generate_clicked, inputs=ctrls, outputs=[run_button, progress_html, progress_window, gallery])
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
parser = argparse.ArgumentParser()
|
| 118 |
-
parser.add_argument("--port", type=int, default=None, help="Set the listen port.")
|
| 119 |
-
parser.add_argument("--share", action='store_true', help="Set whether to share on Gradio.")
|
| 120 |
-
parser.add_argument("--listen", type=str, default=None, metavar="IP", nargs="?", const="0.0.0.0", help="Set the listen interface.")
|
| 121 |
-
args = parser.parse_args()
|
| 122 |
-
shared.gradio_root.launch(inbrowser=True, server_name=args.listen, server_port=args.port, share=args.share)
|
|
|
|
| 10 |
|
| 11 |
from modules.sdxl_styles import style_keys, aspect_ratios
|
| 12 |
|
| 13 |
+
def generate(*args):
|
|
|
|
| 14 |
yield gr.update(interactive=False), \
|
| 15 |
+
gr.update(visible=True, value=modules.html.make_progress_html(1, "0/30")), \
|
| 16 |
+
gr.update()
|
|
|
|
| 17 |
|
| 18 |
+
while worker.is_working:
|
| 19 |
+
time.sleep(0.1)
|
| 20 |
+
|
| 21 |
+
worker.buffer=[list(args)]
|
| 22 |
+
worker.outputs = []
|
| 23 |
|
| 24 |
+
finished=False
|
| 25 |
while not finished:
|
| 26 |
time.sleep(0.01)
|
| 27 |
if len(worker.outputs) > 0:
|
|
|
|
| 29 |
if flag == 'preview':
|
| 30 |
percentage, title, image = product
|
| 31 |
yield gr.update(interactive=False), \
|
| 32 |
+
gr.update(value=modules.html.make_progress_html(percentage, title)), \
|
| 33 |
+
gr.update(value=image) if image is not None else gr.update()
|
|
|
|
| 34 |
if flag == 'results':
|
| 35 |
+
image = product[0]
|
| 36 |
yield gr.update(interactive=True), \
|
| 37 |
gr.update(visible=False), \
|
| 38 |
+
gr.update(value=image)
|
|
|
|
| 39 |
finished = True
|
| 40 |
return
|
| 41 |
|
| 42 |
|
| 43 |
+
shared.gradio_root = gr.Blocks(title='QualityMinds AI Christmas Card Maker', css=modules.html.css)
|
| 44 |
with shared.gradio_root:
|
| 45 |
+
gr.Markdown(
|
| 46 |
+
"""
|
| 47 |
+
# QualityMinds AI Christmas Card Maker
|
| 48 |
+
Type a promt and click generate. Try our examples and different styles.
|
| 49 |
+
""")
|
| 50 |
+
with gr.Row(elem_classes='type_row'):
|
| 51 |
+
with gr.Column(scale=0.7):
|
| 52 |
+
prompt = gr.Textbox(label="Prompt", value="", placeholder="What's on your christmas card?", autofocus=True, elem_classes='type_row', lines=2)
|
| 53 |
+
with gr.Column(scale=0.15, min_width="120px"):
|
| 54 |
+
style_selection = gr.Dropdown(label='Style', choices=style_keys, value='Cinematic', elem_classes="stylebox")
|
| 55 |
+
with gr.Column(scale=0.15, min_width="120px"):
|
| 56 |
+
run_button = gr.Button(label="Generate", value="Generate", variant='primary', elem_classes='generate_button')
|
| 57 |
+
progress_html = gr.HTML(visible=False, elem_id='progress-bar', elem_classes='progress-bar')
|
| 58 |
+
gr.Examples(examples=["Santa Claus with his sack full of gifts", "Scenic winter village inside a snow globe", \
|
| 59 |
+
"Cute penguins wrapped up in scarves and hats", "Snowy trees and a reindeer"], inputs=[prompt], cache_examples=False)
|
| 60 |
+
generated_image = gr.Image(show_label=False, width=1280, value="resources/init.png", show_share_button=True )
|
| 61 |
+
|
| 62 |
+
run_button.click(fn=generate, inputs=[prompt, style_selection], outputs=[run_button, progress_html, generated_image])
|
| 63 |
+
|
| 64 |
+
shared.gradio_root.queue(concurrency_count=1, api_open=False)
|
| 65 |
+
shared.gradio_root.launch(server_name="0.0.0.0", show_api=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|