guardiancc commited on
Commit
136b25d
1 Parent(s): 04019e6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -1905,7 +1905,6 @@ def update_selection(evt: gr.SelectData, width, height):
1905
  width = 1024
1906
  height = 1024
1907
  return (
1908
- gr.update(placeholder=new_placeholder),
1909
  updated_text,
1910
  evt.index,
1911
  width,
@@ -1950,7 +1949,7 @@ def generate_image_to_image(prompt_mash, image_input_path, image_strength, steps
1950
  return final_image
1951
 
1952
  @spaces.GPU(duration=100)
1953
- def run_lora(prompt, image_input, image_strength, cfg_scale, steps, selected_index, randomize_seed, seed, width, height, lora_scale, progress=gr.Progress(track_tqdm=True)):
1954
  if selected_index is None:
1955
  raise gr.Error("You must select a LoRA before proceeding.🧨")
1956
  selected_lora = loras[selected_index]
@@ -2095,7 +2094,8 @@ with gr.Blocks(theme="prithivMLmods/Minecraft-Theme", delete_cache=(60, 60)) as
2095
  selected_index = gr.State(None)
2096
  with gr.Row():
2097
  with gr.Column(scale=3):
2098
- prompt = gr.Textbox(label="Prompt", lines=1, placeholder=":/ choose the LoRA and type the prompt ")
 
2099
  with gr.Row():
2100
  with gr.Column():
2101
  selected_info = gr.Markdown("")
@@ -2109,7 +2109,6 @@ with gr.Blocks(theme="prithivMLmods/Minecraft-Theme", delete_cache=(60, 60)) as
2109
  elem_id="gallery",
2110
  show_share_button=False
2111
  )
2112
- generate_button = gr.Button("Generate", variant="primary", elem_id="gen_btn")
2113
 
2114
  with gr.Column():
2115
  progress_bar = gr.Markdown(elem_id="progress",visible=False)
@@ -2136,12 +2135,12 @@ with gr.Blocks(theme="prithivMLmods/Minecraft-Theme", delete_cache=(60, 60)) as
2136
  gallery.select(
2137
  update_selection,
2138
  inputs=[width, height],
2139
- outputs=[prompt, selected_info, selected_index, width, height]
2140
  )
2141
  gr.on(
2142
- triggers=[generate_button.click, prompt.submit],
2143
  fn=run_lora,
2144
- inputs=[prompt, input_image, image_strength, cfg_scale, steps, selected_index, randomize_seed, seed, width, height, lora_scale],
2145
  outputs=[result, seed, progress_bar]
2146
  )
2147
 
 
1905
  width = 1024
1906
  height = 1024
1907
  return (
 
1908
  updated_text,
1909
  evt.index,
1910
  width,
 
1949
  return final_image
1950
 
1951
  @spaces.GPU(duration=100)
1952
+ def run_lora("", image_input, image_strength, cfg_scale, steps, selected_index, randomize_seed, seed, width, height, lora_scale, progress=gr.Progress(track_tqdm=True)):
1953
  if selected_index is None:
1954
  raise gr.Error("You must select a LoRA before proceeding.🧨")
1955
  selected_lora = loras[selected_index]
 
2094
  selected_index = gr.State(None)
2095
  with gr.Row():
2096
  with gr.Column(scale=3):
2097
+ generate_button = gr.Button("Generate", variant="primary", elem_id="gen_btn")
2098
+
2099
  with gr.Row():
2100
  with gr.Column():
2101
  selected_info = gr.Markdown("")
 
2109
  elem_id="gallery",
2110
  show_share_button=False
2111
  )
 
2112
 
2113
  with gr.Column():
2114
  progress_bar = gr.Markdown(elem_id="progress",visible=False)
 
2135
  gallery.select(
2136
  update_selection,
2137
  inputs=[width, height],
2138
+ outputs=[selected_info, selected_index, width, height]
2139
  )
2140
  gr.on(
2141
+ triggers=[generate_button.click],
2142
  fn=run_lora,
2143
+ inputs=[input_image, image_strength, cfg_scale, steps, selected_index, randomize_seed, seed, width, height, lora_scale],
2144
  outputs=[result, seed, progress_bar]
2145
  )
2146