Generate 10k NFT Poems
Table of Contents
- Introduction
- Setting Up the Hashlips Art Engine
- Creating a Template for Generating Poems
- Cutting Out Poem Segments
- Renaming and Organizing Poem Segments
- Configuring the Hashlips Art Engine
- Generating Poems with Different Layers
- Customizing the Background Image
- Understanding the Metadata of Generated Images
- Scaling Up: Generating a Hundred Poems
Introduction
In this tutorial, I will guide You through the process of generating NFTs (Non-Fungible Tokens) using the Hashlips Art Engine. You might think it's strange, but with some careful thought, you can actually generate poems using this art engine. We will not focus on the structure of a poem but instead provide you with the tools and know-how to generate them using code. So, let's dive into the wonderful world of generative poetry!
Setting Up the Hashlips Art Engine
Before we can start generating poems, we need to set up the Hashlips Art Engine. Here are the steps to get everything up and running:
- Visit the GitHub repository of Hashlips Art Engine: github.com/hashlips
- Download the code by either cloning the repository or downloading the latest release.
- Install Node.js version 14.18.1 on your system.
- Install Visual Studio Code as your code editor.
- Open the Hashlips Art Engine folder in Visual Studio Code.
- Open the terminal within Visual Studio Code and run
npm install
to install the dependencies.
- Test the program by running
npm run generate
in the terminal. You should see some images being generated in the bold
folder.
Creating a Template for Generating Poems
In order to generate poems, we need a template. You can use any photo editing software to Create a template, but for this tutorial, I'll use Photoshop.
- Start by creating a structured template with dark and light boxes inside a big cube.
- Use the T-brackets to realign the document after scanning.
- Print out the template and start writing your poetry, keeping in mind the structure of the template.
- Once you're done writing, scan the template back into your computer and convert it to grayscale.
Cutting Out Poem Segments
Now it's time to cut out the segments of the poem from the template. Follow these steps:
- Duplicate the grayscale template image in Photoshop for each segment you want to extract.
- Use the selection tool to select each Blue box representing a segment.
- Cut and paste the selected segment into a new layer.
- Rename the layers according to the segment's position in the poem (e.g., l1, l2, l3, etc.).
- Repeat these steps for all segments of the poem.
Renaming and Organizing Poem Segments
To prepare the poem segments for generating images, we need to rename and organize them. Follow these steps:
- Ensure that each poem segment layer is visible and remove the background.
- Rename each layer with a descriptive name (e.g., l1, l2, l2_1, l3, l4, etc.).
- Create folders in the layers folder named after the poem segments (e.g., l1, l2, l2_1, l3, l4, etc.).
- Move each corresponding poem segment layer into its respective folder.
- Remove the "raw" folder (which was used for initial organization).
Configuring the Hashlips Art Engine
Now let's configure the Hashlips Art Engine to generate our poems:
- Open the
config.js
file within the source
folder.
- In the
layerConfigurations
property, update the order of the layers to match the desired rendering order.
- Add the folder names of the poem segments in the desired order to the
layerConfigurations
.
- Save the
config.js
file.
Generating Poems with Different Layers
With the Hashlips Art Engine properly configured, we can now generate poems using the different layers. Follow these steps:
- Run
npm run generate
in the terminal to generate the poems.
- Check the
bold
folder to see the generated images.
Customizing the Background Image
You can customize the background image of the generated poems. Here's how:
- Open the
config.js
file.
- Set
background.generated
to false
to have transparent backgrounds.
- Set
background.static
to true
.
- Replace the
background.color
with the desired color code or image path.
- Save the
config.js
file.
- Run
npm run generate
in the terminal to generate poems with the new background.
Understanding the Metadata of Generated Images
Each generated image has associated metadata. Here's an overview of the metadata structure:
- Name: The name of the image.
- Description: A description of the image.
- Image: The image file location.
- Traits: Descriptive attributes of the image, including trait Type and value.
The metadata provides important information about each image, which is crucial for properly displaying and categorizing NFTs in marketplaces.
Scaling Up: Generating a Hundred Poems
To Scale up the generation process, follow these steps:
- Update the
growEditionSize
variable in the config.js
file to the desired number of images (e.g., 100).
- Run
npm run generate
in the terminal.
- Check the
bold
folder to find the generated poems.
Congratulations! You have successfully learned how to generate NFT poems using the Hashlips Art Engine. This opens up endless possibilities for creativity and exploration. Enjoy the Journey!
FAQ
Q: Can I use the Hashlips Art Engine to generate images other than poems?
A: Yes, the Hashlips Art Engine can be used to generate a wide range of images. By configuring the layers and metadata, you can create unique artworks, avatars, and more.
Q: Can I customize the size of the generated images?
A: Yes, you can customize the size of the images by adjusting the configuration settings in the config.js
file. Look for the width
and Height
properties under the imageProperties
section.
Q: How can I add rarity weights to certain layers in the generation process?
A: To add rarity weights, modify the rarityWeights
property in the config.js
file. Assign higher weights to the layers you want to be more rare in the generated images.
Q: Can I generate images with different resolutions or formats?
A: Yes, you can configure the resolution and format of the generated images by modifying the imageProperties
section in the config.js
file. Adjust the resolution
and fileFormat
properties according to your preferences.