fix(mm): handle relative conversion config paths

I have tested main, controlnet and vae checkpoint conversions.
This commit is contained in:
psychedelicious
2024-03-29 22:32:43 +11:00
committed by Kent Keirsey
parent 31e9cf1f06
commit 6d261a5a13
4 changed files with 4 additions and 4 deletions

View File

@ -44,7 +44,7 @@ class ControlNetLoader(GenericDiffusersLoader):
)
self._logger.info(f"Converting {model_path} to diffusers format")
with open(self._app_config.root_path / config.config_path, "r") as config_stream:
with open(self._app_config.legacy_conf_path / config.config_path, "r") as config_stream:
convert_controlnet_to_diffusers(
model_path,
output_path,

View File

@ -98,7 +98,7 @@ class StableDiffusionDiffusersModel(GenericDiffusersLoader):
model_path,
output_path,
model_type=self.model_base_to_model_type[base],
original_config_file=self._app_config.root_path / config.config_path,
original_config_file=self._app_config.legacy_conf_path / config.config_path,
extract_ema=True,
from_safetensors=model_path.suffix == ".safetensors",
precision=self._torch_dtype,

View File

@ -44,7 +44,7 @@ class VAELoader(GenericDiffusersLoader):
raise Exception(f"VAE conversion not supported for model type: {config.base}")
else:
assert isinstance(config, CheckpointConfigBase)
config_file = self._app_config.root_path / config.config_path
config_file = self._app_config.legacy_conf_path / config.config_path
if model_path.suffix == ".safetensors":
checkpoint = safetensors_load_file(model_path, device="cpu")