ComfyUI Node
π§° Ray's Model Tools: Model Merge
Merge compatible models connected to model_a/model_b or data_a/data_b with Ray's nine strategies. Task-vector strategies require a base_model or base_data connection. Block weights accepts a connected JSON string. Inference outputs load automatically when used. merge_name combines the sources, method, ratio, precision, settings fingerprint and time for use with Save Model.
π§° Ray's Model Tools: Model Merge
- model_a
- model_b
- base_model
- clip_a
- clip_b
- base_clip
- vae_a
- data_a
- data_b
- base_data
- model
- clip
- vae
- model_data
- metadata
- report
- merge_name
βstrategyLERPβΊ
βweight_a0.50βΊ
βweight_formatbf16βΊ
βcomponentsdiffusionβΊ
βmismatchforbidβΊ
βseed0βΊ
βdensity0.50βΊ
βlambda1.00βΊ
βtop_trim0.10βΊ
βbottom_trim0.01βΊ
βpath_aβΊ
βpath_bβΊ
βbase_pathβΊ
βblock_weights{}βΊ
Categoryπ Ray/π§° Model Tools
Inputs (24)
| Name | Type | Default | Description |
|---|---|---|---|
| strategy | COMBO | LERP | Merge method. LERP is a fast weighted average; SLERP blends along layer angles. TIES, DARE, DELLA and Breadcrumbs merge changes from a compatible base model. Open node Help for each method's strengths and limitations. |
| weight_a | FLOAT | 0.500β1 | Contribution of A; B uses 1 minus this value. For LERP/SLERP, 1 selects A and 0 selects B. Other methods apply this ratio to pruned changes from the base. Matching block_weights entries override it. |
| weight_format | COMBO | bf16 | Storage format for merged floating-point weights. Quantized formats target eligible Linear layers; other merged layers stay bf16. Higher precision needs more RAM and disk space and cannot restore precision already lost in a source. |
| components | COMBO | diffusion | Components whose matching tensors are merged: diffusion, diffusion plus text, text encoder only, or all. Unselected components pass through from A unchanged. |
| mismatch | COMBO | forbid | Forbid: require matching names and shapes. Intersect: merge shared tensors of matching shape. Pad/Trim: resize shared tensors to the larger/smaller shape. Intersect, Pad and Trim preserve tensors present in only one input unchanged. |
| seed | INT | 00β18446744073709550000 | Random pruning seed for DARE and DELLA. Each tensor derives its own seed from this value and its name. Keep the seed and inputs fixed for repeatable results. |
| density | FLOAT | 0.500β1 | Retention setting for TIES, DARE and DELLA. TIES keeps the largest changes; DARE uses this keep probability; DELLA adjusts it by change magnitude. Lower values prune more changes and can lose detail or amplify retained updates. |
| lambda | FLOAT | 1.000β5 | DELLA importance exponent. Higher values favor larger changes from the base more strongly. Zero gives uniform keep probabilities; use with density and seed. |
| top_trim | FLOAT | 0.100β0.99 | Breadcrumbs fraction of the largest absolute changes to discard as outliers, per tensor. 0.10 means 10%. Top trim plus Bottom trim must be less than 1. |
| bottom_trim | FLOAT | 0.010β0.99 | Breadcrumbs fraction of the smallest absolute changes to discard, per tensor. 0.01 means 1%. Top trim plus Bottom trim must be less than 1; excessive trimming can remove learned details. |
| model_aopt | MODEL | Live model A, including its active patches. Takes priority over data_a and legacy path_a. Effective weights are read one tensor at a time without a temporary source checkpoint. | |
| model_bopt | MODEL | Live model B, including its active patches. Takes priority over data_b and legacy path_b. | |
| base_modelopt | MODEL | Compatible original training base for task-vector methods. Required for TIES, DARE, DELLA and Breadcrumbs; unused by LERP and SLERP. Takes priority over base_data. | |
| clip_aopt | CLIP | Text encoder belonging to live model A. Include it when merging text-encoder components or retaining a full checkpoint. | |
| clip_bopt | CLIP | Text encoder belonging to live model B when merging text-encoder components. | |
| base_clipopt | CLIP | Text encoder belonging to the live base model when merging text-encoder changes. | |
| vae_aopt | VAE | VAE to include with live model A. It passes through from A unless the selected components include it. | |
| data_aopt | RAY_MODEL_DATA | Model data for A, usually from Load Model As. Used when model_a is disconnected; reads file or RAM weights without initializing an inference model. | |
| data_bopt | RAY_MODEL_DATA | Model data for B, usually from Load Model As. Used when model_b is disconnected. | |
| base_dataopt | RAY_MODEL_DATA | Model data for the compatible base. Used by task-vector methods when base_model is disconnected; not needed for LERP or SLERP. | |
| path_aopt | STRING | Legacy model A path retained for saved workflows. Connect Load Model As to data_a for normal file selection; model_a and data_a take priority. | |
| path_bopt | STRING | Legacy model B path retained for saved workflows. Connect Load Model As to data_b; model_b and data_b take priority. | |
| base_pathopt | STRING | Legacy base-model path retained for saved workflows. Connect a compatible base to base_data or base_model instead. | |
| block_weightsopt | STRING | {} | Connect a STRING containing a JSON map of tensor prefixes to A ratios between 0 and 1, for example {"diffusion_model.blocks.0.": 0.7}. The longest prefix wins. Leave disconnected for the global Weight A ratio. |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| model | MODEL | Native ComfyUI diffusion model. Inference components are initialized when this output is used; data-only workflows can use model_data instead. |
| clip | CLIP | Native text encoder when available in the source and enabled by the selected loading/component options; otherwise absent. |
| vae | VAE | Native VAE when available in the source and enabled by the selected loading/component options; otherwise absent. |
| model_data | RAY_MODEL_DATA | Model Tools data handle for a source file or in-memory result. Connect it directly to compatible merge, conversion, inspection, or save nodes without an extra inference load. |
| metadata | RAY_MODEL_METADATA | Structured metadata for the source or result, including operation information where applicable. |
| report | STRING | Readable inspection or operation report, including compatibility, format, processing, and saved-result information relevant to this operation. |
| merge_name | STRING | Suggested merge filename containing resolved source names, strategy, settings, and execution datetime. Connect to Save Model's filename_prefix. |