EmoCube commited on
Commit
156f4d6
·
verified ·
1 Parent(s): d82c582

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -15,7 +15,7 @@ API_TOKEN = os.getenv("HF_READ_TOKEN")
15
  headers = {"Authorization": f"Bearer {API_TOKEN}"}
16
  timeout = 100
17
 
18
- def query(prompt, is_negative=False, steps=15, cfg_scale=7, sampler="DPM++ 2M Karras", seed=-1, strength=0.7):
19
  if prompt == "" or prompt == None:
20
  return None
21
 
@@ -70,7 +70,6 @@ with gr.Blocks(theme='Nymbo/Nymbo_Theme', css=css) as app:
70
  negative_prompt = gr.Textbox(label="Negative Prompt", placeholder="What should not be in the image", value="(deformed, distorted, disfigured), poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, (mutated hands and fingers), disconnected limbs, mutation, mutated, ugly, disgusting, blurry, amputation, misspellings, typos", lines=3, elem_id="negative-prompt-text-input")
71
  steps = gr.Slider(label="Sampling steps", value=4, minimum=1, maximum=100, step=1)
72
  cfg = gr.Slider(label="CFG Scale", value=7, minimum=1, maximum=20, step=1)
73
- method = gr.Radio(label="Sampling method", value="DPM++ 2M Karras", choices=["DPM++ 2M Karras", "DPM++ SDE Karras", "Euler", "Euler a", "Heun", "DDIM"])
74
  strength = gr.Slider(label="Strength", value=0.7, minimum=0, maximum=1, step=0.001)
75
  seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=1000000000, step=1)
76
 
@@ -79,6 +78,6 @@ with gr.Blocks(theme='Nymbo/Nymbo_Theme', css=css) as app:
79
  with gr.Row():
80
  image_output = gr.Image(type="pil", label="Image Output", elem_id="gallery")
81
 
82
- text_button.click(query, inputs=[text_prompt, negative_prompt, steps, cfg, method, seed, strength], outputs=image_output)
83
 
84
  app.launch(show_api=True, share=True)
 
15
  headers = {"Authorization": f"Bearer {API_TOKEN}"}
16
  timeout = 100
17
 
18
+ def query(prompt, is_negative=False, steps=15, cfg_scale=7, seed=-1, strength=0.7):
19
  if prompt == "" or prompt == None:
20
  return None
21
 
 
70
  negative_prompt = gr.Textbox(label="Negative Prompt", placeholder="What should not be in the image", value="(deformed, distorted, disfigured), poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, (mutated hands and fingers), disconnected limbs, mutation, mutated, ugly, disgusting, blurry, amputation, misspellings, typos", lines=3, elem_id="negative-prompt-text-input")
71
  steps = gr.Slider(label="Sampling steps", value=4, minimum=1, maximum=100, step=1)
72
  cfg = gr.Slider(label="CFG Scale", value=7, minimum=1, maximum=20, step=1)
 
73
  strength = gr.Slider(label="Strength", value=0.7, minimum=0, maximum=1, step=0.001)
74
  seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=1000000000, step=1)
75
 
 
78
  with gr.Row():
79
  image_output = gr.Image(type="pil", label="Image Output", elem_id="gallery")
80
 
81
+ text_button.click(query, inputs=[text_prompt, negative_prompt, steps, cfg, seed, strength], outputs=image_output)
82
 
83
  app.launch(show_api=True, share=True)