theNeofr commited on
Commit
3cd1ee2
·
verified ·
1 Parent(s): 4d9eab3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -16
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
- with gr.Group():
54
- with gr.Row():
55
- with gr.Column():
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
- gr.DuplicateButton(value="Duplicate Space")
69
 
70
  gr.on(
71
  triggers=[run_button.click],
72
- fn=download_civitai,
73
- inputs=[dl_url, civitai_key, hf_token, uploaded_urls, newrepo_id, newrepo_type, is_private, is_info, is_rename],
74
- outputs=[uploaded_urls, urls_md, urls_remain],
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(