add ControlNet UNet to existing checkpoints
This commit is contained in:
parent
7f16b2f0ae
commit
7545d7c73d
|
@ -1667,11 +1667,15 @@ 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):
|
||||||
|
if not os.path.exists(cnet_path):
|
||||||
|
logger.info("SD checkpoint was converted without a ControlNet UNet, converting one")
|
||||||
|
else:
|
||||||
logger.info("ONNX pipeline already exists, skipping")
|
logger.info("ONNX pipeline already exists, skipping")
|
||||||
return (False, dest_path)
|
return (False, dest_path)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue