| 开发者 |
beautifulplugins
kawsarahmedr |
|---|---|
| 更新时间 | 2026年10月25日 11:36 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
artificial-image-generator folder to /wp-content/plugins/.wp-config.php instead:
define( 'AIMG_API_KEY', 'sk-your-key-here' ); (and AIMG_UNSPLASH_KEY, AIMG_PEXELS_KEY or AIMG_PIXABAY_KEY)No — only for AI prompt-based generation and stock photos. Template-based image creation, including the automatic featured image on publish, runs entirely on your own server using PHP's built-in GD library. No external services, no API calls, no recurring costs — unless you give a template a stock photo or AI image layer. Stock photos need a free API key from Unsplash, Pexels or Pixabay; you only need one.
Create a free key at Unsplash, Pexels or Pixabay, then paste it under Image Generator → Settings → Stock Photos and click Test Connection. You can also define AIMG_UNSPLASH_KEY, AIMG_PEXELS_KEY or AIMG_PIXABAY_KEY in wp-config.php. New Unsplash keys are limited to 50 searches an hour until Unsplash approves them for production.
Yes. Go to Image Generator → Image Templates → Add New to open the Template Studio. Start from one of 10 ready-made designs or a blank canvas, add backgrounds, images, overlays, shapes, patterns, frames and text, and use tags like {title}, {category} or {custom_field:key} so each post gets its own text. Templates are drawn on your server, so they cost nothing to use. You can export a template as JSON and import it on another site.
Background and image layers can show an image from your Media Library, the post's featured image, the first image in the post, the site logo, the site icon, the author's avatar (uploaded to the Media Library), a stock photo picked for the post (Unsplash, Pexels or Pixabay, searched with the post title or your own search text) or an AI image made for the post (from your own prompt). Stock and AI images are fetched once per post, in the background, and reused when you regenerate.
Unsplash, Pexels and Pixabay photos are free to use, and the libraries ask you to credit photographers where you can. The plugin adds a credit with links to the image caption (you can turn this off under Settings → Stock Photos) and always saves it with the image.
Out of the box, the plugin calls OpenAI's Images API using GPT Image 2.5 Flare by default — you can switch to GPT Image 2.5 Sunburst or GPT Image 2 under Image Generator → Settings. Models OpenAI has retired (GPT Image 1, DALL·E 2 and DALL·E 3) are no longer offered; sites that used them switch to GPT Image 2.5 Flare automatically. Developers can swap the endpoint, model, or request body via the aimg_generate_endpoint and aimg_generate_request_body filters — so you can point it at compatible services (Stability AI, self-hosted SDXL via a compatible proxy, etc.).
You pay OpenAI directly for usage, based on the model, image size and quality; see OpenAI's pricing page for current rates. Larger shapes, higher quality and more variations cost more. The plugin itself is free; you only pay your AI provider for the images it creates. To keep costs predictable, limit AI to certain roles, set an hourly limit per user, and use templates for everyday posts. Automatic AI images are only created when a post is published or scheduled, not for drafts.
By default, it's stored in the aimg_settings option in the WordPress database. For maximum security, define AIMG_API_KEY in wp-config.php instead — the settings UI will detect the constant and disable the input field, so the key never sits in the database.
Automatic generation only fires when a post is saved without a featured image. For existing content, open the post in the block editor and use the AI Featured Image panel to generate one on demand. Bulk generation across the entire site is on the roadmap.
Yes. The block editor integration is the plugin's flagship feature. You'll find the ✨ button on Image and Media & Text block toolbars and a dedicated AI Featured Image panel in the document sidebar.
The editor buttons are built for Gutenberg, but the same modal is available in Media → Library → Generate Image, so you can create template, AI and stock images there and use them in any builder. Automatic featured image generation works with every editor, because it runs whenever WordPress saves a post — so Classic Editor, Elementor, Divi, Beaver Builder, Bricks, and any other builder all benefit from auto-generated thumbnails.
On demand, yes. Open a product, download, course, or any custom post type that supports featured images, and use the AI Featured Image panel or the Media Library modal to generate and assign an image. Automatic generation on save currently covers posts and pages only; extending it to every public post type is next on the roadmap.
Yes. Generated images are stored as standard Media Library attachments with proper alt text, so SEO plugins can read them, expose them in Open Graph and Twitter Card tags, and include them in sitemaps.
No. Template rendering uses PHP's GD library (already loaded) and only runs when a post is saved without a featured image — or when you explicitly trigger it from the editor. Automatic AI images and stock photos are fetched in a single background task per post (Action Scheduler when available, otherwise WP-Cron), so saving a post never waits for an outside service. There's no frontend overhead.
On Windows, versions before 1.4.9 saved the full file path of generated images (for example C:/sites/example/wp-content/uploads/2026/04/image.png) instead of the path inside the uploads folder. They keep working on the same server. After a move, back up your database and remove the old uploads prefix, for example with WP-CLI: wp search-replace 'C:/sites/example/wp-content/uploads/' '' wp_postmeta --dry-run (run it again without --dry-run once the result looks right). Images generated with 1.4.9 or later are not affected.
Yes. Each site on the network can configure its own templates and API keys.
Template-based generation runs entirely on your server, nothing leaves your site (except for templates with a stock photo or AI image layer). Stock photo searches send only search terms (what you type, or keywords from the post title) to the library you use. AI generation sends only a prompt to OpenAI: the text you type, or — for automatic AI images and the Write a prompt from this post button — a prompt built from your prompt template, which by default contains the post's title and excerpt. No visitor data is ever sent. If your posts contain personal information, edit the prompt template so it doesn't include it.
Yes. The plugin is fully translation-ready with a bundled .pot file. Both PHP and JavaScript strings are translatable.
AIMG_API_KEY in wp-config.php rather than storing it in the database.Use the plugin support forum on WordPress.org. We read every post.
AIMG_UNSPLASH_KEY, AIMG_PEXELS_KEY and AIMG_PIXABAY_KEY.aimgModal.tabs (action aimg_enqueue_modal); new filters aimg_stock_providers, aimg_stock_keywords, aimg_stock_stop_words, aimg_stock_max_bytes, aimg_unsplash_app_name, aimg_sanitize_settings, aimg_merge_tag_names and aimg_studio_sample_tags; REST endpoints under /aimg/v1/stock.aimg_generate_preview(), deprecated in 1.7.1.aimg.studio.layerTypes (scripts enqueued on the new aimg_enqueue_template_studio action) together with aimg_template_layers.aimg_generate_timeout filter also receives the model and quality.aimg_generate_preview(); use ArtificialImageGenerator\Templates\Repository::update_preview(). It will be removed in 1.8.0.{title}, {excerpt}, {category}, {tags}, {author}, {date}, {site_name}, {reading_time} and {custom_field:key}, and layers that show only when a tag has a value./templates, /templates/{id}, /templates/preview, /fonts, /capabilities) and developer filters aimg_template_layers, aimg_fonts, aimg_merge_tags, aimg_template_document, aimg_template_starters and aimg_manage_templates_capability.{title}, {excerpt}, {category}, {tags}, {site_name}, {custom_field:key}), style presets, and instructions that keep text and watermarks out of AI images.aimg_providers, aimg_generation_methods, aimg_pre_generate_for_post, aimg_template_for_post, aimg_style_presets, aimg_post_prompt, aimg_auto_generate_statuses, aimg_use_action_scheduler, aimg_kick_queue, and REST endpoints /featured, /status, /prompt and /templates/{id}/preview.& or quotes are no longer shown as HTML codes in the Title text field, or drawn that way on images generated from the modal.aimg_can_generate_from_prompt, aimg_ai_hourly_limit and aimg_generate_timeout.&, quotes or apostrophes are now drawn correctly instead of as HTML codes, and used correctly as alt text.aimg/v1/generate, aimg/v1/templates) with capability and nonce checks for headless and automation use.AIMG_API_KEY PHP constant for storing the API key outside the database.