John6666 commited on
Commit
225af71
·
verified ·
1 Parent(s): eab05e2

Upload 3 files

Browse files
Files changed (2) hide show
  1. app.py +68 -101
  2. presets.py +147 -134
app.py CHANGED
@@ -62,152 +62,119 @@ In particular, conversion of FLUX.1 or SD 3.5 is almost impossible in CPU space.
62
  with gr.Group():
63
  sdxl_presets = gr.Radio(label="Presets", choices=list(sdxl_preset_dict.keys()), value=list(sdxl_preset_dict.keys())[0])
64
  sdxl_mtype = gr.Textbox(value="SDXL", visible=False)
65
- with gr.Row():
66
- sdxl_dtype = gr.Radio(label="Output data type", choices=get_dtypes(), value=DEFAULT_DTYPE)
67
  with gr.Accordion("Advanced settings", open=False):
68
  with gr.Row():
69
  sdxl_vae = gr.Dropdown(label="VAE", choices=sdxl_vaes, value="", allow_custom_value=True)
70
- sdxl_clip = gr.Dropdown(label="CLIP", choices=clips, value="", allow_custom_value=True)
71
  sdxl_scheduler = gr.Dropdown(label="Scheduler (Sampler)", choices=schedulers, value="Euler a")
72
- with gr.Row():
73
- with gr.Column():
74
- with gr.Row():
75
- sdxl_lora1 = gr.Dropdown(label="LoRA1", choices=sdxl_loras, value="", allow_custom_value=True, min_width=320)
76
  sdxl_lora1s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA1 weight scale")
77
- with gr.Column():
78
- with gr.Row():
79
- sdxl_lora2 = gr.Dropdown(label="LoRA2", choices=sdxl_loras, value="", allow_custom_value=True, min_width=320)
80
  sdxl_lora2s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA2 weight scale")
81
- with gr.Column():
82
- with gr.Row():
83
- sdxl_lora3 = gr.Dropdown(label="LoRA3", choices=sdxl_loras, value="", allow_custom_value=True, min_width=320)
84
  sdxl_lora3s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA3 weight scale")
85
- with gr.Column():
86
- with gr.Row():
87
- sdxl_lora4 = gr.Dropdown(label="LoRA4", choices=sdxl_loras, value="", allow_custom_value=True, min_width=320)
88
  sdxl_lora4s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA4 weight scale")
89
- with gr.Column():
90
- with gr.Row():
91
- sdxl_lora5 = gr.Dropdown(label="LoRA5", choices=sdxl_loras, value="", allow_custom_value=True, min_width=320)
92
  sdxl_lora5s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA5 weight scale")
93
  sdxl_run_button = gr.Button(value="Submit", variant="primary")
94
  with gr.Tab("SD 1.5"):
95
  with gr.Group():
96
- with gr.Row():
97
- sd15_presets = gr.Radio(label="Presets", choices=list(sd15_preset_dict.keys()), value=list(sd15_preset_dict.keys())[0])
98
- with gr.Row():
99
- sd15_mtype = gr.Textbox(value="SD 1.5", visible=False)
100
- with gr.Row():
101
- sd15_dtype = gr.Radio(label="Output data type", choices=get_dtypes(), value=DEFAULT_DTYPE)
102
  with gr.Row():
103
  sd15_ema = gr.Checkbox(label="Extract EMA", value=True, visible=True)
104
- with gr.Row():
105
  sd15_isize = gr.Radio(label="Image size", choices=["768", "512"], value="768")
106
- with gr.Row():
107
  sd15_sc = gr.Checkbox(label="Safety checker", value=False)
108
  with gr.Accordion("Advanced settings", open=False):
109
  with gr.Row():
110
  sd15_vae = gr.Dropdown(label="VAE", choices=sd15_vaes, value="", allow_custom_value=True)
111
- with gr.Row():
112
- sd15_clip = gr.Dropdown(label="CLIP", choices=clips, value="", allow_custom_value=True)
113
- with gr.Row():
114
  sd15_scheduler = gr.Dropdown(label="Scheduler (Sampler)", choices=schedulers, value="Euler")
