Nodes/ComfyUI-WordEmbeddings/WordEmbeddings: Token Axis3D
ComfyUI Node

WordEmbeddings: Token Axis3D

The pack's most ambitious meter

By jtrue·Created about a year ago·Updated about a year ago· 1
WordEmbeddings: Token Axis3D
  • we_model
  • x
  • y
  • z
  • summary
  • x_cos_left
  • x_cos_right
  • y_cos_left
  • y_cos_right
  • z_cos_left
  • z_cos_right
tokenking
axis1man,boy,he,him,his,father,brother,husband|woman,girl,she,her,hers,mother,sister,wife
axis2hot,warm,heat|cold,cool,freezing
axis3royal,king,kingly,noble|common,commoner,peasant,ordinary
token_can_be_phrasetrue
lowercasetrue
neutral_eps0.08
equal_eps0.020
strong_proj0.35
strong_cos0.65
strong_gap0.30

If Token Axis is a ruler and Axis 2D is a map, this is the whole coordinate system. Give it a token and three left|right axes and it returns three projections - x, y, z - plus a summary sentence and six per-pole cosine values. The README's example is the good one: gender, temperature, and royalty as three independent meters, so king reads strongly male, roughly neutral on heat, and firmly royal. One word, three simultaneous positions in semantic space.

It's the pack's most elaborate node, and it's also the one with the narrowest real use. Three meters are genuinely useful when you're building a scoring system that needs to place tokens in a 3D semantic space - say, filtering prompt terms by several dimensions at once, or feeding a 3D visualization. But for most day-to-day experiments, two axes answer the question with less setup and less to go wrong. Don't reach for this one first; reach for it when the 2D grid genuinely isn't enough.

How it works

Exactly like the 1D and 2D nodes, one more time. Each axis gets its own left/right pole means, its own axis direction, its own projection and pair of cosines - computed independently, no orthogonality assumed, no shared math between axes. The summary applies the same strength gating as the 2D version, so an axis only shows up in the sentence if it clears strong_proj (0.35), strong_cos (0.65), and strong_gap (0.30). If an axis is weak, it's silently dropped from the text - but the numbers for it still come out the outputs, so nothing is actually lost.

The inputs

we_model (required) is the handle from a Loader. Then the usual suspects, tripled where it matters:

  • token - the word or phrase to place.
  • axis1, axis2, axis3 - the three left|right pole definitions. Defaults: gender, temperature (hot,warm,heat | cold,cool,freezing), and royalty.
  • token_can_be_phrase, lowercase, neutral_eps, equal_eps - shared behavior with the whole axis family. Leave them on their defaults.

The ten outputs are the full set of numbers you could want from three meters: x, y, z (FLOAT projections, positive = left pole), summary (STRING), and x_cos_left, x_cos_right, y_cos_left, y_cos_right, z_cos_left, z_cos_right. There's a real workflow here if you want it: those six cosines give you a per-pole confidence profile for any token, which is more resolution than the 1D node ever exposes.

Honest caveats

Three axes means three chances for a pole to be missing from the vocabulary - and one empty pole makes that axis "unavailable" in the summary while the numbers still come back. Check the axis strings; typo a single word on pole three and you'll get a confusingly partial sentence.

Bias warning applies double here. A three-axis machine that confidently reports nurse as more female, warmer, and less royal than doctor isn't doing anything wrong - it's faithfully reporting what the training corpus believed. That's the point of the tool and the reason to keep it on a leash.

And one more: the axes don't have to be orthogonal, and with three of them the odds that two are partly correlated go up. If your z axis ends up just re-measuring x, the summary will tell you (weak z) and you should pick a more distinct pole. Install is the pack standard: Manager search "ComfyUI-WordEmbeddings," or clone https://github.com/jtrue/ComfyUI-WordEmbeddings into custom_nodes, pip install gensim numpy, restart.

CategoryWordEmbeddings

Inputs (12)

NameTypeDefaultDescription
we_modelWE_MODEL
tokenoptSTRINGking
axis1optSTRINGman,boy,he,him,his,father,brother,husband|woman,girl,she,her,hers,mother,sister,wife
axis2optSTRINGhot,warm,heat|cold,cool,freezing
axis3optSTRINGroyal,king,kingly,noble|common,commoner,peasant,ordinary
token_can_be_phraseoptBOOLEANtrue
lowercaseoptBOOLEANtrue
neutral_epsoptFLOAT0.080–0.5
equal_epsoptFLOAT0.0200–0.2
strong_projoptFLOAT0.350–1
strong_cosoptFLOAT0.650–1
strong_gapoptFLOAT0.300–1

Outputs (10)

NameTypeDescription
xFLOAT
yFLOAT
zFLOAT
summarySTRING
x_cos_leftFLOAT
x_cos_rightFLOAT
y_cos_leftFLOAT
y_cos_rightFLOAT
z_cos_leftFLOAT
z_cos_rightFLOAT