A generative art library for NFT avatar and collectible projects.

Overview

Generative NFT Art

Introduction

The generative-art-nft repository is a library for creating generative art. It was developed for the purpose of creating NFT avatar & collectible projects. This library was used to generate the artwork for the Scrappy Squirrels project.

Features

Generate over a million distinct images with less than 60 traits

The library allows you to generate images every distinct possible combination of your traits. For context, if you had trait art for a project like Bored Apes, the library could generate upwards of 1.2 billion distinct apes.

Add rarity weights

The library also allows you to configure the image generation process in such a way that you have complete control over how rare each and every trait is.

Generate compliant JSON metadata for your NFTs

There is now an added functionality to generate JSON metadata for your NFTs that are in compliance with OpenSea metadata requirements (and by extension, the general NFT metadata standard).

Fuzzy friendly

You can use this library even if you do not know how to program (in Python or otherwise). Do check out the Tutorial for more details on how to use (non-technical) and extend (technical) the library.

Installation

Clone this repository

git clone https://github.com/rounakbanik/generative-art-nft.git

Install required packages

pip install Pillow pandas progressbar2

Upload your input assets in the assets folder, fill up the config.py file, and then run python nft.py.

In order to generate JSON metadata, define BASE_NAME, BASE_IMAGE_URL, and BASE_JSON in metadata.py and then run python metadata.py.

Usage

I have authored a detailed tutorial explaining how to use this library. Check it out here

About Scrappy Squirrels

This library was created as part of the Scrappy Squirrels Project.

Scrappy Squirrels is a collection of 10,000 randomly generated NFTs on the Ethereum Blockchain. Scrappy Squirrels are meant for buyers, creators, and developers who are completely new to the NFT ecosystem.

The community is built around learning about the NFT revolution, exploring its current use cases, discovering new applications, and finding members to collaborate on exciting projects with.

Comments
  • ImportError re PIL

    ImportError re PIL

    When I run nft.py I get the following error message:

    File "nft.py", line 5, in from PIL import Image ImportError: No module named PIL

    I've tried uninstalling pil and pillow and reinstalling pillow, but the error keeps arising. Any thoughts??

    Thanks!

    opened by CasonUK 3
  • Base Image URL for generating metadata

    Base Image URL for generating metadata

    When generating metadata using the metadata.py, what should be used as the BASE_IMAGE_URL? I haven't uploaded my images on any website yet. I have generated multiple sets and those are still in my local storage. Can you please provide some guidance on how to use the metadata.py? Thanks.

    opened by amitbakhru 3
  • Setting layers which impact on variety

    Setting layers which impact on variety

    Hi, @rounakbanik! I suppose it is the most user-friendly code to work with on this subject. Thanks a lot! However, I have a challenge: I have 6 layers in total, and I want only 2 of them that program will treat as unique, and others wont. I explain, there are layers, such as backgound (4 layers) that are needed just "for beauty" and 2 important layers. So I want program to work like this: when it is mixing layers and have combination like (XXXX XX) and (XXXX XY) - are distinct, but (XXXX XX) and (XXYX XX) as "the same" puctures and DO NOT create such picture. So the maximum number of combinations is less than multiplication of all layers by all treats. Sorry, I am not so pro in coding) Thanks in advance!

    opened by ChrisRegis 1
  • TypeError: 'module' object is not callable

    TypeError: 'module' object is not callable

    Checking assets... Assets look great! We are good to go!

    You can create a total of 16 distinct avatars

    How many avatars would you like to create? Enter a number greater than 0: 1 What would you like to call this edition?: edition3 Starting task... Traceback (most recent call last): File "nft.py", line 238, in main() File "nft.py", line 229, in main rt = generate_images(edition_name, num_avatars) File "nft.py", line 164, in generate_images for n in progressbar(range(count)): TypeError: 'module' object is not callable

    opened by mirza-sundus 1
  • Error on Thumbs.db

    Error on Thumbs.db

    I have hidden files turned on and cannot see Thumbs.db, but the script throws errors for various folders and Thumbs.db. Any clue how to get it to ignore it?

    Starting task... 0% (0 of 4200) | | Elapsed Time: 0:00:00 ETA: --:--:--Traceback (most recent call last): File "nft.py", line 237, in main() File "nft.py", line 228, in main rt = generate_images(edition_name, num_avatars) File "nft.py", line 172, in generate_images generate_single_image(trait_paths, os.path.join(op_path, image_name)) File "nft.py", line 72, in generate_single_image img = Image.open(os.path.join('assets', filepath)) File "C:\Python37\lib\site-packages\PIL\Image.py", line 2896, in open "cannot identify image file %r" % (filename if filename else fp) PIL.UnidentifiedImageError: cannot identify image file 'assets\Body\Thumbs.db'

    opened by crhall 1
  • Add metadata JSON per image

    Add metadata JSON per image

    In order to upload assets to, for example, Metaplex, you need to have one JSON file for each image metadata. There is a similar project to this one, based on node, that builds a basic metadata JSON and lets you extend it: https://github.com/HashLips/hashlips_art_engine and

    The JSON format for Metaplex is: https://docs.metaplex.com/nft-standard

    I'm planning to build this myself on top of this project. I'll open a PR as soon as I get it working.

    opened by imartinez 1
  • generative art nft ykeremekinci

    generative art nft ykeremekinci

    Starting task... Traceback (most recent call last): File "D:\Google Indirilenler\generative-art-nft-master\generative-art-nft-master\nft.py", line 259, in main() File "D:\Google Indirilenler\generative-art-nft-master\generative-art-nft-master\nft.py", line 250, in main rt = generate_images(edition_name, num_avatars) File "D:\Google Indirilenler\generative-art-nft-master\generative-art-nft-master\nft.py", line 186, in generate_images if is_dupliacted(rarity_dict, trait_sets, image_index): File "D:\Google Indirilenler\generative-art-nft-master\generative-art-nft-master\nft.py", line 151, in is_dupliacted if rarity_dict[CONFIG[idx]['name']][index] != trait[: -1 * len('.png')]: TypeError: 'NoneType' object is not subscriptable

    I got this problem.

    opened by ykeremekinci 0
  • Fixed different leading zeros in filename in nft.py and metadata.py

    Fixed different leading zeros in filename in nft.py and metadata.py

    Using len( -1) for determining leading zeros in image file name. old: zfill_count = len(str(df.shape[0])) new: zfill_count = len(str(df.shape[0]-1)) According to nft.py. nft.py creates the file name for storing each image metadata.py creates the file name for the image URI to be stored in the json file for each image Old version not working for the first number with 2, 3, 4, ... digits (10 NFTs, 100 NFTs, 1000 NTFs, ...), because in this cases metadata.py would use one leading zero more than nft.py for the file name generation.

    opened by thomasoss 0
  • TypeError: 'module' object is not callable

    TypeError: 'module' object is not callable

    Using python 3.9.7, I got this error while running python3 nft.py

    Traceback (most recent call last): File "/Users/imartinez/Documents/Dev/crypto/generative-art-nft/nft.py", line 237, in <module> main() File "/Users/imartinez/Documents/Dev/crypto/generative-art-nft/nft.py", line 228, in main rt = generate_images(edition_name, num_avatars) File "/Users/imartinez/Documents/Dev/crypto/generative-art-nft/nft.py", line 163, in generate_images for n in pb(range(count)): TypeError: 'module' object is not callable

    After checking stackoverflow I found this similar issue

    Fix: I pip install progressbar2 along with the rest of dependencies and everything worked perfectly.

    opened by imartinez 0
  • Rank?

    Rank?

    Hi! This is awesome thank you so much...just..is possible to have a rank of that nft? if i set some accessories at 5% rarity, is possible to have a list of rarity or something similar withouth have to check every nft one by one?

    opened by LADeal 2
  • Object of type int64 is not JSON serializable

    Object of type int64 is not JSON serializable

    When trying to run metadata.py, I'm getting this error.

    encoder.py", line 179, in default raise TypeError(f'Object of type {o.class.name} ' TypeError: Object of type int64 is not JSON serializable

    opened by SerbiusPrime 0
  • What Edition?

    What Edition?

    What is the "edition" I'm being asked for supposed to be? I can't find any sort of information on what it is, or even where I should look to check what edition I'm supposed to be using.

    opened by KWexoo 1
  • Create just Metadata

    Create just Metadata

    Is it possible to just create metadata json files?

    I have 10000 images all loaded on piñata. I don’t require a ‘traits’ or ‘attributes’ section in the metadata.

    opened by Frexxd 1
  • Code creates silhouette instead of the image

    Code creates silhouette instead of the image

    Generating the images create some of the images as silhouettes of the layered images instead of the image with all the layers. How is that possible ? How can one fix this ?

    opened by NHaiby 3
Owner
Rounak Banik
I am a Software Engineer and Data Scientist from IIT Roorkee. Apart from programming, I'm also involved in quizzing, writing, debating and theatre.
Rounak Banik
NFT Generator - A NFT Generator created using Python

NFT_Generator v1 An NFT Generator created using Python. This NFT Generation tool

null 3 Dec 2, 2022
NFT Generator: A modular NFT generator application

