Skip to main content
Tutorial
Advanced

Generating your NFT collection with AI

Welcome to our NFT generation and deployment tutorial! In just two clicks, you can create and deploy your own valuable NFTs. Our tutorial will guide you through the process of generating and deploying unique NFTs quickly and easily.

This tutorial will guide you on how to set up your environment to create an AI-generated NFT collection. You will learn how to configure your .env file, run the backend and frontend servers, and ensure that you have enough faucet funds.

You will need

  • A Starton API KEY
  • A Wallet with currency of your network
  • A DALL-E 2 API KEY

What is DALL-E 2?

DALL-E 2 is an artificial intelligence (AI) model developed by OpenAI. DALL-E 2 is designed to generate images from textual descriptions.

It is capable of generating complex and detailed images. It can create images that are up to 1024x1024 pixels in size, and can generate multiple objects and textures within a single image. DALL-E 2 can also create images that are animated and can be interacted with.

INSTALLING THE PROJECT

info

The project has been set up using a client-side and a server-side so that your API key is not exposed on client. You can also use the server-side to connect a database for metrics.

CREATING STARTON PROJECT

  1. Clone the project from Starton AI generative NFT collection GitHub.

SETTING UP ENVIRONMENT VARIABLES

Before you start setting up the project, you need to set the environment variables.

  1. In the backend folder of the project, set up an .env according to .env.example:
API_HOST=localhost
API_PORT=8000

## Put on the following line your Starton API key (available at https://app.starton.com)
STARTON_API_URL='https://api.starton.io/v3'
STARTON_API_KEY=

## Put on the following line your Signer wallet address
STARTON_SIGNER_WALLET=

## Put on the following line your OpenAI API key (available at https://platform.openai.com/account/api-keys)
OPEN_AI_API_KEY=
  1. In the frontend set up your .env file according to .env.example :
NEXT_PUBLIC_BACK_URL=http://localhost:8000

SETTING UP THE SERVER SIDE

Here we would like to enter the data needed to generate and deploy your collection as well as entering your API, so that you can authenticate safely to the API.

  1. Go to the backend folder of the project.
  2. Run the command yarn install to install the required dependencies.
  3. Start the server by running the command yarn dev.

SETTING UP OUR CLIENT SIDE

On the client side, we will set up all the information of your smart contract to connect your project to Web3Auth.

  1. Go to the frontend folder of the project.
  2. Run the command yarn install to install the required dependencies.

RUNNING THE PROJECT

To run your project, you will need to run commands both on server and client side.

  1. In server, run the command yarn dev
  2. In client, run the command yarn dev

Visit http://localhost:3000 to test your project.

GENERATING AND DEPLOYING YOUR COLLECTION

Once started, visit http://localhost:3000 to enter the following parameters:

  1. Enter the receiver wallet of the NFT (where you want to send the NFTs).
  2. Select the network on which you want to deploy your NFTs. If you are testing, then use the testnet network, and if you are ready to deploy, use the mainnet network (between Polygon, Avalanche, Binance, and Ethereum).
  3. Choose the number of NFTs that you want to create for your collection.
  4. Enter the prompt that will generate the images for your NFTs. You can use different prompts to create unique and personalised NFTs.
  5. Click Generate to display the assets for your NFTs.
  6. Review the generated assets.
  7. Once you are satisfied with the images, click Deploy.

Congratulations! You just deployed an NFT collection of images generated by AI.

Loubna Benzaama

Lead technical writer


Created:

December 21, 2023

Reading time:

4 min


Content