2.9 KiB
2.9 KiB
ComfyUI WanVideo Save Merged Model
A ComfyUI custom node that saves a WanVideo Wrapper diffusion model — including merged LoRAs — as a standalone .safetensors checkpoint.
This lets you bake LoRA weights into a base model once and reload the result directly, without re-merging every time.
Installation
Clone or copy this repository into your ComfyUI custom_nodes directory:
cd ComfyUI/custom_nodes
git clone <repo-url> Comfyui_WW_msave
Restart ComfyUI. The node will appear under the WanVideoWrapper category.
Node: WanVideo Save Merged Model
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
model |
WANVIDEOMODEL |
Yes | Model output from the WanVideo Model Loader node (with LoRA merged) |
filename_prefix |
STRING |
Yes | Filename for the saved file (default: merged_wanvideo) |
save_dtype |
Dropdown | No | Cast weights before saving: same, bf16, fp16, fp32. Defaults to same (keeps current dtype). Set explicitly if the model was loaded in fp8. |
custom_path |
STRING |
No | Absolute path to a save directory. Leave empty to save in ComfyUI/models/diffusion_models/ |
Usage
- Set up the WanVideo Model Loader with a base model and one or more LoRAs (with
merge_lorasenabled) - Connect the
modeloutput to WanVideo Save Merged Model - Set a filename prefix and optionally choose a dtype and save path
- Queue the prompt — the merged checkpoint will be saved as
<filename_prefix>.safetensors
[WanVideo Lora Select] --> lora
|
[WanVideo Model Loader] --> model --> [WanVideo Save Merged Model]
The saved file can then be loaded directly by the WanVideo Model Loader as a regular diffusion model, without needing the original LoRA files.
Metadata
The saved .safetensors file includes metadata for traceability:
source_model— name of the base modelmerged_loras— JSON list of merged LoRA names and strengthssave_dtype— dtype used when saving
You can inspect this metadata with any safetensors viewer or with Python:
from safetensors import safe_open
with safe_open("merged_wanvideo.safetensors", framework="pt") as f:
print(f.metadata())
Notes
- Existing files are never overwritten — a counter suffix (
_1,_2, ...) is appended automatically - The
custom_pathinput only accepts absolute paths; relative paths are ignored and the default location is used - Saving a 14B model in bf16 produces a ~28 GB file — make sure you have enough disk space
- If the model was quantized to fp8, use
save_dtypeto cast back tobf16orfp16for a more portable checkpoint
Requirements
License
MIT