NFT Generator A simple passion project done with the role to learn a bit about h

null 2 Aug 30, 2022
Open Source Discord bot with many cool features like Weather, Balance, Avatar, User, Server, RP-commands, Gif search, YouTube search, VK post search etc.

Сокобот Дискорд бот с открытым исходным кодом. Содержит в себе экономику, полезные команды (!аватар, !юзер, !сервер и тд.), рп-команды (!обнять, !глад

serverok 2 Jan 16, 2022
Change your discord avatar every x h/d based on a list of images

Discord-Avatar-Autochange Introduction A simple script that automatically keeps changing your discord avatar after a given amount of time based on the

Armin Amiri 5 Apr 30, 2022
An NFTGenerator to generate NFTs and send them to nft.storage

NFTGenerator Table of Contents Overview Installation Introduction Features Reflection Issues & bug reports Show your support Credits Overview The NFTG

null 3 Mar 14, 2022
A simple Discord bot wrote with Python. Kizmeow let you track your NFT project and display some useful information

Kizmeow-OpenSea-and-Etherscan-Discord-Bot 中文版 | English Ver A Discord bot wrote with Python. Kizmeow let you track your NFT project and display some u

Xeift 93 Dec 31, 2022
arweave-nft-uploader is a Python tool to improve the experience of uploading NFTs to the Arweave storage for use with the Metaplex Candy Machine.

arweave-nft-uploader arweave-nft-uploader is a Python tool to improve the experience of uploading NFTs to the Arweave storage for use with the Metaple

0xEnrico 84 Dec 26, 2022
A telegram bot to monitor the latest NFT price on BSC.

NFT_Monitor This is a telegram bot for monitoring price and ranking of NFT on Binance Smart Chain. Can fetch latest ranking and price in real time. .P

Niko Pang 10 Oct 9, 2022
Automatically render tens of thousands of unique NFT images individually as png's.

Blend_My_NFTs Description This project is a work in progress (as of Oct 24th, 2021) and will eventually be an add on to Blender. Blend_My_NFTs is bing

Torrin Leonard 894 Dec 29, 2022
Bulk NFT uploader to OpenSea!

Bulk NFT Uploader Description Simple easy peasy python script which logins to opensea account using metamask and bulk uploads NFT to your default coll

Lakshya Khera 25 May 23, 2022
This bot automaticaly access to giveaway ! You can won free NFT !

This bot automaticaly access to giveaway ! You can won free NFT !

2s.py 28 Oct 20, 2022
Automatically download any NFT collection from OpenSea.

OpenSea NFT Stealer The sole purpose of this script is to download any NFT collection from OpenSea. How does it work? Basically, the OpenSea website a

Dan 111 Dec 29, 2022
SOLSEA-NFT-EXPLORE - Using Streamlit to build a simple UI on top of the Solana API

SOLSEA NFT Explorer Using Streamlit to build a simple UI on top of the Solana AP

Devin Capriola 3 Mar 19, 2022
Sunflower-farmers-automated-bot - Sunflower Farmers NFT Game automated bot.IT IS NOT a cheat or hack bot

Sunflower-farmers-auto-bot Sunflower Farmers NFT Game automated bot.IT IS NOT a

Arthur Alves 17 Nov 9, 2022
Irenedao-nft-generator - Original scripts used to generate IreneDAO NFTs

IreneDAO NFT Generator Scripts to generate IreneDAO NFT. Make sure you have Pill

libevm 60 Oct 27, 2022
This is a free python bot program that crosses you to farm with auto click in space crypto NFT game, having fun :) Creator: Marlon Zanardi

?? Space Crypto auto click bot ready-to-use ?? This is a free python bot program that crosses you to farm with auto click in space crypto NFT game, ha

null 170 Dec 20, 2022
A management system designed for the employees of MIRAS (Art Gallery). It is used to sell/cancel tickets, book/cancel events and keeps track of all upcoming events.

Art-Galleria-Management-System Its a management system designed for the employees of MIRAS (Art Gallery). Backend : Python Frontend : Django Database

Areesha Tahir 8 Nov 30, 2022
A Telegram bot that searches for the original source of anime, manga, and art

A Telegram bot that searches for the original source of anime, manga, and art How to use the bot Just send a screenshot of the anime, manga or art or

Kira Kormak 9 Dec 28, 2022
Gnosis-py includes a set of libraries to work with Ethereum and Gnosis projects

Gnosis-py Gnosis-py includes a set of libraries to work with Ethereum and Gnosis projects: EthereumClient, a wrapper over Web3.py Web3 client includin

Gnosis 93 Dec 23, 2022