← Toko Learn
Core concepts

How the Generator works.

How Toko turns layered parts into a collection of unique, reproducible tokens — and why it never touches rarity or score.

Generator~7 min readCreator-leaning

The Generator is the machine in the corner of the workshop. You give it layered artwork and a set of rules, and it assembles hundreds of unique tokens. Its job is the art — what each token looks like. It deliberately leaves rarity, scoring and supply to the collection.

The building blocks: layers and parts

A generator is a stack of ordered layers (background, body, clothing, accessories…), and each layer holds parts — the individual images that can fill it. To build a token, the Generator picks one part from each layer and stacks them up.

One part per layer, stacked into a token
Accessory
Clothing
Body
Background
one unique token
A layer can be set to appear always or only optionally with a probability — so not every token needs an accessory. Parts within a layer must have unique names.

Steering the mix: weighting and caps

Each part carries a weight that controls how often it's chosen. Higher weight, more frequent. You can use simple presets or custom numbers:

Weighting presets
Very Infrequent1
Infrequent2
Balanced3
Frequent5
Very Frequent8
New parts default to Balanced (3). You can also set a per-part cap — an absolute number or a percent of the batch — to stop a part appearing too many times. Caps are batch-scoped only; they're not collection-wide scarcity.
Weighting is not rarity

Weighting only changes how often a part appears in the artwork. It is not how rare the finished token is — that's the collection's separate rarity policy. Watch the 25-second explainer →

Keeping it sensible: compatibility rules

Some combinations don't make sense — a snorkel with a spacesuit, maybe. Compatibility rules let a part require or exclude another part, or a whole layer. The Generator validates your rules up front, flagging contradictions, self-references, missing targets, unreachable selections, and duplicate part names, so a batch can't get stuck.

The assembly loop

For every token, the Generator runs the same loop, rejecting anything invalid until it has the number of valid, unique tokens you asked for:

How one token is built
Include? evaluate each layer (always / by probability)
Pick a part per layer by weighted choice
Check compatibility + caps
Valid & unique? keep it — otherwise reject and retry
No two tokens in a batch share the same part-combination — duplicates are rejected automatically.

Deterministic and replayable

The Generator's output is a pure function of its inputs. The same configuration, seed and source data always reproduce the exact same tokens — and if any input changes, the output changes.

What determines the output
output = f( config hash, seed, batch type, target count, CSV input? )
Every export also carries a locked snapshot — batch id, seed, config hash, the layers/parts, weights, compatibility rules, caps and asset versions — so any result can be audited, verified, or reproduced later.

Three ways to run a batch

Curate, pin, export

After a run you preview the results, pin the keepers, and export the pinned set into a collection. That export is the only path from the Generator into a collection — there's no separate import wizard. Exported tokens arrive as Draft with their composition and provenance attached, and a collection links to a single generator source, so its history stays clean.

Where the Generator stops

The Generator makes the art and nothing else. It doesn't assign rarity, attribute desirability, scores, or collection-wide scarcity — those are the collection's job. Keeping the two apart is what lets you re-roll art without disturbing the rules buyers rely on.

In short

  • Layers + parts: the Generator picks one part per layer and stacks them into a unique token.
  • Weighting sets how often a part appears (presets 1–8, default Balanced 3); caps limit a part per batch.
  • Compatibility rules keep nonsensical combinations out; duplicates are rejected.
  • Deterministic: same config + seed + inputs → identical tokens, with a locked snapshot for audit.
  • It makes art, not rules — export pins into a collection as Draft; rarity and score are set there.