ideogram-reference-architecture

0
1
Source

Implement Ideogram reference architecture with best-practice project layout. Use when designing new Ideogram integrations, reviewing project structure, or establishing architecture standards for Ideogram applications. Trigger with phrases like "ideogram architecture", "ideogram best practices", "ideogram project structure", "how to organize ideogram", "ideogram layout".

Install

mkdir -p .claude/skills/ideogram-reference-architecture && curl -L -o skill.zip "https://mcp.directory/api/skills/download/6316" && unzip -o skill.zip -d .claude/skills/ideogram-reference-architecture && rm skill.zip

Installs to .claude/skills/ideogram-reference-architecture

About this skill

Ideogram Reference Architecture

Overview

Production architecture for AI image generation with Ideogram at scale. Covers prompt templating for brand consistency, generation pipelines using all six API endpoints, asset storage and CDN delivery, and metadata tracking for reproducibility.

Architecture Diagram

┌─────────────────────────────────────────────────────────┐
│  Prompt Engineering Layer                                │
│  Templates │ Brand Guidelines │ Negative Prompts         │
└──────────────────────────┬──────────────────────────────┘
                           │
                           ▼
┌─────────────────────────────────────────────────────────┐
│  Ideogram API (api.ideogram.ai)                          │
│  ┌──────────┐ ┌────────┐ ┌───────┐ ┌────────┐          │
│  │ Generate │ │ Edit   │ │ Remix │ │Describe│          │
│  │(text→img)│ │(inpaint)│ │(vary) │ │(img→txt)│         │
│  └────┬─────┘ └───┬────┘ └──┬────┘ └───┬────┘          │
│       │           │         │          │                │
│  ┌────┴───────────┴─────────┴──────────┘                │
│  │  ┌──────────┐  ┌─────────┐                           │
│  │  │ Upscale  │  │ Reframe │                           │
│  │  └────┬─────┘  └────┬────┘                           │
│  └───────┴──────────────┘                               │
└──────────────────────────┬──────────────────────────────┘
                           │
                           ▼
┌─────────────────────────────────────────────────────────┐
│  Post-Processing & Storage                               │
│  Download │ Resize │ WebP Convert │ S3/GCS │ CDN        │
└─────────────────────────────────────────────────────────┘

Instructions

Step 1: Prompt Template System

interface PromptTemplate {
  name: string;
  base: string;
  style: string;
  negativePrompt: string;
  aspectRatio: string;
  model: string;
  renderingSpeed?: string;
}

const BRAND_TEMPLATES: Record<string, PromptTemplate> = {
  socialPost: {
    name: "Social Media Post",
    base: "{subject}, modern clean design, vibrant colors, professional",
    style: "DESIGN",
    negativePrompt: "blurry text, misspelled, watermark, low quality",
    aspectRatio: "ASPECT_1_1",
    model: "V_2",
  },
  blogHero: {
    name: "Blog Hero Image",
    base: "{subject}, editorial photography, wide composition, cinematic lighting",
    style: "REALISTIC",
    negativePrompt: "text overlay, watermark, blurry, oversaturated",
    aspectRatio: "ASPECT_16_9",
    model: "V_2",
  },
  storyVertical: {
    name: "Story / Reel",
    base: "{subject}, vertical composition, eye-catching, bold colors",
    style: "DESIGN",
    negativePrompt: "horizontal layout, small text, blurry",
    aspectRatio: "ASPECT_9_16",
    model: "V_2_TURBO",
  },
  ogImage: {
    name: "Open Graph Image",
    base: '{subject}, with text "{title}" in bold clean font, tech aesthetic',
    style: "DESIGN",
    negativePrompt: "blurry text, misspelled words, cluttered",
    aspectRatio: "ASPECT_16_9",
    model: "V_2",
  },
};