115
- with gr.Row():
116
- with gr.Column():
117
- with gr.Row():
118
- sd15_lora1 = gr.Dropdown(label="LoRA1", choices=sd15_loras, value="", allow_custom_value=True, min_width=320)
119
- with gr.Row():
120
- sd15_lora1s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA1 weight scale")
121
- with gr.Row():
122
- with gr.Column():
123
- sd15_lora2 = gr.Dropdown(label="LoRA2", choices=sd15_loras, value="", allow_custom_value=True, min_width=320)
124
- with gr.Row():
125
- sd15_lora2s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA2 weight scale")
126
- with gr.Column():
127
- with gr.Row():
128
- sd15_lora3 = gr.Dropdown(label="LoRA3", choices=sd15_loras, value="", allow_custom_value=True, min_width=320)
129
- with gr.Row():
130
- sd15_lora3s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA3 weight scale")
131
-
132
- with gr.Column():
133
- with gr.Row():
134
- sd15_lora4 = gr.Dropdown(label="LoRA4", choices=sd15_loras, value="", allow_custom_value=True, min_width=320)
135
- with gr.Row():
136
- sd15_lora4s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA4 weight scale")
137
- with gr.Column():
138
- with gr.Row():
139
- sd15_lora5 = gr.Dropdown(label="LoRA5", choices=sd15_loras, value="", allow_custom_value=True, min_width=320)
140
- with gr.Row():
141
- sd15_lora5s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA5 weight scale")
142
  sd15_run_button = gr.Button(value="Submit", variant="primary")
143
  with gr.Tab("FLUX.1"):
144
  with gr.Group():
145
  flux_presets = gr.Radio(label="Presets", choices=list(flux_preset_dict.keys()), value=list(flux_preset_dict.keys())[0])
146
  flux_mtype = gr.Textbox(value="FLUX", visible=False)
147
- with gr.Row():
148
- flux_dtype = gr.Radio(label="Output data type", choices=get_dtypes(), value="bf16")
149
  flux_base_repo = gr.Dropdown(label="Base repo ID", choices=FLUX_BASE_REPOS, value=FLUX_BASE_REPOS[0], allow_custom_value=True, visible=True)
150
  with gr.Accordion("Advanced settings", open=False):
151
  with gr.Row():
152
  flux_vae = gr.Dropdown(label="VAE", choices=flux_vaes, value="", allow_custom_value=True)
 
153
  with gr.Row():
154
  flux_clip = gr.Dropdown(label="CLIP", choices=clips, value="", allow_custom_value=True)
155
- with gr.Row():
156
  flux_t5 = gr.Dropdown(label="T5", choices=t5s, value="", allow_custom_value=True)
157
- flux_scheduler = gr.Dropdown(label="Scheduler (Sampler)", choices=[""], value="", visible=False)
158
- with gr.Row():
159
- with gr.Column():
160
- flux_lora1 = gr.Dropdown(label="LoRA1", choices=flux_loras, value="", allow_custom_value=True, min_width=320)
161
  flux_lora1s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA1 weight scale")
162
- with gr.Column():
163
- flux_lora2 = gr.Dropdown(label="LoRA2", choices=flux_loras, value="", allow_custom_value=True, min_width=320)
164
  flux_lora2s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA2 weight scale")
165
- with gr.Column():
166
- flux_lora3 = gr.Dropdown(label="LoRA3", choices=flux_loras, value="", allow_custom_value=True, min_width=320)
167
  flux_lora3s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA3 weight scale")
168
- with gr.Column():
169
- flux_lora4 = gr.Dropdown(label="LoRA4", choices=flux_loras, value="", allow_custom_value=True, min_width=320)
170
  flux_lora4s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA4 weight scale")
171
- with gr.Column():
172
- flux_lora5 = gr.Dropdown(label="LoRA5", choices=flux_loras, value="", allow_custom_value=True, min_width=320)
173
  flux_lora5s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA5 weight scale")
174
  flux_run_button = gr.Button(value="Submit", variant="primary")
175
  with gr.Tab("SD 3.5"):
176
  with gr.Group():
177
- with gr.Row():
178
- sd35_presets = gr.Radio(label="Presets", choices=list(sd35_preset_dict.keys()), value=list(sd35_preset_dict.keys())[0])
179
- with gr.Row():
180
- sd35_mtype = gr.Textbox(value="SD 3.5", visible=False)
181
- with gr.Row():
182
- sd35_dtype = gr.Radio(label="Output data type", choices=get_dtypes(), value="bf16")
183
  sd35_base_repo = gr.Dropdown(label="Base repo ID", choices=SD35_BASE_REPOS, value=SD35_BASE_REPOS[0], allow_custom_value=True, visible=True)
184
  with gr.Accordion("Advanced settings", open=False):
185
  with gr.Row():
186
  sd35_vae = gr.Dropdown(label="VAE", choices=sd35_vaes, value="", allow_custom_value=True)
187
- sd35_clip = gr.Dropdown(label="CLIP", choices=clips, value="", allow_custom_value=True)
188
- sd35_t5 = gr.Dropdown(label="T5", choices=t5s, value="", allow_custom_value=True)
189
  sd35_scheduler = gr.Dropdown(label="Scheduler (Sampler)", choices=[""], value="", visible=False)
190
  with gr.Row():
