WordEmbeddings: Token Axis3D
The pack's most ambitious meter
- we_model
- x
- y
- z
- summary
- x_cos_left
- x_cos_right
- y_cos_left
- y_cos_right
- z_cos_left
- z_cos_right
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|rightpole 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.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| we_model | WE_MODEL | — | |
| tokenopt | STRING | king | — |
| axis1opt | STRING | man,boy,he,him,his,father,brother,husband|woman,girl,she,her,hers,mother,sister,wife | — |
| axis2opt | STRING | hot,warm,heat|cold,cool,freezing | — |
| axis3opt | STRING | royal,king,kingly,noble|common,commoner,peasant,ordinary | — |
| token_can_be_phraseopt | BOOLEAN | true | — |
| lowercaseopt | BOOLEAN | true | — |
| neutral_epsopt | FLOAT | 0.080–0.5 | — |
| equal_epsopt | FLOAT | 0.0200–0.2 | — |
| strong_projopt | FLOAT | 0.350–1 | — |
| strong_cosopt | FLOAT | 0.650–1 | — |
| strong_gapopt | FLOAT | 0.300–1 | — |
Outputs (10)
| Name | Type | Description |
|---|---|---|
| x | FLOAT | — |
| y | FLOAT | — |
| z | FLOAT | — |
| summary | STRING | — |
| x_cos_left | FLOAT | — |
| x_cos_right | FLOAT | — |
| y_cos_left | FLOAT | — |
| y_cos_right | FLOAT | — |
| z_cos_left | FLOAT | — |
| z_cos_right | FLOAT | — |