John6666 commited on
Commit
247223f
1 Parent(s): 748d896

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +6 -6
  2. externalmod.py +5 -1
app.py CHANGED
@@ -236,11 +236,11 @@ def make_me():
236
  with gr.Accordion("Advanced", open=False, visible=True):
237
  neg_input = gr.Textbox(label='Negative prompt:', lines=1)
238
  with gr.Row():
239
- width = gr.Number(label="Width", info="If 0, the default value is used.", maximum=1216, step=32, value=0)
240
- height = gr.Number(label="Height", info="If 0, the default value is used.", maximum=1216, step=32, value=0)
241
  with gr.Row():
242
- steps = gr.Number(label="Number of inference steps", info="If 0, the default value is used.", maximum=100, step=1, value=0)
243
- cfg = gr.Number(label="Guidance scale", info="If 0, the default value is used.", maximum=30.0, step=0.1, value=0)
244
  seed = gr.Slider(label="Seed", info="Randomize Seed if -1.", minimum=-1, maximum=MAX_SEED, step=1, value=-1)
245
  #gen_button = gr.Button('Generate images', width=150, height=30)
246
  #stop_button = gr.Button('Stop', variant='secondary', interactive=False, width=150, height=30)
@@ -311,5 +311,5 @@ with gr.Blocks(theme="Nymbo/Nymbo_Theme", fill_width=True, css="div.float.svelte
311
 
312
  # https://www.gradio.app/guides/setting-up-a-demo-for-maximum-performance
313
  #demo.queue(concurrency_count=999) # concurrency_count is deprecated in 4.x
314
- demo.queue()
315
- demo.launch()
 
236
  with gr.Accordion("Advanced", open=False, visible=True):
237
  neg_input = gr.Textbox(label='Negative prompt:', lines=1)
238
  with gr.Row():
239
+ width = gr.Slider(label="Width", info="If 0, the default value is used.", maximum=1216, step=32, value=0)
240
+ height = gr.Slider(label="Height", info="If 0, the default value is used.", maximum=1216, step=32, value=0)
241
  with gr.Row():
242
+ steps = gr.Slider(label="Number of inference steps", info="If 0, the default value is used.", maximum=100, step=1, value=0)
243
+ cfg = gr.Slider(label="Guidance scale", info="If 0, the default value is used.", maximum=30.0, step=0.1, value=0)
244
  seed = gr.Slider(label="Seed", info="Randomize Seed if -1.", minimum=-1, maximum=MAX_SEED, step=1, value=-1)
245
  #gen_button = gr.Button('Generate images', width=150, height=30)
246
  #stop_button = gr.Button('Stop', variant='secondary', interactive=False, width=150, height=30)
 
311
 
312
  # https://www.gradio.app/guides/setting-up-a-demo-for-maximum-performance
313
  #demo.queue(concurrency_count=999) # concurrency_count is deprecated in 4.x
314
+ demo.queue(default_concurrency_limit=200, max_size=200)
315
+ demo.launch(max_threads=400)
externalmod.py CHANGED
@@ -531,7 +531,11 @@ def gr_Interface_load(
531
  alias: str | None = None,
532
  **kwargs,
533
  ) -> Blocks:
534
- return load_blocks_from_repo(name, src, hf_token, alias)
 
 
 
 
535
 
536
 
537
  def list_uniq(l):
 
531
  alias: str | None = None,
532
  **kwargs,
533
  ) -> Blocks:
534
+ try:
535
+ return load_blocks_from_repo(name, src, hf_token, alias)
536
+ except Exception as e:
537
+ print(e)
538
+ return gradio.Interface(lambda: None, ['text'], ['image'])
539
 
540
 
541
  def list_uniq(l):