### Complete Workflow Example (Bash) Source: https://context7.com/hashlips/hashlips_art_engine/llms.txt Provides a step-by-step guide for the complete NFT collection generation workflow using the HashLips Art Engine. This includes cloning the repository, installing dependencies, organizing assets, configuring settings, generating the collection, analyzing rarity, and updating metadata. ```bash # 1. Clone repository git clone https://github.com/HashLips/hashlips_art_engine.git cd hashlips_art_engine # 2. Install dependencies npm install # 3. Organize layer assets in /layers/ directory # layers/ # Background/Blue#50.png, Red#30.png, Gold#10.png # Body/Normal#60.png, Zombie#20.png, Robot#10.png # Eyes/Standard#50.png, Angry#30.png, Laser#15.png # Mouth/Smile#40.png, Frown#30.png, Surprised#20.png # 4. Configure src/config.js with your settings # 5. Generate collection npm run build # 6. Check rarity distribution npm run rarity # 7. Generate preview image npm run preview # 8. Update baseUri after IPFS upload # Edit src/config.js with new baseUri npm run update_info # 9. Optional: Generate pixelated versions npm run pixelate # 10. Deploy metadata and images to IPFS/marketplace ``` -------------------------------- ### Install Project Dependencies with npm Source: https://github.com/hashlips/hashlips_art_engine/blob/main/README.md This command installs the project's dependencies using npm. It is an alternative to using Yarn and can be run in the root directory of the cloned repository if you have Node.js and npm installed. ```sh npm install ``` -------------------------------- ### Install Project Dependencies with Yarn Source: https://github.com/hashlips/hashlips_art_engine/blob/main/README.md This command installs the project's dependencies using Yarn. Ensure you have Yarn installed globally before running this command in the root directory of the cloned repository. ```sh yarn install ``` -------------------------------- ### Build and Generate NFT Collection (Bash) Source: https://context7.com/hashlips/hashlips_art_engine/llms.txt Commands to install project dependencies and run the main generation script for creating the NFT collection. The output includes generated images in `build/images/` and metadata in `build/json/`, including a combined `_metadata.json` file. ```bash # Install dependencies npm install # Generate the collection npm run build # or node index.js # Output structure: # build/ # images/ # 1.png # 2.png # ... # json/ # 1.json # 2.json # ... # _metadata.json (combined metadata for all NFTs) ``` -------------------------------- ### Example NFT Metadata JSON Source: https://github.com/hashlips/hashlips_art_engine/blob/main/README.md This is an example structure of a single metadata JSON file generated for an NFT. It includes essential details like DNA, name, description, image URI, edition, date, attributes, and the compiler used. ```json { "dna": "d956cdf4e460508b5ff90c21974124f68d6edc34", "name": "#1", "description": "This is the description of your NFT project", "image": "https://hashlips/nft/1.png", "edition": 1, "date": 1731990799975, "attributes": [ { "trait_type": "Background", "value": "Black" }, { "trait_type": "Eyeball", "value": "Red" }, { "trait_type": "Eye color", "value": "Yellow" }, { "trait_type": "Iris", "value": "Small" }, { "trait_type": "Shine", "value": "Shapes" }, { "trait_type": "Bottom lid", "value": "Low" }, { "trait_type": "Top lid", "value": "Middle" } ], "compiler": "HashLips Art Engine" } ``` -------------------------------- ### Build and Output Art and JSON Source: https://github.com/hashlips/hashlips_art_engine/blob/main/README.md This command initiates the art generation process. It outputs the final artwork images to the `build/images` directory and metadata JSON files to the `build/json` directory. Each collection will have a `_metadata.json` file, and individual JSON files will represent each image. ```sh npm run build ``` ```sh node index.js ``` -------------------------------- ### Generate Animated Preview GIF Source: https://context7.com/hashlips/hashlips_art_engine/llms.txt Configures the creation of an animated GIF that cycles through a specified number of images from the generated collection. Options include the number of images, display order (ascending, descending, or mixed), loop count, quality, and frame delay. The 'npm run preview_gif' command generates the preview GIF. ```javascript // In src/config.js const preview_gif = { numberOfImages: 5, // Number of images to include in preview order: "ASC", // "ASC", "DESC", or "MIXED" (random) repeat: 0, // 0 = loop forever quality: 100, // GIF quality delay: 500, // Delay between frames (ms) imageName: "preview.gif", }; // Generate preview GIF after building collection npm run preview_gif # Output: build/preview.gif ``` -------------------------------- ### Core Configuration for NFT Art Generation (JavaScript) Source: https://context7.com/hashlips/hashlips_art_engine/llms.txt Defines essential settings for artwork generation, including network selection (Ethereum or Solana), collection metadata (name, description, base URI), output image dimensions, and layer order. It also allows for extra metadata fields to be added to each NFT. ```javascript const { MODE } = require("./constants/blend_mode.js"); const { NETWORK } = require("./constants/network.js"); // Select target blockchain network const network = NETWORK.eth; // or NETWORK.sol for Solana // Collection metadata const namePrefix = "My NFT Collection"; const description = "A unique generative art collection"; const baseUri = "ipfs://QmYourIPFSHash"; // Output image dimensions const format = { width: 512, height: 512, smoothing: false, }; // Layer configuration - defines which layers to use and how many editions to create const layerConfigurations = [ { growEditionSizeTo: 100, layersOrder: [ { name: "Background" }, { name: "Body" }, { name: "Eyes" }, { name: "Mouth" }, { name: "Accessories" }, ], }, ]; // Extra metadata fields added to every NFT const extraMetadata = { creator: "Your Name", external_url: "https://yourwebsite.com", }; ``` -------------------------------- ### Clone HashLips Art Engine Repository Source: https://github.com/hashlips/hashlips_art_engine/blob/main/README.md This command clones the HashLips Art Engine repository from GitHub. It is the first step for users who wish to work with the project's source code directly. ```sh git clone https://github.com/HashLips/hashlips_art_engine.git ``` -------------------------------- ### Multiple Layer Configurations for Diverse Art Collections (JavaScript) Source: https://github.com/hashlips/hashlips_art_engine/blob/main/README.md Allows for multiple, distinct configurations within a single art generation process. Each configuration can have a different `growEditionSizeTo` value and a unique `layersOrder`, enabling the creation of diverse art collections with varying layer compositions and edition counts. ```javascript const layerConfigurations = [ { growEditionSizeTo: 50, layersOrder: [ { name: "Background" }, { name: "Head" }, { name: "Mouth" }, { name: "Eyes" }, { name: "Eyeswear" }, { name: "Headwear" }, ], }, { growEditionSizeTo: 150, layersOrder: [ { name: "Background" }, { name: "Head" }, { name: "Eyes" }, { name: "Mouth" }, { name: "Eyeswear" }, { name: "Headwear" }, { name: "AlienHeadwear" }, ], }, ]; ``` -------------------------------- ### Generate Collage Preview Image Source: https://context7.com/hashlips/hashlips_art_engine/llms.txt Sets up configuration for generating a collage preview image of the entire NFT collection. Parameters include the number of thumbnails per row, thumbnail width, and maintaining the image aspect ratio. The 'npm run preview' command generates the preview file. ```javascript // In src/config.js const preview = { thumbPerRow: 5, // Thumbnails per row thumbWidth: 50, // Width of each thumbnail imageRatio: format.height / format.width, // Maintain aspect ratio imageName: "preview.png", // Output filename }; // Generate preview after building collection npm run preview # Output: build/preview.png # Console output: # Preparing a 250x500 project preview with 50 thumbnails. # Project preview image located at: /path/to/build/preview.png ``` -------------------------------- ### Multiple Layer Configurations for Diverse Collections (JavaScript) Source: https://context7.com/hashlips/hashlips_art_engine/llms.txt Allows for the creation of collections with multiple distinct configurations, enabling different character types or rarity tiers within a single project. Each configuration can specify its own set of layers and edition size. ```javascript const layerConfigurations = [ { // First 50 editions: Human characters growEditionSizeTo: 50, layersOrder: [ { name: "Background" }, { name: "Human_Body" }, { name: "Human_Eyes" }, { name: "Human_Mouth" }, { name: "Clothing" }, ], }, { // Editions 51-100: Alien characters (rare) growEditionSizeTo: 100, layersOrder: [ { name: "Background" }, { name: "Alien_Body" }, { name: "Alien_Eyes" }, { name: "Alien_Antenna" }, { name: "Space_Suit" }, ], }, { // Editions 101-110: Legendary robot characters growEditionSizeTo: 110, layersOrder: [ { name: "Cyber_Background" }, { name: "Robot_Body" }, { name: "Robot_Eyes" }, { name: "Robot_Accessories" }, ], }, ]; ``` -------------------------------- ### Solana Metadata Configuration Source: https://context7.com/hashlips/hashlips_art_engine/llms.txt Configures Solana-specific metadata, including the symbol, seller fee basis points for royalties, an external URL, and creator addresses with their respective shares. This configuration is used to generate Solana-compatible metadata. ```javascript const network = NETWORK.sol; const solanaMetadata = { symbol: "MYNFT", seller_fee_basis_points: 500, // 5% royalty on secondary sales external_url: "https://yourproject.com", creators: [ { address: "YourSolanaWalletAddress1111111111111111111", share: 70, }, { address: "CollaboratorWalletAddress22222222222222222", share: 30, }, ], }; // Generated Solana metadata format: // { // "name": "My NFT Collection #1", // "symbol": "MYNFT", // "description": "...", // "seller_fee_basis_points": 500, // "image": "1.png", // "external_url": "https://yourproject.com", // "edition": 1, // "attributes": [...], // "properties": { // "files": [{ "uri": "1.png", "type": "image/png" }], // "category": "image", // "creators": [...] // } // } ``` -------------------------------- ### Enable Animated GIF Export Source: https://context7.com/hashlips/hashlips_art_engine/llms.txt Configures the engine to export generated NFTs as animated GIFs. This involves setting the 'export' option to true and defining parameters like loop count, quality, and frame delay. The build command generates both image and GIF files. ```javascript // In src/config.js const gif = { export: true, // Enable GIF export repeat: 0, // 0 = loop forever, -1 = play once quality: 100, // GIF quality (1-100) delay: 500, // Delay between frames in milliseconds }; // Run the build to generate both images and GIFs npm run build # Output: # build/ # images/ # 1.png, 2.png, ... # gifs/ # 1.gif, 2.gif, ... # json/ # 1.json, 2.json, ... ``` -------------------------------- ### Advanced Layer Configuration with Options (JavaScript) Source: https://context7.com/hashlips/hashlips_art_engine/llms.txt Enables advanced artwork composition by allowing options for blend modes, opacity, DNA bypass, and custom display names for individual layers. This provides finer control over how layers interact and how their metadata is presented. ```javascript const { MODE } = require("./constants/blend_mode.js"); const layerConfigurations = [ { growEditionSizeTo: 50, layersOrder: [ // Background is excluded from DNA uniqueness check { name: "Background", options: { bypassDNA: true, }, }, { name: "Body" }, // Eye color with blend mode and custom metadata name { name: "Eye color", options: { blend: MODE.destinationIn, opacity: 0.8, displayName: "Eye Color", }, }, { name: "Iris" }, // Shadows with overlay blend mode { name: "Shadows", options: { blend: MODE.overlay, opacity: 0.5 } }, { name: "Accessories" }, ], }, ]; ``` -------------------------------- ### Background Generation Configuration (JavaScript) Source: https://context7.com/hashlips/hashlips_art_engine/llms.txt Configures automatic background generation with either random or static colors in the src/config.js file. The 'generate' flag enables the feature, 'brightness' controls the HSL brightness for random colors, and 'static' determines if a default color is used. ```javascript // In src/config.js const background = { generate: true, // Enable background generation brightness: "80%", // HSL brightness for random colors static: false, // false = random colors, true = use default default: "#000000", // Default color when static is true }; // With static: false, backgrounds are randomly generated HSL colors // With static: true, all backgrounds use the default color ``` -------------------------------- ### Update Base URI and Description Source: https://github.com/hashlips/hashlips_art_engine/blob/main/README.md This utility command allows you to update the `baseUri` and `description` fields in your NFT metadata after the collection has been generated. This is useful for setting IPFS URIs or modifying descriptions post-generation. ```sh npm run update_info ``` -------------------------------- ### Update Metadata (JavaScript) Source: https://context7.com/hashlips/hashlips_art_engine/llms.txt Updates the baseUri, description, or name prefix for all metadata files after initial generation. This script modifies the src/config.js file and requires running 'npm run update_info'. It outputs the updated values to the console. ```javascript // Modify src/config.js with new values const namePrefix = "Updated Collection Name"; const description = "New description for the collection"; const baseUri = "ipfs://QmNewIPFSHashAfterUpload"; // Run update script npm run update_info # Console output: # Updated baseUri for images to ===> ipfs://QmNewIPFSHashAfterUpload # Updated description for images to ===> New description for the collection # Updated name prefix for images to ===> Updated Collection Name ``` -------------------------------- ### Rarity Analysis (Bash) Source: https://context7.com/hashlips/hashlips_art_engine/llms.txt Analyzes the trait distribution of a generated NFT collection to verify rarity settings. This command requires the collection to be generated first using 'npm run build', and then 'npm run rarity' is executed. The output shows trait types and their occurrences. ```bash # Generate collection first npm run build # Analyze rarity distribution npm run rarity # Example output: # Trait type: Background # { trait: 'Blue', chance: '50', occurrence: '26 in 50 editions (52.00 %)' } # { trait: 'Red', chance: '30', occurrence: '15 in 50 editions (30.00 %)' } # { trait: 'Gold', chance: '10', occurrence: '6 in 50 editions (12.00 %)' } # { trait: 'Rainbow', chance: '5', occurrence: '3 in 50 editions (6.00 %)' } # # Trait type: Eyes # { trait: 'Normal', chance: '60', occurrence: '32 in 50 editions (64.00 %)' } # { trait: 'Angry', chance: '25', occurrence: '12 in 50 editions (24.00 %)' } # ... ``` -------------------------------- ### Standard JSON Metadata Format for NFTs Source: https://context7.com/hashlips/hashlips_art_engine/llms.txt Specifies the structure for JSON metadata files, compliant with NFT marketplace standards. Includes essential fields like name, description, image URI, DNA, edition, date, attributes, and compiler. ```json { "name": "My NFT Collection #1", "description": "A unique generative art collection", "image": "ipfs://QmYourIPFSHash/1.png", "dna": "d956cdf4e460508b5ff90c21974124f68d6edc34", "edition": 1, "date": 1731990799975, "attributes": [ { "trait_type": "Background", "value": "Blue" }, { "trait_type": "Body", "value": "Normal" }, { "trait_type": "Eyes", "value": "Laser" }, { "trait_type": "Mouth", "value": "Smile" }, { "trait_type": "Accessories", "value": "Crown" } ], "compiler": "HashLips Art Engine" } ``` -------------------------------- ### Advanced Layer Options: Blend, Opacity, Display Name, Bypass DNA (JavaScript) Source: https://github.com/hashlips/hashlips_art_engine/blob/main/README.md Demonstrates advanced configuration options for individual layers within `layersOrder`. This includes setting blending modes (`blend`), transparency (`opacity`), custom metadata display names (`displayName`), and controlling DNA uniqueness checks (`bypassDNA`). These options provide fine-grained control over art generation and trait uniqueness. ```javascript const layerConfigurations = [ { growEditionSizeTo: 5, layersOrder: [ { name: "Background" , { options: { bypassDNA: false; } }}, { name: "Eyeball" }, { name: "Eye color", options: { blend: MODE.destinationIn, opacity: 0.2, displayName: "Awesome Eye Color", }, }, { name: "Iris" }, { name: "Shine" }, { name: "Bottom lid", options: { blend: MODE.overlay, opacity: 0.7 } }, { name: "Top lid" }, ], }, ]; ``` -------------------------------- ### Generate Preview Image Collage Source: https://github.com/hashlips/hashlips_art_engine/blob/main/README.md This command generates a collage image that serves as a preview of your entire NFT collection. It helps in visualizing the diversity and overall aesthetic of the generated artworks. ```sh npm run preview ``` -------------------------------- ### Configure Layer Order for Art Generation (JavaScript) Source: https://github.com/hashlips/hashlips_art_engine/blob/main/README.md Defines the order of layers for generating art editions. Each object in `layersOrder` specifies a layer name, corresponding to a folder in the 'layers' directory. The `growEditionSizeTo` property determines the total number of artworks to be generated for this configuration. ```javascript const layerConfigurations = [ { growEditionSizeTo: 100, layersOrder: [ { name: "Head" }, { name: "Mouth" }, { name: "Eyes" }, { name: "Eyeswear" }, { name: "Headwear" }, ], }, ]; ``` -------------------------------- ### Layer Asset Naming Convention with Rarity Weights Source: https://context7.com/hashlips/hashlips_art_engine/llms.txt Defines the naming convention for layer assets, incorporating rarity weights indicated by a number followed by a '#' symbol. Higher weights mean higher rarity. The total weight of a layer determines the probability of each asset appearing. ```text layers/ Background/ Blue#50.png # Weight 50 (common) Red#30.png # Weight 30 (uncommon) Gold#10.png # Weight 10 (rare) Rainbow#5.png # Weight 5 (very rare) Eyes/ Normal#60.png # Weight 60 Angry#25.png # Weight 25 Laser#10.png # Weight 10 Diamond#5.png # Weight 5 Accessories/ None#40.png # Weight 40 (no accessory is common) Hat#30.png # Weight 30 Crown#15.png # Weight 15 Halo#10.png # Weight 10 # Rarity calculation example for Background layer: # Total weight = 50 + 30 + 10 + 5 = 95 # Blue appears: 50/95 = 52.6% of the time # Gold appears: 10/95 = 10.5% of the time # Rainbow appears: 5/95 = 5.3% of the time ``` -------------------------------- ### Available Blending Modes for Layer Effects (JavaScript) Source: https://github.com/hashlips/hashlips_art_engine/blob/main/README.md Lists the various blending modes supported by the art engine for applying visual effects to layers. These modes, such as 'multiply', 'screen', and 'overlay', can be specified in the `options` object for a layer to control how it interacts with layers beneath it. ```javascript const MODE = { sourceOver: "source-over", sourceIn: "source-in", sourceOut: "source-out", sourceAtop: "source-out", destinationOver: "destination-over", destinationIn: "destination-in", destinationOut: "destination-out", destinationAtop: "destination-atop", lighter: "lighter", copy: "copy", xor: "xor", multiply: "multiply", screen: "screen", overlay: "overlay", darken: "darken", lighten: "lighten", colorDodge: "color-dodge", colorBurn: "color-burn", hardLight: "hard-light", softLight: "soft-light", }; ``` -------------------------------- ### Add Extra Metadata to JSON Source: https://github.com/hashlips/hashlips_art_engine/blob/main/README.md Allows for the addition of custom key-value pairs to the metadata of each generated NFT. This is configured in the `config.js` file within the `extraMetadata` object. ```javascript const extraMetadata = { creator: "Daniel Eugene Botha", }; ``` ```javascript const extraMetadata = {}; ``` -------------------------------- ### Blend Modes Reference (JavaScript) Source: https://context7.com/hashlips/hashlips_art_engine/llms.txt Lists available canvas blend modes for layer composition effects within the HashLips Art Engine. These modes are imported from './constants/blend_mode.js' and can be used in layer configurations to achieve various visual effects. ```javascript const { MODE } = require("./constants/blend_mode.js"); // Available blend modes: MODE.sourceOver // Default - normal layer stacking MODE.sourceIn // Show source where it overlaps destination MODE.sourceOut // Show source where it doesn't overlap MODE.sourceAtop // Source on top of destination MODE.destinationOver // Destination on top of source MODE.destinationIn // Show destination where overlap occurs MODE.destinationOut // Show destination where no overlap MODE.destinationAtop // Destination on top where overlap MODE.lighter // Add color values (lighten) MODE.copy // Only show source MODE.xor // XOR composite MODE.multiply // Multiply colors (darken) MODE.screen // Screen blend (lighten) MODE.overlay // Overlay (contrast) MODE.darken // Keep darker color MODE.lighten // Keep lighter color MODE.colorDodge // Brighten to reflect source MODE.colorBurn // Darken to reflect source MODE.hardLight // Hard light effect MODE.softLight // Soft light effect MODE.difference // Subtract colors MODE.exclusion // Similar to difference, lower contrast MODE.hue // Hue from source, saturation/luminosity from dest MODE.saturation // Saturation from source MODE.color // Hue and saturation from source MODE.luminosity // Luminosity from source // Usage example: { name: "Glow", options: { blend: MODE.screen, opacity: 0.7 } } ``` -------------------------------- ### Configure Pixelation Ratio Source: https://github.com/hashlips/hashlips_art_engine/blob/main/README.md This JavaScript object within `src/config.js` defines the ratio for pixelating images. A lower ratio on the left side of the division results in a more pixelated image. ```javascript const pixelFormat = { ratio: 5 / 128, }; ``` -------------------------------- ### Configure GIF Export Settings Source: https://github.com/hashlips/hashlips_art_engine/blob/main/README.md This JavaScript object within `src/config.js` controls the export of animated GIFs from the generated layers. You can enable/disable export, set looping behavior (`repeat`), image quality, and frame delay. ```javascript const gif = { export: true, repeat: 0, quality: 100, delay: 500, }; ``` -------------------------------- ### Generate Pixelated Images Source: https://github.com/hashlips/hashlips_art_engine/blob/main/README.md Converts existing collection images into pixelated versions. The degree of pixelation can be controlled by adjusting the `ratio` property within the `pixelFormat` object in `src/config.js`. ```sh npm run pixelate ``` -------------------------------- ### Pixelate Generated Images Source: https://context7.com/hashlips/hashlips_art_engine/llms.txt Enables the pixelation of generated artwork to achieve a retro aesthetic. This is controlled by the 'ratio' property in the 'pixelFormat' configuration, where a lower ratio results in more pixelation. The process involves first building the collection and then running the pixelate command. ```javascript // In src/config.js const pixelFormat = { ratio: 5 / 128, // Lower = more pixelated (e.g., 2/128 is very pixelated) }; // First generate the collection, then pixelate npm run build npm run pixelate # Output: build/pixel_images/ # 1.png, 2.png, ... (pixelated versions) ``` -------------------------------- ### Print Rarity Data Source: https://github.com/hashlips/hashlips_art_engine/blob/main/README.md An experimental feature that calculates and displays the rarity percentages of each trait within your NFT collection. This helps in understanding the distribution of attributes across all generated items. ```sh npm run rarity ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.