Skip to content

How to make a generative NFT collection: layers, rarity and rules

How a folder of layer images becomes thousands of unique NFTs: traits and file names, rarity weights and percentages, never-with and only-with rules, the supply cap, the export to IPFS and the launch. The examples use the five sample layers that ship in the studio.

Updated October 2026 · 9 min read
1 · Layers

One folder per layer, one file per trait

A generative NFT is a stack of transparent images. Each layer holds a set of traits, and every token takes exactly one trait from each layer, drawn bottom to top. In the sample set the layers are Background, Body, Eyes, Mouth and Hat; a Sunset background under a Peach body with Round eyes, a Smile and a Beanie is one token.

The studio reads all of this from a folder. The number in front of each folder name sets the drawing order, the folder name is the layer, the file name is the trait, and the number after # is the rarity weight.

sunset-frens/
  1 Background/   Sunset#30.png  Dusk#25.png   Sky#25.png    Mint#15.png   Noir#5.png
  2 Body/         Peach#30.png   Cocoa#25.png  Sand#25.png   Lilac#15.png  Robot#5.png
  3 Eyes/         Round#40.png   Sleepy#30.png Wink#20.png   Laser#10.png
  4 Mouth/        Smile#50.png   Grin#30.png   Pout#15.png   Gold_Teeth#5.png
  5 Hat/          None#40.png    Beanie#25.png Cap#20.png    Halo#10.png   Crown#5.png
  • Same canvas everywhere. Every file is the full picture size, for example 2000 × 2000, with transparency where the layer below should show through.
  • Underscores become spaces. Gold_Teeth#5.png is the trait "Gold Teeth".
  • Optional layers need a None trait. A fully transparent PNG with its own weight, so some tokens have no hat.
  • The weight is optional. Leave it off and the trait gets an equal share; you can still change it in the Layers step.

No folder yet? The AI NFT generator starts a collection from a described character and gives you five layers and 32 traits to edit the same way.

2 · Rarity

Weights become percentages

A trait's odds are its weight divided by the sum of the weights in its layer. The studio shows the result as a percentage next to each trait, so you never have to do the division. Weights don't have to add up to 100: 3, 2, 1 gives the same odds as 50, 33, 17.

Hat traitWeightOddsOf 500
None4040%≈ 200
Beanie2525%≈ 125
Cap2020%≈ 100
Halo1010%≈ 50
Crown55%≈ 25

The expected count is odds times supply, before rules. It is an average: a 500-token run might have 22 Crowns or 28. If a trait must appear an exact number of times, give it a cap in the Layers step; a capped trait leaves the draw once it reaches its number.

  • Rarity on or off. Turn Enable rarity off and every trait in a layer is equally likely. Your weights are kept for when you turn it back on.
  • Rarity score. Preview shows a score per token from the odds of its traits, so you can see the rare pulls before anyone mints.
  • Keep the rare tier small. One or two traits per layer at 5% or less gives collectors something to look for without making most tokens look the same.
3 · Rules

Never-with and only-with

Rules keep combinations that don't belong apart. There are two kinds, and each one names two traits.

LaserEyesnever withHaloHat

The two traits never appear on the same token. Use it for art that collides (a halo over laser eyes) and for lore that doesn't fit. It works both ways.

CrownHatonly withNoirBackground

The first trait appears only when the second is present. A Crown always sits on a Noir background; a Noir background can still appear without a Crown. It works one way.

Every rule removes combinations, so the supply cap drops as you add them. The studio recalculates it as you go. Two or three rules is normal; a dozen usually means a layer should be split or a trait redrawn.

4 · Supply

How many unique NFTs the layers allow

Before rules, the number of possible tokens is the trait counts multiplied together. For the sample set that is 5 background × 5 body × 4 eyes × 4 mouth × 5 hat = 2,000 combinations. The two rules above remove the Laser-with-Halo tokens and the Crown-without-Noir tokens, which leaves 1,580. That number is the supply cap shown in the Layers step, and the generator will not make more tokens than that.

