bolshoytoster / hashlips_art_engine

HashLips Art Engine is a tool used to create multiple different instances of artworks based on provided layers.
MIT License
42 stars 34 forks source link

DNA exists! #8

Closed BravoNatalie closed 2 years ago

BravoNatalie commented 2 years ago

Checklist

Description

I want to create a collection of 10000 and I have the following layers structure:

In my understanding, with this is possible to create up to 15000 (10 5 5 6 10) unique NFTs, but I can only create 2512 with them.


...
DNA exists!
Saved edition: 2512
Created edition: 2512, with DNA: 49b6d7a54a296f3ae7207d98757eedce31ed654b
DNA exists!
...
DNA exists!
You need more layers or elements to grow your edition to 10000 artworks!

ps.: I'm not using any rarity or other different features.

Steps to reproduce

On the layers folder create a folder for each layer and its different options:

On the config file edit the layerConfigurations variable to look like this:

const layerConfigurations = [
  {
    growEditionSizeTo: 10000,
    layersOrder: [
      { name: "Background" },
      { name: "Eyebrow" },
      { name: "Eyes" },
      { name: "Glasses" },
      { name: "Mouth" },
    ],
  },
];

Run the script with:

yarn build

Expected result

On the build folder should be created 10k different files on the images and build folder.

Actual result

...
DNA exists!
Saved edition: 2512
Created edition: 2512, with DNA: 49b6d7a54a296f3ae7207d98757eedce31ed654b
DNA exists!
...
DNA exists!
You need more layers or elements to grow your edition to 10000 artworks!

Environment

OS Version (uname -a on unix, systeminfo on windows): Darwin Bravos-MacBook-Air.local 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:24 PDT 2021; root:xnu-8019.41.5~1/RELEASE_ARM64_T8101 arm64 Node.js version (node -v): v16.13.0

bolshoytoster commented 2 years ago

@BravoNatalie it says that when it's run into too many duplicates, you can remove the check in src/main.js ~line 481 by removing failedCount++: https://github.com/bolshoytoster/hashlips_art_engine/blob/5a5ef7f3dfa5c2d2247b680d3a2484ebf88fc31c/src/main.js#L480-L482

Keep in mind that it'll probably take a while to generate the full collections and will probably use a lot of memory.

BravoNatalie commented 2 years ago

@bolshoytoster thank you! it worked! Can I suggest you add this as a feature so it's only needed to change a boolean value on the config file?

bolshoytoster commented 2 years ago

@BravoNatalie I could add something, but this is more of a workaround anyway.

I could optimise this more, but it would break compatibility with the main repo.


EDIT: Looks like you can just set uniqueDnaTorrance in src/config.js to Infinity.

I could add a note in the README.md somewhere.

BravoNatalie commented 2 years ago

thank you! I'll be closing this issue since it's resolved