Linoy Tsaban commited on
Commit
f2d1c8f
1 Parent(s): 7eca8c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -330,10 +330,12 @@ def swap_visibilities(input_image,
330
  concept1_update = update_display_concept("Remove" if neg_guidance_1 else "Add", edit_concept_1, neg_guidance_1, sega_concepts_counter)
331
  if(edit_concept_2 != ""):
332
  concept2_update = update_display_concept("Remove" if neg_guidance_2 else "Add", edit_concept_2, neg_guidance_2, sega_concepts_counter+1)
 
 
333
  else:
334
  concept2_update = gr.update(visible=False), gr.update(visible=False),gr.update(visible=False), gr.update(value=neg_guidance_2),gr.update(visible=True),gr.update(visible=False),sega_concepts_counter+1
335
-
336
- return (gr.update(visible=True), *concept1_update[:-1], *concept2_update)
337
 
338
 
339
 
@@ -870,7 +872,7 @@ with gr.Blocks(css="style.css") as demo:
870
  seed,
871
  sega_concepts_counter
872
  ],
873
- outputs=[share_btn_container, box1, concept_1, guidnace_scale_1,neg_guidance_1, row1, row2,box2, concept_2, guidnace_scale_2,neg_guidance_2,row2, row3,sega_concepts_counter],
874
  cache_examples=True
875
  )
876
 
 
330
  concept1_update = update_display_concept("Remove" if neg_guidance_1 else "Add", edit_concept_1, neg_guidance_1, sega_concepts_counter)
331
  if(edit_concept_2 != ""):
332
  concept2_update = update_display_concept("Remove" if neg_guidance_2 else "Add", edit_concept_2, neg_guidance_2, sega_concepts_counter+1)
333
+ if(edit_concept_3 != ""):
334
+ concept3_update = update_display_concept("Remove" if neg_guidance_3 else "Add", edit_concept_3, neg_guidance_3, sega_concepts_counter+2)
335
  else:
336
  concept2_update = gr.update(visible=False), gr.update(visible=False),gr.update(visible=False), gr.update(value=neg_guidance_2),gr.update(visible=True),gr.update(visible=False),sega_concepts_counter+1
337
+ concept3_update = gr.update(visible=False), gr.update(visible=False),gr.update(visible=False), gr.update(value=neg_guidance_3),gr.update(visible=False),gr.update(visible=False),sega_concepts_counter+1
338
+ return (gr.update(visible=True), *concept1_update[:-1], *concept2_update[:-1], *concept3_update)
339
 
340
 
341
 
 
872
  seed,
873
  sega_concepts_counter
874
  ],
875
+ outputs=[share_btn_container, box1, concept_1, guidnace_scale_1,neg_guidance_1, row1, row2,box2, concept_2, guidnace_scale_2,neg_guidance_2,row2, row3,box3, concept_3, guidnace_scale_3,neg_guidance_3,row3, row3,sega_concepts_counter],
876
  cache_examples=True
877
  )
878