Before rules
2,000
5 × 5 × 4 × 4 × 5
After two rules
1,580
the supply cap
Sample collection
500
a quarter of the cap
  • Stay well under the cap. At 500 of 1,580 every token has room to be different. Close to the cap, the last tokens are whatever combinations are left, rare traits included.
  • Every token is unique. The generator never repeats a combination inside one run. Same seed, same size, same rules: the same collection, every time.
  • Shuffle or in order. Token numbers can follow the draw order or be shuffled, so rare tokens aren't clustered at the start.
5 · Export

The ZIP and the IPFS upload

Previewing is free and unlimited. When the collection looks right, run the health check, then export. One payment of $0.50 per NFT covers both the ZIP download and the IPFS upload of that run.

The export holds one image and one metadata file per token, numbered from the start ID you set in Setup. Images come out as WebP, PNG or GIF at the size you chose. The metadata follows the standard marketplaces read: a name from your pattern, the description, the image link and one attribute per layer, plus any collection-wide attributes you added.

sunset-frens/
  images/     1.webp  2.webp  3.webp  …  500.webp
  metadata/   1.json  2.json  3.json  …  500.json

metadata/1.json
  name:         "Sunset Fren #1"
  description:  "500 hand-drawn frens watching the sun go down."
  image:        "ipfs://bafybeih4…n6/1.webp"
  attributes:   Background: Sunset · Body: Peach · Eyes: Round · Mouth: Smile · Hat: Beanie · Season: Genesis

An IPFS upload pins the images first, then writes the metadata with those image links and pins that too. You get back the images CID, the metadata CID and the base URI, and they stay with the collection so the smart contract's Storage step can pick the upload without any pasting. Already have files on IPFS from somewhere else? Paste the two CIDs on the Storage step instead.

6 · Launch

Contract and mint page

The Smart contract tab turns the upload into a sale in six forms: contract (name, symbol, supply, network), pricing (public price, per-wallet limit, presale phases with allowlists), revenue (split and royalties), features (delayed reveal, burnable), storage (the upload) and deploy. Your wallet signs the deployment on any of 14 networks, ERC-721 on the EVM chains and Metaplex Core on Solana.

The mint page is live at nftgen.app/mint/your-collection as soon as the contract is, and Manage covers everything after: opening the next phase, pausing, airdrops, withdrawals, the reveal and transferring ownership. Nothing is charged up front; 3% of each mint goes to the platform.

7 · Checklist

Before you generate

  1. 1Every layer file is the same pixel size, transparent where it should be, named Trait#weight.png.
  2. 2Optional layers have a None trait with a weight.
  3. 3Layer order reads bottom to top: background first, headwear last.
  4. 4Each layer has a clear rare tier, and the percentages next to the traits say what you meant.
  5. 5Rules cover the combinations that clip or clash, and the supply cap is still several times the collection size.
  6. 6Name pattern, description, start ID and image format are set in Setup; they are written into every metadata file.
  7. 7You opened a handful of tokens in Preview, filtered by the rare traits, and ran the health check.
  8. 8The seed is written down somewhere, so the run can be reproduced.
FAQ

Common questions about layers and rarity

How many layers and traits does an NFT collection need?
Five layers with four or five traits each already give 2,000 combinations. For 10,000 unique NFTs you want a cap several times that, for example seven layers with six traits each, which is about 280,000 combinations before rules.
What image size and format should NFT layers be?
Every layer file at the same pixel size, as a transparent PNG drawn on the final canvas, for example 2000 by 2000. The export can write WebP, PNG or GIF at the size set in Setup.
Can I change rarity after generating the collection?
Yes. Preview is free and can be regenerated as often as you like. Once you have exported to IPFS and deployed, the contract points at that metadata, so make rarity changes before the export you launch with.

Drop the folder in and see the percentages.

Preview the whole collection for free, with the supply cap, the rarity scores and the health check. Pay only when you export.

Create your collectionFree to preview · No subscription