disable api usage

#5
by ysharma HF Staff - opened
Files changed (1) hide show
  1. app.py +11 -6
app.py CHANGED
@@ -348,18 +348,21 @@ with gr.Blocks(theme=gr.themes.Soft(font=font), css=css, delete_cache=(60, 60))
348
  update_selection,
349
  inputs=[], # No direct inputs needed, uses evt
350
  # Update prompt placeholder, selection text, selected index state, and width/height states
351
- outputs=[prompt, selected_info, selected_index, width, height]
 
352
  )
353
  # Use submit event for Textbox to trigger add_custom_lora
354
  custom_lora.submit(
355
  add_custom_lora,
356
  inputs=[custom_lora],
357
  # Outputs: info card, remove button, gallery, selection text, selected index state, prompt placeholder
358
- outputs=[custom_lora_info, custom_lora_button, gallery, selected_info, selected_index, prompt]
 
359
  )
360
  custom_lora_button.click(
361
  remove_custom_lora,
362
- outputs=[custom_lora_info, custom_lora_button, gallery, selected_info, selected_index, custom_lora] # Clear textbox too
 
363
  )
364
  gr.on(
365
  triggers=[generate_button.click, prompt.submit],
@@ -367,14 +370,16 @@ with gr.Blocks(theme=gr.themes.Soft(font=font), css=css, delete_cache=(60, 60))
367
  # Inputs now use state variables for width, height, seed
368
  inputs=[prompt, selected_index, seed, width, height],
369
  # Outputs: result image, seed state (updated with used seed), progress bar update
370
- outputs=[result, seed, progress_bar]
 
371
  ).then(
372
  # Update the displayed seed value after run_lora completes
373
  lambda s: gr.update(value=s),
374
  inputs=[seed],
375
- outputs=[used_seed_display]
 
376
  )
377
 
378
 
379
  app.queue()
380
- app.launch()
 
348
  update_selection,
349
  inputs=[], # No direct inputs needed, uses evt
350
  # Update prompt placeholder, selection text, selected index state, and width/height states
351
+ outputs=[prompt, selected_info, selected_index, width, height],
352
+ api_name=False,
353
  )
354
  # Use submit event for Textbox to trigger add_custom_lora
355
  custom_lora.submit(
356
  add_custom_lora,
357
  inputs=[custom_lora],
358
  # Outputs: info card, remove button, gallery, selection text, selected index state, prompt placeholder
359
+ outputs=[custom_lora_info, custom_lora_button, gallery, selected_info, selected_index, prompt],
360
+ api_name=False,
361
  )
362
  custom_lora_button.click(
363
  remove_custom_lora,
364
+ outputs=[custom_lora_info, custom_lora_button, gallery, selected_info, selected_index, custom_lora]. # Clear textbox too
365
+ api_name=False,
366
  )
367
  gr.on(
368
  triggers=[generate_button.click, prompt.submit],
 
370
  # Inputs now use state variables for width, height, seed
371
  inputs=[prompt, selected_index, seed, width, height],
372
  # Outputs: result image, seed state (updated with used seed), progress bar update
373
+ outputs=[result, seed, progress_bar],
374
+ api_name=False,
375
  ).then(
376
  # Update the displayed seed value after run_lora completes
377
  lambda s: gr.update(value=s),
378
  inputs=[seed],
379
+ outputs=[used_seed_display],
380
+ api_name=False,
381
  )
382
 
383
 
384
  app.queue()
385
+ app.launch(show_api=False)