Tensor_Prism Introduction
Tensor_Prism is a collection of custom nodes for ComfyUI that helps you combine and examine Stable Diffusion models. Instead of blending two checkpoints with a single setting, you can choose how much each model contributes, target particular parts of a model, or inspect the models before merging them.
This is useful when you want to explore a new visual style, combine qualities you like from two compatible checkpoints, or understand why a merge is producing unexpected images. Tensor_Prism also includes tools for merging CLIP text encoders and VAE models, creating selective masks, and managing memory during larger operations.
Start with two models of the same architecture, such as SDXL with SDXL. The author notes that SDXL block-layer merging in version 1.6.5 and later may need a regular ModelMergeSDXL workflow instead; that specific behavior was not confirmed in the original documentation. Treat a block merge as an experiment and compare its results with a standard merge.
How Tensor_Prism Works
A model contains many numerical values, often called weights, that influence how it generates images. A merge combines weights from two models to create a new set. Think of it like mixing two paints: the merge ratio controls how much of each goes into the mixture. In Main Merge, 0.0 uses Model A, 1.0 uses Model B, and 0.5 starts with an even blend.
Models are more complicated than paint, though. Different groups of weights do different jobs, so changing the overall ratio does not always give you the control you need. Tensor_Prism offers several ways to refine the mixture:
- Choose a blending method. Linear merging is a straightforward starting point. Other methods, including SLERP, cosine, directional, stochastic, and frequency-based blending, combine weights differently and may produce different results from the same two models.
- Choose which parts to affect. Block and layer controls let you give one model more influence in selected parts instead of applying one ratio everywhere.
- Use a mask. A mask acts like a stencil: it identifies the weights or components where a merge should apply.
- Analyze before merging. Analysis nodes report model characteristics, compare compatibility, or suggest per-block weights. These suggestions provide a starting point, not a guarantee of better images.
After any merge, generate test images with the same prompts and generation settings you used for the original models. That makes changes in style, prompt response, and image quality easier to judge.
Tensor_Prism Features
Everyday model merging
Main Merge combines two MODEL inputs. Start with Linear and a moderate ratio, then adjust after testing images. You can also try SLERP or Cosine for a different transition, Directional for vector-based blending, Frequency for frequency-domain blending, or Stochastic for a random-pattern approach.
Prism focuses on frequency-based merging. Its options include Spectral Blend, Frequency Bands, Magnitude Weighted, Adaptive Mix, and Harmonic Merge. Frequency Bands, for example, gives you separate control over lower- and higher-frequency parts of the model weights. Try this node when a conventional merge does not preserve the qualities you wanted from each source model; evaluate the generated images to see whether it helps.
Layered Blend provides separate controls for model components, including the text encoder, UNet blocks, and time embeddings. This can be useful when an overall merge ratio changes too much at once.
SDXL block controls
SDXL Block Merge provides individual controls for SDXL UNet blocks and supports TIES and add-difference methods. SDXL Advanced Block Merge adds memory-aware processing intended to make block merging more practical on GPUs with less memory, including cards with 12 GB or less. These nodes are for more targeted experiments than a basic two-model blend.
Because the author expressed uncertainty about block-layer merging in version 1.6.5 and later, check the output against a regular ModelMergeSDXL merge before relying on it.
Analysis and guided merging
Model Analyzer examines a model at Quick, Standard, or Deep depth. Depending on the options you enable, its report can describe model structure, weight statistics, memory use, comparison with a second model, and merge recommendations. It can also export analysis data as JSON. Use Quick for an initial look and deeper modes when planning a more involved merge.
Model Comparator provides a faster compatibility check, similarity score, and recommendations. Check compatibility before spending time on a complex merge; a similarity score alone does not tell you whether the artistic result will be good.
Analyze Model Weights compares two models and produces a per-block merge recipe. Its optimization choices are Combined, Similarity, Variance, Gradient Magnitude, and Entropy. You can adjust the starting weight, optimization strength, target weight distribution, and smoothing. Apply Merge Recipe then uses that recipe with a weighted-sum or add-difference method. Changing its strength changes how strongly the recipe is applied. Keep a record of settings that produce results you like so you can repeat or refine them.
Precise tensor selection and blending
Weighted Tensor Merge [Advanced] offers Linear, Sigmoid, Cosine, Exponential, Logarithmic, and Smoothstep blend modes. Curve Power changes the intensity of a non-linear blend. Layer Scaling can apply influence uniformly, increase it through deeper layers, or favor shallow or deep layers. You can also preserve extreme 0 and 1 mask values or add subtle noise. Start with uniform scaling when you want a simpler baseline, then change one control at a time.
Intelligent Tensor Selector chooses between models tensor by tensor using selected metrics. Competitive Model Selector extends this idea to multiple candidate models. These are exploratory alternatives to averaging all corresponding weights.
Noise Injection Merge
Noise Injection Merge, added in version 1.7.0, adds controlled variation while merging two models. Set a base merge ratio, then choose a pattern:
| Pattern | What it changes |
|---|---|
| Gaussian | Adds general-purpose random variation |
| Uniform | Draws variation from an even distribution |
| Structured | Applies more organized, block-like variation |
| Layer-Scaled | Changes noise strength according to layer depth |
| Adaptive | Adjusts noise according to model similarity |
| Perlin | Produces smoother variation |
| Gradient | Applies directional variation |
For a first experiment, the original guidance suggests a 0.5 base ratio, Gaussian noise, and a low noise strength around 0.02–0.05. Increase strength gradually; too much variation can reduce image coherence. Set a seed when you need to repeat a result. Optional focus_attention and focus_mlp settings limit where noise is applied. layer_scaling_factor, noise_decay, and adaptive_threshold refine the relevant patterns, while preserve_norms aims to keep weight magnitudes stable.
Masks and selective merging
The mask nodes let you specify where a blend takes effect:
- Model Mask Generator creates masks based on layers, blocks, attention or feedforward components, custom patterns, random sparsity, or depth gradients.
- Model Key Filter narrows the model parameters being considered.
- Mask Blender combines masks using Add, Multiply, Max, Min, Linear Blend, or Exponential Blend.
- Weighted Mask Merge applies a mask while combining models.
For example, you could create a mask that focuses on a selected component instead of blending the whole model equally. Test the result with familiar prompts to determine whether the selective change had the effect you intended.
CLIP, VAE, conversion, and weight tools
Advanced CLIP Merge combines CLIP text encoders using Linear, SLERP, Cosine, Weighted Average, or Spectral Blend methods. It also offers separate bias controls for attention, feedforward, embedding, and normalization layers, plus a norm-preservation option. If prompt interpretation changes unexpectedly after a CLIP merge, try a lower blend ratio and enable norm preservation.
VAE Merge blends VAE models using different interpolation methods. Epsilon/V-Pred Converter addresses models with different prediction types: specify the input and desired output type, then adjust conversion strength. The original guidance suggests starting at 1.0 for full conversion and reducing it if the result shows artifacts. Confirm the source model’s prediction type before changing it.
Model Weight Modifier directly changes weights through operations such as multiply, add, set value, clamp magnitude, and scale maximum absolute value. Model Enhancer provides additional model-enhancement functions; the supplied documentation does not describe its individual controls.
Memory and performance
Tensor_Prism describes automatic GPU detection, adaptive batch sizing, precision selection, cleanup, CPU fallback, and checks intended to prevent CPU/GPU device conflicts. These features can help with large merges, but available memory still matters.
If a merge runs out of memory, reduce its batch size or use CPU processing where the node offers that option. Larger batches can run more efficiently but need more memory; half precision (FP16) can save memory, though some operations may produce different results than full precision (FP32). Check whether the workflow is using the GPU when performance is unexpectedly slow.
What's New with Tensor_Prism
The original documentation lists these releases. Its header says 1.7.0, while its changelog also includes 1.7.1; the notes below follow the changelog without assuming which release you currently have.
- 1.7.1: Fixed Advanced CLIP Merge, Model Enhancer, and Mask Blender. These fixes matter if you use those nodes in an existing workflow.
- 1.7.0: Added Noise Injection Merge with seven patterns, layer targeting, depth-based controls, norm preservation, and seed-based repeatability. The author also reorganized the files and updated the documentation.
- 1.6.5: Corrected missing file uploads from 1.6.0 and confirmed that the Model Analyzer and Model Comparator files were included.
- 1.6.0: Added Model Analyzer and Model Comparator, organized them under an Analysis category, and removed fine-tuning placeholder nodes. These tools make it easier to assess models before merging.
- 1.5.0: Added Weighted Tensor Merge [Advanced], Analyze Model Weights, and Apply Merge Recipe. It also addressed device-conflict errors and improved memory management.
- 1.2.0: Added Advanced CLIP Merge and Epsilon/V-Pred Converter, expanded spectral CLIP blending, and improved SDXL block merging, mask precision, and memory handling.
- 1.1.0: Introduced GPU-focused memory management, CUDA/MPS/CPU compatibility improvements, bug fixes, and three additional nodes.
- 1.0.0: Initial release, with core merging methods, masks, spectral merging, SDXL block controls, and weight modification.
The author says versions before 1.6.0 were removed from the repository after issues were found in some earlier work. If you are following an older workflow, its nodes or behavior may differ from the currently available version.
Troubleshooting Tensor_Prism
A merge runs out of GPU memory
- Lower the batch size if the node exposes that setting.
- Use automatic precision or CPU processing where available.
- Close other GPU-intensive work, then retry.
- If the workflow still fails, begin with a simpler merge before adding analysis, masks, or block-level controls.
The models will not merge, or the result appears incompatible
- Check that both source models use the same architecture, such as SDXL with SDXL.
- Run Model Comparator for a quick compatibility assessment.
- Try Main Merge with Linear blending to establish a baseline.
- Add advanced methods only after the basic merge works.
The images contain artifacts or lose the qualities you wanted
- Reduce the influence of Model B or return to a more conservative merge ratio.
- If using noise injection, lower noise strength.
- Compare Linear, SLERP, and other available methods using the same test prompts.
- If using masks or block weights, change one setting at a time so you can identify its effect.
- For a CLIP merge, try a lower ratio and enable
preserve_norms.
An SDXL block merge does not behave as expected
- Confirm both inputs are SDXL models.
- Make a comparable merge with a regular
ModelMergeSDXLworkflow. - Test both outputs with identical prompts and generation settings.
- Use the workflow whose results you can verify; the author did not confirm the block-layer behavior for version 1.6.5 and later.
Analysis fails or processing is unusually slow
- Check available system RAM as well as GPU memory; the documented weight-analysis calculations use the CPU.
- Try Quick analysis instead of Standard or Deep.
- Check whether a merge has fallen back to CPU processing.
- Retry with fewer simultaneous memory-intensive tasks.
You see an “expected tensors on same device” error
- Check which Tensor_Prism version your ComfyUI setup is using.
- The changelog says version 1.5.0 addressed CPU/GPU device conflicts, so use a version that includes that fix.
- Retry with a simpler two-model workflow to identify whether a particular node or combination triggers the error.
Frequently asked questions
Do I need to understand model weights to begin?
No. Start with two compatible models and Main Merge. Change the ratio, generate comparison images, and explore analysis or masks when you need finer control.
Is there one best merge method?
No method is guaranteed to look best. Use Linear as a baseline, keep your test prompts consistent, and compare alternatives against the qualities you want to preserve.
What is a merge recipe?
It is a set of suggested weights for different model blocks. Analyze Model Weights creates one, and Apply Merge Recipe uses it to produce a merge.
Will the same noise settings give me the same result?
Set a seed to make noise-injection experiments reproducible. Keep the source models and other settings the same when comparing runs.
Are any checkpoints included with Tensor_Prism?
The supplied documentation describes nodes for working with models; it does not list bundled checkpoint models.
Learn More about Tensor_Prism
The Tensor_Prism repository is the source linked in the original documentation for the node pack. For broader guidance on building and testing node workflows, see the ComfyUI documentation. When learning a new merge method, keep a small set of familiar prompts and compare images side by side: the analysis reports and merge settings are most useful when you can connect them to visible results.
