This page may contain legacy content

To get our most up-to-date content please access our documentation

November 21, 2021

How to Generate Thousands of NFTs

Table of Contents

It’s clear to see that the NFT sector is just getting started. As such, this may be the best time to learn NFT token development. Specifically, learning how to generate thousands of NFTs will prove to be highly useful for a blockchain developer. With that skill under your belt, you may easily create your own NFT collection or team up with an artist or a company looking to adopt this world-changing technology and create 1,000s of NFTs for them. Fortunately, there are powerful and easy-to-use tools at your disposal that will simplify the NFT generating process. Moreover, with Moralis’ Web3 development platform, you could produce thousands of NFTs with simple programming code.

It wasn’t too long ago that we released an article on Moralis’ blog where we illustrated how to generate NFTs using Moralis and its IPFS integration to create computer-generated NFTs. However, in that article, we only created about ten NFTs, and we focused solely on creating the files that will represent the NFTs without actually minting them. As such, we received numerous requests from our readers regarding how to create thousands of NFTs. Therefore, we will address that topic herein. By the end of this article, you should be ready to create 1,000s of NFTs yourself. To accomplish this quickly and easily, you’ll need Moralis, so make sure to create your free Moralis account now! 

Create vs Generate Thousands of NFTs

Non-fungible tokens, or NFTs, are one of the most popular blockchain use cases at the moment. Moreover, the fact that their creators predominantly focus on using them for digital art and collectibles has a lot to do with that. Why? Well, people have always preferred exciting and fun stuff, which is literally what many NFTs have to offer. Whether it’s in the form of incredible digital art, cool collectibles, or play-to-earn games, NFTs have a way to appeal to the crowd. On the other hand, keep in mind that there are many serious use cases for this type of crypto asset already being implemented as well. The latter includes all sorts of ownership, certification, subscription proofs, etc. As such, we dare to say with confidence that NFTs are here to stay.

Moreover, there are several aspects to creating NFTs: create, execute/mint, and generate. As such, let’s take a closer look at these aspects:

  • On the one hand, we have the process of creating a digital file (JPG, PNG, PDF, MP3, MP4, etc.) that will be the essence of an NFT. 
  • On the other hand, we have the process of executing a transaction using smart contracts that will convert that digital file (together with its details [metadata]) into an NFT. That process is known as “minting” (learn how to mint NFTs).
  • Moreover, in the case of computer-generated collectible NFTs, there’s also a part of creating a code that will take particular PNG files (layers or components of the final images) and randomly combine them in proper order. As such, a more suitable verb for this type of NFT creation is “generate”. 

Why Learn How to Generate Thousands of NFTs

As a developer, you’d normally be more interested in the minting process; however, when such a large amount of NFTs are to be created, your programming skills must come to the table for that part as well. Unlike most digital art, where an artist typically creates a single NFT, the collectible NFT teams tend to create 1,000s of NFTs. 

Moreover, the two most popular NFT collections, CryptoPunks and Bored Ape Yacht Club are great leading examples since both of these two collections have 10,000 collectibles. Furthermore, many other projects follow their example and also create 1,000s of NFTs. In addition, these types of NFTs are normally computer-generated by combining a certain combination of PNG files randomly (based on a predefined rarity). The latter must be properly layered to get the results we are after. With all of that said, it is no wonder that developers are asking themselves how to generate thousands of NFTs. 

How to Generate Thousands of NFTs with Moralis

As mentioned earlier, we have a separate article (linked above) covering the details of how to use Moralis to generate NFTs in a decentralized manner. Aside from Moralis, we used a code editor (Visual Studio Code), Adobe Photoshop, MetaMask, and Remix. Moreover, Moralis (a.k.a Firebase for crypto) helps us cover all of the blockchain-related backend aspects. By using its ultimate Web3 SDK and its ultimate NFT API, we get to implement features that would otherwise take us days or even weeks in minutes.

Moreover, let’s stress the importance of having a goal in mind when you want to create any kind of NFTs. This is even more important when “how to generate thousands of NFTs” is the question. Specifically, we need even more unique components or layers. Furthermore, it can take quite some time to generate this amount of NFTs, (especially if we aim for large-sized images). Thus, proper preparation is essential if you want to avoid errors and time-wasting.

