Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -293,12 +293,16 @@ def update_pricing(steps, oauth_token: Union[gr.OAuthToken, None]):
|
|
293 |
return gr.update(visible=True), cost_preview, gr.update(visible=False), gr.update(visible=True)
|
294 |
else:
|
295 |
pay_disclaimer = f'''## ⚠️ {user["name"]}, your account doesn't have a payment method. Set one up <a href='https://huggingface.co/settings/billing/payment' target='_blank'>here</a> and come back here to train your LoRA<br><br>'''
|
296 |
-
return gr.update(visible=True),
|
|
|
|
|
|
|
|
|
297 |
else:
|
298 |
return gr.update(visible=False), "", gr.update(visible=False), gr.update(visible=True)
|
299 |
|
300 |
def swap_base_model(model):
|
301 |
-
return gr.update(visible=
|
302 |
|
303 |
config_yaml = '''
|
304 |
device: cuda:0
|
@@ -374,9 +378,14 @@ with gr.Blocks(theme=theme, css=css) as demo:
|
|
374 |
placeholder="uncommon word like p3rs0n or trtcrd, or sentence like 'in the style of CNSTLL'",
|
375 |
interactive=True,
|
376 |
)
|
377 |
-
which_model = gr.Radio(
|
|
|
|
|
|
|
|
|
|
|
378 |
model_warning = gr.Markdown("""> [dev] model license is non-commercial. By choosing to fine-tune [dev], you must agree with [its license](https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md) and make sure the LoRA you will train and the training process you would start does not violate it.
|
379 |
-
""", visible=
|
380 |
with gr.Group(visible=True) as image_upload:
|
381 |
with gr.Row():
|
382 |
images = gr.File(
|
@@ -468,7 +477,6 @@ with gr.Blocks(theme=theme, css=css) as demo:
|
|
468 |
pip3 install -r requirements.txt
|
469 |
cd ..
|
470 |
```
|
471 |
-
|
472 |
Login with Hugging Face to access FLUX.1 [dev], choose a token with `write` permissions to push your LoRAs to the HF Hub
|
473 |
```bash
|
474 |
huggingface-cli login
|
@@ -545,4 +553,4 @@ with gr.Blocks(theme=theme, css=css) as demo:
|
|
545 |
demo.load(fn=swap_visibilty, outputs=main_ui)
|
546 |
|
547 |
if __name__ == "__main__":
|
548 |
-
demo.launch(share=True, show_error=True)
|
|
|
293 |
return gr.update(visible=True), cost_preview, gr.update(visible=False), gr.update(visible=True)
|
294 |
else:
|
295 |
pay_disclaimer = f'''## ⚠️ {user["name"]}, your account doesn't have a payment method. Set one up <a href='https://huggingface.co/settings/billing/payment' target='_blank'>here</a> and come back here to train your LoRA<br><br>'''
|
296 |
+
return gr.update(visible=True),
|
297 |
+
|
298 |
+
|
299 |
+
|
300 |
+
return gr.update(visible=True), pay_disclaimer+cost_preview, gr.update(visible=True), gr.update(visible=False)
|
301 |
else:
|
302 |
return gr.update(visible=False), "", gr.update(visible=False), gr.update(visible=True)
|
303 |
|
304 |
def swap_base_model(model):
|
305 |
+
return gr.update(visible=False) if model == "[schnell] (4 step fast model)" else gr.update(visible=True)
|
306 |
|
307 |
config_yaml = '''
|
308 |
device: cuda:0
|
|
|
378 |
placeholder="uncommon word like p3rs0n or trtcrd, or sentence like 'in the style of CNSTLL'",
|
379 |
interactive=True,
|
380 |
)
|
381 |
+
which_model = gr.Radio(
|
382 |
+
["[dev] (high quality model, non-commercial license)", "[schnell] (4 step fast model)"],
|
383 |
+
label="Which base model to train?",
|
384 |
+
elem_id="space_model" if is_spaces else "local_model",
|
385 |
+
value="[dev] (high quality model, non-commercial license)",
|
386 |
+
)
|
387 |
model_warning = gr.Markdown("""> [dev] model license is non-commercial. By choosing to fine-tune [dev], you must agree with [its license](https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md) and make sure the LoRA you will train and the training process you would start does not violate it.
|
388 |
+
""", visible=True)
|
389 |
with gr.Group(visible=True) as image_upload:
|
390 |
with gr.Row():
|
391 |
images = gr.File(
|
|
|
477 |
pip3 install -r requirements.txt
|
478 |
cd ..
|
479 |
```
|
|
|
480 |
Login with Hugging Face to access FLUX.1 [dev], choose a token with `write` permissions to push your LoRAs to the HF Hub
|
481 |
```bash
|
482 |
huggingface-cli login
|
|
|
553 |
demo.load(fn=swap_visibilty, outputs=main_ui)
|
554 |
|
555 |
if __name__ == "__main__":
|
556 |
+
demo.launch(share=True, show_error=True)
|