This package is not (yet) made generic enough to be used from the command line for arbitrary NFT art. However, we hope that the details herein can help you create generative programs that will create fun, unique art with specified rarity gradients.
The most interesting functions in the Python script are highlighted below.
def generate_nft_metadata(start_num, total_nfts, traits_ratios, acceptable_hamming, static_traits, variable_traits)
def compose_image(combination, bg_color, in_pics_dir)
See Pillow for more information.
def compile_metadata_statistics(full_list, variable_traits)
def upload_to_ipfs(api_client, nft, in_pics_dir)
See NFT.Storage for more information.
def generate_sample_images(metadata_dir, pics_dir, num_images, num_iterations, output_pics_dir)
Note that this function incorporates hamming distance to ensure that you get a very unique set of sample images.
The command line code that started it all was:
python3 src/py/compose.py generate-nfts --total-nfts 4410 --min-hamming 3 --percentages-file tangz/percentages.json
The Astronaut set was generated by hand to ensure that the static-trait
flag was set correctly and no odd combinations were created. The final result is now visible on the secondary market via JPG.Store or epoch.art.