diff --git a/nodes.py b/nodes.py index 689e8c0..b5089fb 100644 --- a/nodes.py +++ b/nodes.py @@ -1806,6 +1806,9 @@ class WanVideoSampler: image_cond = torch.cat([mask_latents, masked_video_latents_input], dim=0).to(device) clip_fea = None fun_ref_image = control_embeds.get("fun_ref_image", None) + if fun_ref_image is not None: + if transformer.ref_conv.weight.dtype in [torch.float8_e4m3fn, torch.float8_e5m2]: + raise ValueError("Fun-Control reference image won't work with this specific fp8_scaled model, it's been fixed in latest version of the model") control_start_percent = control_embeds.get("start_percent", 0.0) control_end_percent = control_embeds.get("end_percent", 1.0) else: diff --git a/nodes_model_loading.py b/nodes_model_loading.py index b84f79b..aec9f5d 100644 --- a/nodes_model_loading.py +++ b/nodes_model_loading.py @@ -1048,7 +1048,7 @@ class WanVideoModelLoader: dtype = torch.float8_e5m2 else: dtype = base_dtype - params_to_keep = {"norm", "bias", "time_in", "patch_embedding", "time_", "img_emb", "modulation", "text_embedding", "adapter", "add"} + params_to_keep = {"norm", "bias", "time_in", "patch_embedding", "time_", "img_emb", "modulation", "text_embedding", "adapter", "add", "ref_conv"} if not lora_low_mem_load: log.info("Using accelerate to load and assign model weights to device...") param_count = sum(1 for _ in transformer.named_parameters())