WP Manifestindependent plugin directory
manifest / ai / ai-eyecatch-generator

AI Eyecatch Generator

WordPress plugin: generate featured images (eyecatch) from post title & content with the OpenAI Images API

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/sujikox/ai-eyecatch-generator/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

OpenAI の画像生成APIを使って、WordPress の投稿タイトル・本文からアイキャッチ画像(featured image)を自動生成するプラグインです。

本プラグインは OpenAI とは提携していない非公式のプラグインです。

主な機能

  • 投稿の公開時、アイキャッチが未設定なら自動で生成(WP-Cron で非同期実行)
  • 投稿編集画面のボタンから、いつでも手動で生成・再生成
  • モデル・画像サイズ・画質・プロンプトテンプレートを設定画面で変更可能
  • APIキーを wp-config.php の定数で指定可能(データベースに保存しない運用ができます)

動作環境

  • WordPress 5.8 以上
  • PHP 7.4 以上
  • OpenAI の APIキー(画像生成APIの利用には料金が発生します)

インストール

  1. このリポジトリを ZIP でダウンロードするか、wp-content/plugins/ai-eyecatch-generator に clone します。
  2. 管理画面の「プラグイン」から AI Eyecatch Generator を有効化します。
  3. 「設定 > AI Eyecatch」で OpenAI の APIキーを入力します。

設定

項目 内容
OpenAI APIキー OpenAI のダッシュボードで発行したキー。保存後は画面に表示されません
画像生成モデル 例: gpt-image-1.5(標準)など。利用中のアカウントで使えるモデル名を指定します
画像サイズ 1024x1024 / 1536x1024 / 1024x1536 / auto
画質 low / medium / high / auto
対象の投稿タイプ 生成ボタンと自動生成の対象
自動生成 公開時にアイキャッチが未設定なら自動生成する
プロンプトテンプレート {title}(タイトル)と {excerpt}(本文の冒頭)が使えます

APIキーを wp-config.php で指定する

define( 'AIEG_OPENAI_API_KEY', 'sk-...' );

定数がある場合は設定画面のキーより優先され、データベースにキーを保存せずに運用できます。

生成できるユーザーを変更する

API料金が発生するため、手動生成は既定で「メディアをアップロードできるユーザー(投稿者以上)」に限定しています。

add_filter( 'aieg_generate_capability', function () {
    return 'edit_others_posts'; // 編集者以上に限定する例
} );

外部サービスへの送信について

アイキャッチを生成するときに、OpenAI の画像生成API に次の内容を送信します。

  • プロンプトテンプレートに投稿タイトルと本文の冒頭(最大200文字)を埋め込んだテキスト
  • モデル名・画像サイズ・画質の設定
  • APIキー

下書きや非公開の投稿でも、生成を実行すると上記が送信されます。OpenAI の利用規約とプライバシーポリシーをご確認ください。

注意事項

  • 生成される画像の内容はAIによるものであり、内容を保証するものではありません。生成画像の利用は OpenAI の利用規約に従い、ご自身の責任で行ってください。
  • 大量の投稿を一括公開する場合、WP-Cron の実行タイミングにより生成が遅れることがあります。

ライセンス

GPL v2 or later

作者

Osaka design office


English

AI Eyecatch Generator automatically creates a featured image for WordPress posts from the post title and the beginning of the content, using the OpenAI Images API.

  • Auto-generates a featured image on publish when none is set (runs asynchronously via WP-Cron)
  • "Generate" button in the post editor sidebar for manual (re)generation
  • Configurable model, size, quality and prompt template
  • API key can be defined in wp-config.php as AIEG_OPENAI_API_KEY instead of being stored in the database

External service: when generating, the plugin sends a prompt built from the post title and the first 200 characters of the content, plus the model/size/quality settings, to the OpenAI Images API. This also applies to drafts and private posts. See OpenAI's Terms of Use and Privacy Policy.

This is an unofficial plugin and is not affiliated with OpenAI. Licensed under GPL v2 or later.