File size: 1,268 Bytes
2c6a2ce
b58cbab
 
2c6a2ce
 
b58cbab
4632b4d
 
2c6a2ce
 
 
b58cbab
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2c6a2ce
b58cbab
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import gradio as gr
import os
from convert_repo_to_safetensors_sd_gr import convert_repo_to_safetensors_multi_sd

DESCRIPTION = """
- For original behavior please use the alternatives below:
- https://huggingface.co/spaces/diffusers/sd-to-diffusers (the original)
- https://huggingface.co/spaces/Yntec/sd-to-diffusers-backup (my back up)

"""

os.environ['HF_OUTPUT_REPO'] = 'Yntec/lnkdn'

css = """"""

with gr.Blocks(theme="NoCrypt/miku@>=1.2.2", css=css) as demo:
    with gr.Column(): 
        repo_id = gr.Textbox(label="Repo ID", placeholder="author/model", value="", lines=1)
        is_half = gr.Checkbox(label="Half precision", value=True)
        is_upload = gr.Checkbox(label="Upload safetensors to HF Repo", info="Fast download, but files will be public.", value=False)
        uploaded_urls = gr.CheckboxGroup(visible=False, choices=[], value=None)
        run_button = gr.Button(value="Convert")
        st_file = gr.Files(label="Output", interactive=False)
        st_md = gr.Markdown()

    gr.on(
        triggers=[repo_id.submit, run_button.click],
        fn=convert_repo_to_safetensors_multi_sd,
        inputs=[repo_id, st_file, is_upload, uploaded_urls, is_half],
        outputs=[st_file, uploaded_urls, st_md],
    )

demo.queue()
demo.launch()