Jon-Becker / nft-generator-py

This tool allows users to generate sets of unique images and metadata using weighted layer collections.
MIT License
306 stars 127 forks source link

generate_unique_images(amount, config) error #4

Closed lsoudi closed 2 years ago

lsoudi commented 2 years ago

hello, when I run the "generate_unique_images(amount, config)" command I get a "syntax error near unexpected token `amount,'" error. what am I suppose to put instead of amount? I have tried replacing amount with the number of images i want to generate but still run into the same issue. what would an example input command be if i wanted to generate just 3 nft images?

thank you!

Jon-Becker commented 2 years ago

Hey! Thanks for using my tool.

amount is an integer. If you want to generate 3 images, run generate_unique_images(3, config). config is an object that you specify in order to tell the program what to do.

For example, generating 5 images would look like:

generate_unique_images(5, {
  "layers": [
    {
      "name": "Background",
      "values": ["Blue", "Orange", "Purple", "Red", "Yellow"],
      "trait_path": "./trait-layers/backgrounds",
      "filename": ["blue", "orange", "purple", "red", "yellow"],
      "weights": [30, 45, 15, 5, 10]
    },
    {
      "name": "Foreground",
      "values": ["Python Logo"],
      "trait_path": "./trait-layers/foreground",
      "filename": ["logo"],
      "weights": [100]
    },
    {
      "name": "Branding",
      "values": ["A Name"],
      "trait_path": "./trait-layers/text",
      "filename": ["text"],
      "weights": [100]
    }
  ],
  "name": "NFT #"
})