Spaces:
Running
on
Zero
Running
on
Zero
Improve example prompts
Browse files- DOCS.md +4 -4
- app.py +9 -10
- data/prompts.json +23 -46
- lib/__init__.py +2 -0
- lib/config.py +1 -1
- lib/utils.py +3 -2
DOCS.md
CHANGED
@@ -4,7 +4,7 @@ TL;DR: Enter a prompt or roll the `🎲` and press `Generate`.
|
|
4 |
|
5 |
### Prompting
|
6 |
|
7 |
-
Positive and negative prompts are embedded by [Compel](https://github.com/damian0815/compel)
|
8 |
|
9 |
#### Weighting
|
10 |
|
@@ -16,13 +16,13 @@ Groups of tokens can be weighted together by wrapping in parentheses and multipl
|
|
16 |
|
17 |
Some require specific parameters to get the best results, so check the model's link for more information:
|
18 |
|
19 |
-
* [Lykon/dreamshaper-8](https://huggingface.co/Lykon/dreamshaper-8)(default)
|
20 |
* [cyberdelia/CyberRealistic_V5](https://huggingface.co/cyberdelia/CyberRealistic)
|
21 |
* [fluently/Fluently-v4](https://huggingface.co/fluently/Fluently-v4)
|
|
|
22 |
* [s6yx/ReV_Animated](https://huggingface.co/s6yx/ReV_Animated)
|
23 |
* [SG161222/Realistic_Vision_V5](https://huggingface.co/SG161222/Realistic_Vision_V5.1_noVAE)
|
24 |
* [stable-diffusion-v1-5/stable-diffusion-v1-5](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5)
|
25 |
-
* [XpucT/Deliberate_v6](https://huggingface.co/XpucT/Deliberate)
|
26 |
* [XpucT/Reliberate_v3](https://huggingface.co/XpucT/Reliberate)
|
27 |
|
28 |
### Scale
|
@@ -55,7 +55,7 @@ For capturing faces, enable `IP-Adapter Face` to use the full-face model. You sh
|
|
55 |
|
56 |
#### Textual Inversion
|
57 |
|
58 |
-
Add `<fast_negative>` anywhere in your negative prompt to apply the [
|
59 |
|
60 |
#### DeepCache
|
61 |
|
|
|
4 |
|
5 |
### Prompting
|
6 |
|
7 |
+
Positive and negative prompts are embedded by [Compel](https://github.com/damian0815/compel). See [syntax features](https://github.com/damian0815/compel/blob/main/doc/syntax.md) to learn more.
|
8 |
|
9 |
#### Weighting
|
10 |
|
|
|
16 |
|
17 |
Some require specific parameters to get the best results, so check the model's link for more information:
|
18 |
|
|
|
19 |
* [cyberdelia/CyberRealistic_V5](https://huggingface.co/cyberdelia/CyberRealistic)
|
20 |
* [fluently/Fluently-v4](https://huggingface.co/fluently/Fluently-v4)
|
21 |
+
* [Lykon/dreamshaper-8](https://huggingface.co/Lykon/dreamshaper-8)
|
22 |
* [s6yx/ReV_Animated](https://huggingface.co/s6yx/ReV_Animated)
|
23 |
* [SG161222/Realistic_Vision_V5](https://huggingface.co/SG161222/Realistic_Vision_V5.1_noVAE)
|
24 |
* [stable-diffusion-v1-5/stable-diffusion-v1-5](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5)
|
25 |
+
* [XpucT/Deliberate_v6](https://huggingface.co/XpucT/Deliberate) (default)
|
26 |
* [XpucT/Reliberate_v3](https://huggingface.co/XpucT/Reliberate)
|
27 |
|
28 |
### Scale
|
|
|
55 |
|
56 |
#### Textual Inversion
|
57 |
|
58 |
+
Add `<fast_negative>` anywhere in your negative prompt to apply the [FastNegative v2](https://civitai.com/models/71961?modelVersionId=94057) textual inversion embedding. Read [An Image is Worth One Word](https://huggingface.co/papers/2208.01618) to learn more.
|
59 |
|
60 |
#### DeepCache
|
61 |
|
app.py
CHANGED
@@ -1,6 +1,4 @@
|
|
1 |
import argparse
|
2 |
-
import json
|
3 |
-
import random
|
4 |
|
5 |
import gradio as gr
|
6 |
|
@@ -11,6 +9,7 @@ from lib import (
|
|
11 |
download_repo_files,
|
12 |
generate,
|
13 |
read_file,
|
|
|
14 |
)
|
15 |
|
16 |
# Update refresh button hover text
|
@@ -41,7 +40,6 @@ aspect_ratio_js = """
|
|
41 |
}
|
42 |
"""
|
43 |
|
44 |
-
|
45 |
# Show "Custom" aspect ratio when manually changing width or height, or one of the predefined ones
|
46 |
custom_aspect_ratio_js = """
|
47 |
(w, h) => {
|
@@ -54,12 +52,13 @@ custom_aspect_ratio_js = """
|
|
54 |
}
|
55 |
"""
|
56 |
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
|
|
63 |
|
64 |
|
65 |
# Transform the raw inputs before generation
|
@@ -356,7 +355,7 @@ with gr.Blocks(
|
|
356 |
gr.Markdown(read_file("DOCS.md"))
|
357 |
|
358 |
# Random prompt on click
|
359 |
-
random_btn.click(
|
360 |
|
361 |
# Update seed on click
|
362 |
refresh_btn.click(None, inputs=[], outputs=[seed], js=refresh_seed_js)
|
|
|
1 |
import argparse
|
|
|
|
|
2 |
|
3 |
import gradio as gr
|
4 |
|
|
|
9 |
download_repo_files,
|
10 |
generate,
|
11 |
read_file,
|
12 |
+
read_json,
|
13 |
)
|
14 |
|
15 |
# Update refresh button hover text
|
|
|
40 |
}
|
41 |
"""
|
42 |
|
|
|
43 |
# Show "Custom" aspect ratio when manually changing width or height, or one of the predefined ones
|
44 |
custom_aspect_ratio_js = """
|
45 |
(w, h) => {
|
|
|
52 |
}
|
53 |
"""
|
54 |
|
55 |
+
random_prompt_js = f"""
|
56 |
+
(prompt) => {{
|
57 |
+
const prompts = {read_json("data/prompts.json")};
|
58 |
+
const filtered = prompts.filter(p => p !== prompt);
|
59 |
+
return filtered[Math.floor(Math.random() * filtered.length)];
|
60 |
+
}}
|
61 |
+
"""
|
62 |
|
63 |
|
64 |
# Transform the raw inputs before generation
|
|
|
355 |
gr.Markdown(read_file("DOCS.md"))
|
356 |
|
357 |
# Random prompt on click
|
358 |
+
random_btn.click(None, inputs=[prompt], outputs=[prompt], js=random_prompt_js)
|
359 |
|
360 |
# Update seed on click
|
361 |
refresh_btn.click(None, inputs=[], outputs=[seed], js=refresh_seed_js)
|
data/prompts.json
CHANGED
@@ -1,48 +1,25 @@
|
|
1 |
[
|
2 |
-
"
|
3 |
-
"
|
4 |
-
"
|
5 |
-
"
|
6 |
-
|
7 |
-
"
|
8 |
-
"
|
9 |
-
"
|
10 |
-
"
|
11 |
-
"
|
12 |
-
|
13 |
-
"
|
14 |
-
"
|
15 |
-
|
16 |
-
"
|
17 |
-
"
|
18 |
-
"
|
19 |
-
"
|
20 |
-
"tranquil
|
21 |
-
"
|
22 |
-
"
|
23 |
-
"
|
24 |
-
"
|
25 |
-
"beautiful Santorini island, iconic white buildings, pristine beach, Mediterranean, charming, romantic",
|
26 |
-
"breathtaking Grand Canyon, vast, awe-inspiring, otherworldly, iconic, historic landmark",
|
27 |
-
"breathtaking Machu Picchu, set against a backdrop of towering mountains, iconic, historic landmark",
|
28 |
-
"iconic New York City skyline, with towering skyscrapers, golden-hour lighting, dramatic, atmospheric",
|
29 |
-
"iconic Great Wall of China, stretching along the countryside, historic landmark",
|
30 |
-
"iconic Sydney Opera House, with the harbor and cityscape in the background, stunning, historic landmark",
|
31 |
-
"iconic Taj Mahal, set against a backdrop of lush greenery, stunning, historic landmark",
|
32 |
-
"bowl of steaming hot ramen with a sliced egg, thin slices of meat, green onions, noodles, chopsticks, solo, minimal",
|
33 |
-
"large pizza with melted cheese, seared pepperoni, crispy crust, solo, minimal",
|
34 |
-
"sizzling hot sirloin steak with a perfect crust, seared to perfection, served with a side of roasted vegetables and mashed potatoes, solo, minimal",
|
35 |
-
"wedding cake, white frosting, colorful accent flowers, fresh berry garnish, tiers, layers, elegant, minimal",
|
36 |
-
"baked salmon fillet with a perfectly crispy skin and flaky flesh, side of steamed vegetables and quinoa, healthy, fresh, solo, minimal",
|
37 |
-
"steaming bowl of hearty chili with tender chunks of beef, rich tomato sauce, topped with grated cheddar cheese and green onions, solo, minimal",
|
38 |
-
"platter of sushi rolls, tuna, salmon, california maki, rainbow, colorful, beautiful arrangement, solo, minimal",
|
39 |
-
"stuffed bell pepper filled with browned ground beef, rice, melted cheese, parsley garnish, solo, minimal",
|
40 |
-
"pair of tacos filled with shredded chicken, red onions, cilantro, a drizzle of cream, white plate, blue tablecloth, solo, minimal",
|
41 |
-
"contemporary living room, floor-to-ceiling windows, neutral color palette, minimalistic design, modern furniture, wall-mounted television, ceiling fan, recessed lighting, open floor plan",
|
42 |
-
"rustic kitchen with reclaimed wood cabinetry, large farmhouse sink, industrial lighting fixtures, open shelving, cast iron cookware, exposed brick wall",
|
43 |
-
"luxurious bathroom with freestanding bathtub, marble tiles, brass fixtures, double-sink floating vanity, spa-like atmosphere",
|
44 |
-
"cozy bedroom with a four-poster bed, decorative throw pillows, plush bedding, single large window with natural light, statement wallpaper, relaxing atmosphere",
|
45 |
-
"formula one race car, aerodynamic design, captured in a high speed motion blur, shallow depth-of-field, dramatic lighting, epic, intense",
|
46 |
-
"luxury supercar with aerodynamic curves, high-key lighting, depth-of-field, exotic",
|
47 |
-
"stunning yacht with sleek lines, golden-hour lighting, depth-of-field, breathtaking"
|
48 |
]
|
|
|
1 |
[
|
2 |
+
"portrait of a blonde woman, detailed facial features, soft natural lighting, bokeh, professional photography, breathtaking, masterpiece, highly detailed, best quality, sharp focus, 8k, uhd",
|
3 |
+
"portrait of a young adult woman, freckled complexion, vibrant red hair, smiling, under tree, golden hour lighting, professional photography, breathtaking, masterpiece, highly detailed, best quality, sharp focus, 8k, uhd",
|
4 |
+
"portrait of an elderly woman, weathered features, gentle smile, natural window lighting, professional photography, breathtaking, masterpiece, highly detailed, best quality, sharp focus, 8k, uhd",
|
5 |
+
"headshot of a middle-aged man, salt and pepper hair, confident expression, studio lighting, neutral backdrop, professional photography, breathtaking, masterpiece, highly detailed, best quality, sharp focus, 8k, uhd",
|
6 |
+
|
7 |
+
"portrait of a majestic Norwegian forest cat, soft fur detail, green eyes, natural lighting, professional photography, breathtaking, masterpiece, highly detailed, best quality, sharp focus, 8k, uhd",
|
8 |
+
"portrait of a British shorthair cat, yellow eyes, gentle expression, soft lighting, bokeh, professional photography, breathtaking, masterpiece, highly detailed, best quality, sharp focus, 8k, uhd",
|
9 |
+
"adorable Siamese kitten, blue eyes, soft natural lighting, shallow depth of field, professional photography, breathtaking, masterpiece, highly detailed, best quality, sharp focus, 8k, uhd",
|
10 |
+
"portrait of a regal German shepherd, alert ears, noble expression, natural background, golden hour lighting, bokeh, professional photography, breathtaking, masterpiece, highly detailed, best quality, sharp focus, 8k, uhd",
|
11 |
+
"Welsh corgi in a colorful garden, cheerful expression, daylight, shallow depth of field, professional photography, breathtaking, masterpiece, highly detailed, best quality, sharp focus, 8k, uhd",
|
12 |
+
|
13 |
+
"Porsche 911 Turbo (991), front 3/4 view, motion blur, dramatic lighting, professional photography, breathtaking, masterpiece, highly detailed, best quality, sharp focus, 8k, uhd",
|
14 |
+
"BMW E92 M3 on mountain road, side profile, motion blur, daylight, professional photography, breathtaking, masterpiece, highly detailed, best quality, sharp focus, 8k, uhd",
|
15 |
+
|
16 |
+
"tropical beach at sunset, light sand, azure water, swaying palm trees, scattered clouds, distant volcano, ultra wide angle lens, HDR photography, breathtaking, masterpiece, highly detailed, best quality, sharp focus, 8k, uhd",
|
17 |
+
"lighthouse on rocky coast at dawn, crashing waves, pastel sky, cumulus clouds, soft morning light, HDR photography, breathtaking, masterpiece, highly detailed, best quality, sharp focus, 8k, uhd",
|
18 |
+
"California vineyard at sunset, rows of grapevines stretching to horizon, golden hour lighting, rolling hills, scattered oak trees, ultra wide angle lens, HDR photography, breathtaking, masterpiece, highly detailed, best quality, sharp focus, 8k, uhd",
|
19 |
+
"mountain stream in autumn, moss-covered rocks, fallen maple leaves, dappled sunlight through canopy, HDR photography, breathtaking, masterpiece, highly detailed, best quality, sharp focus, 8k, uhd",
|
20 |
+
"tranquil alpine lake at night, snow-capped mountain range in distance, scattered evergreens along shoreline, aurora borealis in sky, HDR photography, breathtaking, masterpiece, highly detailed, best quality, sharp focus, 8k, uhd",
|
21 |
+
"desert ranch house at dusk, saguaro cactus, purple mountain backdrop, last rays of sunlight, HDR photography, breathtaking, masterpiece, highly detailed, best quality, sharp focus, 8k, uhd",
|
22 |
+
"Japanese pagoda between cherry blossom trees, misty mountain backdrop, golden hour lighting, HDR photography, breathtaking, masterpiece, highly detailed, best quality, sharp focus, 8k, uhd",
|
23 |
+
"red Dutch barn, colorful tulip rows in front, low evening sun, scattered clouds, HDR photography, breathtaking, masterpiece, highly detailed, best quality, sharp focus, 8k, uhd",
|
24 |
+
"lavender field in Provence, ancient stone farmhouse, sunset lighting, scattered clouds, distant mountains, HDR photography, breathtaking, masterpiece, highly detailed, best quality, sharp focus, 8k, uhd"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
]
|
lib/__init__.py
CHANGED
@@ -5,6 +5,7 @@ from .utils import (
|
|
5 |
disable_progress_bars,
|
6 |
download_repo_files,
|
7 |
read_file,
|
|
|
8 |
)
|
9 |
|
10 |
__all__ = [
|
@@ -14,4 +15,5 @@ __all__ = [
|
|
14 |
"download_repo_files",
|
15 |
"generate",
|
16 |
"read_file",
|
|
|
17 |
]
|
|
|
5 |
disable_progress_bars,
|
6 |
download_repo_files,
|
7 |
read_file,
|
8 |
+
read_json,
|
9 |
)
|
10 |
|
11 |
__all__ = [
|
|
|
15 |
"download_repo_files",
|
16 |
"generate",
|
17 |
"read_file",
|
18 |
+
"read_json",
|
19 |
]
|
lib/config.py
CHANGED
@@ -86,7 +86,7 @@ Config = SimpleNamespace(
|
|
86 |
"controlnet_txt2img": CustomStableDiffusionControlNetPipeline,
|
87 |
"controlnet_img2img": CustomStableDiffusionControlNetImg2ImgPipeline,
|
88 |
},
|
89 |
-
MODEL="
|
90 |
MODELS=[
|
91 |
"cyberdelia/CyberRealistic",
|
92 |
"fluently/Fluently-v4",
|
|
|
86 |
"controlnet_txt2img": CustomStableDiffusionControlNetPipeline,
|
87 |
"controlnet_img2img": CustomStableDiffusionControlNetImg2ImgPipeline,
|
88 |
},
|
89 |
+
MODEL="XpucT/Deliberate",
|
90 |
MODELS=[
|
91 |
"cyberdelia/CyberRealistic",
|
92 |
"fluently/Fluently-v4",
|
lib/utils.py
CHANGED
@@ -38,9 +38,10 @@ def timer(message="Operation", logger=print):
|
|
38 |
|
39 |
|
40 |
@functools.lru_cache()
|
41 |
-
def
|
42 |
with open(path, "r", encoding="utf-8") as file:
|
43 |
-
|
|
|
44 |
|
45 |
|
46 |
@functools.lru_cache()
|
|
|
38 |
|
39 |
|
40 |
@functools.lru_cache()
|
41 |
+
def read_json(path: str) -> dict:
|
42 |
with open(path, "r", encoding="utf-8") as file:
|
43 |
+
data = json.load(file)
|
44 |
+
return json.dumps(data, indent=4)
|
45 |
|
46 |
|
47 |
@functools.lru_cache()
|