191
- with gr.Column():
192
- with gr.Row():
193
- sd35_lora1 = gr.Dropdown(label="LoRA1", choices=sd35_loras, value="", allow_custom_value=True, min_width=320)
194
- sd35_lora1s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA1 weight scale")
195
- with gr.Column():
196
- with gr.Row():
197
- sd35_lora2 = gr.Dropdown(label="LoRA2", choices=sd35_loras, value="", allow_custom_value=True, min_width=320)
198
- sd35_lora2s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA2 weight scale")
199
- with gr.Column():
200
- with gr.Row():
201
- sd35_lora3 = gr.Dropdown(label="LoRA3", choices=sd35_loras, value="", allow_custom_value=True, min_width=320)
202
- sd35_lora3s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA3 weight scale")
203
- with gr.Column():
204
- with gr.Row():
205
- sd35_lora4 = gr.Dropdown(label="LoRA4", choices=sd35_loras, value="", allow_custom_value=True, min_width=320)
206
- sd35_lora4s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA4 weight scale")
207
- with gr.Column():
208
- with gr.Row():
209
- sd35_lora5 = gr.Dropdown(label="LoRA5", choices=sd35_loras, value="", allow_custom_value=True, min_width=320)
210
- sd35_lora5s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA5 weight scale")
211
  sd35_run_button = gr.Button(value="Submit", variant="primary")
212
  adv_args = gr.Textbox(label="Advanced arguments", value="", visible=False)
213
  with gr.Group():
@@ -281,4 +248,4 @@ In particular, conversion of FLUX.1 or SD 3.5 is almost impossible in CPU space.
281
  clear_button.click(lambda: ([], "<br><br>"), None, [repo_urls, output_md], queue=False, show_api=False)
282
 
283
  demo.queue()
284
- demo.launch()
 
62
  with gr.Group():
63
  sdxl_presets = gr.Radio(label="Presets", choices=list(sdxl_preset_dict.keys()), value=list(sdxl_preset_dict.keys())[0])
64
  sdxl_mtype = gr.Textbox(value="SDXL", visible=False)
65
+ sdxl_dtype = gr.Radio(label="Output data type", choices=get_dtypes(), value=DEFAULT_DTYPE)
 
66
  with gr.Accordion("Advanced settings", open=False):
67
  with gr.Row():
68
  sdxl_vae = gr.Dropdown(label="VAE", choices=sdxl_vaes, value="", allow_custom_value=True)
 
69
  sdxl_scheduler = gr.Dropdown(label="Scheduler (Sampler)", choices=schedulers, value="Euler a")
70
+ sdxl_clip = gr.Dropdown(label="CLIP", choices=clips, value="", allow_custom_value=True)
71
+ with gr.Column():
72
+ with gr.Row():
73
+ sdxl_lora1 = gr.Dropdown(label="LoRA1", choices=sdxl_loras, value="", allow_custom_value=True, min_width=320, scale=2)
74
  sdxl_lora1s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA1 weight scale")
75
+ with gr.Row():
76
+ sdxl_lora2 = gr.Dropdown(label="LoRA2", choices=sdxl_loras, value="", allow_custom_value=True, min_width=320, scale=2)
 
77
  sdxl_lora2s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA2 weight scale")
78
+ with gr.Row():
79
+ sdxl_lora3 = gr.Dropdown(label="LoRA3", choices=sdxl_loras, value="", allow_custom_value=True, min_width=320, scale=2)
 
80
  sdxl_lora3s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA3 weight scale")
81
+ with gr.Row():
82
+ sdxl_lora4 = gr.Dropdown(label="LoRA4", choices=sdxl_loras, value="", allow_custom_value=True, min_width=320, scale=2)
 
83
  sdxl_lora4s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA4 weight scale")
84
+ with gr.Row():
85
+ sdxl_lora5 = gr.Dropdown(label="LoRA5", choices=sdxl_loras, value="", allow_custom_value=True, min_width=320, scale=2)
 
86
  sdxl_lora5s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA5 weight scale")
87
  sdxl_run_button = gr.Button(value="Submit", variant="primary")
88
  with gr.Tab("SD 1.5"):
89
  with gr.Group():
90
+ sd15_presets = gr.Radio(label="Presets", choices=list(sd15_preset_dict.keys()), value=list(sd15_preset_dict.keys())[0])
91
+ sd15_mtype = gr.Textbox(value="SD 1.5", visible=False)
92
+ sd15_dtype = gr.Radio(label="Output data type", choices=get_dtypes(), value=DEFAULT_DTYPE)
 
 
 
93
  with gr.Row():
94
  sd15_ema = gr.Checkbox(label="Extract EMA", value=True, visible=True)
 
95
  sd15_isize = gr.Radio(label="Image size", choices=["768", "512"], value="768")
 
96
  sd15_sc = gr.Checkbox(label="Safety checker", value=False)
97
  with gr.Accordion("Advanced settings", open=False):
98
  with gr.Row():
99
  sd15_vae = gr.Dropdown(label="VAE", choices=sd15_vaes, value="", allow_custom_value=True)
 
 
 
100
  sd15_scheduler = gr.Dropdown(label="Scheduler (Sampler)", choices=schedulers, value="Euler")