function buildPrompt(templateKey: string, vars: Record<string, string>): string {
  const template = BRAND_TEMPLATES[templateKey];
  if (!template) throw new Error(`Unknown template: ${templateKey}`);
  let prompt = template.base;
  for (const [key, value] of Object.entries(vars)) {
    prompt = prompt.replace(`{${key}}`, value);
  }
  return prompt;
}

Step 2: Generation Service

import { writeFileSync, mkdirSync } from "fs";
import { join } from "path";

const API_KEY = process.env.IDEOGRAM_API_KEY!;

async function generateFromTemplate(
  templateKey: string,
  vars: Record<string, string>,
  outputDir = "./assets"
) {
  const template = BRAND_TEMPLATES[templateKey];
  const prompt = buildPrompt(templateKey, vars);

  const response = await fetch("https://api.ideogram.ai/generate", {
    method: "POST",
    headers: { "Api-Key": API_KEY, "Content-Type": "application/json" },
    body: JSON.stringify({
      image_request: {
        prompt,
        model: template.model,
        style_type: template.style,
        aspect_ratio: template.aspectRatio,
        negative_prompt: template.negativePrompt,
        magic_prompt_option: "AUTO",
      },
    }),
  });

  if (!response.ok) throw new Error(`Generate failed: ${response.status}`);
  const result = await response.json();
  const image = result.data[0];

  // Download immediately (URLs expire ~1hr)
  const imgResp = await fetch(image.url);
  const buffer = Buffer.from(await imgResp.arrayBuffer());
  mkdirSync(outputDir, { recursive: true });
  const filename = `${templateKey}-${image.seed}.png`;
  writeFileSync(join(outputDir, filename), buffer);

  return {
    localPath: join(outputDir, filename),
    seed: image.seed,
    prompt,
    resolution: image.resolution,
    template: templateKey,
  };
}

Step 3: Multi-Format Asset Pipeline

import sharp from "sharp";

async function generateBrandAssetSet(subject: string, title: string) {
  const results = [];

  for (const [key, template] of Object.entries(BRAND_TEMPLATES)) {
    const asset = await generateFromTemplate(key, { subject, title });
    results.push(asset);

    // Generate WebP variant for web
    await sharp(asset.localPath)
      .webp({ quality: 85 })
      .toFile(asset.localPath.replace(".png", ".webp"));

    // Rate limit courtesy
    await new Promise(r => setTimeout(r, 3000));
  }

  // Generate manifest for asset tracking
  const manifest = results.map(r => ({
    template: r.template,
    seed: r.seed,
    prompt: r.prompt,
    files: {
      png: r.localPath,
      webp: r.localPath.replace(".png", ".webp"),
    },
  }));

  writeFileSync("./assets/manifest.json", JSON.stringify(manifest, null, 2));
  console.log(`Generated ${results.length} brand assets with manifest`);
  return results;
}

Step 4: Describe-then-Remix Pipeline

// Use Describe to analyze a reference image, then Remix to create variations
async function referenceBasedGeneration(referenceImagePath: string, modifications: string) {
  // Step 1: Describe the reference image
  const form1 = new FormData();
  form1.append("image_file", new Blob([readFileSync(referenceImagePath)]));
  form1.append("describe_model_version", "V_3");

  const descResp = await fetch("https://api.ideogram.ai/describe", {
    method: "POST",
    headers: { "Api-Key": API_KEY },
    body: form1,
  });
  const descriptions = await descResp.json();
  const basePrompt = descriptions.descriptions[0].text;

  // Step 2: Remix with modifications
  const form2 = new FormData();
  form2.append("image", new Blob([readFileSync(referenceImagePath)]));
  form2.append("prompt", `${basePrompt}, ${modifications}`);
  form2.append("image_weight", "40");
  form2.append("rendering_speed", "DEFAULT");

  const remixResp = await fetch("https://api.ideogram.ai/v1/ideogram-v3/remix", {
    method: "POST",
    headers: { "Api-Key": API_KEY },
    body: form2,
  });

  return remixResp.json();
}

