adamelliotfields commited on
Commit
80a3408
·
verified ·
1 Parent(s): ca2f5d2

Improve example prompts

Browse files
Files changed (6) hide show
  1. DOCS.md +4 -4
  2. app.py +9 -10
  3. data/prompts.json +23 -46
  4. lib/__init__.py +2 -0
  5. lib/config.py +1 -1
  6. 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) for weighting. See [syntax features](https://github.com/damian0815/compel/blob/main/doc/syntax.md) to learn more.
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 [`fast_negative`](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
 
 
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
- # Random prompt function
59
- async def random_fn():
60
- prompts = read_file("data/prompts.json")
61
- prompts = json.loads(prompts)
62
- return gr.Textbox(value=random.choice(prompts))
 
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(random_fn, inputs=[], outputs=[prompt], show_api=False)
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
- "stunning sunset over a futuristic city, with towering skyscrapers, dramatic clouds, golden-hour lighting, atmospheric",
3
- "epic dragon perched atop a cliff, detailed claws, fiery landscape, plumes of smoke",
4
- "serene beach with crystal clear water and white sand, tropical palm trees swaying in the breeze, paradise",
5
- "post-apocalyptic wasteland with rusted and abandoned vehicles, dust storms and towering dust clouds in the distance, dark, gritty, dramatic",
6
- "mysterious underwater world with vibrant coral and a school of colorful fish, sun beams shining through the water, magical, enchanting, otherworldly",
7
- "snowy winter wonderland with a lone cabin in the distance, surrounded by frosty trees and fresh snowfall, peaceful, serene",
8
- "mysterious and abandoned temple in the jungle, surrounded by lush vegetation and tall trees, ancient, atmospheric",
9
- "vibrant and bustling city street, busy traffic, bright lights, fast-paced, intense",
10
- "gothic cathedral on a stormy night, lightning illuminating the sky, rain pouring down, epic, dramatic, atmospheric",
11
- "fantasy castle on a hilltop, surrounded by rolling hills, breathtaking sunset, magical, enchanting, charming, romantic",
12
- "vast desert with sand dunes, a lone oasis in the distance, hot sun, blue sky, peaceful, serene",
13
- "beautiful waterfall in a lush jungle, sunlight shining through the trees, tropical, peaceful, serene",
14
- "enchanted forest with a babbling brook, glowing fireflies, towering trees, shrouded in mist, magical, ethereal, dreamlike, fantasy",
15
- "volcanic island with a boiling crater, clouds of ash rise from the peak, intense, dramatic, atmospheric",
16
- "lonely lighthouse on a rocky cliff overlooking the sea, stormy sky, crashing waves, ominous, intense, dramatic, atmospheric",
17
- "mysterious underground cave with glowing crystals, underground stream, dark, mysterious, otherworldly",
18
- "glowing aurora borealis over a frozen lake, with towering mountains in the distance, ethereal, magical, peaceful, serene",
19
- "vibrant flower field in the spring, surrounded by rolling hills, brilliant blue sky, full-bloom, colorful, peaceful, serene",
20
- "tranquil pond surrounded by tall trees, with a beautiful lily pad garden and calm reflection of the sky, peaceful, serene",
21
- "stunning sunset over an ocean horizon, orange and pink hues spread across the sky, peaceful, serene",
22
- "abandoned temple in a mountain range, surrounded by misty clouds and tall peaks, mysterious, ancient",
23
- "steam locomotive in a snowy mountain range, surrounded by tall peaks, frosted trees, nostalgic",
24
- "radiant nebula, star clusters and gas clouds shining brightly, celestial, otherworldly, abstract, space art",
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="Lykon/dreamshaper-8",
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 load_json(path: str) -> dict:
42
  with open(path, "r", encoding="utf-8") as file:
43
- return json.load(file)
 
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()