Prism (Tensor Prism):
TensorPrism_Prism combines the weights of two models to produce a new model for your workflow. It offers five ways to decide how much of the second model to incorporate: some use weight magnitudes or similarity, one compares weight signs, and one can use a Fourier transform to blend different portions of the weight data. This gives you more control than a single uniform blend, although the effect on generated images depends on the models you combine. The node clones the first model and applies changes to compatible weights; it does not modify the original model in place. The supplied source defines this behavior in a class named TensorPrism_FastPrism; the headings here use the requested documentation name.
Prism (Tensor Prism) Input Parameters:
model_A
Required MODEL. This is the starting model: the node clones it and applies the calculated weight changes to that clone. Its weights also serve as the reference for deciding whether a change needs to be applied. Choose the model whose structure and baseline behavior you want to retain.
model_B
Required MODEL. This supplies the weights to blend with those from model_A. The node considers a weight only when both models have an entry with the same name, both entries are tensors, their shapes match, and each tensor has at least 10 elements. Entries that do not meet those conditions are skipped, so models with more compatible weights give the node more to work with.
merge_method
Required option with five choices: spectral_blend, frequency_bands, magnitude_weighted, adaptive_mix, and harmonic_merge. spectral_blend splits weight elements into two groups according to their magnitudes and applies the two bias settings to those groups; despite its name, this method does not run an FFT. frequency_bands uses variance-based weighting in fast mode and for one-dimensional tensors, or an FFT-based blend for higher-dimensional tensors in balanced and precise modes. magnitude_weighted adjusts the blend according to the overall sizes of the two tensors. adaptive_mix reduces the requested blend according to how similar the tensors are. harmonic_merge applies different biases where corresponding weights have matching or nonmatching signs. The source lists the choices in this order but does not declare a separate default for the option.
strength
Required FLOAT with minimum 0.0, maximum 1.0, default 0.5, and step 0.01. This is the base blending control: higher values generally allow more influence from model_B, while lower values generally retain more of model_A. Its exact effect depends on the chosen method and, if enabled, layer-specific adjustments. In particular, magnitude_weighted can still blend at 0.0, so zero is not a universal guarantee of an unchanged result.
low_freq_bias
Optional FLOAT with minimum 0.0, maximum 1.0, default 0.7, and step 0.05. This scales the contribution from model_B for the group designated “low” by the selected method. It affects spectral_blend, frequency_bands, and harmonic_merge; it is not used by magnitude_weighted or adaptive_mix. The meaning of “low” differs between methods: for example, spectral_blend assigns its low-labeled group using a weight-magnitude threshold, not a measured frequency.
high_freq_bias
Optional FLOAT with minimum 0.0, maximum 1.0, default 0.3, and step 0.05. This scales the contribution from model_B for the group designated “high” by spectral_blend or frequency_bands. In harmonic_merge, it applies where the corresponding weight signs do not align. It has no effect in magnitude_weighted or adaptive_mix. As with low_freq_bias, the label does not mean every method identifies a literal frequency band.
spectral_precision
Optional option with choices fast, balanced, and precise; default fast. This setting affects only frequency_bands. fast uses variance-based weighting instead of an FFT. For tensors with at least two dimensions, both balanced and precise take the same FFT-based path in the supplied code; there is no separate higher-precision algorithm for precise. One-dimensional tensors use the fast path regardless of this setting.
layer_selective
Optional BOOLEAN with default False. When enabled, the node reduces strength for weights whose names contain certain terms: attention or attn receives 80% of the base strength, norm or ln 60%, embed or pos 40%, and output or head 90%. Other matching weights use the full strength. The checks run in that order, so the first matching category takes precedence. Enable this when you want the blend to be more restrained in those named parts of the model.
Prism (Tensor Prism) Output Parameters:
merged_model
The sole output, a MODEL containing a clone of model_A with calculated changes applied to eligible weights. You can pass it to the next model-consuming node in your workflow. It is not a report of which weights changed: missing names, incompatible shapes, non-tensor entries, and tensors with fewer than 10 elements remain as they were in model_A. If no eligible weight produces a meaningful difference, the output is still returned, but no patches are added.
Prism (Tensor Prism) Usage Tips:
- Start with
strengthat its default0.5and compare results with a lower value when you want to preserve more ofmodel_A. Compare images using the same prompt and generation settings so differences are easier to judge. - Choose
frequency_bandswithspectral_precisionset tofastwhen you want its variance-based path. Choosebalancedto try its FFT-based path on eligible higher-dimensional tensors; selectingpreciseuses that same path in this implementation. - Adjust
low_freq_biasandhigh_freq_biasonly withspectral_blend,frequency_bands, orharmonic_merge. For example, increasing one bias increases the potential contribution frommodel_Bin the group to which that method assigns it. - Try
layer_selectivewhen a full-strength blend changes too much. It reduces blending for the recognized weight-name categories, but it does not select or exclude whole layers. - Use models with matching weight names and shapes when possible. The node silently skips incompatible entries, so a completed merge does not establish that every part of
model_Bwas incorporated. - Do not use
magnitude_weightedwhen you needstrengthset to0.0to preservemodel_Aexactly. Its formula can produce a blend even at that setting.
Prism (Tensor Prism) Common Errors and Solutions:
No visible change after merging
- Explanation: This is not a specific error message emitted by the source. The node may have found no compatible weights, calculated changes below its
1e-6threshold, or applied a blend too subtle to notice in an image. - Solution: Check that the models have compatible weight names and shapes, then test a higher
strengthand compare outputs under the same generation settings. Remember that some methods also scale strength with biases or layer selection.
Model type mismatch or missing MODEL connection
- Explanation: No exact validation message is defined in this node class. The required
model_Aandmodel_Bsockets expectMODELvalues; an unconnected socket or incompatible upstream output may be rejected by the workflow before the merge runs. - Solution: Connect valid model outputs to both required sockets and check that the upstream model-loading nodes complete successfully.
Invalid merge_method or spectral_precision value
- Explanation: No exact validation message is defined in this node class. The interface restricts each setting to its listed choices, so a workflow containing another value may fail validation.
- Solution: Re-select one of the displayed options. Use
fast,balanced, orpreciseforspectral_precision.
strength, low_freq_bias, or high_freq_bias is outside the allowed range
- Explanation: No exact validation message is defined in this node class. Each of these controls is declared with an allowed range of
0.0to1.0; an out-of-range value in an edited workflow may be rejected. - Solution: Set the affected value within
0.0to1.0and retry.
FFT or tensor operation fails for a weight
- Explanation: The source does not expose a specific per-weight error message. If a spectral calculation fails,
frequency_bandsmay fall back tospectral_blend; if the merge method still fails for a weight, the outer handler attempts a simple linear blend for that weight. The workflow may therefore finish without using the method you expected for every weight. - Solution: Try
spectral_precisionset tofastor choose a non-FFT method. If the workflow still fails, check the upstream models and consult the application’s runtime log for the actual exception.
add_patches failure or an incompatible model object
- Explanation: The source calls
clone(), reads each model’sstate_dict(), and, when changes exist, callsadd_patches(). It does not catch failures in those outer operations or define a fixed message for them, so the wording depends on the runtime and upstream model objects. - Solution: Verify that both inputs are valid models from compatible workflow nodes. Reconnect or reload the models, then use the actual runtime message to identify which operation failed.
