ideogram-reference-architecture
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".
- License 许可
- MIT
- 最近更新
- 2026-03-20
- Stars
- ★ 4
- Forks
- 0
01 前言 Front Matter
- name
- ideogram-reference-architecture
- author
- Jeremy Longshore <jeremy@intentsolutions.io>
- license
- MIT
- version
- 1.0.0
- description
- 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".
- allowed-tools
- Read, Grep
- compatible-with
- claude-code, codex, openclaw
03 SKILL.md 正文
Ideogram Reference Architecture
Overview
Production architecture for AI image generation with Ideogram. Covers generation pipelines, asset management, brand consistency workflows, prompt templating, and CDN delivery for generated images.
Prerequisites
- Ideogram API key
- Image storage (S3, GCS, or filesystem)
- CDN for image delivery (optional)
- Understanding of Ideogram models and parameters
Architecture Diagram
┌──────────────────────────────────────────────────────┐
│ Prompt Engineering Layer │
│ Templates │ Brand Guidelines │ Style Presets │
└──────────────────────────┬───────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────┐
│ Ideogram Generation API │
│ ┌───────────┐ ┌───────────┐ ┌─────────────────┐ │
│ │ Generate │ │ Edit │ │ Remix │ │
│ │ (text→img)│ │ (inpaint) │ │ (style transfer)│ │
│ └─────┬─────┘ └─────┬─────┘ └───────┬─────────┘ │
│ └───────────────┴────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────────────────────────────────┐ │
│ │ Post-Processing │ │
│ │ Resize │ Optimize │ Watermark │ Metadata │ │
│ └──────────────────────┬───────────────────────┘ │
└─────────────────────────┼───────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────┐
│ Asset Storage & Delivery │
│ S3/GCS │ CDN │ DAM System │ CMS Integration │
└──────────────────────────────────────────────────────┘
Instructions
Step 1: Prompt Template System
interface PromptTemplate {
name: string;
base: string;
style: string;
negativePrompt?: string;
aspectRatio: string;
model: 'V_2' | 'V_2_TURBO';
}
const BRAND_TEMPLATES: Record<string, PromptTemplate> = {
socialPost: {
name: 'Social Media Post',
base: '{subject}, modern clean design, vibrant colors',
style: 'professional photography, high quality',
negativePrompt: 'text, watermark, blurry, low quality',
aspectRatio: 'ASPECT_1_1',
model: 'V_2',
},
blogHero: {
name: 'Blog Hero Image',
base: '{subject}, editorial style, wide composition',
style: 'professional, minimalist, tech aesthetic',
aspectRatio: 'ASPECT_16_9',
model: 'V_2',
},
appIcon: {
name: 'App Icon',
base: '{subject}, flat design, rounded corners, gradient',
style: 'minimal, modern, app store ready',
aspectRatio: 'ASPECT_1_1',
model: 'V_2_TURBO',
},
};
function buildPrompt(template: PromptTemplate, subject: string): string {
return template.base.replace('{subject}', subject) + ', ' + template.style;
}
Step 2: Generation Service
const IDEOGRAM_API = 'https://api.ideogram.ai/generate';
async function generateFromTemplate(
templateKey: string,
subject: string
) {
const template = BRAND_TEMPLATES[templateKey];
if (!template) throw new Error(`Unknown template: ${templateKey}`);
const response = await fetch(IDEOGRAM_API, {
method: 'POST',
headers: {
'Api-Key': process.env.IDEOGRAM_API_KEY!,
'Content-Type': 'application/json',
},
body: JSON.stringify({
image_request: {
prompt: buildPrompt(template, subject),
negative_prompt: template.negativePrompt,
aspect_ratio: template.aspectRatio,
model: template.model,
magic_prompt_option: 'AUTO',
},
}),
});
return response.json();
}
Step 3: Asset Management Pipeline
import { createWriteStream, mkdirSync } from 'fs';
import { join } from 'path';
async function generateAndStore(
templateKey: string,
subject: string,
outputDir: string
) {
mkdirSync(outputDir, { recursive: true });
const result = await generateFromTemplate(templateKey, subject);
const imageUrl = result.data?.[0]?.url;
if (!imageUrl) throw new Error('No image generated');
const filename = `${templateKey}_${Date.now()}.png`;
const outputPath = join(outputDir, filename);
const response = await fetch(imageUrl);
const buffer = Buffer.from(await response.arrayBuffer());
const { writeFileSync } = await import('fs');
writeFileSync(outputPath, buffer);
return {
path: outputPath,
url: imageUrl,
prompt: buildPrompt(BRAND_TEMPLATES[templateKey], subject),
seed: result.data[0].seed,
};
}
Step 4: Batch Generation with Style Consistency
async function generateBrandAssets(brandSubjects: string[]) {
const assets = [];
for (const subject of brandSubjects) {
for (const templateKey of Object.keys(BRAND_TEMPLATES)) {
const asset = await generateAndStore(templateKey, subject, './assets');
assets.push(asset);
// Rate limit: wait between generations
await new Promise(r => setTimeout(r, 3000)); # 3000: 3 seconds in ms
}
}
return assets;
}
Error Handling
| Issue | Cause | Solution |
|---|---|---|
| Content filtered | NSFW prompt detected | Review and sanitize prompt text |
| Generation timeout | Complex prompt | Simplify prompt, use V_2_TURBO |
| URL expired | Images are temporary (~1hr) | Download immediately after generation |
| Inconsistent style | No template system | Use consistent prompt templates |
Examples
Quick Brand Asset Generation
const assets = await generateBrandAssets([
'cloud computing platform',
'data analytics dashboard',
'team collaboration tool',
]);
console.log(`Generated ${assets.length} brand assets`);
Resources
Output
- Configuration files or code changes applied to the project
- Validation report confirming correct implementation
- Summary of changes made and their rationale
04 同仓库更多 Skills
azure-apim-architecture
Analyzes and explains Azure API Management architecture decisions for enterprise API marketplace implementations using VNet Internal mode, Front Door, hybrid authentication, and multi-environment strategies. Use when discussing APIM component selection, network topology, cost optimization, or comparing alternatives like workspaces vs instances, VNet Internal vs External mode, or Front Door vs Application Gateway.
apiops-deployment
Guides deployment of Azure API Management infrastructure using Infrastructure as Code (Bicep/Terraform), CI/CD pipelines (GitHub Actions/Azure DevOps), and APIOps workflows. Use when deploying APIM, creating pipelines, or implementing dev→test→prod promotion strategies.
apim-policy-authoring
Creates production-ready Azure API Management policy XML for authentication (OAuth 2.0, JWT validation, subscription keys), rate limiting, CORS configuration, error handling, and API transformations. Use when implementing API security, access control, or request/response processing logic.
api-security-review
Reviews Azure API Management configurations for security vulnerabilities, OWASP API Security Top 10 compliance, VNet Internal mode validation, Private Link verification, and Azure Security Benchmark alignment. Use when performing security audits, pre-deployment validation, or compliance reviews.
jira-cli
Interact with Jira from the command line to create, list, view, edit, and transition issues, manage sprints and epics, and perform common Jira workflows. Use when the user asks about Jira tasks, tickets, issues, sprints, or needs to manage project work items.
calculator
Performs arbitrary-precision arithmetic calculations including addition, subtraction, multiplication, division, and exponents. Use when the user asks to calculate, compute, or evaluate math expressions, or when precise decimal arithmetic is needed to avoid floating-point errors.