@@ -2267,12 +2267,41 @@ void setConvertImatrixCollector(void* collector) {
2267
2267
imatrix_collector = ((IMatrixCollector*)collector);
2268
2268
}
2269
2269
2270
- bool convert (const char * input_path , const char * vae_path, const char * output_path, sd_type_t output_type, const char * tensor_type_rules) {
2270
+ bool convert (const char * model_path, const char * clip_l_path, const char * clip_g_path, const char * t5xxl_path, const char * diffusion_model_path , const char * vae_path, const char * output_path, sd_type_t output_type, const char * tensor_type_rules) {
2271
2271
ModelLoader model_loader;
2272
2272
2273
- if (!model_loader.init_from_file (input_path)) {
2274
- LOG_ERROR (" init model loader from file failed: '%s'" , input_path);
2275
- return false ;
2273
+ if (model_path != NULL && strlen (model_path) > 0 ) {
2274
+ if (!model_loader.init_from_file (model_path)) {
2275
+ LOG_ERROR (" init model loader from file failed: '%s'" , model_path);
2276
+ return false ;
2277
+ }
2278
+ }
2279
+
2280
+ if (clip_l_path != NULL && strlen (clip_l_path) > 0 ) {
2281
+ if (!model_loader.init_from_file (clip_l_path, " text_encoders.clip_l.transformer." )) {
2282
+ LOG_ERROR (" init model loader from file failed: '%s'" , clip_l_path);
2283
+ return false ;
2284
+ }
2285
+ }
2286
+
2287
+ if (clip_g_path != NULL && strlen (clip_g_path) > 0 ) {
2288
+ if (!model_loader.init_from_file (clip_g_path, " text_encoders.clip_g.transformer." )) {
2289
+ LOG_ERROR (" init model loader from file failed: '%s'" , clip_g_path);
2290
+ return false ;
2291
+ }
2292
+ }
2293
+ if (t5xxl_path != NULL && strlen (t5xxl_path) > 0 ) {
2294
+ if (!model_loader.init_from_file (t5xxl_path, " text_encoders.t5xxl.transformer." )) {
2295
+ LOG_ERROR (" init model loader from file failed: '%s'" , t5xxl_path);
2296
+ return false ;
2297
+ }
2298
+ }
2299
+
2300
+ if (diffusion_model_path != NULL && strlen (diffusion_model_path) > 0 ) {
2301
+ if (!model_loader.init_from_file (diffusion_model_path, " model.diffusion_model." )) {
2302
+ LOG_ERROR (" init model loader from file failed: '%s'" , diffusion_model_path);
2303
+ return false ;
2304
+ }
2276
2305
}
2277
2306
2278
2307
if (vae_path != NULL && strlen (vae_path) > 0 ) {
0 commit comments