barreloflube commited on
Commit
578deb0
·
1 Parent(s): c88a186

Refactor UI structure and remove negative prompt from generate_image function

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -507,7 +507,7 @@ def remove_from_enabled_loras(enabled_loras, index):
507
 
508
  @spaces.GPU
509
  def generate_image(
510
- model, prompt, negative_prompt, fast_generation, enabled_loras,
511
  lora_slider_0, lora_slider_1, lora_slider_2, lora_slider_3, lora_slider_4, lora_slider_5,
512
  img2img_image, inpaint_image, canny_image, pose_image, depth_image,
513
  img2img_strength, inpaint_strength, canny_strength, pose_strength, depth_strength,
@@ -519,7 +519,6 @@ def generate_image(
519
  base_args = {
520
  "model": model,
521
  "prompt": prompt,
522
- "negative_prompt": negative_prompt,
523
  "fast_generation": fast_generation,
524
  "loras": None,
525
  "resize_mode": resize_mode,
@@ -647,7 +646,6 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
647
  with gr.Group() as image_options:
648
  model = gr.Dropdown(label="Models", choices=flux_models, value=flux_models[0], interactive=True)
649
  prompt = gr.Textbox(lines=5, label="Prompt")
650
- negative_prompt = gr.Textbox(label="Negative Prompt")
651
  fast_generation = gr.Checkbox(label="Fast Generation (Hyper-SD) 🧪")
652
 
653
 
@@ -656,7 +654,8 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
656
  label="Gallery",
657
  value=[(lora['image'], lora['title']) for lora in loras],
658
  allow_preview=False,
659
- columns=[3],
 
660
  type="pil"
661
  )
662
 
@@ -790,7 +789,7 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
790
  generate_images.click(
791
  generate_image, # type: ignore
792
  [
793
- model, prompt, negative_prompt, fast_generation, enabled_loras,
794
  lora_slider_0, lora_slider_1, lora_slider_2, lora_slider_3, lora_slider_4, lora_slider_5, # type: ignore
795
  img2img_image, inpaint_image, canny_image, pose_image, depth_image, # type: ignore
796
  img2img_strength, inpaint_strength, canny_strength, pose_strength, depth_strength, # type: ignore
 
507
 
508
  @spaces.GPU
509
  def generate_image(
510
+ model, prompt, fast_generation, enabled_loras,
511
  lora_slider_0, lora_slider_1, lora_slider_2, lora_slider_3, lora_slider_4, lora_slider_5,
512
  img2img_image, inpaint_image, canny_image, pose_image, depth_image,
513
  img2img_strength, inpaint_strength, canny_strength, pose_strength, depth_strength,
 
519
  base_args = {
520
  "model": model,
521
  "prompt": prompt,
 
522
  "fast_generation": fast_generation,
523
  "loras": None,
524
  "resize_mode": resize_mode,
 
646
  with gr.Group() as image_options:
647
  model = gr.Dropdown(label="Models", choices=flux_models, value=flux_models[0], interactive=True)
648
  prompt = gr.Textbox(lines=5, label="Prompt")
 
649
  fast_generation = gr.Checkbox(label="Fast Generation (Hyper-SD) 🧪")
650
 
651
 
 
654
  label="Gallery",
655
  value=[(lora['image'], lora['title']) for lora in loras],
656
  allow_preview=False,
657
+ columns=3,
658
+ rows=3,
659
  type="pil"
660
  )
661
 
 
789
  generate_images.click(
790
  generate_image, # type: ignore
791
  [
792
+ model, prompt, fast_generation, enabled_loras,
793
  lora_slider_0, lora_slider_1, lora_slider_2, lora_slider_3, lora_slider_4, lora_slider_5, # type: ignore
794
  img2img_image, inpaint_image, canny_image, pose_image, depth_image, # type: ignore
795
  img2img_strength, inpaint_strength, canny_strength, pose_strength, depth_strength, # type: ignore