If you were to generate ten unique NFTs, you obviously need way fewer unique layers and components for those layers. However, when your goal is to create 1,000s of NFTs, you need to ensure that layers and components are sufficient to have unique NFTs, which usually is the goal. Of course, you can also decide to have certain NFTs repeat themselves (their metadata would be unique, but their visual part would be the same), in which case you’ll reduce the number of required layers and components.

Create 1,000s of NFTs – Layers and Components

Manually creating 1,000s of NFTs would take a lot of time. Moreover, users seem to appreciate the fact that the art part of NFTs generates by computer code. Thus, you’ll have to prepare components. With proper preparation, you will determine which kind of layers will make sense for your NFT collection. This could be backgrounds, bodies, clothing, eyes, mouths, noses, accessories (hats, glasses, etc.), to name a few. 

You can create these components yourself using a piece of software such as Photoshop. However, if you are not artistic in any way, you can easily outsource that part. Platforms such as Fiverr are great places to find freelancers that will take care of the artistic part at an affordable price. 

With that said, let’s move on to the coding part, which will enable you to put the components together by generating files that will later be minted into NFTs. 

How to Generate Thousands of NFTs with Moralis – The Coding Part

Since a video is worth a thousand words, we decided to let one of Moralis’ experts cover the coding part with two video tutorials. By watching the two videos below, you’ll get a clear understanding of what it takes to go from scratch to actually generate your NFTs, and even list them on OpenSea. You will see that by using the code templates that we prepared for you, combined with Moralis, it can all be done in less than an hour. 

How to generate NFTs video – part one:

How to generate NFTs video – part two:

How to Generate Thousands of NFTs – Part 1

The first video (part one) also covers all the details of creating the art part with Photoshop and exporting each layer as a separate PNG file (see at 2:14). It then moves on to show you how to use the code that we provide on GitHub with VSC (at 4:48). Basically, it guides you through the process of configuring your own NFT generating engine, which will take the artistic components (PNG files) and generate unique and complete images.

Moreover, at 6:00 in the video, it shows you how to create a Moralis server, which basically is your ticket to gain full Moralis backend support. At exactly 6:28, the video addresses edition size, which is where you get to define the total number of unique images. So, if you want to create 1,000s of NFTs, this is where you get to enter your target number. This is done inside the “config.js” file, in the line containing “const editionSize”:

Note: Keep in mind that the larger the total amount of NFTs, the more components you need to have to be able to meet your target number and retain uniqueness. Moreover, the larger the total number of NFTs, the more time it will take to generate them.

An Engine to Create 1,000s of NFTs

Moving forward, at 6:53 in the video, you get to learn about the most critical part of your NFT generating engine, which is the proper arrangement of the layers and how they get inserted into an array:

The thing that is on top of the code (with the highlight in the image above) is the one that needs to be the bottom layer of your image. Furthermore, in the video at 7:38, the Moralis expert covers the details of the “index.js” file. The latter is essentially the engine itself, where we compile all the layers – creating final PNG files and metadata files (JSON files). Moreover, it is also the part of the code that ensures those files get uploaded in a decentralized manner (9:13). By using Moralis’ integration with IPFS together with Moralis’ dashboard (database), a simple snippet of code covers this otherwise lengthy task:

To generate the files and upload them to IPFS, type “node index.js” into VSC’s terminal. Thanks to the fact that Moralis enables us to upload folders to IPFS (bulk upload), we are able to get file paths that match the ERC-1155 token standard requirements.

How to Generate Thousands of NFTs – Part 2

By completing the steps covered above, you have your images and corresponding metadata generated and uploaded to IPFS. While this means that you have all of your files ready, you still haven’t actually generated NFTs. So, in this section, we’ll cover how to generate thousands of NFTs. Moreover, in case you’ve lost track of the big picture of our quest, make sure to check out the part two video at 0:20. 

