rounakbanik / generative-art-nft Goto Github PK
View Code? Open in Web Editor NEWA generative art library for NFT avatar and collectible projects.
License: MIT License
A generative art library for NFT avatar and collectible projects.
License: MIT License
Starting task...
Traceback (most recent call last):
File "D:\Google Indirilenler\generative-art-nft-099c93f6cd918a124e9f6e7e044a157eee9b49bd\nft.py", line 259, in
main()
File "D:\Google Indirilenler\generative-art-nft-099c93f6cd918a124e9f6e7e044a157eee9b49bd\nft.py", line 250, in main
rt = generate_images(edition_name, num_avatars)
File "D:\Google Indirilenler\generative-art-nft-099c93f6cd918a124e9f6e7e044a157eee9b49bd\nft.py", line 186, in generate_images
if is_duplicated(rarity_dict, trait_sets, image_index):
File "D:\Google Indirilenler\generative-art-nft-099c93f6cd918a124e9f6e7e044a157eee9b49bd\nft.py", line 151, in is_duplicated
if rarity_dict[CONFIG[idx]['name']][index] != trait[: -1 * len('.png')]:
TypeError: 'NoneType' object is not subscriptable
I got this error. Can anybody help me?
I have followed the instructions and yet the generated images came out strange. Here's the output:
`C:\Users\Kalin\Documents\GitHub\generative-art-nft>python nft.py
Checking assets...
Assets look great! We are good to go!
You can create a total of 153900 distinct avatars
How many avatars would you like to create? Enter a number greater than 0:
5
What would you like to call this edition?:
1
Starting task...
100% (5 of 5) |#############################################################################################################################################################| Elapsed Time: 0:00:03 Time: 0:00:03
Generated 5 images, 5 are distinct
Removing 0 images...
Saving metadata...
Task complete!`
The result for the first image is:
And here are the images that make it up (In order):
What can I do to get it to work?
71% (60 of 84) |################# | Elapsed Time: 0:00:44 ETA: 0:00:21Traceback (most recent call last):
File "/Users/liaozhedeng/Desktop/NFT_Turtle/nft.py", line 238, in
main()
File "/Users/liaozhedeng/Desktop/NFT_Turtle/nft.py", line 229, in main
rt = generate_images(edition_name, num_avatars)
File "/Users/liaozhedeng/Desktop/NFT_Turtle/nft.py", line 173, in generate_images
generate_single_image(trait_paths, os.path.join(op_path, image_name))
File "/Users/liaozhedeng/Desktop/NFT_Turtle/nft.py", line 67, in generate_single_image
bg = Image.open(os.path.join('assets', filepaths[0]))
IndexError: list index out of range
When generating a large amount of avatars(in my case 80000), full systyem memory gets taken up and process returns "Memory Leak".
can someone help me with the BASE_JSON format?
I installed the "progressbar" package but it occur issue.
after I remove the progressbar feature from the script, it works fine.
To document: The first layer will define the output resolution at the moment.
To implement: Warn if resolutions of asset are different, display output resolution.
It does give for an interesting cropped output:
But I would like to add the following parameters:
RESOLUTION_AUTO=True # process the first image, detect resolution and proceed with that resolution
RESOLUTION_OUT="600x600" # This only applies if RESOLUTION_AUTO=False
What would be the consensus on where to put this tunable?
Into the config list or into each and every dictionary item, feels superfluous and inefficient.
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!
Hi,
I generate a collection with your tools but i have a problem.
I try to generate 11 000 NFT.
The return of the script is good, the metadata.csv contain the date of 11 000 distincts NFT but only 1500 images are created when i open the folder.
You can create a total of 36578304000 distinct avatars How many avatars would you like to create? Enter a number greater than 0: 11000 What would you like to call this edition?: test#1 Starting task... 100% (11000 of 11000) |############################################################| Elapsed Time: 0:03:26 Time: 0:03:26 Generated 11000 images, 10500 are distinct Removing 500 images... Saving metadata... Task complete!
What would you like to call this edition?:
version_1
Traceback (most recent call last):
File "nft.py", line 238, in
main()
File "nft.py", line 226, in main
edition_name = input()
File "", line 1, in
NameError: name 'version_1' is not defined
can't run nft.py
File "nft.py", line 5, in
from PIL import Image
ImportError: No module named PIL
getting a ValueError: bad transparency mask when I try to generate some NFTs with custom assets
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.
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!
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 ?
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.
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.
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'
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.
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
Do you know any place where I can buy assets?
Hello, is it possible to use animated PNG layers? I’ve tried but i can’t get it to work
thanks.
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.
It would be great if config.py
supported more of a tree-like structure than a linear structure.
For example, I have a trait that is 50/50 in terms of rarity. Depending on which one of the two options is selected, I want to add different traits on top of it.
For reference, https://nft-generator.art/app supports a similar capability.
A way this could be implemented in the config.py
would be to add 2 keys named: next_trait_id
and next_trait_rarity
. next_trait
would be a field that takes the id
of the trait to follow and next_trait_rarity
represents the odds that the trait will be applied.
I've been trying to generate background with 6 traits. But I've stumbled into problem that output only shows background or one asset. Files are 24x24 pixel and in a .png form transparent. I get no errors or anything like that. The weirdest part is that I can get on my laptop background + next trait but on my main only background or a trait if I deselect background.
How I should proceed?
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?
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.