Rotor Machine Rotor Mapper
The stage that changes alphabets, and the default with a typo in it
- perm_obj
Every other node in this category maps letters to letters. This one is allowed to map a 26-letter alphabet onto ten digits, or onto a 40-character symbol set, or onto anything else - and that's why it exists.
Rotor machines are alphabet-preserving by construction: signal goes in as A–Z and comes back as A–Z. If you want a machine whose output is grouped digits, or that takes a reduced alphabet in and gives the full one out, something has to convert. In this pack that something is Rotor Machine Rotor Mapper, output perm_obj, a PERMUTATION you insert into the rotor chain.
src_alphabet, dst_alphabet, mapping
The three inputs read exactly like what they do. src_alphabet is what the stage accepts, dst_alphabet is what it emits, mapping is the translation written in destination symbols, one character per source symbol.
So a full-alphabet-to-digits stage looks like this:
src_alphabet: ABCDEFGHIJKLMNOPQRSTUVWXYZ
dst_alphabet: 0123456789
mapping: 01234567890123456789012345
Twenty-six characters of mapping, one for each letter, repeating digits because ten symbols can't biject onto twenty-six. That's the key difference from the plain permutation node: this stage is not required to be a bijection. It only checks that the mapping is as long as the source alphabet and that every character in it belongs to the destination alphabet. Injective, surjective, neither - it doesn't care. That's deliberate: a mapper is allowed to lose information, which is exactly what compressing 26 letters into 10 digits does.
Where it earns its keep is inside the machine. When Rotor Machine State builds a signal path it validates that each stage's output alphabet matches the next stage's input alphabet, and errors with a message naming the two mismatched stages. The fix for that error is almost always "insert a mapper here". A chain like letters in → mapper → digit-alphabet rotor → mapper → letters out is a legitimate machine, and the mapper is the hinge in each transition.
Now the thing you need to know before trusting the defaults
Look closely at the default src_alphabet and dst_alphabet the node ships with:
ABCEDEFGHIJKLMNOPQRSTUVWXYZ
D and E are swapped. That's not a rendering issue on this page - it's in the source. It's a harmless-looking typo that isn't harmless at all: the node will accept it (all 26 characters are unique, which is all the alphabet check requires), and then your mapping will be off by one letter for everything from D onward, because character 3 of your mapping now applies to E instead of D. Your cipher will work, produce plausible-looking output, and be wrong in a way no error message will tell you about.
Retype both alphabets as ABCDEFGHIJKLMNOPQRSTUVWXYZ every single time you use this node. If you're sharing a workflow, check the saved widget values before you trust someone else's puzzle.
Installing it
Manager → ComfyUI ARG Toolkit → install → restart → refresh the browser, or:
cd ComfyUI/custom_nodes
git clone https://github.com/AzelusLightvale/ComfyUI-ARG-Toolkit
pip install -r requirements.txt
Zero models, zero heavy maths - the whole rotor category is plain Python. The pack's requirements file is not: it pins torch, torchaudio, stegano, invisible-watermark and cryptography, and pip will happily re-resolve your torch build in the process. If you only came for classical ciphers, that's a lot of blast radius for a string mapper, so Manager or a targeted install is the friendlier road. A small honest caveat carries over from the README: this pack's tests are functionality tests, and the default that ships with a typo is a decent argument for checking the values rather than trusting the node.
Using it well
Use the mapper where the alphabet genuinely changes and nowhere else. A stage that maps an alphabet to itself is what Rotor Machine Permutation is for, it's cheaper to reason about, and it keeps the involution rules where you expect them.
Keep a comment node next to each mapper spelling out src, dst and the mapping in plain text. A machine with two mappers in it is four widget strings away from being unreadable, and the failure mode when you get one wrong isn't an exception - it's a ciphertext that simply doesn't decrypt, which you'll blame on the rotors for an hour before you remember the D/E thing.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| src_alphabet | STRING | ABCEDEFGHIJKLMNOPQRSTUVWXYZ | — |
| dst_alphabet | STRING | ABCEDEFGHIJKLMNOPQRSTUVWXYZ | — |
| mapping | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| perm_obj | PERMUTATION | — |