101
+ sd15_clip = gr.Dropdown(label="CLIP", choices=clips, value="", allow_custom_value=True)
102
+ with gr.Column():
103
+ with gr.Row():
104
+ sd15_lora1 = gr.Dropdown(label="LoRA1", choices=sd15_loras, value="", allow_custom_value=True, min_width=320, scale=2)
105
+ sd15_lora1s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA1 weight scale")
106
+ with gr.Row():
107
+ sd15_lora2 = gr.Dropdown(label="LoRA2", choices=sd15_loras, value="", allow_custom_value=True, min_width=320, scale=2)
108
+ sd15_lora2s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA2 weight scale")
109
+ with gr.Row():
110
+ sd15_lora3 = gr.Dropdown(label="LoRA3", choices=sd15_loras, value="", allow_custom_value=True, min_width=320, scale=2)
111
+ sd15_lora3s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA3 weight scale")
112
+ with gr.Row():
113
+ sd15_lora4 = gr.Dropdown(label="LoRA4", choices=sd15_loras, value="", allow_custom_value=True, min_width=320, scale=2)
114
+ sd15_lora4s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA4 weight scale")
115
+ with gr.Row():
116
+ sd15_lora5 = gr.Dropdown(label="LoRA5", choices=sd15_loras, value="", allow_custom_value=True, min_width=320, scale=2)
117
+ sd15_lora5s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA5 weight scale")
 
 
 
 
 
 
 
 
 
 
118
  sd15_run_button = gr.Button(value="Submit", variant="primary")
119
  with gr.Tab("FLUX.1"):
120
  with gr.Group():
121
  flux_presets = gr.Radio(label="Presets", choices=list(flux_preset_dict.keys()), value=list(flux_preset_dict.keys())[0])
122
  flux_mtype = gr.Textbox(value="FLUX", visible=False)
123
+ flux_dtype = gr.Radio(label="Output data type", choices=get_dtypes(), value="bf16")
 
124
  flux_base_repo = gr.Dropdown(label="Base repo ID", choices=FLUX_BASE_REPOS, value=FLUX_BASE_REPOS[0], allow_custom_value=True, visible=True)
125
  with gr.Accordion("Advanced settings", open=False):
126
  with gr.Row():
127
  flux_vae = gr.Dropdown(label="VAE", choices=flux_vaes, value="", allow_custom_value=True)
128
+ flux_scheduler = gr.Dropdown(label="Scheduler (Sampler)", choices=[""], value="", visible=False)
129
  with gr.Row():
130
  flux_clip = gr.Dropdown(label="CLIP", choices=clips, value="", allow_custom_value=True)
 
131
  flux_t5 = gr.Dropdown(label="T5", choices=t5s, value="", allow_custom_value=True)
132
+ with gr.Column():
133
+ with gr.Row():
134
+ flux_lora1 = gr.Dropdown(label="LoRA1", choices=flux_loras, value="", allow_custom_value=True, min_width=320, scale=2)
 
135
  flux_lora1s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA1 weight scale")
136
+ with gr.Row():
137
+ flux_lora2 = gr.Dropdown(label="LoRA2", choices=flux_loras, value="", allow_custom_value=True, min_width=320, scale=2)
138
  flux_lora2s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA2 weight scale")
139
+ with gr.Row():
140
+ flux_lora3 = gr.Dropdown(label="LoRA3", choices=flux_loras, value="", allow_custom_value=True, min_width=320, scale=2)
141
  flux_lora3s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA3 weight scale")
142
+ with gr.Row():
143
+ flux_lora4 = gr.Dropdown(label="LoRA4", choices=flux_loras, value="", allow_custom_value=True, min_width=320, scale=2)
144
  flux_lora4s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA4 weight scale")
145
+ with gr.Row():
146
+ flux_lora5 = gr.Dropdown(label="LoRA5", choices=flux_loras, value="", allow_custom_value=True, min_width=320, scale=2)
147
  flux_lora5s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA5 weight scale")
148
  flux_run_button = gr.Button(value="Submit", variant="primary")
149
  with gr.Tab("SD 3.5"):
150
  with gr.Group():
151
+ sd35_presets = gr.Radio(label="Presets", choices=list(sd35_preset_dict.keys()), value=list(sd35_preset_dict.keys())[0])
152
+ sd35_mtype = gr.Textbox(value="SD 3.5", visible=False)
153
+ sd35_dtype = gr.Radio(label="Output data type", choices=get_dtypes(), value="bf16")
 
 
 
154
  sd35_base_repo = gr.Dropdown(label="Base repo ID", choices=SD35_BASE_REPOS, value=SD35_BASE_REPOS[0], allow_custom_value=True, visible=True)
155
  with gr.Accordion("Advanced settings", open=False):
156
  with gr.Row():
