Create 10000 generative NFTs / Artworks with code part 3

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
i personally think that this is the best update this far [Music] hey how's it going guys my name is daniel aka hashflips and welcome to my channel in this channel we are continuing to look at the hashlabs art generator code now if you haven't seen any of these videos before please go and watch the previous two it will give you great context and you will learn how to create multiple images thousands of images with just a few layers now for this update we've done a few fixes to get the latest repo on your machine you can either go here to the code section and copy it over there or if you really want to make sure to follow along with a particular video such as this you can go to the releases over there if you click on the releases for a file there where it says v 1.0.2 it might say something different in the future but we are looking at this video particularly to version 1.0.2 now the few fixes that were done was the windows fix where the delimiter was actually breaking for windows users because it was an asterix you cannot have an asterisk in a file name on windows so we change it to a hashtag but you can change it dynamically to whatever symbol you want and i'll show you now in the code number two is the very secretive but the most awesomest update thus far it is adding layer configurations to do more complex collections ever seen before this will change history and this was inspired by an artist that contacted me that gave me this idea to implement then the dna is now hashed and we did a little fix on the random selection by weights i cannot wait to take you guys through this amazing new update so if you enjoyed the code please leave a like and comment in the section below i would really like to hear your feedback as always and i do listen and i do implement your suggestions so go ahead and do that if you get stuck for any reason go and follow our telegram group or twitter there's a lot of community members by now that will definitely help you out let's jump right into the new update what you want to do is you want to go down here to where it says version 1.0.2 and then you want to click on the source code zip once you've downloaded this zip file extract it on your machine and then open an ide so now that you have downloaded extracted the zip and opened that zip folder in your favorite ide i'm using visual studio code it's just very convenient to use but you can use any ide for this make sure that you are in the root of the folder structure and you can tell that by opening a terminal and make sure that that terminal is inside of your folder structure so usually in visual studio code you can just go to terminal and say new terminal and it will open it up in your root to make sure that you are in the root you can type ls on a mac and when you run it you should see all these folders showing up in the terminal representing these ones just basically make sure that you've opened it correctly next what you want to do is you need to install the dependencies i prefer yarn so after you've installed yarn you can use that or you can use npm from node so you can say yarn add all in your terminal make sure you are on the route and it should start downloading all the dependencies needed for this repo and there you can see that all the dependencies was installed successfully if you are having trouble with yarn you can alternatively run npm install so after running npm install it would do exactly the same npm and yarn are just two different libraries which grabs dependencies from the internet and downloads it onto your machine so either one would work all right perfect now we have some extra folders and mainly this node underscore modules folder make sure that you have this in your folder structure before continuing to the next step so for the next step what you want to do is you want to run the program to make sure that everything builds and we actually built the base project generating the new artworks you can do that by going to the same terminal and running node space index.js once you hit enter you should see the artworks generating here on your folder structure underneath a built folder the first time you run this program it takes some time but afterwards it's much faster once that this kicks in you'll see that it goes ahead and creates 10 artworks down here like so it even found a existing dna which it then skipped and continued to run which is perfect that's exactly how we want this program to work a lot of people have asked me where do these things get saved so for those people who wonder where the artworks get saved it simply gets saved in the exact same folder structure that you downloaded it just will be underneath the builds folder that will be created when you run this program you can see that if you open the builds folder there all your images and metadata exist in there similarly if you look at the ide that you're working in it will also show up here because these are just folders and files inside of a folder on your machine right so here in the builds folder we can see that these images was now created great our program works and we also getting back the metadata for each of these images now that we know that this program works as intended we can go ahead and now experiment with new types of layers that we want to add firstly there was a fix that i had to do for the windows users out there let's go and check how the program works and the configuration that you can play around with to make your own collection work so having a look at what changed in the program we can go ahead and go to the source file open the config.js and this is the file that we're going to explore this is also the only file that you ever need to change when you create your own collection i highly recommend that you go back and watch the previous two videos of this series in order to fully understand this program well members have been complaining saying that they can't run this program on windows and that's mainly to do with the delimiter that they can't use previously our delimiter and when i talk about that i mean in this layers on all of our layer files if we open one usually this was a asterisk a star and for windows users they simply can't use an asterisk in the file name so what i've gone and done for you guys is put a rarity delimiter inside the configuration so exactly like the previous program you go and set up your weights basically all you all you have to do is put a hashtag now and then put your weight you can simply go and change this delimiter over there and if you want to make it an and sign if you want to make it a asterix again or if you want to make it an at sign you can go ahead and do so as long as it doesn't conflict with the rest of your naming convention this is done so that this will now work on windows machines and linux and mac so that's the first change into in the configuration file that you need to be aware of so just change all the asterisks to hashtags for now and if you want a custom one you can change that then just remember to change it over here another thing i want to mention is that if you have a folder each one needs a rarity attribute let's say you wanted all these files to carry the same weight and be equal in the selection process you can go ahead and have a weight of 1 on all of them it means it will equally go and choose one of these if you want one to be more ordinary and chosen the most you can go and update a weight let's say yellow to maybe 10. this means that yellow would be chosen 10 times more than the other ones and that's how the weights work they don't work in percentages and that's what makes it so flexible you can have a lot of weights and a lot of attributes the next thing that change that we have to take a look at that is very very exciting is the layers configuration now i am very excited regarding the layers configurations because this now allows the artist to have all the freedom they want and this was actually brought up by an artist who contacted me and saying that they have these issues where they don't always have layers that work together perfectly i then went ahead and create these layer configurations for you guys out there to either create a normal collection like we always used to and also to have the option to create the same collection but with multiple layers switching in and out i'll give you guys an explanation here but you can play around with this code let's quickly run through the rest of what we need to do with the layer configuration before we do another run and so you understand how it works firstly you can see that we have this layer configuration file this used to be the layers orders we still have the layers orders but that is this is sitting inside of an object this all the way down to here from 17 to 6 is one object you can see that it's one object by closing it down and seeing that it closes in on itself meaning that this one object has a grow addition size 2 object or while a value as well as the layers order this is important to understand if you want to create a collection just basically the same way how we always have done where you add your layers to the layer folder name them exactly the same as your layers over there organize them in any order you want to and if you want to create now a hundred artworks you make the grow edition size a hundred we don't have an edition size down here anymore the reason for that is because the grow addition to size is there to control how many editions should be created and facilitate this new workflow when you do that and you save the program you can go ahead and go and run this in the terminal again make sure that you save the config.js before running it you can see that a hundred artworks gets created pretty quickly another change i want you to mention notice and that i want to mention is basically the dna the dna are now converted to sha-1 hashes and the reason for that is we want a static value that changes based on the images being selected i have done a lot of code updates in this update so i'm not going to run through the code feel free to go through the code on your own i think it's important for you to know how to use the code and on a later stage we'll refine it we'll take everyone through it again but basically this is the one change and you can see that in our builds folder this has now generated these new artworks but why are these configurations necessary well let me explain so first off if you just want to create a normal collection and you have sorted out your layers and you don't want extra complexity with your layers you can perfectly use it just like this like the old way except for the edition size is now in this grow edition size 2 value so there you will set your addition size basically for one collection for one collection with one layer configuration but let's say in my layers i've got this extra goo png that i now want to add but i only want to add it on certain editions as well as order it in a different way on my layers let's say if i look at my png i want this goo sometimes to be inside the lids and sometimes i want it to be on top how do i do that now this is a very basic example but i'm going to show you how to achieve this what you need to remember is we need to add our goo folder into our layers order but instead of just adding it so i can go ahead and do this and say well i need to add my folder goo i need to make sure that my goo has an image at least one image and i've set the weight to one so it always selects it anyway then i'm going to change the addition to only five when i run the program after saving the the config.js my five images gets created and i can see each one has this goo image on top of it because it's the last layer in this order but let's say i didn't want that but only for someone for some of the images i wanted the gu to be actually ordered below the bottom lid like so so if i save the program again and run it i can see that my new images gets created and now the goo is below the lids but this is a problem because sometimes i want it on top again how do we do that now what you can do and this is very important go ahead and make sure that you copy this whole object from line 6 to line 18 wherever it stops with the curly brace you can make sure that you're copying the whole object by closing it first over there on this arrow or you can just make sure to copy this whole thing you copy it and paste it right below this is now a continuation of your collection the only rule with this is the grow addition to size amount can't be the same and it must go higher it must increment for the next edition that you're busy with because think of it like this we start off with our collection and we create five now we want to grow our collection to let's say 10 meaning that this layer structure will be used for the next five nfts and i'll show you what i mean i'm going to keep this simple keep everything the same and just take this goo and move it on top of everything again once i save the program and i run it you will see that 10 images now gets created because the last one determines the whole edition size but every increment of it determines how many images will be created so in layman's terms for this layer order 5 will be created for this layer order coming after it another 5 will be created because it goes to 10. so let's go and check it out in the bolds folder if we go and have a look at png one we can see that the goo is below the lids if we go down and we go to five which is the last one of those and we carry on to six six is now triggering our latest layer configuration so onwards the goo will now be on top this might be a simple example but you can see how powerful this gets we can carry on with as many layer configurations as we want we can even say well let's make our edition 15 or 20 even so that we add another 10 images but this time i don't want a bottom lid to be there i also don't want a background and i also don't want a top lid maybe i don't even want goo i just want the eyeball and i can rearrange orders in doing this if i save this file we can see that i have now three layer configurations and when i run it i will see the output we can see like normal there's our first cool nfts up till five from there on the goo is on top right up until ten remember it goes from five first then up till ten and then from ten to twenty we can see that it would probably look a lot different so 11 there you can see 12 13 now these don't even have bottom lids but yet they form part of the same collection they form part with the same dna and metadata i think this is some of the most exciting additions to this program this allows an artist to really be free with what they want to create you can contribute layers of different series if you want to into one this is also a way that you can do races you can say that you want one race to have these folders with their rarity specified another race can be this and another race you can have your imagination go wild and create as many of these as you want to just remember that the grow addition size will first make five of these then grow edition 10 will make five of these because it it continues growing the edition see it as that and you'll be fine with this concept like i mentioned if you just want the normal collection to run remove the rest of these configuration files just to keep to one addition if you really wanted to be like this and maybe you can create 20 100 or 10 ten thousand nfts that's how simple this program now is this will all be explained in the readme file like you can see on the repo but from my side i can't wait for you guys to test this out and let me know what you think and as always guys have an amazing day please leave a comment in the description if you like this video and join our telegram group if you struggling with any coding questions that you want answered the community is growing and they'll definitely help you out cheers for now
Info
Channel: HashLips NFT
Views: 3,480
Rating: 5 out of 5
Keywords:
Id: _v2ibx7eUF0
Channel Id: undefined
Length: 20min 24sec (1224 seconds)
Published: Wed Sep 15 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.