txpipe / pix

Cardano NFT Generator CLI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

generative limitations/problem

pehcastro opened this issue · comments

I really liked the project and have been testing the use of it for a collection.
The metadata, upload system and creating a new project worked very well, but I had some problems with the generation script.

I have an average of 140 traits, the script can only generate 20, more than that it says "You need more features or traits to generate 21" even with low or high tolerance, simple or advanced mode.

It's probably a problem on my side, so, directly to this problem I would like to better understand how simple and advanced modes work, and how the pix.json tolerance margin works

My folder structure is project/images/background/common (uncommon, rare, etc)

Rarity should be on folders or names on files on a single folder?

It would also be interesting to take a look at the Hashlips generator, it has a fine adjustment for each layer within each rarity, which makes it much easier to average the images and traits you want to be generated, if you can implement something like that in advanced mode It would make the tool much more complete.

The idea is that you choose a range in the collection for commons (1500 nfts for example) and set the probability of the layers inside 'common' (and later for other rarities)

//commons
addRarityPercentForLayer('common', 'ambience', { 'common': 60, 'uncommon': 40, 'rare': 0, 'epic': 0, 'exotic': 0 });
addRarityPercentForLayer('common', 'body', { 'common': 60, 'uncommon': 28, 'rare': 12, 'epic': 0, 'exotic': 0 });
addRarityPercentForLayer('common', 'shoes', { 'common': 60, 'uncommon': 28, 'rare': 12, 'epic': 0, 'exotic': 0 });
addRarityPercentForLayer('common', 'pants', { 'common': 60, 'uncommon': 28, 'rare': 12, 'epic': 0, 'exotic': 0 });
addRarityPercentForLayer('common', 'shirt', { 'common': 60, 'uncommon': 28, 'rare': 12, 'epic': 0, 'exotic': 0 });
addRarityPercentForLayer('common', 'hair', { 'common': 60, 'uncommon': 28, 'rare': 12, 'epic': 0, 'exotic': 0 });
addRarityPercentForLayer('common', 'eyes', { 'common': 60, 'uncommon': 28, 'rare': 12, 'epic': 0, 'exotic': 0 });
addRarityPercentForLayer('common', 'gadget', { 'common': 67, 'uncommon': 33, 'rare': 0, 'epic': 0, 'exotic': 0 });

I am grateful if you can answer the questions or take into consideration the fine-tuning concept.
Nice tool, it adds a lot to the cnfts scenario, I understand little/almost nothing about rust and I found its use very accessible.

commented

@pehcastro

Thank you for using our tool, we're glad that you like it so far, and we appreciate your kind words. Please join our discord if you would like more immediate feedback in the future, we usually have someone available there to help in real time.

https://t.co/9v7sZbtAtO

This tool is actually inspired by hashlips already. I understand your fine tuning concept. I think we can come up with something to make that configurable. Let me explain how simple and advanced mode works. I hope to have more thorough documentation soon.

how simple and advanced modes work

Simple Mode

In simple mode, you have some base folder for your images defaulted to images/. Then in there you have a folder for each layer who's names match the layers provided in the pix.json file.

Then within the layer folders you need to have your trait files organized into rarity folders.

images/
|__ambience/
     |__common/
     |    |__trait.png
     |__uncommon/
     |__rare/
     |__mythical/
     |__legendary/

These have their numeric weights defaulted like so:

  • common: 70
  • uncommon: 50
  • rare: 20
  • mythical: 10
  • legendary: 5

Advanced Mode

This mode works much more like what people are used to in hashlips. In advanced mode, you have some base folder for your images defaulted to images/. Then in there you have a folder for each layer who's names match the layers provided in the pix.json file.

Unlike simple mode, the trait files live in the layer folders and NOT within rarity folders. From there you must provide the rarity with a special suffix in the trait file names.

This is the pattern: name#WEIGHT.png

images/
|__ambience/
     |__trait#30.png

how the pix.json tolerance margin works

This is a number that the tool uses to decide when to stop trying to make unique combinations. The program essentially loops continuously trying to make as many combinations as specified in the pix.json file and stops looping when that amount is reached or when the failure tolerance is reached. Without the tolerance number the program could potentially loop infinitely.

Short Term Solution

In your case it might be safe to turn it up very high just in case the program incorrectly runs into many collisions early on even though there might still be available unique combinations.

Long Term Solution

We'll look into shuffling the traits between loops to see if that avoids causing collisions when unique combinations are still available.

Thanks for the quick response :)

we found the problem on discord, in case someone else has it too, it is necessary to reinstall in the pix folder in case you make changes to the name of the rarities or any related to code

just use cargo install --path .
and try again