157
  sd35_vae = gr.Dropdown(label="VAE", choices=sd35_vaes, value="", allow_custom_value=True)
 
 
158
  sd35_scheduler = gr.Dropdown(label="Scheduler (Sampler)", choices=[""], value="", visible=False)
159
  with gr.Row():
160
+ sd35_clip = gr.Dropdown(label="CLIP", choices=clips, value="", allow_custom_value=True)
161
+ sd35_t5 = gr.Dropdown(label="T5", choices=t5s, value="", allow_custom_value=True)
162
+ with gr.Column():
163
+ with gr.Row():
164
+ sd35_lora1 = gr.Dropdown(label="LoRA1", choices=sd35_loras, value="", allow_custom_value=True, min_width=320, scale=2)
165
+ sd35_lora1s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA1 weight scale")
166
+ with gr.Row():
167
+ sd35_lora2 = gr.Dropdown(label="LoRA2", choices=sd35_loras, value="", allow_custom_value=True, min_width=320, scale=2)
168
+ sd35_lora2s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA2 weight scale")
169
+ with gr.Row():
170
+ sd35_lora3 = gr.Dropdown(label="LoRA3", choices=sd35_loras, value="", allow_custom_value=True, min_width=320, scale=2)
171
+ sd35_lora3s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA3 weight scale")
172
+ with gr.Row():
173
+ sd35_lora4 = gr.Dropdown(label="LoRA4", choices=sd35_loras, value="", allow_custom_value=True, min_width=320, scale=2)
174
+ sd35_lora4s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA4 weight scale")
175
+ with gr.Row():
176
+ sd35_lora5 = gr.Dropdown(label="LoRA5", choices=sd35_loras, value="", allow_custom_value=True, min_width=320, scale=2)
177
+ sd35_lora5s = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA5 weight scale")
 
 
178
  sd35_run_button = gr.Button(value="Submit", variant="primary")
179
  adv_args = gr.Textbox(label="Advanced arguments", value="", visible=False)
180
  with gr.Group():
 
248
  clear_button.click(lambda: ([], "<br><br>"), None, [repo_urls, output_md], queue=False, show_api=False)
249
 
250
  demo.queue()
