# AI Banner Generator (`happitap/ai-banner-generator`) Actor

Generate professional marketing banners using multiple AI models including Google Gemini, OpenAI DALL-E 3, Stable Diffusion XL, and Midjourney. This Actor automates banner creation with customizable text, colors, dimensions, and styles, plus the ability to revise existing banners.

- **URL**: https://apify.com/happitap/ai-banner-generator.md
- **Developed by:** [HappiTap](https://apify.com/happitap) (community)
- **Categories:** AI, Automation, Developer tools
- **Security:** Limited permissions
- **Stats:** 64 total users, 0 monthly users, 0.0% runs succeeded, 10 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $0.01 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

<div align="center">

## 🎨 AI Banner Generator

#### Professional Marketing Banners Powered by AI

Generate stunning banners using multiple AI models including Google Gemini, OpenAI DALL-E 3, Stable Diffusion XL, and Midjourney. Automate banner creation with customizable text, colors, dimensions, and styles.

[![Apify Actor](https://img.shields.io/badge/Apify-Actor-00D4FF?style=flat-square)](https://apify.com)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=flat-square)](LICENSE)

[🚀 Get Started](#-quick-start) • [📖 Documentation](#-configuration) • [💡 Examples](#-usage-examples) • [💰 Pricing](#-pricing)

</div>

***

### ✨ Features

<table>
<tr>
<td width="50%">

#### 🎨 Multiple AI Models

- **Native/Canvas** ⭐ **FREE** - No API required!
- **Google Gemini Pro** - AI-powered design
- **OpenAI DALL-E 3** - Photorealistic quality
- **Stable Diffusion XL** - Open-source generation
- **Midjourney** - Artistic styles

</td>
<td width="50%">

#### ⚡ Key Capabilities

- ✅ Automated design generation
- 🎭 7 style templates available
- 🎨 Custom colors & branding
- 📊 Generate up to 5 variations
- 🔄 Banner revision mode
- 📐 Flexible dimensions (300x200 to 3000x2000)
- 🖼️ Multiple formats (PNG, JPEG, WebP)

</td>
</tr>
</table>

#### 🎯 Perfect For

<details>
<summary><b>👥 Who Should Use This Actor?</b></summary>

- 📱 **Digital Marketers** - Create campaign banners in seconds
- 🏪 **E-commerce Owners** - Generate product promotion banners
- 💼 **Small Business Owners** - Professional designs without hiring designers
- 📲 **Social Media Managers** - Consistent branding across platforms
- 💻 **Web Developers** - Quick banner content for client projects

</details>

### 💰 Pricing

<div align="center">

#### Pay-Per-Event Model

**$0.10 USD per banner generated**

<table>
<tr>
<th>Banners</th>
<th>Cost</th>
<th>Use Case</th>
</tr>
<tr>
<td>1 banner</td>
<td>$0.10</td>
<td>Single campaign</td>
</tr>
<tr>
<td>3 variations</td>
<td>$0.30</td>
<td>A/B testing</td>
</tr>
<tr>
<td>10 banners</td>
<td>$1.00</td>
<td>Multi-platform campaign</td>
</tr>
<tr>
<td>50 banners</td>
<td>$5.00</td>
<td>Monthly content</td>
</tr>
</table>

✅ **No monthly fees** - Pay only for what you use\
🎁 **Free $5 credits** for new users (50 free banners!)\
📊 See [PRICING.md](PRICING.md) for detailed cost calculator

</div>

> **Note:** External API costs apply when using AI models (DALL-E, Stable Diffusion, etc.). Use Native/Canvas mode for completely free generation!

### 🚀 Quick Start

#### Step 1: Choose Your AI Model

```javascript
// No API key needed!
"aiModel": "native"  // ⭐ Recommended for beginners

// Or use advanced AI models:
"aiModel": "dall-e-3"        // Requires OpenAI API key
"aiModel": "stable-diffusion" // Requires Replicate API key
```

#### Step 2: Configure Your Banner

```json
{
  "aiModel": "native",
  "bannerText": "Summer Sale - 50% Off!",
  "bannerWidth": 1200,
  "bannerHeight": 628,
  "primaryColor": "#FF6B6B",
  "outputFormat": "png"
}
```

#### Step 3: Run & Download

Your banners will be available in:

- 📊 **Dataset** - Metadata and URLs
- 🖼️ **Key-Value Store** - Image files

***

### 📖 Configuration

#### Required Parameters

<table>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Description</th>
<th>Example</th>
</tr>
<tr>
<td><code>aiModel</code></td>
<td>string</td>
<td>AI model to use</td>
<td><code>"native"</code></td>
</tr>
<tr>
<td><code>bannerText</code></td>
<td>string</td>
<td>Main headline text</td>
<td><code>"Summer Sale"</code></td>
</tr>
</table>

#### Optional Parameters

<details>
<summary><b>🎨 Design Options</b></summary>

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `bannerStyle` | string | `"vibrant"` | Style: modern, minimalist, vibrant, professional, playful, elegant, bold |
| `primaryColor` | string | `"#FF6B6B"` | Primary brand color (hex) |
| `secondaryColor` | string | `"#FFA500"` | Secondary brand color (hex) |
| `bannerWidth` | integer | `1200` | Width in pixels (300-3000) |
| `bannerHeight` | integer | `628` | Height in pixels (200-2000) |
| `outputFormat` | string | `"png"` | Format: png, jpg, webp |

</details>

<details>
<summary><b>📝 Content Options</b></summary>

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `subText` | string | - | Secondary text or tagline |
| `industry` | string | `"ecommerce"` | Industry context |
| `includeCallToAction` | boolean | `true` | Add CTA button |
| `callToActionText` | string | `"Shop Now"` | CTA button text |
| `customPrompt` | string | - | Custom AI prompt (advanced) |
| `skipTextOverlay` | boolean | `false` | Skip text overlay |

</details>

<details>
<summary><b>⚙️ Generation Options</b></summary>

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `mode` | string | `"generate"` | Mode: generate or revise |
| `numberOfVariations` | integer | `1` | Number of variations (1-5) |
| `apiKey` | string | - | API key for AI model (not needed for native) |

</details>

<details>
<summary><b>🔄 Revision Mode</b></summary>

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `existingBannerUrl` | string | Yes | URL of banner to revise |
| `revisionInstructions` | string | Yes | Description of changes |

</details>

### 🔑 API Keys Setup

<details>
<summary><b>🆓 Native/Canvas (No API Key Required)</b></summary>

✅ **No setup needed!** Just select `"native"` as your AI model and start generating.

</details>

<details>
<summary><b>🤖 Google Gemini Pro</b></summary>

1. Visit [Google AI Studio](https://makersuite.google.com/app/apikey)
2. Click **"Create API Key"**
3. Copy the generated key
4. Paste into the `apiKey` field

**Cost:** Free tier available, then pay-as-you-go

</details>

<details>
<summary><b>🎨 OpenAI DALL-E 3</b></summary>

1. Visit [OpenAI Platform](https://platform.openai.com/api-keys)
2. Click **"Create new secret key"**
3. Ensure you have credits in your account
4. Copy and paste into the `apiKey` field

**Cost:** ~$0.04-0.08 per image

</details>

<details>
<summary><b>🖼️ Stable Diffusion / Midjourney (Replicate)</b></summary>

1. Visit [Replicate](https://replicate.com/account/api-tokens)
2. Create an API token
3. Add billing information
4. Copy and paste into the `apiKey` field

**Cost:** ~$0.0023 per second

</details>

### 💡 Usage Examples

#### Example 1: Generate Banner with Native/Canvas (No API Required!)

```json
{
  "mode": "generate",
  "aiModel": "native",
  "bannerText": "Summer Sale - 50% Off!",
  "subText": "Limited Time Offer",
  "bannerStyle": "vibrant",
  "bannerWidth": 1200,
  "bannerHeight": 628,
  "primaryColor": "#FF6B6B",
  "secondaryColor": "#FFA500",
  "industry": "ecommerce",
  "includeCallToAction": true,
  "callToActionText": "Shop Now",
  "numberOfVariations": 3,
  "outputFormat": "png"
}
```

#### Example 2: Generate E-commerce Banner with DALL-E

```json
{
  "mode": "generate",
  "aiModel": "dall-e-3",
  "apiKey": "your-openai-api-key",
  "bannerText": "Summer Sale - 50% Off!",
  "subText": "Limited Time Offer",
  "bannerStyle": "vibrant",
  "bannerWidth": 1200,
  "bannerHeight": 628,
  "primaryColor": "#FF6B6B",
  "secondaryColor": "#FFA500",
  "industry": "ecommerce",
  "includeCallToAction": true,
  "callToActionText": "Shop Now",
  "numberOfVariations": 3,
  "outputFormat": "png"
}
```

#### Example 3: Generate Social Media Banner

```json
{
  "mode": "generate",
  "aiModel": "stable-diffusion",
  "apiKey": "your-replicate-api-key",
  "bannerText": "Join Our Community",
  "subText": "Connect with thousands of creators",
  "bannerStyle": "modern",
  "bannerWidth": 1080,
  "bannerHeight": 1080,
  "primaryColor": "#4A90E2",
  "secondaryColor": "#7B68EE",
  "industry": "technology",
  "includeCallToAction": true,
  "callToActionText": "Sign Up Free",
  "outputFormat": "webp"
}
```

#### Example 4: Custom AI Prompt (Advanced)

```json
{
  "mode": "generate",
  "aiModel": "dall-e-3",
  "apiKey": "your-openai-api-key",
  "bannerText": "Summer Vacation",
  "customPrompt": "Create a stunning tropical beach scene at sunset with palm trees, turquoise water, and golden sand. Vibrant colors, photorealistic style, no text or typography. Leave center space clear for text overlay. 1200x628 pixels.",
  "bannerWidth": 1200,
  "bannerHeight": 628,
  "outputFormat": "png"
}
```

#### Example 5: Revise Existing Banner

```json
{
  "mode": "revise",
  "aiModel": "dall-e-3",
  "apiKey": "your-openai-api-key",
  "existingBannerUrl": "https://example.com/banner.jpg",
  "revisionInstructions": "Change the background to a gradient from blue to purple, and make the text more prominent",
  "bannerText": "New Year Sale",
  "primaryColor": "#4169E1",
  "secondaryColor": "#9370DB",
  "outputFormat": "png"
}
```

### 📤 Output

#### Output Structure

The Actor provides two outputs:

1. **📊 Banner Results** - Dataset containing metadata and URLs
2. **🖼️ Banner Files** - Key-value store with image files

#### Dataset Structure

```json
{
  "mode": "generate",
  "aiModel": "dall-e-3",
  "timestamp": "2024-01-15T10:30:00.000Z",
  "banners": [
    {
      "url": "https://api.apify.com/v2/key-value-stores/.../banner_1234567890_v1.png",
      "fileName": "banner_1234567890_v1.png",
      "dimensions": {
        "width": 1200,
        "height": 628
      },
      "format": "png",
      "generationMethod": "dall-e",
      "variationNumber": 1,
      "prompt": "..."
    }
  ],
  "metadata": {
    "bannerText": "Summer Sale - 50% Off!",
    "subText": "Limited Time Offer",
    "style": "vibrant",
    "dimensions": "1200x628",
    "colors": {
      "primary": "#FF6B6B",
      "secondary": "#FFA500"
    },
    "industry": "ecommerce",
    "numberOfVariations": 1
  }
}
```

### 📐 Common Banner Sizes

<table>
<tr>
<td width="50%">

#### 📱 Social Media

| Platform | Size | Dimensions |
|----------|------|------------|
| Facebook Cover | 820 × 312 px | `820, 312` |
| Facebook Post | 1200 × 630 px | `1200, 630` |
| Instagram Post | 1080 × 1080 px | `1080, 1080` |
| Instagram Story | 1080 × 1920 px | `1080, 1920` |
| Twitter Header | 1500 × 500 px | `1500, 500` |
| LinkedIn Banner | 1584 × 396 px | `1584, 396` |

</td>
<td width="50%">

#### 🌐 Web Banners

| Type | Size | Dimensions |
|------|------|------------|
| Leaderboard | 728 × 90 px | `728, 90` |
| Large Rectangle | 336 × 280 px | `336, 280` |
| Medium Rectangle | 300 × 250 px | `300, 250` |
| Wide Skyscraper | 160 × 600 px | `160, 600` |
| Billboard | 970 × 250 px | `970, 250` |
| Hero Banner | 1920 × 600 px | `1920, 600` |

</td>
</tr>
</table>

### 💡 Best Practices

<table>
<tr>
<td width="50%">

#### ✅ Do's

- ✓ **Start with Native/Canvas** - Free and fast
- ✓ **Use brand colors** - Maintain consistency
- ✓ **Generate variations** - Test multiple designs
- ✓ **Match platform sizes** - Use recommended dimensions
- ✓ **Be specific** - Clear text = better results
- ✓ **Use revision mode** - Refine existing banners

</td>
<td width="50%">

#### ❌ Don'ts

- ✗ Don't use vague text
- ✗ Don't ignore brand guidelines
- ✗ Don't use unsupported sizes
- ✗ Don't skip A/B testing
- ✗ Don't forget API costs
- ✗ Don't use low-quality source images

</td>
</tr>
</table>

#### 🎯 Model Selection Guide

| Model | Best For | Speed | Cost | Quality |
|-------|----------|-------|------|----------|
| **Native/Canvas** ⭐ | Quick banners, gradients | ⚡⚡⚡ | 💰 FREE | ⭐⭐⭐⭐ |
| **DALL-E 3** | Photorealistic designs | ⚡⚡ | 💰💰💰 | ⭐⭐⭐⭐⭐ |
| **Stable Diffusion** | Artistic styles | ⚡⚡ | 💰💰 | ⭐⭐⭐⭐ |
| **Midjourney** | Stylized art | ⚡⚡ | 💰💰 | ⭐⭐⭐⭐⭐ |
| **Gemini Pro** | Design guidance | ⚡⚡⚡ | 💰 | ⭐⭐⭐ |

***

### ⚠️ Limitations

<details>
<summary><b>Model-Specific Limitations</b></summary>

- **DALL-E 3**: Limited to specific sizes (1024×1024, 1792×1024, 1024×1792)
- **Stable Diffusion**: Best results up to 1024×1024 pixels
- **API Rate Limits**: Vary by provider and plan
- **Generation Time**: 5-30 seconds depending on model

</details>

<details>
<summary><b>Cost Considerations</b></summary>

| Model | External API Cost |
|-------|------------------|
| Native/Canvas | **FREE** |
| DALL-E 3 | ~$0.04-0.08 per image |
| Stable Diffusion | ~$0.0023 per second |
| Midjourney | ~$0.0023 per second |
| Gemini Pro | Free tier available |

> 💡 **Pro Tip**: Use Native/Canvas mode to avoid external API costs entirely!

</details>

### 📚 Additional Resources

- 📖 [Complete Documentation](./OVERVIEW.md)
- 💰 [Detailed Pricing Guide](./PRICING.md)
- 🚀 [Quick Start Guide](./QUICKSTART.md)
- 📋 [API Reference](./API_REFERENCE.md)
- ✅ [Deployment Checklist](./CHECKLIST.md)

***

### 🆘 Support

<table>
<tr>
<td width="33%" align="center">

#### 📖 Documentation

Check the [Apify Docs](https://docs.apify.com)

</td>
<td width="33%" align="center">

#### 🔑 API Issues

Review provider docs:

- [OpenAI](https://platform.openai.com/docs)
- [Replicate](https://replicate.com/docs)
- [Google AI](https://ai.google.dev/docs)

</td>
<td width="33%" align="center">

#### ✅ Troubleshooting

1. Verify API keys
2. Check account credits
3. Review error logs

</td>
</tr>
</table>

***

### 📄 License

This Actor is provided as-is for use on the Apify platform.

***

<div align="center">

**Made with ❤️ for the Apify Community**

[⬆ Back to Top](#-ai-banner-generator)

</div>

# Actor input Schema

## `mode` (type: `string`):

Choose whether to generate a new banner or revise an existing one

## `aiModel` (type: `string`):

Select the generation method. Native/Canvas is FREE and requires no API key!

## `apiKey` (type: `string`):

API key for the selected AI model. NOT REQUIRED for Native/Canvas option. (Gemini: Google AI Studio, DALL-E: OpenAI, Stable Diffusion/Midjourney: Replicate)

## `bannerText` (type: `string`):

Main text/headline to display on the banner

## `subText` (type: `string`):

Secondary text or tagline

## `bannerStyle` (type: `string`):

Visual style for the banner

## `bannerWidth` (type: `integer`):

Width of the banner in pixels

## `bannerHeight` (type: `integer`):

Height of the banner in pixels

## `primaryColor` (type: `string`):

Primary color for the banner (hex code)

## `secondaryColor` (type: `string`):

Secondary color for the banner (hex code)

## `industry` (type: `string`):

Industry or category for context

## `existingBannerUrl` (type: `string`):

URL of existing banner to revise (only for 'revise' mode)

## `revisionInstructions` (type: `string`):

Describe what changes you want to make to the existing banner

## `numberOfVariations` (type: `integer`):

How many banner variations to generate

## `includeCallToAction` (type: `boolean`):

Add a call-to-action button/text to the banner

## `callToActionText` (type: `string`):

Text for the CTA button

## `outputFormat` (type: `string`):

Image format for the generated banners

## `skipTextOverlay` (type: `boolean`):

Skip adding text overlay on the banner (use this if AI already generated text in the image)

## `customPrompt` (type: `string`):

Provide your own custom prompt for AI image generation. If empty, a prompt will be auto-generated from your inputs. Only works with AI models (not Native/Canvas).

## Actor input object example

```json
{
  "mode": "generate",
  "aiModel": "native",
  "bannerText": "Summer Sale - 50% Off!",
  "subText": "Limited time offer",
  "bannerStyle": "vibrant",
  "bannerWidth": 1200,
  "bannerHeight": 628,
  "primaryColor": "#FF5733",
  "secondaryColor": "#FFC300",
  "industry": "ecommerce",
  "existingBannerUrl": "https://example.com/banner.jpg",
  "revisionInstructions": "Change the background to blue and make the text larger",
  "numberOfVariations": 1,
  "includeCallToAction": true,
  "callToActionText": "Shop Now",
  "outputFormat": "png",
  "skipTextOverlay": false,
  "customPrompt": "Create a vibrant summer beach scene with palm trees and sunset colors, no text, suitable for a travel banner background"
}
```

# Actor output Schema

## `bannerResults` (type: `string`):

Complete banner generation results including URLs, metadata, and generation details

## `bannerFiles` (type: `string`):

Generated banner image files (PNG/JPG/WebP)

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "bannerText": "Summer Sale - 50% Off!",
    "subText": "Limited Time Offer",
    "bannerStyle": "vibrant",
    "bannerWidth": 1200,
    "bannerHeight": 628,
    "primaryColor": "#FF6B6B",
    "secondaryColor": "#FFA500",
    "callToActionText": "Shop Now"
};

// Run the Actor and wait for it to finish
const run = await client.actor("happitap/ai-banner-generator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "bannerText": "Summer Sale - 50% Off!",
    "subText": "Limited Time Offer",
    "bannerStyle": "vibrant",
    "bannerWidth": 1200,
    "bannerHeight": 628,
    "primaryColor": "#FF6B6B",
    "secondaryColor": "#FFA500",
    "callToActionText": "Shop Now",
}

# Run the Actor and wait for it to finish
run = client.actor("happitap/ai-banner-generator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "bannerText": "Summer Sale - 50% Off!",
  "subText": "Limited Time Offer",
  "bannerStyle": "vibrant",
  "bannerWidth": 1200,
  "bannerHeight": 628,
  "primaryColor": "#FF6B6B",
  "secondaryColor": "#FFA500",
  "callToActionText": "Shop Now"
}' |
apify call happitap/ai-banner-generator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,happitap/ai-banner-generator"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/MFOwC5XeHhcZKNIEV/builds/B7whXxxBHYxGa0yE4/openapi.json
