Skip to content

Commit 0428156

Browse files
committed
fix: convert vae
Signed-off-by: thxCode <thxcode0824@gmail.com>
1 parent 0f54865 commit 0428156

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/convert/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ int convert_sd3(const convert_params& params, const SDVersion ver) {
251251
return 1;
252252
}
253253

254-
if (!ignore_vae) {
254+
if (!ignore_vae || !params.vae_model_file_path.empty()) {
255255
if (params.vae_model_file_path.empty()) {
256256
loaded = loader.init_from_safetensors_file(params.model_path, "vae/diffusion_pytorch_model", params.vae_output_type, "vae.");
257257
} else {
@@ -316,7 +316,7 @@ int convert_flux(const convert_params& params, const SDVersion ver) {
316316
return 1;
317317
}
318318

319-
if (!ignore_vae) {
319+
if (!ignore_vae || !params.vae_model_file_path.empty()) {
320320
if (params.vae_model_file_path.empty()) {
321321
loaded = loader.init_from_safetensors_file(params.model_path, "vae/diffusion_pytorch_model", params.vae_output_type, "vae.");
322322
} else {
@@ -367,7 +367,7 @@ int convert_sdxl(const convert_params& params, const SDVersion ver) {
367367
return 1;
368368
}
369369

370-
if (!ignore_vae) {
370+
if (!ignore_vae || !params.vae_model_file_path.empty()) {
371371
if (params.vae_model_file_path.empty()) {
372372
loaded = loader.init_from_safetensors_file(params.model_path, "vae/diffusion_pytorch_model", params.vae_output_type, "vae.");
373373
} else {
@@ -420,7 +420,7 @@ int convert_sd(const convert_params& params, const SDVersion ver) {
420420
return 1;
421421
}
422422

423-
if (!ignore_vae) {
423+
if (!ignore_vae || !params.vae_model_file_path.empty()) {
424424
if (params.vae_model_file_path.empty()) {
425425
loaded = loader.init_from_safetensors_file(params.model_path, "vae/diffusion_pytorch_model", params.vae_output_type, "vae.");
426426
} else {

0 commit comments

Comments
 (0)