John6666 commited on
Commit
1e9dd50
1 Parent(s): 818d649

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -1
app.py CHANGED
@@ -26,6 +26,23 @@ loras = [
26
  ]
27
  schedulers = list(SCHEDULER_CONFIG_MAP.keys())
28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  css = """"""
30
 
31
  with gr.Blocks(theme="NoCrypt/miku@>=1.2.2", css=css) as demo:
@@ -48,7 +65,7 @@ It saves you the trouble of typing them in.<br>
48
  - Input your new repo name. If empty, auto-complete. e.g. 'newrepo'.
49
  - Set the parameters. If not sure, just use the defaults.
50
  - Click "Submit".
51
- - Patiently wait until the output changes.
52
  """
53
  )
54
  with gr.Column():
@@ -58,6 +75,7 @@ It saves you the trouble of typing them in.<br>
58
  hf_token = gr.Textbox(label="Your HF write token", placeholder="hf_...", value="", max_lines=1)
59
  civitai_key = gr.Textbox(label="Your Civitai API Key (Optional)", info="If you download model from Civitai...", placeholder="", value="", max_lines=1)
60
  is_upload_sf = gr.Checkbox(label="Upload single safetensors file into new repo", value=False)
 
61
  with gr.Accordion("Advanced settings", open=False):
62
  is_half = gr.Checkbox(label="Half precision", value=True)
63
  vae = gr.Dropdown(label="VAE", choices=vaes, value="", allow_custom_value=True)
@@ -84,6 +102,12 @@ It saves you the trouble of typing them in.<br>
84
  lora1, lora1s, lora2, lora2s, lora3, lora3s, lora4, lora4s, lora5, lora5s],
85
  outputs=[repo_urls, output_md],
86
  )
 
 
 
 
 
 
87
 
88
  demo.queue()
89
  demo.launch()
 
26
  ]
27
  schedulers = list(SCHEDULER_CONFIG_MAP.keys())
28
 
29
+ preset_dict = {
30
+ "Default": [True, "", "Euler a", "", 1.0, "", 1.0, "", 1.0, "", 1.0, "", 1.0],
31
+ "Bake in standard VAE": [True, "https://huggingface.co/madebyollin/sdxl-vae-fp16-fix/blob/main/sdxl.vae.safetensors",
32
+ "Euler a", "", 1.0, "", 1.0, "", 1.0, "", 1.0, "", 1.0],
33
+ "Hyper-SDXL & SPO": [True, "https://huggingface.co/madebyollin/sdxl-vae-fp16-fix/blob/main/sdxl.vae.safetensors",
34
+ "TCD", "https://huggingface.co/ByteDance/Hyper-SD/blob/main/Hyper-SDXL-8steps-CFG-lora.safetensors", 1.0,
35
+ "", 1.0, "", 1.0, "", 1.0, "", 1.0],
36
+ }
37
+
38
+
39
+ def set_presets(preset: str="Default"):
40
+ p = []
41
+ if preset in preset_dict.keys(): p = preset_dict[preset]
42
+ else: p = preset_dict["Default"]
43
+ return p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8], p[9], p[10], p[11], p[12]
44
+
45
+
46
  css = """"""
47
 
48
  with gr.Blocks(theme="NoCrypt/miku@>=1.2.2", css=css) as demo:
 
65
  - Input your new repo name. If empty, auto-complete. e.g. 'newrepo'.
66
  - Set the parameters. If not sure, just use the defaults.
67
  - Click "Submit".
68
+ - Patiently wait until the output changes. It takes approximately 2 to 3 minutes (downloading from HF).
69
  """
70
  )
71
  with gr.Column():
 
75
  hf_token = gr.Textbox(label="Your HF write token", placeholder="hf_...", value="", max_lines=1)
76
  civitai_key = gr.Textbox(label="Your Civitai API Key (Optional)", info="If you download model from Civitai...", placeholder="", value="", max_lines=1)
77
  is_upload_sf = gr.Checkbox(label="Upload single safetensors file into new repo", value=False)
78
+ presets = gr.Radio(label="Presets", choices=list(preset_dict.keys()), value="Default")
79
  with gr.Accordion("Advanced settings", open=False):
80
  is_half = gr.Checkbox(label="Half precision", value=True)
81
  vae = gr.Dropdown(label="VAE", choices=vaes, value="", allow_custom_value=True)
 
102
  lora1, lora1s, lora2, lora2s, lora3, lora3s, lora4, lora4s, lora5, lora5s],
103
  outputs=[repo_urls, output_md],
104
  )
105
+ presets.change(
106
+ fn=set_presets,
107
+ inputs=[presets],
108
+ outputs=[is_half, vae, scheduler, lora1, lora1s, lora2, lora2s, lora3, lora3s, lora4, lora4s, lora5, lora5s],
109
+ queue=False,
110
+ )
111
 
112
  demo.queue()
113
  demo.launch()