Dreams to NFTs: AI Image Generation & Minting built with Replicate Models and MintbaseJS.
Tooling:
Author:
-
@mintbase.js/sdk: to use the execute call when minting
-
@mintbase.js/react to provide the wallet connection
-
@mintbase.js/storage: to upload the images to Arweave
By writing a prompt and selecting a model from the dropdown, users can generate an image through AI when pressing the prompt
button.
If the user then wishes to mint the resulting image, they may add a title and press Mint Me
which will then redirect them to the transaction page so they can finish the minting process.
you should create an .env
file with the following properties:
REPLICATE_API_TOKEN='...'
NEXT_PUBLIC_MINT_CONTRACT_ADDRESS='...'
NEXT_PUBLIC_PROXY_CONTRACT_ADDRESS='...'
NEXT_PUBLIC_NETWORK='...'
REPLICATE_API_TOKEN
should have the value of your token for the replicate api. You can get a token on the replicate website.
NEXT_PUBLIC_MINT_CONTRACT_ADDRESS
is the address of the contract where you want to mint the result into an NFT. If you dont have one, you can deploy a new contract on our launchpad.
NEXT_PUBLIC_PROXY_CONTRACT_ADDRESS
is the address of a proxy contract to allow you to relay the transaction to the minting address. This address should have minting permissions on your minting contract.
NEXT_PUBLIC_NETWORK
is the network of the contracts being used (usually 'mainnet' or 'testnet').
After setting up, you can run:
pnpm install
After the install succeeds, you con start the project with:
pnpm dev
And you're done! The project should be running locally on your machine.
This project is set up using Next.js + @mintbase/js + shadcn ui + react hook form. You can use this project as a reference to build your own, and use or remove any library as needed.
- Support: Join the Telegram
- Twitter: @mintbase