一个简单的跨平台开源 NFT Art Generator

在这里插入图片描述

Introduction

Appsus NFT Art Generator is a free, open source application used to generate NFT art collections from an input of base image layers. Complete with configurable layer rarity and metadata generation. Ready to upload and mint to the Ethereum or Solana blockchains!

app-image-generation

Downloads

Windows

Mac

Linux

Usage Quick Start

  1. Run the Nft Art Generator executable
  2. Click the “Load Input Folder” Button
  3. Select the folder which contains your NFT image layer folders (Output images are saved in a folder at the same level e.g. if input folder is in Desktop, the output folder will also be placed there)
  4. Adjust the layer ordering by dragging the layers to position
  5. Adjust the individual layer percentage probabilities
  6. Adjust the rarity folder percentage probabilities - must add up to 100
  7. Test that image creation is as expected by clicking the “Random” button
  8. Set the number of Nfts to generate
  9. Select the blockchain to generate metadata for
  10. Optional - Set “Art Base Name” NFT Image prefix (This only sets the image metadata name)
  11. Click Generate
  12. ???
  13. Profit

Concepts

Layer

Image artwork is composed of many layers stacked on each other. Layers can have a percentage probability assigned.

Rarity Folder

Layers contain a common, fixed number of rarity folders. Each rarity folder defines a configurable “probability bucket” in which layer items can be placed.

Item

An item is an individual piece of artwork which belongs to a layer, items layered on top of other items make up the image.

Image creation process

Each image goes through the following process in order to be created:

For each layer, a random roll is made to determine selection.

For each selected layer, another random roll is made to select which rarity folder is selected.

Each rarity folder has a random image selected from it, if no images exist, nothing is selected for the layer.

If the end image has already been generated, repeat the whole process until a unique image is generated.
Metadata is created for this created image.

Requirements

The application assumes these to be true in order for it to function correctly.

Folder Structure

The input folder should be structured as follows:

Input Folder > Layers > Rarity Folders > Items

Rarity Folders need to be the same across all the layers

Example Folder Structure
📦Input Folder
┣ 📂Chest
┃ ┣ 📂common
┃ ┃ ┗ 📜plain_shirt.png
┃ ┣ 📂legendary
┃ ┃ ┗ 📜legendary_shirt.png
┃ ┗ 📂rare
┃ ┃ ┗ 📜rare_shirt.png
┣ 📂Head
┃ ┣ 📂common
┃ ┃ ┗ 📜common_hat.png
┃ ┣ 📂legendary
┃ ┃ ┗ 📜legendary_hat.png
┃ ┗ 📂rare
┃ ┃ ┗ 📜rare_hat.png
┣ 📂Left_Leg
┃ ┣ 📂common
┃ ┃ ┣ 📜common_gun_holster.png
┃ ┃ ┗ 📜standard_pocket.png
┃ ┣ 📂legendary
┃ ┃ ┣ 📜biiiiig_pocket.png
┃ ┃ ┗ 📜legendary_gun_holster.png
┃ ┗ 📂rare
┃ ┃ ┣ 📜kinda_big_pocket.png
┃ ┃ ┗ 📜rare_gun_holster.png
┗ 📂Right_Leg
┃ ┣ 📂common
┃ ┃ ┗ 📜leg_thing.png
┃ ┣ 📂legendary
┃ ┃ ┗ 📜legendary_leg_thing.png
┃ ┗ 📂rare
┃ ┃ ┗ 📜rare_leg_thing.png

Layer Names

Individual words in a layers name must be separated by an underscore in order for the matching metadata to be generated correctly.

Item Names

Individual words in an items name must be separated by an underscore in order for the matching metadata to be generated correctly.

Image Dimensions

Images need to have the same width and height, so that the position of the image item is correct relative to the other layered image items.

FAQ’s

Ask away

For Developers

Introduction

This is an [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-OiUaNqbb-1653034232351)(https://angularjs.org/)] application using [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-hgStnItf-1653034232352)(https://www.electronjs.org/)], with [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-RTIKUtFq-1653034232352)(https://github.com/maximegris/angular-electron)] as a base.

Requirements

  • NodeJs - v14.17.1 (the lowest version we’ve used and verified, lower versions may or may not work)

Getting Started

Clone this repository locally:

git clone https://github.com/AppsusUK/NFT-Art-Generator.git

Install dependencies with npm (used by Electron renderer process):

cd NFT-Art-Generator/

npm install

There is an issue with yarn and node_modules when the application is built by the packager. Please use npm as dependencies manager.

If you want to generate Angular components with Angular-cli , you MUST install @angular/cli in npm global context. Please follow Angular-cli documentation if you had installed a previous version of angular-cli.

npm install -g @angular/cli

Install NodeJS dependencies with npm (used by Electron main process):

cd app/

npm install

Creating a build

To create the build/executable, install the above dependencies, then navigate to the main directory and run:

npm run electron:build

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
当然,我可以帮您回答这个问题。下面是一个例子: ``` // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; contract MyNFT is ERC721 { using Counters for Counters.Counter; Counters.Counter private _tokenIds; uint256 public constant ROYALTY_FEE = 10; // 10% uint256 public royaltyAmount; address public royaltyBeneficiary; constructor(address _royaltyBeneficiary) ERC721("MyNFT", "NFT") { royaltyBeneficiary = _royaltyBeneficiary; } function mint(address _to, string memory _tokenURI) public returns (uint256) { _tokenIds.increment(); uint256 newItemId = _tokenIds.current(); _safeMint(_to, newItemId); _setTokenURI(newItemId, _tokenURI); return newItemId; } function setRoyaltyBeneficiary(address _newBeneficiary) public { require(msg.sender == royaltyBeneficiary, "Only current beneficiary can change."); royaltyBeneficiary = _newBeneficiary; } function transferFrom( address _from, address _to, uint256 _tokenId ) public payable override { require(_checkRoyaltyFee(msg.value), "Not enough Ether sent."); super.transferFrom(_from, _to, _tokenId); royaltyAmount = msg.value; } function _checkRoyaltyFee(uint256 _amount) internal view returns (bool) { return _amount * 100 / ROYALTY_FEE == royaltyAmount * 100; } function withdrawRoyalty() public { require(msg.sender == royaltyBeneficiary, "Only royalty beneficiary can withdraw."); uint256 amount = royaltyAmount; royaltyAmount = 0; payable(msg.sender).transfer(amount); } } ``` 上面的合约可以让您创建一个 ERC721 标准的 NFT 合约,并包含版税功能。当合约中的 NFT 进行转移时,合约会收取 10% 的转移费用,并分给版税接收人。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值