From b9b46638ac55006399c99964f1a671303b28aaec Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Sun, 31 Aug 2025 18:41:08 +0300 Subject: [PATCH] Fix FantasyPortrait + GGUF main model --- nodes_model_loading.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/nodes_model_loading.py b/nodes_model_loading.py index f2060a6..ff5b5ce 100644 --- a/nodes_model_loading.py +++ b/nodes_model_loading.py @@ -743,11 +743,11 @@ def load_weights(transformer, sd=None, weight_dtype=None, base_dtype=None, # Prepare sd from GGUF readers - # UniAnimate embedding weight workaround - unianimate_sd = {} - for key in sd.keys(): - if "dwpose_embedding" in key or "randomref_embedding_pose" in key: - unianimate_sd[key] = sd[key] + # handle possible non-GGUF weights + extra_sd = {} + for key, value in sd.items(): + if value.device != torch.device("meta"): + extra_sd[key] = value sd = {} all_tensors = [] @@ -777,8 +777,8 @@ def load_weights(transformer, sd=None, weight_dtype=None, base_dtype=None, is_gguf_quant = tensor.tensor_type not in [GGMLQuantizationType.F32, GGMLQuantizationType.F16] weights = torch.from_numpy(tensor.data.copy()).to(load_device) sd[tensor.name] = GGUFParameter(weights, quant_type=tensor.tensor_type) if is_gguf_quant else weights - sd.update(unianimate_sd) - del all_tensors, unianimate_sd + sd.update(extra_sd) + del all_tensors, extra_sd if not getattr(transformer, "gguf_patched", False): transformer = _replace_with_gguf_linear(