Using Templates with AIGen SDK (Node.js)

Templates make it easy to create personalized, reusable, and scalable image designs with just a few variables. Perfect for certificates, social media banners, email hero images, and marketing creatives.


What Are Templates?

Templates are pre-designed visuals with placeholders for dynamic content like names, roles, product names, colors, or profile pictures.

You create them visually using the Vibe Editor at aigen.run — no code needed!


Create a Template in the Vibe Editor

  1. Go to https://aigen.run
  2. Click “Create Image Template”
  3. Drag and drop elements like text, images, shapes, and placeholders
  4. Assign variable names to text or image layers (e.g., name, company, photo)
  5. Click Export to get your template ID
  6. The template ID will appear in the export screen, like: abc123/1 (where abc123 is the template ID and 1 is the version)

You can update your template anytime and use different versions!


Node.js SDK Usage

import AigenSDK from 'aigen-sdk'

const aigen = new AigenSDK('your-secret-key')

const url = await aigen.createImage({
  template: 'abc123/1', // Template ID from Vibe Editor
  data: {
    name: 'Jane Smith',
    title: 'Founder',
    company: 'Visionary Labs'
  },
  duration: 48 // Optional (time validity in hours of the pre-signed url)
})

console.log('Generated Image URL:', url)

📌 Tips

  • Use descriptive variable names like name, event_date, photo, score
  • Group your templates by use-case (e.g., event banners, certificates)
  • Combine with social profile (--profile) for hyper-personalized content at scale for each of your users or clients

📦 Example Use Cases

  • 🎉 Event invitations personalized with name + QR code
  • 🏆 Certificate of achievement with dynamic recipient info
  • 📰 Social media post templates for announcements
  • 📧 Personalized email graphics for customers

💡 Template Benefits

  • Design once, use forever
  • Easily scale personalized images
  • Version control and visual consistency
  • Share templates across teams or customers

❤️ Use templates to build fast, beautiful, and scalable visual campaigns — with aigen.run