Skip to content
ajan.io

Docs menu

On this page

Image Generation

Generate images from text prompts using AI models in your workflows.

Overview

The Image Generation node creates images from text prompts using AI image models. Perfect for generating visuals, creating marketing assets, or adding dynamic imagery to automated workflows.

Configuration

Prompt (Required)

The text description of the image you want to generate. Supports Auto, Manual, and Prompt AI modes.

Manual mode example:

handlebars
A professional headshot photo of a person in business attire, neutral background

Using variables:

handlebars
A {{trigger.output.style}} illustration of {{agent.output.structured.subject}} with {{agent.output.structured.mood}} lighting

Image Model

Select the AI model to generate images. Available models depend on your workspace configuration.

Aspect Ratio

Choose the image dimensions:

OptionRatioBest For
Square1:1Social media posts, profile images
Landscape16:9Presentations, banners, headers
Portrait9:16Stories, mobile content, posters

Style

Apply a visual style to guide the image generation:

StyleDescription
AutoLet the model decide based on the prompt
PhotorealisticHigh detail, professional photography quality
Digital ArtVibrant colors, detailed illustration
Oil PaintingArtistic, painterly brushstrokes
WatercolorSoft edges, artistic paper texture
SketchPencil sketch, hand-drawn line art
AnimeAnime/manga art style
3D RenderRealistic lighting, CGI quality
MinimalistClean, simple, modern design
CinematicDramatic lighting, film grain

Example Use Cases

Marketing Content Generation

text
Trigger: New product added to catalog
β†’ Agent: Generate product description
β†’ Image Generation: Create product visualization
  Prompt: {{agent.output.structured.product_visual_description}}
  Style: photorealistic
  Aspect Ratio: square
β†’ Action: Upload to marketing platform

Automated Report Visuals

text
Trigger: Weekly report scheduled
β†’ Agent: Analyze data and create summary
β†’ Image Generation: Create infographic header
  Prompt: Professional business infographic showing {{agent.output.structured.key_metric}}
  Style: minimalist
  Aspect Ratio: landscape
β†’ Action: Send report via email

Dynamic Content Creation

text
Trigger: Blog post drafted
β†’ Agent: Extract key themes from {{trigger.output.content}}
β†’ Image Generation: Create featured image
  Prompt: {{agent.output.structured.image_prompt}} for a blog about {{trigger.output.topic}}
  Style: digital_art
β†’ Action: Update blog post with image

Accessing Generated Images

After execution, access the generated image in subsequent nodes:

handlebars
{{image_gen.output.imageUrl}}           β†’ Signed URL (valid for 1 week)
{{image_gen.output.imagePath}}          β†’ Internal storage path
{{image_gen.output.attachmentId}}       β†’ Attachment ID for file operations
{{image_gen.output.prompt}}             β†’ The prompt used
{{image_gen.output.aspectRatio}}        β†’ The aspect ratio used
{{image_gen.output.path}}               β†’ Standard file path format
{{image_gen.output._metadata.mimeType}} β†’ Always "image/png"

Output Format

The node outputs a file in standard workflow format, making it compatible with file pickers and downstream nodes that expect file inputs:

json
{
  "path": "/mnt/data/1234567890-workflow_image_generation-openai.png",
  "_metadata": {
    "name": "1234567890-workflow_image_generation-openai.png",
    "mimeType": "image/png",
    "sizeInKb": 245,
    "attachmentId": "abc123"
  },
  "imageUrl": "https://...",
  "attachmentId": "abc123",
  "prompt": "Your prompt here",
  "aspectRatio": "square"
}

Best Practices

Be specific about what you want. Include details about style, composition, lighting, and subject matter for better results.

Instead of describing style in your prompt, use the Style dropdown. This ensures consistent style application and keeps your prompts focused on content.

Choose the aspect ratio based on where the image will be used. Square for social media, landscape for presentations, portrait for stories.

Use an Agent node before image generation to craft optimized prompts based on your data. AI-generated prompts often produce better images.

The signed URL expires after 1 week. For long-term storage, use the attachment ID to move the file or save the URL immediately.

Cost Considerations

Further Processing

Generated images are automatically available to all subsequent nodes in your workflow. Here's how you can use them:

Analyze with Agent Node

Agent nodes can see and analyze the generated image:

text
β†’ Image Generation: Create product photo
β†’ Agent: "Analyze this image and describe what you see"
  (Agent automatically receives the generated image)

Upload via Action Node

Send images to connected integrations:

text
β†’ Image Generation: Create marketing visual
β†’ Action (Slack): Post image to #marketing channel
β†’ Action (Google Drive): Upload to Marketing folder
β†’ Action (Notion): Add to product page

Send via HTTP Request

Upload to any API that accepts files:

text
β†’ Image Generation: Generate thumbnail
β†’ HTTP Request: POST to your CDN
  Body: Use {{image_gen.output.imageUrl}} or reference the attachment

Batch Generation with Loop

Generate multiple images in one workflow:

text
Loop over {{trigger.output.products}}
  β†’ Image Generation: Create {{product.output.currentItem.name}} visual
  β†’ Action: Upload to product catalog

Limitations

  • Timeout: 60 seconds maximum for image generation
  • Format: Output is always PNG format
  • No reference images: Currently does not support image-to-image generation in workflows
  • URL expiration: Signed URLs are valid for 1 week

Next Steps