Skip to content

1xmr/NFT-Metada-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

NFT Generator

πŸŽ† A simple unique Metadata & NFT images generator script with custom probabilities.


Contents

Introduction

This is a custom NFT generator script that generates unique images with custom probabilities. It's a simple script that can be used to generate NFT images for your project. Follow the setup and usage instructions to get started. A UI version of this script will be available soon.

Project structure:

β”œβ”€β”€ LICENSE
β”œβ”€β”€ README.md
β”œβ”€β”€ app
β”‚Β Β  β”œβ”€β”€ __init__.py
β”‚Β Β  β”œβ”€β”€ images
β”‚Β Β  β”‚Β Β  └── __init__.py
β”‚Β Β  β”œβ”€β”€ launcher.py
β”‚Β Β  β”œβ”€β”€ metadata
β”‚Β Β  β”‚Β Β  └── __init__.py
β”‚Β Β  β”œβ”€β”€ metadata_generator.py
β”‚Β Β  β”œβ”€β”€ nft_generator.py
β”‚Β Β  β”œβ”€β”€ nfts
β”‚Β Β  β”‚Β Β  └── __init__.py
β”‚Β Β  β”œβ”€β”€ rarity.json
β”‚Β Β  └── requirements.txt
β”œβ”€β”€ docs
β”‚Β Β  β”œβ”€β”€ README.md
β”‚Β Β  β”œβ”€β”€ __init__.py
β”‚Β Β  β”œβ”€β”€ metadata_structure_example.json
β”‚Β Β  └── rarity_structure_example.json
β”œβ”€β”€ pre-commit-config.yaml
β”œβ”€β”€ requirements.txt
└── tests
    └── __init__.py

Features

  • Generate Metadata JSON files and save them automatically.
  • Generate NFT images with custom probabilities and save them automatically.
  • Check the possibilities and get informed if the requested numbers match the probabilities.
  • Completely customizable project name, file extension, project description, NFT numbering, etc.

Setup

  1. Environment setup:
  • The current code was run on Python 3.11.0, but it should work on Python 3.8+. Make sure to create a virtual environment and install the required packages.
$ python3 -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
  1. Requirements:
  • Put all of your images in the app/images folder. The images should be named the same as the trait names in the rarity.json file. For example, if you have a trait named as Golden in the rarity.json file, you should have a Golden.png image in the trait folders. Any name mismatch will cause the script to fail.
  • The folder names in app/images should be renamed to the trait category names in the rarity.json file. For example, if you have a trait category named as Background or Skin etc. in rarity.json, you should have a Background folder in the app/images folder as well. Any name mismatch will cause the script to fail.
  • All of the images in the app/images folder should be the same size. Any size mismatch will NOT cause the script to fail, however, final images will be distorted.
  • rarity.json file should be in the app folder. The structure of the file is explained in the docs folder, README.md file.
  • Finally when running the launcher.py to generate all of the NFTs, make sure to be in the correct directory and the path, which is:
$ cd app/
$ pwd

> nft-and-metadata-generator/app/
  1. Streamlit GUI Setup and Usage:
$ pip install -r requirements.txt
$ cd app/

$ pwd

> nft-and-metadata-generator/app/

$ streamlit run streamlit_gui_generator.py

>  You can now view your Streamlit app in your browser.

>  Local URL: http://localhost:8501
>  Network URL: http://192.168.1.114:8501

Streamlit Video Guide:

Streamlit Video Guide

Usage

  • To generate all of the NFTs, run the launcher.py file after modifying rarity. json and putting all of the necessary images in the app/images folder. Make sure to read #Setup section before running the script:
$ python3 -m venv venv
$ source venv/bin/activate

$ python launcher.py
  • According to the number of NFTs you want to generate, the script will generate the NFTs and save them in the app/nfts folder. It will also generate the metadata JSON files and save them in the app/metadata folder. It might take some time to generate all of the NFTs, so be patient. You can follow the progress throughout the logs.

License

About

πŸŽ† A simple unique Metadata & NFT images generator script with custom probabilities.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors