|
import os
|
|
import sys
|
|
import subprocess
|
|
|
|
def run_controlnet_training(args):
|
|
"""Run train_controlnet.py with the provided command-line arguments."""
|
|
|
|
controlnet_script = os.path.join(os.path.dirname(__file__), "..",
|
|
"third_party", "diffusers", "examples", "controlnet", "train_controlnet.py")
|
|
|
|
|
|
command = [sys.executable, controlnet_script] + args
|
|
|
|
|
|
try:
|
|
subprocess.run(command, check=True)
|
|
except subprocess.CalledProcessError as e:
|
|
print(f"Error running train_controlnet.py: {e}", file=sys.stderr)
|
|
sys.exit(e.returncode)
|
|
|
|
if __name__ == "__main__":
|
|
run_controlnet_training(sys.argv[1:]) |