sd_hijack_ip2p.py 360 B

12345678910
  1. import os.path
  2. def should_hijack_ip2p(checkpoint_info):
  3. from modules import sd_models_config
  4. ckpt_basename = os.path.basename(checkpoint_info.filename).lower()
  5. cfg_basename = os.path.basename(sd_models_config.find_checkpoint_config_near_filename(checkpoint_info)).lower()
  6. return "pix2pix" in ckpt_basename and "pix2pix" not in cfg_basename