DemiPoto commited on
Commit
5f3c43c
·
verified ·
1 Parent(s): 4751ba3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -249,9 +249,9 @@ list_ratios=[["None",[None,None]],
249
  ["5:12 (640 x 1536)",[640,1536]],
250
  ["1:4 (512 x 2048)",[512,2048]]]
251
 
252
- def fonc_add_param(param_actu,disp_param):
253
- disp_param.exemples=disp_param.append(param_actu)
254
- return
255
 
256
  def make_me():
257
  with gr.Row():
@@ -272,9 +272,10 @@ def make_me():
272
  steps = gr.Slider(label="Number of inference steps", info="If 0, the default value is used.", maximum=100, step=1, value=0, interactive = True)
273
  cfg = gr.Slider(label="Guidance scale", info="If 0, the default value is used.", maximum=30.0, step=0.1, value=0, interactive = True)
274
  seed = gr.Slider(label="Seed", info="Randomize Seed if -1.", minimum=-1, maximum=MAX_SEED, step=1, value=-1, interactive = True)
275
-
276
  param_actu=[txt_input,neg_input,width,height,steps,cfg,seed]
277
  list_param=[["prompt","neg p",1024,800,50,3.0],["prompt 2","neg p 2",720,1200,30,2.5]]
 
 
278
 
279
  add_param=gr.Button("add to the list")
280
  del_param=gr.Button("delete to the list")
@@ -289,7 +290,7 @@ def make_me():
289
  outputs=[txt_input,neg_input,width,height,steps,cfg,seed],
290
  )
291
 
292
- add_param.click(fonc_add_param,[param_actu,disp_param],[])
293
 
294
 
295
  js_code = """
 
249
  ["5:12 (640 x 1536)",[640,1536]],
250
  ["1:4 (512 x 2048)",[512,2048]]]
251
 
252
+ def fonc_add_param(pa,lp):
253
+ lp.append(pa)
254
+ return gr.Examples(examples=lp) , gr.Dropdown(choices=["a",lp], value=lp)
255
 
256
  def make_me():
257
  with gr.Row():
 
272
  steps = gr.Slider(label="Number of inference steps", info="If 0, the default value is used.", maximum=100, step=1, value=0, interactive = True)
273
  cfg = gr.Slider(label="Guidance scale", info="If 0, the default value is used.", maximum=30.0, step=0.1, value=0, interactive = True)
274
  seed = gr.Slider(label="Seed", info="Randomize Seed if -1.", minimum=-1, maximum=MAX_SEED, step=1, value=-1, interactive = True)
 
275
  param_actu=[txt_input,neg_input,width,height,steps,cfg,seed]
276
  list_param=[["prompt","neg p",1024,800,50,3.0],["prompt 2","neg p 2",720,1200,30,2.5]]
277
+ lp=gr.Dropdown(choices=["a",list_param], value=list_param, visible=False)
278
+ pa=gr.Dropdown(choices=["a",param_actu], value=param_actu, visible=False)
279
 
280
  add_param=gr.Button("add to the list")
281
  del_param=gr.Button("delete to the list")
 
290
  outputs=[txt_input,neg_input,width,height,steps,cfg,seed],
291
  )
292
 
293
+ add_param.click(fonc_add_param,[pa,lp],[disp_param],lp)
294
 
295
 
296
  js_code = """