As mentioned previously, the minting of NFTs requires using smart contracts. Creating your own smart contract may sound like a daunting task if you’re a beginner, but let us reassure you that there is nothing to worry about. By using available templates and Remix, the minting process becomes extremely simple.

Moreover, feel free to skip the part between 1:41 and 7:24 in the video. This is where the Moralis expert repeats some of the steps covered in part one (creating a local code instance, Moralis server, and running our NFT files generating engine). However, in this case, he shows that he uses Polygon’s testnet (2:06 – 7:24). Of course, he could’ve also used one of the Ethereum testnets since Moralis is cross-chain operable and makes selecting different supported chains straightforward. 

How to Generate Thousands of NFTs – The Minting Part

So, the part where you learn the final act of how to generate thousands of NFTs starts at 7:24. Moreover, for the minting part, you will need MetaMask. Yes, aside from being the most popular hot wallet, developers are building dApps with MetaMask as well. Since we are working on Polygon’s Mumbai testnet, we need to add that network to our MetaMask (shown at 7:42 in the video). Next, you need to obtain some “play” MATIC assets to cover the transactions on the testnet (watch the video at 8:04):

Then, you go to Remix, where you can finally mint your NFTs (8:54). The code that essentially is your smart contract is available at GitHub (NFT contract). So, just copy and paste that code into Remix, and replace the “INSERT_YOUR_CID_METAHASH” part with your uploaded folder’s CID (available in your Moralis dashboard). Moreover, this template is set to mint only three NFTs. So, to create 1,000s of NFTs, you need to replace the code below with a loop that will cover all your PNG and JSON files.

        // account, token_id, number
        _mint(msg.sender, 1, 1, "");
        _mint(msg.sender, 2, 1, "");
        _mint(msg.sender, 3, 1, "");

Once your code is ready, you get to compile your smart contract (12:00). After your contract is successfully compiled, you get to deploy it and mint your NFTs (12:15):

All that’s left to do now is to display your NFTs on OpenSea (12:57), where other people will be able to view and purchase them (if you decide to list them). 

How to Generate Thousands of NFTs – Summary

We’ve covered quite a lot of ground in today’s article. At this point, you should know how to generate thousands of NFTs. Following the detailed steps provided in the two videos above, in combination with the power of Moralis, VSC, MetaMask, and Remix, you get to create 1,000s of NFTs in a matter of minutes.

Moreover, you’ve also learned that the thinking process before actually rolling up your sleeves for the coding part is also crucial. When creating computer-generated NFTs, you usually work with multiple components. As such, it includes arranging layers properly to form the images for the NFTs. So, whether you create those components yourself or outsource an artist, you need to know what you are after. Furthermore, we’ve put another video that answers all the most common questions related to NFT generation at the bottom of this article. 

Moreover, we invite you to check out the Moralis YouTube channel and the Moralis blog, where a ton of valuable content is available to those interested in leveling up their crypto game. For instance, you can even learn how to launch an NFT marketplace. Furthermore, this is where you can learn more about the ultimate Ethereum dApp boilerplate and the Ethereum mobile boilerplate. In addition, we also cover how to use various powerful tools, such as WalletConnect and OpenZeppelin. As such, make sure to make the most out of these free resources.

Generate NFTs Q&A:
Unlock the full potential of your NFT projects with this industry-leading NFT API! Fast, easy, and free.
Related Articles
November 17, 2023

How to Add the Sepolia Network to MetaMask – Full Guide

August 17, 2022

Web3 Identity – The Full Guide to Authentication, Identity, and Web3

January 5, 2024

How to List All the Coins in An ETH Address – Full Guide 

September 4, 2022

How to Build a Dapp with C# and .NET in 4 Steps

March 14, 2023

Notify Custom Webhooks – Real-Time Data with Moralis Streams

November 29, 2022

The Best ERC20 Token Balance API for Dapp Development

November 8, 2023

Ropsten Faucet Guide – Full Ropsten Testnet & Deprecated Faucet Alternatives

April 4, 2024

Which is the Best Crypto Logo API to Get the Logo of a Token?

October 11, 2023

Check Wallet Activity and Get Crypto Address Labels