Yntec commited on
Commit
b58cbab
·
verified ·
1 Parent(s): 4632b4d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -21
app.py CHANGED
@@ -1,30 +1,34 @@
1
  import gradio as gr
2
-
3
- from convert import convert
4
 
5
  DESCRIPTION = """
6
- - ⚠️ Oops! I broke the space and reverting the changes didn't fix it. 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
- demo = gr.Interface(
13
- title="No longer working",
14
- description=DESCRIPTION,
15
- allow_flagging="never",
16
- article="Check out the [Diffusers repo on GitHub](https://github.com/huggingface/diffusers)",
17
- inputs=[
18
- gr.Text(max_lines=1, label="your_hf_token"),
19
- gr.Text(max_lines=1, label="model_id"),
20
- gr.Text(max_lines=1, label="filename"),
21
- gr.Radio(label="Model type", choices=["v1", "v2", "ControlNet"]),
22
- gr.Radio(label="Sample size (px)", choices=[512, 768]),
23
- gr.Radio(label="Scheduler type", choices=["pndm", "heun", "euler", "dpm", "ddim"], value="dpm"),
24
- gr.Radio(label="Extract EMA or non-EMA?", choices=["ema", "non-ema"], value="ema"),
25
- ],
26
- outputs=[gr.Markdown(label="output")],
27
- fn=convert,
28
- ).queue(max_size=10, concurrency_count=1)
 
 
 
29
 
30
- demo.launch(show_api=True)
 
 
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()