mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
restore ability to convert SDXL checkpoints to diffusers
This commit is contained in:
parent
d4d4d749f2
commit
77946bfea5
@ -112,16 +112,12 @@ class StableDiffusionXLModel(DiffusersModel):
|
|||||||
# The convert script adapted from the diffusers package uses
|
# The convert script adapted from the diffusers package uses
|
||||||
# strings for the base model type. To avoid making too many
|
# strings for the base model type. To avoid making too many
|
||||||
# source code changes, we simply translate here
|
# source code changes, we simply translate here
|
||||||
model_base_to_model_type = {BaseModelType.StableDiffusionXL: 'SDXL',
|
|
||||||
BaseModelType.StableDiffusionXLRefiner: 'SDXL-Refiner',
|
|
||||||
}
|
|
||||||
if isinstance(config, cls.CheckpointConfig):
|
if isinstance(config, cls.CheckpointConfig):
|
||||||
from invokeai.backend.model_management.models.stable_diffusion import _convert_ckpt_and_cache
|
from invokeai.backend.model_management.models.stable_diffusion import _convert_ckpt_and_cache
|
||||||
return _convert_ckpt_and_cache(
|
return _convert_ckpt_and_cache(
|
||||||
version=base_model,
|
version=base_model,
|
||||||
model_config=config,
|
model_config=config,
|
||||||
output_path=output_path,
|
output_path=output_path,
|
||||||
model_type=model_base_to_model_type[base_model],
|
|
||||||
use_safetensors=False, # corrupts sdxl models for some reason
|
use_safetensors=False, # corrupts sdxl models for some reason
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
@ -272,8 +272,9 @@ def _convert_ckpt_and_cache(
|
|||||||
|
|
||||||
model_base_to_model_type = {BaseModelType.StableDiffusion1: 'FrozenCLIPEmbedder',
|
model_base_to_model_type = {BaseModelType.StableDiffusion1: 'FrozenCLIPEmbedder',
|
||||||
BaseModelType.StableDiffusion2: 'FrozenOpenCLIPEmbedder',
|
BaseModelType.StableDiffusion2: 'FrozenOpenCLIPEmbedder',
|
||||||
|
BaseModelType.StableDiffusionXL: 'SDXL',
|
||||||
|
BaseModelType.StableDiffusionXLRefiner: 'SDXL-Refiner',
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info(f'Converting {weights} to diffusers format')
|
logger.info(f'Converting {weights} to diffusers format')
|
||||||
with SilenceWarnings():
|
with SilenceWarnings():
|
||||||
convert_ckpt_to_diffusers(
|
convert_ckpt_to_diffusers(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user