Project Structure

project/
├── src/
│   ├── ideogram/
│   │   ├── client.ts          # API wrapper
│   │   ├── templates.ts       # Prompt templates
│   │   ├── pipeline.ts        # Generation pipeline
│   │   └── types.ts           # TypeScript types
│   ├── storage/
│   │   └── s3.ts              # Image upload to S3/GCS
│   └── api/
│       └── generate.ts        # API route handler
├── assets/                    # Generated image output
│   └── manifest.json          # Asset tracking
├── tests/
│   ├── templates.test.ts      # Prompt template tests
│   └── pipeline.test.ts       # Pipeline tests (mocked)
└── config/
    ├── ideogram.ts            # API configuration
    └── templates.json         # Prompt templates (optional)

Error Handling

IssueCauseSolution
Inconsistent styleNo template systemUse branded prompt templates
URL expiredLate downloadDownload in same function call
Text misspelledPrompt too vagueUse DESIGN style, quote exact text
Wrong aspect ratioTemplate mismatchMap templates to target platforms

Output

  • Prompt template system for brand consistency
  • Generation service with auto-download
  • Multi-format asset pipeline (PNG + WebP)
  • Describe-then-remix pipeline for reference-based generation
  • Asset manifest for tracking and reproducibility

Resources

Next Steps

For multi-environment setup, see ideogram-multi-env-setup.

svg-icon-generator

jeremylongshore

Svg Icon Generator - Auto-activating skill for Visual Content. Triggers on: svg icon generator, svg icon generator Part of the Visual Content skill category.

11036

d2-diagram-creator

jeremylongshore

D2 Diagram Creator - Auto-activating skill for Visual Content. Triggers on: d2 diagram creator, d2 diagram creator Part of the Visual Content skill category.

9033

automating-mobile-app-testing

jeremylongshore

This skill enables automated testing of mobile applications on iOS and Android platforms using frameworks like Appium, Detox, XCUITest, and Espresso. It generates end-to-end tests, sets up page object models, and handles platform-specific elements. Use this skill when the user requests mobile app testing, test automation for iOS or Android, or needs assistance with setting up device farms and simulators. The skill is triggered by terms like "mobile testing", "appium", "detox", "xcuitest", "espresso", "android test", "ios test".

18828

performing-penetration-testing

jeremylongshore

This skill enables automated penetration testing of web applications. It uses the penetration-tester plugin to identify vulnerabilities, including OWASP Top 10 threats, and suggests exploitation techniques. Use this skill when the user requests a "penetration test", "pentest", "vulnerability assessment", or asks to "exploit" a web application. It provides comprehensive reporting on identified security flaws.

5519

designing-database-schemas

jeremylongshore

Design and visualize efficient database schemas, normalize data, map relationships, and generate ERD diagrams and SQL statements.

12516

optimizing-sql-queries

jeremylongshore

This skill analyzes and optimizes SQL queries for improved performance. It identifies potential bottlenecks, suggests optimal indexes, and proposes query rewrites. Use this when the user mentions "optimize SQL query", "improve SQL performance", "SQL query optimization", "slow SQL query", or asks for help with "SQL indexing". The skill helps enhance database efficiency by analyzing query structure, recommending indexes, and reviewing execution plans.

5513

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

1,6831,428

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

1,2601,321

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

1,5291,146

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

1,350807

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

1,262727

pdf-to-markdown

aliceisjustplaying

Convert entire PDF documents to clean, structured Markdown for full context loading. Use this skill when the user wants to extract ALL text from a PDF into context (not grep/search), when discussing or analyzing PDF content in full, when the user mentions "load the whole PDF", "bring the PDF into context", "read the entire PDF", or when partial extraction/grepping would miss important context. This is the preferred method for PDF text extraction over page-by-page or grep approaches.

1,477682