Giter VIP home page Giter VIP logo

pix's Introduction

pix

A CLI for managing NFT projects

Table of Contents

Features

  • Generate unique NFTs from attribute files
  • Layer ordering defined in the config
  • Output rarity data
  • Sets (groups of the same layers with different image files)
  • Conditional Layer Rendering (based on sets or traits within a previous layer)
  • Starting count at 1 or 0
  • Simple or Advanced rarity configurations
  • Integrates with nft maker
    • generate metadata template
    • upload collections

Installation

For now pix needs to be built from source.

  • install rustup.rs
  • git clone https://github.com/3based/pix.git
  • cd pix
  • cargo install --path .

If you decide to make code changes to customize it to your needs you'll have to re-run cargo install --path .

Usage

USAGE:
    pix <SUBCOMMAND>

OPTIONS:
    -h, --help    Print help information

SUBCOMMANDS:
    auth        Provide your NFT Maker API Key to use globally
    clean       Clean the output directory
    gen         Generate an NFT collection
    help        Print this message or the help of the given subcommand(s)
    metadata    Output metadata template that can be uploaded to nft-maker.io
    new         Create a new project
    upload      Upload an NFT collection to nft-maker.io

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 dos 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.

Config

There needs to be a config file at the root of a project.

Example

{
  "policy_id": "123",
  "name": "BasedBear",
  "display_name": "Based Bear",
  "mode": "simple",
  "start_at_one": false,
  "amount": 10000,
  "tolerance": 50,
  "path": "images",
  "sets": [
    {
      "name": "Head",
      "amount": 20
    },
    {
      "name": "Mohawk",
      "amount": 20
    }
  ],
  "layers": [
    { "name": "background" },
    {
      "name": "eyes",
      "exclude_if_sets": ["Mohawk"],
      "exclude_if_traits": [
        { "layer": "background", "traits": ["clouds", "cardano"] }
      ]
    },
    { "name": "Base" },
    { "name": "Stitch Color" },
    { "name": "belly", "none": 80 },
    { "name": "forehead", "none": 60 },
    { "name": "Stuffing" }
  ],
  "extra": {
    "twitter": "https://twitter.com/_3based",
    "website": "https://3based.com",
    "copyright": "2022 3Based",
  },
  "nft_maker": {
    "network": "mainnet",
    "apikey": "",
    "nft_project_id": 0
  }
}

Types

{
    policy_id?: string,
    name: string,
    display_name?: string,
    mode: "simple" | "advanced",
    start_at_one?: true,
    amount: integer,
    tolerance: integer,
    path: string,
    sets?: { name: string, amount: integer }[],
    layers: {
      name: string,
      none?: integer,
      exclude_if_sets?: string[],
      exclude_if_traits?: {
        layer: string,
        traits: string[]
      }[]
    }[],
    extra: Json,
    nft_maker?: {
        network: string,
        apikey: string,
        nft_project_id: integer
    }
}

pix's People

Contributors

microproofs avatar rvcas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pix's Issues

generative limitations/problem

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.

Panic on upload

split_name isn't indexed properly for rarity.json and this file in general should be filtered out of the folder search for upload.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.