Nodes/Tensor Prism/Intelligent Tensor Selector (Tensor Prism)
ComfyUI Node

Intelligent Tensor Selector (Tensor Prism)

Per-tensor picking instead of per-block averaging

By Arctenox·Created 12 months ago·Updated 7 months ago· 2
Intelligent Tensor Selector (Tensor Prism)
  • model_A
  • model_B
  • model_C
  • model_D
  • merged_model
  • selection_report
selection_modebest_quality
magnitude_weight0.30
variance_weight0.25
spectral_weight0.25
stability_weight0.20
model_A_bias0.00
attention_preference0.00
output_preference0.00
enable_block_analysistrue
memory_efficienttrue

Block merges work at the level of whole layers: this input block from A, that output block from B. Intelligent Tensor Selector (Tensor Prism) goes one level finer - it judges each individual tensor and picks whichever model's version is "better" by a scoring function, then stitches a model together from the winning tensors. Think of it as a merge that's allowed to disagree with itself layer by layer.

That fineness is the appeal and the risk. Tensor-level selection can preserve detail that a block-level average would smear away - but it can also produce internal inconsistencies, because the model never agreed to be assembled this way. It's the kind of tool you reach for when a regular merge looks washed out and you want to keep the best of both without the mud.

How it works

Wire in model_A and model_B (optional model_C / model_D for four-way). Pick a selection_mode:

  • best_quality (default) - the strictest picker; takes the top-scoring tensor per position.
  • balanced - softer, blends near-ties.
  • conservative - only replaces a tensor when the other model clearly wins; keeps A's version by default.
  • aggressive - replaces more freely, chasing detail over consistency.

Then set the scoring weights, each with an author-provided tooltip: magnitude_weight (0.3, "Weight for tensor magnitude (strength)"), variance_weight (0.25, "Weight for tensor variance (detail preservation)"), spectral_weight (0.25, "Weight for spectral content (frequency richness)"), stability_weight (0.2, "Weight for numerical stability"). Higher magnitude pulls toward strong weights; higher variance pulls toward detailed weights; higher stability pulls toward safe ones.

Three bias dials shape the outcome without changing the scoring math: model_A_bias (-1 to +1, "Bias toward Model A"), attention_preference and output_preference (both ±0.5) which nudge extra weight toward attention layers and output layers respectively. enable_block_analysis (on) and memory_efficient (on) control how much work happens per block and how hard it tries to save VRAM.

Outputs: merged_model (MODEL) for your KSampler, and selection_report (STRING) - a plain-text play-by-play of which model won which tensor. Read the report; it's the only way to learn whether the "intelligence" is doing what you think.

The settings that matter

Beginners should leave the four weights alone and just switch selection_mode between best_quality and balanced - that's most of the value. Reach for model_A_bias when one model keeps stealing the merge; reach for attention_preference when you specifically want one parent's attention behavior to win.

Installing it

Part of ComfyUI-Tensor-Prism-Node-Pack. ComfyUI Manager → search "Tensor Prism" → Install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/AstrionX/ComfyUI-Tensor-Prism-Node-Pack

No model downloads; deps are torch, numpy, psutil. Ignore the typo'd clone URL in the README.

The honest caveat

This is one of the pack's most experimental nodes, and the pack itself is a first-time author's "vibe-coded" effort with no community track record worth citing. Tensor-level selection can give you gorgeous, detailed hybrids - and it can give you a model that renders beautifully for one prompt and falls apart on the next. Always A/B it against a plain block merge of the same two models before committing, and treat conservative mode as the sensible default when the result matters.

CategoryTensor_Prism/Advanced

Inputs (14)

NameTypeDefaultDescription
model_AMODEL
model_BMODEL
selection_modeCOMBObest_quality4 options: best_quality, balanced, conservative, aggressive
magnitude_weightFLOAT0.300–2Weight for tensor magnitude (strength)
variance_weightFLOAT0.250–2Weight for tensor variance (detail preservation)
spectral_weightFLOAT0.250–2Weight for spectral content (frequency richness)
stability_weightFLOAT0.200–2Weight for numerical stability
model_A_biasFLOAT0.00-1–1Bias toward Model A (-1 = strong B preference, +1 = strong A preference)
attention_preferenceFLOAT0.00-0.5–0.5Extra weight for attention layers
output_preferenceFLOAT0.00-0.5–0.5Extra weight for output layers
model_CoptMODEL
model_DoptMODEL
enable_block_analysisoptBOOLEANtrue
memory_efficientoptBOOLEANtrue

Outputs (2)

NameTypeDescription
merged_modelMODEL
selection_reportSTRING