fix(mm): provide ckpt config as stream to diffusers

Fixes converting ckpt main models
This commit is contained in:
psychedelicious 2024-03-18 22:39:15 +11:00
parent 9fa9ebe386
commit 9d045964d6

View File

@ -79,17 +79,18 @@ class StableDiffusionDiffusersModel(GenericDiffusersLoader):
) )
self._logger.info(f"Converting {model_path} to diffusers format") self._logger.info(f"Converting {model_path} to diffusers format")
convert_ckpt_to_diffusers( with open(self._app_config.root_path / config_file, "r") as config_stream:
model_path, convert_ckpt_to_diffusers(
output_path, model_path,
model_type=self.model_base_to_model_type[base], output_path,
original_config_file=self._app_config.root_path / config_file, model_type=self.model_base_to_model_type[base],
extract_ema=True, original_config_file=config_stream,
from_safetensors=model_path.suffix == ".safetensors", extract_ema=True,
precision=self._torch_dtype, from_safetensors=model_path.suffix == ".safetensors",
prediction_type=prediction_type, precision=self._torch_dtype,
image_size=image_size, prediction_type=prediction_type,
upcast_attention=upcast_attention, image_size=image_size,
load_safety_checker=False, upcast_attention=upcast_attention,
) load_safety_checker=False,
)
return output_path return output_path