Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -50,28 +50,19 @@ with gr.Blocks(theme="NoCrypt/miku@>=1.2.2", fill_width=True, css=css, delete_ca
|
|
50 |
with gr.Column():
|
51 |
civitai_key = gr.Textbox(label="Your Civitai Key", value="", max_lines=1)
|
52 |
gr.Markdown("Your Civitai API key is available at [https://civitai.com/user/account](https://civitai.com/user/account).", elem_classes="info")
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
hf_token = gr.Textbox(label="Your HF write token", placeholder="hf_...", value="", max_lines=1)
|
57 |
-
gr.Markdown("Your token is available at [hf.co/settings/tokens](https://huggingface.co/settings/tokens).", elem_classes="info")
|
58 |
-
newrepo_id = gr.Textbox(label="Upload repo ID", placeholder="yourid/yourrepo", value="", max_lines=1)
|
59 |
-
with gr.Row():
|
60 |
-
newrepo_type = gr.Radio(label="Upload repo type", choices=["model", "dataset"], value="model")
|
61 |
-
is_private = gr.Checkbox(label="Create private repo", value=True)
|
62 |
-
is_info = gr.Checkbox(label="Upload Civitai information files", value=False)
|
63 |
-
is_rename = gr.Checkbox(label="Auto rename", value=True)
|
64 |
-
run_button = gr.Button(value="Download and Upload", variant="primary")
|
65 |
uploaded_urls = gr.CheckboxGroup(visible=False, choices=[], value=None) # hidden
|
66 |
urls_md = gr.Markdown("<br><br>", elem_classes="result")
|
67 |
urls_remain = gr.Textbox("Remaining URLs", value="", show_copy_button=True, visible=False)
|
68 |
-
|
69 |
|
70 |
gr.on(
|
71 |
triggers=[run_button.click],
|
72 |
-
fn=
|
73 |
-
inputs=[dl_url, civitai_key
|
74 |
-
outputs=[
|
75 |
queue=True,
|
76 |
)
|
77 |
gr.on(
|
|
|
50 |
with gr.Column():
|
51 |
civitai_key = gr.Textbox(label="Your Civitai Key", value="", max_lines=1)
|
52 |
gr.Markdown("Your Civitai API key is available at [https://civitai.com/user/account](https://civitai.com/user/account).", elem_classes="info")
|
53 |
+
|
54 |
+
run_button = gr.Button(value="Download", variant="primary")
|
55 |
+
output_but = gr.File(label="output")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
uploaded_urls = gr.CheckboxGroup(visible=False, choices=[], value=None) # hidden
|
57 |
urls_md = gr.Markdown("<br><br>", elem_classes="result")
|
58 |
urls_remain = gr.Textbox("Remaining URLs", value="", show_copy_button=True, visible=False)
|
59 |
+
|
60 |
|
61 |
gr.on(
|
62 |
triggers=[run_button.click],
|
63 |
+
fn=download_file,
|
64 |
+
inputs=[dl_url, civitai_key],
|
65 |
+
outputs=[output_but],
|
66 |
queue=True,
|
67 |
)
|
68 |
gr.on(
|