251
+ demo.launch(ssr_mode=False)
presets.py CHANGED
@@ -1,134 +1,147 @@
1
- from sdutils import get_dtypes, SCHEDULER_CONFIG_MAP
2
-
3
-
4
- DEFAULT_DTYPE = get_dtypes()[0]
5
- schedulers = list(SCHEDULER_CONFIG_MAP.keys())
6
-
7
-
8
- clips = [
9
- "",
10
- "openai/clip-vit-large-patch14",
11
- ]
12
-
13
-
14
- t5s = [
15
- "",
16
- "https://huggingface.co/camenduru/FLUX.1-dev/blob/main/t5xxl_fp8_e4m3fn.safetensors",
17
- ]
18
-
19
-
20
- sdxl_vaes = [
21
- "",
22
- "https://huggingface.co/madebyollin/sdxl-vae-fp16-fix/blob/main/sdxl.vae.safetensors",
23
- "https://huggingface.co/nubby/blessed-sdxl-vae-fp16-fix/blob/main/sdxl_vae-fp16fix-blessed.safetensors",
24
- "https://huggingface.co/John6666/safetensors_converting_test/blob/main/xlVAEC_e7.safetensors",
25
- "https://huggingface.co/John6666/safetensors_converting_test/blob/main/xlVAEC_f1.safetensors",
26
- ]
27
-
28
-
29
- sdxl_loras = [
30
- "",
31
- "https://huggingface.co/SPO-Diffusion-Models/SPO-SDXL_4k-p_10ep_LoRA/blob/main/spo_sdxl_10ep_4k-data_lora_diffusers.safetensors",
32
- "https://huggingface.co/wangfuyun/PCM_Weights/blob/main/sdxl/pcm_sdxl_smallcfg_2step_converted.safetensors",
33
- "https://huggingface.co/wangfuyun/PCM_Weights/blob/main/sdxl/pcm_sdxl_smallcfg_4step_converted.safetensors",
34
- "https://huggingface.co/wangfuyun/PCM_Weights/blob/main/sdxl/pcm_sdxl_smallcfg_8step_converted.safetensors",
35
- "https://huggingface.co/wangfuyun/PCM_Weights/blob/main/sdxl/pcm_sdxl_normalcfg_8step_converted.safetensors",
36
- "https://huggingface.co/wangfuyun/PCM_Weights/blob/main/sdxl/pcm_sdxl_normalcfg_16step_converted.safetensors",
37
- "https://huggingface.co/ByteDance/Hyper-SD/blob/main/Hyper-SDXL-1step-lora.safetensors",
38
- "https://huggingface.co/ByteDance/Hyper-SD/blob/main/Hyper-SDXL-2steps-lora.safetensors",
39
- "https://huggingface.co/ByteDance/Hyper-SD/blob/main/Hyper-SDXL-4steps-lora.safetensors",
40
- "https://huggingface.co/ByteDance/Hyper-SD/blob/main/Hyper-SDXL-8steps-CFG-lora.safetensors",
41
- "https://huggingface.co/ByteDance/Hyper-SD/blob/main/Hyper-SDXL-12steps-CFG-lora.safetensors",
42
- "https://huggingface.co/latent-consistency/lcm-lora-sdxl/blob/main/pytorch_lora_weights.safetensors",
43
- ]
44
-
45
-
46
- sdxl_preset_dict = {
47
- "Default": [DEFAULT_DTYPE, "", "Euler a", "", 1.0, "", 1.0, "", 1.0, "", 1.0, "", 1.0],
48
- "Bake in standard VAE": [DEFAULT_DTYPE, "https://huggingface.co/madebyollin/sdxl-vae-fp16-fix/blob/main/sdxl.vae.safetensors",
49
- "Euler a", "", 1.0, "", 1.0, "", 1.0, "", 1.0, "", 1.0],
50
- "Hyper-SDXL / SPO": [DEFAULT_DTYPE, "https://huggingface.co/madebyollin/sdxl-vae-fp16-fix/blob/main/sdxl.vae.safetensors",
51
- "TCD", "https://huggingface.co/ByteDance/Hyper-SD/blob/main/Hyper-SDXL-8steps-CFG-lora.safetensors", 1.0,
52
- "https://huggingface.co/SPO-Diffusion-Models/SPO-SDXL_4k-p_10ep_LoRA/blob/main/spo_sdxl_10ep_4k-data_lora_diffusers.safetensors",
53
- 1.0, "", 1.0, "", 1.0, "", 1.0],
54
- }
55
-
56
-
57
- def sdxl_set_presets(preset: str="Default"):
58
- p = []
59
- if preset in sdxl_preset_dict.keys(): p = sdxl_preset_dict[preset]
60
- else: p = sdxl_preset_dict["Default"]
61
- 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]
62
-
63
-
64
- sd15_vaes = [
65
- "",
66
- "https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.ckpt",
67
- "https://huggingface.co/stabilityai/sd-vae-ft-ema-original/resolve/main/vae-ft-ema-560000-ema-pruned.ckpt",
68
- ]
69
-
70
-
71
- sd15_loras = [
72
- "",
73
- "https://huggingface.co/SPO-Diffusion-Models/SPO-SD-v1-5_4k-p_10ep_LoRA/blob/main/spo-sd-v1-5_4k-p_10ep_lora_diffusers.safetensors",
74
- ]
75
-
76
-
77
- sd15_preset_dict = {
78
- "Default": [DEFAULT_DTYPE, "", "Euler", "", 1.0, "", 1.0, "", 1.0, "", 1.0, "", 1.0, True],
79
- "Bake in standard VAE": [DEFAULT_DTYPE, "https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.ckpt",
80
- "Euler", "", 1.0, "", 1.0, "", 1.0, "", 1.0, "", 1.0, True],
81
- }
82
-
83
-
84
- def sd15_set_presets(preset: str="Default"):
85
- p = []
86
- if preset in sd15_preset_dict.keys(): p = sd15_preset_dict[preset]
87
- else: p = sd15_preset_dict["Default"]
88
- 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], p[13]
89
-
90
-
91
- flux_vaes = [
92
- "",
93
- ]
94
-
95
-
96
- flux_loras = [
97
- "",
98
- ]
99
-
100
-
101
- flux_preset_dict = {
102
- "dev": ["bf16", "", "", "", 1.0, "", 1.0, "", 1.0, "", 1.0, "", 1.0, "camenduru/FLUX.1-dev-diffusers"],
103
- "schnell": ["bf16", "", "", "", 1.0, "", 1.0, "", 1.0, "", 1.0, "", 1.0, "black-forest-labs/FLUX.1-schnell"],
104
- }
105
-
106
-
107
- def flux_set_presets(preset: str="dev"):
108
- p = []
109
- if preset in flux_preset_dict.keys(): p = flux_preset_dict[preset]
110
- else: p = flux_preset_dict["dev"]
111
- 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], p[13]
112
-
113
-
114
-
115
- sd35_vaes = [
116
- "",
117
- ]
118
-
119
-
120
- sd35_loras = [
121
- "",
122
- ]
123
-
124
-
125
- sd35_preset_dict = {
126
- "Default": ["bf16", "", "", "", 1.0, "", 1.0, "", 1.0, "", 1.0, "", 1.0, "adamo1139/stable-diffusion-3.5-large-ungated"],
127
- }
128
-
129
-
130
- def sd35_set_presets(preset: str="dev"):
131
- p = []
132
- if preset in sd35_preset_dict.keys(): p = sd35_preset_dict[preset]
133
- else: p = sd35_preset_dict["Default"]
134
- 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], p[13]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from sdutils import get_dtypes, SCHEDULER_CONFIG_MAP
2
+ import gradio as gr
3
+
4
+
5
+ DEFAULT_DTYPE = get_dtypes()[0]
6
+ schedulers = list(SCHEDULER_CONFIG_MAP.keys())
7
+
8
+
9
+ clips = [
10
+ "",
11
+ "openai/clip-vit-large-patch14",
12
+ ]
13
+
14
+
15
+ t5s = [
16
+ "",
17
+ "https://huggingface.co/camenduru/FLUX.1-dev/blob/main/t5xxl_fp8_e4m3fn.safetensors",
18
+ ]
19
+
20
+
21
+ sdxl_vaes = [
22
+ "",
23
+ "https://huggingface.co/madebyollin/sdxl-vae-fp16-fix/blob/main/sdxl.vae.safetensors",
24
+ "https://huggingface.co/nubby/blessed-sdxl-vae-fp16-fix/blob/main/sdxl_vae-fp16fix-blessed.safetensors",
25
+ "https://huggingface.co/John6666/safetensors_converting_test/blob/main/xlVAEC_e7.safetensors",
26
+ "https://huggingface.co/John6666/safetensors_converting_test/blob/main/xlVAEC_f1.safetensors",
27
+ ]
28
+
29
+
30
+ sdxl_loras = [
31
+ "",
32
+ "https://huggingface.co/SPO-Diffusion-Models/SPO-SDXL_4k-p_10ep_LoRA/blob/main/spo_sdxl_10ep_4k-data_lora_diffusers.safetensors",
33
+ "https://huggingface.co/wangfuyun/PCM_Weights/blob/main/sdxl/pcm_sdxl_smallcfg_2step_converted.safetensors",
34
+ "https://huggingface.co/wangfuyun/PCM_Weights/blob/main/sdxl/pcm_sdxl_smallcfg_4step_converted.safetensors",
35
+ "https://huggingface.co/wangfuyun/PCM_Weights/blob/main/sdxl/pcm_sdxl_smallcfg_8step_converted.safetensors",
36
+ "https://huggingface.co/wangfuyun/PCM_Weights/blob/main/sdxl/pcm_sdxl_normalcfg_8step_converted.safetensors",
37
+ "https://huggingface.co/wangfuyun/PCM_Weights/blob/main/sdxl/pcm_sdxl_normalcfg_16step_converted.safetensors",
38
+ "https://huggingface.co/ByteDance/Hyper-SD/blob/main/Hyper-SDXL-1step-lora.safetensors",
39
+ "https://huggingface.co/ByteDance/Hyper-SD/blob/main/Hyper-SDXL-2steps-lora.safetensors",
40
+ "https://huggingface.co/ByteDance/Hyper-SD/blob/main/Hyper-SDXL-4steps-lora.safetensors",
41
+ "https://huggingface.co/ByteDance/Hyper-SD/blob/main/Hyper-SDXL-8steps-CFG-lora.safetensors",
42
+ "https://huggingface.co/ByteDance/Hyper-SD/blob/main/Hyper-SDXL-12steps-CFG-lora.safetensors",
43
+ "https://huggingface.co/latent-consistency/lcm-lora-sdxl/blob/main/pytorch_lora_weights.safetensors",
44
+ ]
45
+
46
+
47
+ sdxl_preset_items = ["dtype", "vae", "scheduler", "lora1", "lora1s", "lora2", "lora2s", "lora3", "lora3s", "lora4", "lora4s", "lora5", "lora5s"]
48
+ sdxl_preset_dict = {
49
+ "Default": [DEFAULT_DTYPE, "", "Euler a", "", 1.0, "", 1.0, "", 1.0, "", 1.0, "", 1.0],
50
+ "Bake in standard VAE": [DEFAULT_DTYPE, "https://huggingface.co/madebyollin/sdxl-vae-fp16-fix/blob/main/sdxl.vae.safetensors",
51
+ "Euler a", "", 1.0, "", 1.0, "", 1.0, "", 1.0, "", 1.0],
52
+ "Hyper-SDXL / SPO": [DEFAULT_DTYPE, "https://huggingface.co/madebyollin/sdxl-vae-fp16-fix/blob/main/sdxl.vae.safetensors",
53
+ "TCD", "https://huggingface.co/ByteDance/Hyper-SD/blob/main/Hyper-SDXL-8steps-CFG-lora.safetensors", 1.0,
54
+ "https://huggingface.co/SPO-Diffusion-Models/SPO-SDXL_4k-p_10ep_LoRA/blob/main/spo_sdxl_10ep_4k-data_lora_diffusers.safetensors",
55
+ 1.0, "", 1.0, "", 1.0, "", 1.0],
56
+ }
57
+
58
+
59
+ def sdxl_set_presets(preset: str="Default"):
60
+ p = []
61
+ if preset in sdxl_preset_dict.keys(): p = sdxl_preset_dict[preset]
62
+ else: p = sdxl_preset_dict["Default"]
63
+ if len(p) != len(sdxl_preset_items): raise gr.Error("Invalid preset.")
64
+ print("Setting SDXL preset:", ", ".join([f"{x}:{y}" for x, y in zip(sdxl_preset_items, p)]))
65
+ 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]
66
+
67
+
68
+ sd15_vaes = [
69
+ "",
70
+ "https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.ckpt",
71
+ "https://huggingface.co/stabilityai/sd-vae-ft-ema-original/resolve/main/vae-ft-ema-560000-ema-pruned.ckpt",
72
+ ]
73
+
74
+
75
+ sd15_loras = [
76
+ "",
77
+ "https://huggingface.co/SPO-Diffusion-Models/SPO-SD-v1-5_4k-p_10ep_LoRA/blob/main/spo-sd-v1-5_4k-p_10ep_lora_diffusers.safetensors",
78
+ ]
79
+
80
+
81
+ sd15_preset_items = ["dtype", "vae", "scheduler", "lora1", "lora1s", "lora2", "lora2s", "lora3", "lora3s", "lora4", "lora4s", "lora5", "lora5s", "ema"]
82
+ sd15_preset_dict = {
83
+ "Default": [DEFAULT_DTYPE, "", "Euler", "", 1.0, "", 1.0, "", 1.0, "", 1.0, "", 1.0, True],
84
+ "Bake in standard VAE": [DEFAULT_DTYPE, "https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.ckpt",
85
+ "Euler", "", 1.0, "", 1.0, "", 1.0, "", 1.0, "", 1.0, True],
86
+ }
87
+
88
+
89
+ def sd15_set_presets(preset: str="Default"):
90
+ p = []
91
+ if preset in sd15_preset_dict.keys(): p = sd15_preset_dict[preset]
92
+ else: p = sd15_preset_dict["Default"]
93
+ if len(p) != len(sd15_preset_items): raise gr.Error("Invalid preset.")
94
+ print("Setting SD1.5 preset:", ", ".join([f"{x}:{y}" for x, y in zip(sd15_preset_items, p)]))
95
+ 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], p[13]
96
+
97
+
98
+ flux_vaes = [
99
+ "",
100
+ ]
101
+
102
+
103
+ flux_loras = [
104
+ "",
105
+ ]
106
+
107
+
108
+ flux_preset_items = ["dtype", "vae", "scheduler", "lora1", "lora1s", "lora2", "lora2s", "lora3", "lora3s", "lora4", "lora4s", "lora5", "lora5s", "base_repo"]
109
+ flux_preset_dict = {
110
+ "dev": ["bf16", "", "", "", 1.0, "", 1.0, "", 1.0, "", 1.0, "", 1.0, "camenduru/FLUX.1-dev-diffusers"],
111
+ "schnell": ["bf16", "", "", "", 1.0, "", 1.0, "", 1.0, "", 1.0, "", 1.0, "black-forest-labs/FLUX.1-schnell"],
112
+ }
113
+
114
+
115
+ def flux_set_presets(preset: str="dev"):
116
+ p = []
117
+ if preset in flux_preset_dict.keys(): p = flux_preset_dict[preset]
118
+ else: p = flux_preset_dict["dev"]
119
+ if len(p) != len(flux_preset_items): raise gr.Error("Invalid preset.")
120
+ print("Setting FLUX.1 preset:", ", ".join([f"{x}:{y}" for x, y in zip(flux_preset_items, p)]))
121
+ 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], p[13]
122
+
123
+
124
+
125
+ sd35_vaes = [
126
+ "",
127
+ ]
128
+
129
+
130
+ sd35_loras = [
131
+ "",
132
+ ]
133
+
134
+
135
+ sd35_preset_items = ["dtype", "vae", "scheduler", "lora1", "lora1s", "lora2", "lora2s", "lora3", "lora3s", "lora4", "lora4s", "lora5", "lora5s", "base_repo"]
136
+ sd35_preset_dict = {
137
+ "Default": ["bf16", "", "", "", 1.0, "", 1.0, "", 1.0, "", 1.0, "", 1.0, "adamo1139/stable-diffusion-3.5-large-ungated"],
138
+ }
139
+
140
+
141
+ def sd35_set_presets(preset: str="dev"):
142
+ p = []
143
+ if preset in sd35_preset_dict.keys(): p = sd35_preset_dict[preset]
144
+ else: p = sd35_preset_dict["Default"]
145
+ if len(p) != len(sd35_preset_items): raise gr.Error("Invalid preset.")
146
+ print("Setting SD3.5 preset:", ", ".join([f"{x}:{y}" for x, y in zip(sd35_preset_items, p)]))
147
+ 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], p[13]