diff --git a/src/BuiltinExtensions/ComfyUIBackend/ExtraNodes/SwarmComfyCommon/SwarmExtractLora.py b/src/BuiltinExtensions/ComfyUIBackend/ExtraNodes/SwarmComfyCommon/SwarmExtractLora.py index 0917e6443..497c2dc16 100644 --- a/src/BuiltinExtensions/ComfyUIBackend/ExtraNodes/SwarmComfyCommon/SwarmExtractLora.py +++ b/src/BuiltinExtensions/ComfyUIBackend/ExtraNodes/SwarmComfyCommon/SwarmExtractLora.py @@ -114,7 +114,11 @@ def extract_lora(self, base_model, base_model_clip, other_model, other_model_cli other_data = other_model.model_state_dict() key_count = len(base_data.keys()) if save_clip: - key_count += len(base_model_clip.get_sd().keys()) + if base_model_clip is None or other_model_clip is None: + print("Warning: save_clip is True but CLIP model(s) are unavailable (model may not have embedded CLIP, e.g. Flux), skipping CLIP extraction") + save_clip = False + else: + key_count += len(base_model_clip.get_sd().keys()) pbar = comfy.utils.ProgressBar(key_count) class Helper: steps = 0