Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,30 +1,34 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
|
| 3 |
-
from
|
| 4 |
|
| 5 |
DESCRIPTION = """
|
| 6 |
-
-
|
| 7 |
- https://huggingface.co/spaces/diffusers/sd-to-diffusers (the original)
|
| 8 |
- https://huggingface.co/spaces/Yntec/sd-to-diffusers-backup (my back up)
|
| 9 |
|
| 10 |
"""
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
gr.
|
| 19 |
-
gr.
|
| 20 |
-
gr.
|
| 21 |
-
gr.
|
| 22 |
-
gr.
|
| 23 |
-
gr.
|
| 24 |
-
gr.
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
-
demo.
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import os
|
| 3 |
+
from convert_repo_to_safetensors_sd_gr import convert_repo_to_safetensors_multi_sd
|
| 4 |
|
| 5 |
DESCRIPTION = """
|
| 6 |
+
- For original behavior please use the alternatives below:
|
| 7 |
- https://huggingface.co/spaces/diffusers/sd-to-diffusers (the original)
|
| 8 |
- https://huggingface.co/spaces/Yntec/sd-to-diffusers-backup (my back up)
|
| 9 |
|
| 10 |
"""
|
| 11 |
|
| 12 |
+
os.environ['HF_OUTPUT_REPO'] = 'Yntec/lnkdn'
|
| 13 |
+
|
| 14 |
+
css = """"""
|
| 15 |
+
|
| 16 |
+
with gr.Blocks(theme="NoCrypt/miku@>=1.2.2", css=css) as demo:
|
| 17 |
+
with gr.Column():
|
| 18 |
+
repo_id = gr.Textbox(label="Repo ID", placeholder="author/model", value="", lines=1)
|
| 19 |
+
is_half = gr.Checkbox(label="Half precision", value=True)
|
| 20 |
+
is_upload = gr.Checkbox(label="Upload safetensors to HF Repo", info="Fast download, but files will be public.", value=False)
|
| 21 |
+
uploaded_urls = gr.CheckboxGroup(visible=False, choices=[], value=None)
|
| 22 |
+
run_button = gr.Button(value="Convert")
|
| 23 |
+
st_file = gr.Files(label="Output", interactive=False)
|
| 24 |
+
st_md = gr.Markdown()
|
| 25 |
+
|
| 26 |
+
gr.on(
|
| 27 |
+
triggers=[repo_id.submit, run_button.click],
|
| 28 |
+
fn=convert_repo_to_safetensors_multi_sd,
|
| 29 |
+
inputs=[repo_id, st_file, is_upload, uploaded_urls, is_half],
|
| 30 |
+
outputs=[st_file, uploaded_urls, st_md],
|
| 31 |
+
)
|
| 32 |
|
| 33 |
+
demo.queue()
|
| 34 |
+
demo.launch()
|