multimodalart HF staff commited on
Commit
d83a418
1 Parent(s): 3e0afac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -199,7 +199,7 @@ theme = gr.themes.Monochrome(
199
  )
200
  css = '''
201
  #component-1{text-align:center}
202
- .main_ui_logged_out{opacity: 0.5; poiner-events: none}
203
  .tabitem{border: 0px}
204
  '''
205
 
@@ -212,14 +212,15 @@ def swap_visibilty(profile: gr.OAuthProfile | None):
212
  print(profile.name)
213
  return gr.update(elem_classes=["main_ui_logged_in"])
214
  else:
215
- gr.update(elem_classes=["main_ui_logged_in"])
216
 
217
  with gr.Blocks(theme=theme, css=css) as demo:
218
  gr.Markdown('''# LoRA Ease for FLUX 🧞‍♂️
219
  ### Train a high quality FLUX LoRA in a breeze ༄ using [Ostris' AI Toolkit](https://github.com/ostris/ai-toolkit) and [AutoTrain Advanced](https://github.com/huggingface/autotrain-advanced)''')
220
- gr.LoginButton(visible=is_spaces)
 
221
  with gr.Tab("Train on Spaces" if is_spaces else "Train locally"):
222
- with gr.Column(elem_classes="main_ui_logged_out") as main_ui:
223
  with gr.Row():
224
  lora_name = gr.Textbox(label="The name of your LoRA", info="This has to be a unique name", placeholder="e.g.: Persian Miniature Painting style, Cat Toy")
225
  #training_option = gr.Radio(
 
199
  )
200
  css = '''
201
  #component-1{text-align:center}
202
+ .main_ui_logged_out{opacity: 0.3; pointer-events: none}
203
  .tabitem{border: 0px}
204
  '''
205
 
 
212
  print(profile.name)
213
  return gr.update(elem_classes=["main_ui_logged_in"])
214
  else:
215
+ return gr.update(elem_classes=["main_ui_logged_in"])
216
 
217
  with gr.Blocks(theme=theme, css=css) as demo:
218
  gr.Markdown('''# LoRA Ease for FLUX 🧞‍♂️
219
  ### Train a high quality FLUX LoRA in a breeze ༄ using [Ostris' AI Toolkit](https://github.com/ostris/ai-toolkit) and [AutoTrain Advanced](https://github.com/huggingface/autotrain-advanced)''')
220
+ if(is_spaces):
221
+ gr.LoginButton("Sign in with Hugging Face to train your LoRA on Spaces", visible=is_spaces)
222
  with gr.Tab("Train on Spaces" if is_spaces else "Train locally"):
223
+ with gr.Column() as main_ui:
224
  with gr.Row():
225
  lora_name = gr.Textbox(label="The name of your LoRA", info="This has to be a unique name", placeholder="e.g.: Persian Miniature Painting style, Cat Toy")
226
  #training_option = gr.Radio(