gokaygokay commited on
Commit
15ad9e5
1 Parent(s): 8840a6c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -1
app.py CHANGED
@@ -204,7 +204,18 @@ with gr.Blocks(css=custom_css, theme=gr.themes.Soft(primary_hue="blue", secondar
204
  output_image = gr.Image(label="Result", elem_id="gallery", show_label=False)
205
  used_seed = gr.Number(label="Seed Used")
206
 
207
- # ... existing code for update_llm_visibility function ...
 
 
 
 
 
 
 
 
 
 
 
208
 
209
  def generate_prompt(image, text_prompt, use_enhancer, use_llm_generator, llm_provider, llm_model, prompt_type):
210
  if image is not None:
 
204
  output_image = gr.Image(label="Result", elem_id="gallery", show_label=False)
205
  used_seed = gr.Number(label="Seed Used")
206
 
207
+ def update_llm_visibility(use_llm):
208
+ return {
209
+ llm_provider: gr.update(visible=use_llm),
210
+ llm_model: gr.update(visible=use_llm),
211
+ prompt_type: gr.update(visible=use_llm)
212
+ }
213
+
214
+ use_llm_generator.change(
215
+ update_llm_visibility,
216
+ inputs=[use_llm_generator],
217
+ outputs=[llm_provider, llm_model, prompt_type]
218
+ )
219
 
220
  def generate_prompt(image, text_prompt, use_enhancer, use_llm_generator, llm_provider, llm_model, prompt_type):
221
  if image is not None: