Aarifkhan Falco-TK commited on
Commit
210d396
1 Parent(s): 5c5993b

Update app.py (#1)

Browse files

- Update app.py (e219337a866fd2fa2178190f891d19c19a82574e)


Co-authored-by: Tokai Falco <Falco-TK@users.noreply.huggingface.co>

Files changed (1) hide show
  1. app.py +41 -7
app.py CHANGED
@@ -19,14 +19,48 @@ def generate_txt2img(prompt, is_negative=False, image_style="None style", steps=
19
  }
20
 
21
  if image_style == "Cinematic":
22
- base_payload["inputs"] += ", realistic, detailed, textured, skin, hair, eyes, by Alex Huguet, Mike Hill, Ian Spriggs, JaeCheol Park, Marek Denko"
23
- base_payload["is_negative"] += ", abstract, cartoon, stylized"
 
 
 
 
24
  elif image_style == "Digital Art":
25
- base_payload["inputs"] += ", faded , vintage , nostalgic , by Jose Villa , Elizabeth Messina , Ryan Brenizer , Jonas Peterson , Jasmine Star"
26
- base_payload["is_negative"] += ", sharp , modern , bright"
 
 
 
 
27
  elif image_style == "Portrait":
28
- base_payload["inputs"] += ", soft light, sharp, exposure blend, medium shot, bokeh, (hdr:1.4), high contrast, (cinematic, teal and orange:0.85), (muted colors, dim colors, soothing tones:1.3), low saturation, (hyperdetailed:1.2), (noir:0.4), (natural skin texture, hyperrealism, soft light, sharp:1.2)"
29
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  image_bytes = requests.post(API_URL, headers=headers, json=base_payload).content
31
  image = Image.open(io.BytesIO(image_bytes))
32
  return image
@@ -121,7 +155,7 @@ with gr.Blocks(css=css) as demo:
121
  gr.Markdown("<h4>Advanced Settings</h4>")
122
  with gr.Accordion("Advanced Customizations", open=False):
123
  negative_prompt = gr.Textbox(label="Negative Prompt (Optional)", placeholder="Example: blurry, unfocused", lines=2)
124
- image_style = gr.Dropdown(label="Select Style", choices=["None style", "Cinematic", "Digital Art", "Portrait"], value="None style")
125
 
126
  with gr.Row():
127
  image_output = gr.Image(type="pil", label="Output Image")
 
19
  }
20
 
21
  if image_style == "Cinematic":
22
+ payload[
23
+ "inputs"
24
+ ] += ", realistic, detailed, textured, skin, hair, eyes, by Alex Huguet, Mike Hill, Ian Spriggs, JaeCheol Park, Marek Denko"
25
+ payload[
26
+ "is_negative"
27
+ ] += ", anime, cartoon, graphic, text, painting, crayon, graphite, abstract, glitch, deformed, mutated, ugly, disfigured"
28
  elif image_style == "Digital Art":
29
+ payload[
30
+ "inputs"
31
+ ] += ", faded, vintage, nostalgic, by Jose Villa, Elizabeth Messina, Ryan Brenizer, Jonas Peterson, Jasmine Star"
32
+ payload[
33
+ "is_negative"
34
+ ] += ", sharp , modern , bright, photo, photorealistic, realism, ugly"
35
  elif image_style == "Portrait":
36
+ payload[
37
+ "inputs"
38
+ ] += ", soft light, sharp, exposure blend, medium shot, bokeh, (hdr:1.4), high contrast, (cinematic, teal and orange:0.85), (muted colors, dim colors, soothing tones:1.3), low saturation, (hyperdetailed:1.2), (noir:0.4), (natural skin texture, hyperrealism, soft light, sharp:1.2)"
39
+ elif image_style == "Photographic":
40
+ payload[
41
+ "inputs"
42
+ ] += ",cinematic photo, 35mm photograph, film, bokeh, professional, 4k, highly detailed"
43
+ payload["is_negative"] += (
44
+ ", drawing, painting, crayon, sketch, graphite, impressionist, noisy, blurry, soft, deformed, ugly",
45
+ )
46
+ elif image_style == "Anime":
47
+ payload[
48
+ "inputs"
49
+ ] += "anime artwork,anime style, key visual, vibrant, studio anime, highly detailed"
50
+ payload[
51
+ "is_negative"
52
+ ] += ", photo, deformed, black and white, realism, disfigured, low contrast"
53
+
54
+ elif image_style == "Fantasy art":
55
+ payload[
56
+ "inputs"
57
+ ] += ", ethereal fantasy concept art, magnificent, celestial, ethereal, painterly, epic, majestic, magical, fantasy art, cover art, dreamy"
58
+ payload[
59
+ "is_negative"
60
+ ] += "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"
61
+
62
+
63
+
64
  image_bytes = requests.post(API_URL, headers=headers, json=base_payload).content
65
  image = Image.open(io.BytesIO(image_bytes))
66
  return image
 
155
  gr.Markdown("<h4>Advanced Settings</h4>")
156
  with gr.Accordion("Advanced Customizations", open=False):
157
  negative_prompt = gr.Textbox(label="Negative Prompt (Optional)", placeholder="Example: blurry, unfocused", lines=2)
158
+ image_style = gr.Dropdown(label="Select Style", choices=["None style", "Cinematic", "Digital Art", "Portrait","Anime", "Fantasy art"], value="None style")
159
 
160
  with gr.Row():
161
  image_output = gr.Image(type="pil", label="Output Image")