Welcome to the Swan Chain Generative Art NFT
project. We used Lagrange APIs and Chainlink Functions to create NFTs for digital arts generated by Lagrange AI. These NFTs are developed on the Mumbai testnets.
To set up the Generative Art NFT Project, ensure you have a compatible virtual environment. Follow these steps to install the necessary dependencies:
# Clone the repository
git clone https://github.com/TomYang-TZ/Generative-Art-NFT.git
# Navigate to the project directory
cd Generative-Art-NFT
# Create a virtual environment first
conda create -n "VIRTUAL_ENV_NAME" python=3.9
conda activate "VIRTUAL_ENV_NAME"
# Run the setup script
chmod +x setup.sh
./setup.sh
Note that all our functions run locally, your information is not collected. Please remember to use your personal API token from your Lagrange Testnet account as the Lagrange API key. To register for a Multichain Storage(MCS) API key, sign up here and go to setting.
To run the application locally:
-
Navigate to the
Generative-Art-NFT
folder:cd Generative-Art-NFT
-
Start the Flask application:
python app.py
To run the application using Docker:
-
Build the Docker image:
docker build -t artnft-app .
-
Run the Docker container:
docker run -p 9999:9999 artnft-app
The Dockerfile is located at
Generative-Art-NFT/Dockerfile
.
To launch our NFT Campaign, which is themed around constellation, advanced technology, cosmic phenomena, and surreal sci-fi environments, we have crafted a comprehensive collection of both positive and negative text prompts. These prompts are systematically selected at random to ensure a diverse and captivating representation in our project. See generate_prompt()
for more information. To modify and design your own campain, see below
The core functionality of this application is encapsulated in the generateArtNFT()
function, which can be found in src/utils.py
.
-
API Configuration:
- Create a
.env
file in the root directory. - Follow the template provided to set up your API keys and other configurations.
- Create a
-
Using the
generateArtNFT()
Function:- Here's an example to illustrate the usage of
generateArtNFT()
:You can craft your own text prompts and create unique NFTs using Lagrange AI and Chainlink Functionsmcs_img_link, chainlink_function_contract_address, nft_contract_address, dataset_address, license_mint_hash = generateArtNFT(POS_TEXT_PROMPT=POS_TEXT_PROMPT, NEG_TEXT_PROMPT=NEG_TEXT_PROMPT) )
- Here's an example to illustrate the usage of