Walmart-the-bag commited on
Commit
e89ebe2
1 Parent(s): 3f769c1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -10,6 +10,8 @@ pipe = pipe.to("cuda")
10
 
11
  @spaces.GPU()
12
  def text_to_image(prompt, negative_prompt, steps, guidance_scale, progress=gr.Progress(track_tqdm=True)):
 
 
13
  image = pipe(prompt, negative_prompt=negative_prompt, num_inference_steps=steps, guidance_scale=guidance_scale).images[0]
14
  return image
15
  duplicate_button = gr.DuplicateButton(value="Duplicate Space for private use", elem_id="duplicate-button")
@@ -21,6 +23,7 @@ gradio_interface = Interface(
21
  gr.Textbox(label="Prompt", lines=2, placeholder="Enter your prompt here..."),
22
  gr.Textbox(label="Negative Prompt", lines=2, placeholder="What to exclude from the image..."),
23
  gr.Slider(minimum=1, maximum=65, value=50, label="Steps", step=1),
 
24
  gr.Slider(minimum=1, maximum=20, value=7.5, label="Guidance Scale", step=0.1)
25
  ],
26
  outputs=Image(type="pil", show_download_button=True),
 
10
 
11
  @spaces.GPU()
12
  def text_to_image(prompt, negative_prompt, steps, guidance_scale, progress=gr.Progress(track_tqdm=True)):
13
+ if add_4k_masterpiece:
14
+ prompt += ", 4k, (masterpiece)"
15
  image = pipe(prompt, negative_prompt=negative_prompt, num_inference_steps=steps, guidance_scale=guidance_scale).images[0]
16
  return image
17
  duplicate_button = gr.DuplicateButton(value="Duplicate Space for private use", elem_id="duplicate-button")
 
23
  gr.Textbox(label="Prompt", lines=2, placeholder="Enter your prompt here..."),
24
  gr.Textbox(label="Negative Prompt", lines=2, placeholder="What to exclude from the image..."),
25
  gr.Slider(minimum=1, maximum=65, value=50, label="Steps", step=1),
26
+ gr.Checkbox(label="Add recommended prompt items (4k, masterpiece)", value=False),
27
  gr.Slider(minimum=1, maximum=20, value=7.5, label="Guidance Scale", step=0.1)
28
  ],
29
  outputs=Image(type="pil", show_download_button=True),