1
0
Fork 0

add ControlNet UNet to existing checkpoints

This commit is contained in:
Sean Sube 2023-04-15 10:54:52 -05:00
parent 7f16b2f0ae
commit 7545d7c73d
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 6 additions and 2 deletions

View File

@ -1667,13 +1667,17 @@ def convert_diffusion_original(
dest_path = os.path.join(conversion.model_path, name) dest_path = os.path.join(conversion.model_path, name)
dest_index = os.path.join(dest_path, "model_index.json") dest_index = os.path.join(dest_path, "model_index.json")
cnet_path = os.path.join(dest_path, "cnet", ONNX_MODEL)
logger.info( logger.info(
"converting original Diffusers checkpoint %s: %s -> %s", name, source, dest_path "converting original Diffusers checkpoint %s: %s -> %s", name, source, dest_path
) )
if os.path.exists(dest_path) and os.path.exists(dest_index): if os.path.exists(dest_path) and os.path.exists(dest_index):
logger.info("ONNX pipeline already exists, skipping") if not os.path.exists(cnet_path):
return (False, dest_path) logger.info("SD checkpoint was converted without a ControlNet UNet, converting one")
else:
logger.info("ONNX pipeline already exists, skipping")
return (False, dest_path)
torch_name = name + "-torch" torch_name = name + "-torch"
torch_path = os.path.join(conversion.cache_path, torch_name) torch_path = os.path.join(conversion.cache_path, torch_name)