Disty0 commited on
Commit
41df45d
1 Parent(s): 511d4d6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -80,6 +80,7 @@ def save_images(image_array, profile: gr.OAuthProfile | None, metadata: dict):
80
 
81
  def generate(
82
  prompt: str,
 
83
  seed: int = 0,
84
  num_inference_steps: int = 4,
85
  randomize_seed: bool = False,
@@ -97,6 +98,7 @@ def generate(
97
  start_time = time.time()
98
  result = pipe(
99
  prompt=prompt,
 
100
  width=width,
101
  height=height,
102
  guidance_scale=guidance_scale,
@@ -115,7 +117,6 @@ examples = [
115
  "(masterpiece, best quality, highres), anime art style, pixiv, 1girl, solo, supernova, abstract, abstract background, (bloom, swirling lights, light particles), fire, galaxy, floating, romanticized, blush, looking at viewer, dark red hair, long hair, blue eyes, straight hair, cat ears, medium breasts, mature female, white sweater",
116
  ]
117
 
118
-
119
  with gr.Blocks(css="style.css") as demo:
120
  gr.Markdown(DESCRIPTION)
121
  gr.DuplicateButton(
@@ -129,7 +130,7 @@ with gr.Blocks(css="style.css") as demo:
129
  label="Prompt",
130
  show_label=False,
131
  max_lines=1,
132
- placeholder="Enter your prompt",
133
  container=False,
134
  )
135
  run_button = gr.Button("Run", scale=0)
@@ -137,6 +138,12 @@ with gr.Blocks(css="style.css") as demo:
137
  label="Generated images", show_label=False, elem_id="gallery", grid=[2]
138
  )
139
  with gr.Accordion("Advanced options", open=False):
 
 
 
 
 
 
140
  seed = gr.Slider(
141
  label="Seed",
142
  minimum=0,
@@ -174,6 +181,7 @@ with gr.Blocks(css="style.css") as demo:
174
  fn=generate,
175
  inputs=[
176
  prompt,
 
177
  seed,
178
  num_inference_steps,
179
  randomize_seed
 
80
 
81
  def generate(
82
  prompt: str,
83
+ negative_prompt: str,
84
  seed: int = 0,
85
  num_inference_steps: int = 4,
86
  randomize_seed: bool = False,
 
98
  start_time = time.time()
99
  result = pipe(
100
  prompt=prompt,
101
+ negative_prompt=negative_prompt,
102
  width=width,
103
  height=height,
104
  guidance_scale=guidance_scale,
 
117
  "(masterpiece, best quality, highres), anime art style, pixiv, 1girl, solo, supernova, abstract, abstract background, (bloom, swirling lights, light particles), fire, galaxy, floating, romanticized, blush, looking at viewer, dark red hair, long hair, blue eyes, straight hair, cat ears, medium breasts, mature female, white sweater",
118
  ]
119
 
 
120
  with gr.Blocks(css="style.css") as demo:
121
  gr.Markdown(DESCRIPTION)
122
  gr.DuplicateButton(
 
130
  label="Prompt",
131
  show_label=False,
132
  max_lines=1,
133
+ value="(masterpiece, best quality, highres), anime art style, pixiv, 1girl, solo",
134
  container=False,
135
  )
136
  run_button = gr.Button("Run", scale=0)
 
138
  label="Generated images", show_label=False, elem_id="gallery", grid=[2]
139
  )
140
  with gr.Accordion("Advanced options", open=False):
141
+ with gr.Row():
142
+ negative_prompt = gr.Text(
143
+ label="Negative Prompt",
144
+ max_lines=1,
145
+ value="(worst quality, low quality, lowres), zombie, comic, sketch, blurry, interlocked fingers",
146
+ )
147
  seed = gr.Slider(
148
  label="Seed",
149
  minimum=0,
 
181
  fn=generate,
182
  inputs=[
183
  prompt,
184
+ negative_prompt,
185
  seed,
186
  num_inference_steps,
187
  randomize_seed