Fix PiD Injector.
Browse filesFiles changed (2)
120 unmodified lines1211221231241251261271289 unmodified lines1381391401411421431444 unmodified lines149150151152153154155120 unmodified linesif active_model_file:try:model_config = load_model_config()checkpoints = model_config.get("Checkpoints", {})for arch_name, arch_data in checkpoints.items():models_list = arch_data.get("models", [])for model_entry in models_list:if model_entry.get('path') == active_model_file:9 unmodified linesprint(f"Error looking up model architecture in PiD injector: {e}")if architecture:architecture = architecture.lower().replace(" ", "-").replace(".", "")else:file_lower = active_model_file.lower().replace("-", "").replace("_", "").replace(".", "")for arch in sorted(architectures_settings.keys(), key=len, reverse=True):4 unmodified linescandidates.append(arch.replace("-i1", ""))if "-kv" in arch:candidates.append(arch.replace("-kv", ""))matched = Falsefor cand in candidates:if cand.replace("-", "").replace(".", "") in file_lower:120 unmodified lines1211221231241251261271281291301311321339 unmodified lines1431441451461471481491501511521531541551561571584 unmodified lines163164165166167168169170171172173174175120 unmodified linesif active_model_file:try:model_config = load_model_config()checkpoints = {}for k, v in model_config.items():if isinstance(v, dict):checkpoints.update(v)for arch_name, arch_data in checkpoints.items():if not isinstance(arch_data, dict):continuemodels_list = arch_data.get("models", [])for model_entry in models_list:if model_entry.get('path') == active_model_file:9 unmodified linesprint(f"Error looking up model architecture in PiD injector: {e}")if architecture:try:from core.settings import ARCHITECTURES_CONFIGarch_info = ARCHITECTURES_CONFIG.get('architectures', {}).get(architecture, {})mapped_arch = arch_info.get("model_type")if mapped_arch:architecture = mapped_archelse:architecture = architecture.lower().replace(" ", "-").replace(".", "")except Exception:architecture = architecture.lower().replace(" ", "-").replace(".", "")else:file_lower = active_model_file.lower().replace("-", "").replace("_", "").replace(".", "")for arch in sorted(architectures_settings.keys(), key=len, reverse=True):4 unmodified linescandidates.append(arch.replace("-i1", ""))if "-kv" in arch:candidates.append(arch.replace("-kv", ""))if arch == "sdxl":candidates.append("xl")if arch == "sd35":candidates.append("sd3")if arch == "flux1":candidates.append("flux")matched = Falsefor cand in candidates:if cand.replace("-", "").replace(".", "") in file_lower:
79 unmodified lines8081828384858679 unmodified linesif is_pid_enabled:import yamlpid_config_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))), 'yaml', 'pid.yaml')pid_unet_name = "pid_flux1_1024_to_4096_4step_mxfp8.safetensors"try:with open(pid_config_path, 'r', encoding='utf-8') as f:pid_config = yaml.safe_load(f) or {}79 unmodified lines8081828384858679 unmodified linesif is_pid_enabled:import yamlpid_config_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))), 'yaml', 'pid.yaml')pid_unet_name = "pid_1.5_flux1_1024_to_4096_4step_int8_convrot.safetensors"try:with open(pid_config_path, 'r', encoding='utf-8') as f:pid_config = yaml.safe_load(f) or {}
chain_injectors/pid_injector.py+23-3
core/pipelines/sd_image_pipeline.py+1-1