multimodalart HF staff commited on
Commit
1c15549
1 Parent(s): 1d2dff5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -27,7 +27,7 @@ def update_selection(evt: gr.SelectData):
27
  )
28
 
29
  @spaces.GPU
30
- def run_lora(prompt, negative_prompt, cfg_scale, steps, selected_index, seed, width, height, lora_scale):
31
  if selected_index is None:
32
  raise gr.Error("You must select a LoRA before proceeding.")
33
 
@@ -44,7 +44,7 @@ def run_lora(prompt, negative_prompt, cfg_scale, steps, selected_index, seed, wi
44
  # Generate image
45
  image = pipe(
46
  prompt=f"{prompt} {trigger_word}",
47
- negative_prompt=negative_prompt,
48
  num_inference_steps=steps,
49
  guidance_scale=cfg_scale,
50
  width=width,
@@ -80,11 +80,11 @@ with gr.Blocks(theme=gr.themes.Soft()) as app:
80
  prompt_title = gr.Markdown("### Click on a LoRA in the gallery to select it")
81
  selected_info = gr.Markdown("")
82
  prompt = gr.Textbox(label="Prompt", lines=3, placeholder="Type a prompt after selecting a LoRA")
83
- negative_prompt = gr.Textbox(label="Negative Prompt", lines=2, value="low quality, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry")
84
 
85
  with gr.Column():
86
  with gr.Row():
87
- cfg_scale = gr.Slider(label="CFG Scale", minimum=1, maximum=20, step=0.5, value=7.5)
88
  steps = gr.Slider(label="Steps", minimum=1, maximum=100, step=1, value=30)
89
 
90
  with gr.Row():
@@ -99,7 +99,7 @@ with gr.Blocks(theme=gr.themes.Soft()) as app:
99
 
100
  generate_button.click(
101
  fn=run_lora,
102
- inputs=[prompt, negative_prompt, cfg_scale, steps, selected_index, seed, width, height, lora_scale],
103
  outputs=[result]
104
  )
105
 
 
27
  )
28
 
29
  @spaces.GPU
30
+ def run_lora(prompt, cfg_scale, steps, selected_index, seed, width, height, lora_scale):
31
  if selected_index is None:
32
  raise gr.Error("You must select a LoRA before proceeding.")
33
 
 
44
  # Generate image
45
  image = pipe(
46
  prompt=f"{prompt} {trigger_word}",
47
+ #negative_prompt=negative_prompt,
48
  num_inference_steps=steps,
49
  guidance_scale=cfg_scale,
50
  width=width,
 
80
  prompt_title = gr.Markdown("### Click on a LoRA in the gallery to select it")
81
  selected_info = gr.Markdown("")
82
  prompt = gr.Textbox(label="Prompt", lines=3, placeholder="Type a prompt after selecting a LoRA")
83
+ #negative_prompt = gr.Textbox(label="Negative Prompt", lines=2, value="low quality, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry")
84
 
85
  with gr.Column():
86
  with gr.Row():
87
+ cfg_scale = gr.Slider(label="CFG Scale", minimum=1, maximum=20, step=0.5, value=3.5)
88
  steps = gr.Slider(label="Steps", minimum=1, maximum=100, step=1, value=30)
89
 
90
  with gr.Row():
 
99
 
100
  generate_button.click(
101
  fn=run_lora,
102
+ inputs=[prompt, cfg_scale, steps, selected_index, seed, width, height, lora_scale],
103
  outputs=[result]
104
  )
105