
內容簡介
### 總結:
這個 WordPress 外掛包括一個 Gutenberg 區塊,可插入提示,生成圖像並將圖像區塊插入當前文章。外掛連接到第三方 AI 圖像生成服務,允許您根據提示創建圖像。您需要從服務獲得自己的 API 金鑰,並遵守其服務條款和隱私政策。
### 問題與答案:
<ul>
<li>
<strong>如何使用這個外掛生成圖像?</strong>
<ul>
<li>編輯一篇文章。</li>
<li>插入一個圖像區塊。</li>
<li>在區塊工具欄中點擊 "KaiGen" 按鈕。</li>
<li>在輸入框中輸入提示。</li>
<li>點擊 "Generate Image" 按鈕。</li>
<li>(等候30秒,因為 OpenAI API 有時可能會有延遲。)</li>
<li>檢視/編輯插入的圖像區塊(替代文字包含提示)。</li>
</ul>
</li>
<li>
<strong>這個外掛連接到哪些外部服務?</strong>
<ul>
<li>OpenAI API:</li>
<ul>
<li>服務內容:OpenAI 的圖像生成服務(DALL-E)。</li>
<li>發送的數據:您的文本提示和選定的圖像參數(大小、質量等)。</li>
<li>數據發送時機:僅當你選擇 OpenAI 作為提供商並點擊 "Generate Image" 時。</li>
<li>API 端點:https://api.openai.com/v1/images/generations 和 https://api.openai.com/v1/images/edits</li>
<li>服務條款:https://openai.com/terms/</li>
<li>隱私政策:https://openai.com/privacy/</li>
</ul>
<li>Replicate API:</li>
<ul>
<li>服務內容:Replicate 的機器學習模型托管服務,用於各種 AI 圖像生成模型。</li>
<li>發送的數據:您的文本提示和選定的模型參數。</li>
<li>數據發送時機:僅當你選擇 Replicate 模型作為提供商並點擊 "Generate Image" 時。</li>
<li>API 端點:https://api.replicate.com/v1/models/ 和 https://api.replicate.com/v1/predictions/</li>
<li>服務條款:https://replicate.com/terms</li>
<li>隱私政策:https://replicate.com/privacy</li>
</ul>
</ul>
</li>
<li>
<strong>這個外掛的源代碼在哪里?</strong>
<ul>
<li>所有壓縮/縮小的 JavaScript 文件具有可讀的源代碼。</li>
<li>源文件地址:build/index.js → src/ 目錄、build/admin.js → src/admin.js。</li>
<li>源代碼位置:完整的可讀源代碼在此外掛的 src/ 目錄中以及GitHub上:https://github.com/jacobschweitzer/KaiGen</li>
<li>構建過程:這個外掛使用 @wordpress/scripts 構建系統。</li>
<li>要從源代碼構建:</li>
<ul>
<li>安裝Node.js和npm。</li>
<li>運行:npm install。</li>
<li>運行:npm run build。</li>
<li>開發時用:npm run start。</li>
</ul>
<li>更多詳細信息請參閱 README.md 文件。</li>
</ul>
</li>
</ul>
外掛標籤
開發者團隊
原文外掛簡介
Includes a Gutenberg block to insert a prompt that generates an image and inserts an image block into the current post.
How To Gen
Edit a post
Insert an image block
Click the “KaiGen” button in the block toolbar
Put a prompt into the input box
Click the Generate Image button
View/Edit the inserted image block (the alt text contains the prompt)
Use “Generate Alt Text” in the block inspector to describe the image
Text to image generation times vary by quality, low quality can be ~1 second, medium quality ~10 seconds, and high quality ~30 seconds or more.
Image to image generation times can take up to 2 minutes.
External Services
This plugin connects to third-party AI services to generate images and alt text. No data is sent to these services without your explicit action – images are only generated when you click “Generate Image”, and alt text is only generated when you click “Generate Alt Text”.
OpenAI API
What it is: OpenAI’s image generation service
What data is sent: Your text prompt, selected image parameters (size, quality, etc.), and image data for alt text generation
When data is sent: Only when you click “Generate Image” or “Generate Alt Text” with OpenAI selected as your provider
API Endpoint: https://api.openai.com/v1/images/generations, https://api.openai.com/v1/images/edits, and https://api.openai.com/v1/responses
Terms of Service: https://openai.com/terms/
Privacy Policy: https://openai.com/privacy/
Models supported: GPT Image 1.5
Replicate API
What it is: Replicate’s machine learning model hosting service for various AI image generation models
What data is sent: Your text prompt, selected model parameters, and image data for alt text generation
When data is sent: Only when you click “Generate Image” or “Generate Alt Text” with Replicate selected as your provider
API Endpoint: https://api.replicate.com/v1/models/ and https://api.replicate.com/v1/predictions/
Terms of Service: https://replicate.com/terms
Privacy Policy: https://replicate.com/privacy
Models supported: low quality (FLUX.2 klein 4B by Black Forest Labs), medium quality (Seedream 4.5 by ByteDance), and high quality (Nano Banana Pro by Google).
Important: You must obtain your own API keys from these services and are responsible for complying with their respective terms of service and privacy policies. The plugin does not collect, store, or transmit any of your data to any other parties.
Source Code
All compressed/minified JavaScript files have their human-readable source code available:
Compressed Files → Source Files:
* build/index.js → Source files in src/ directory
* build/admin.js → src/admin.js
Source Code Location:
The complete human-readable source code is available in the src/ directory of this plugin and on GitHub: https://github.com/jacobschweitzer/KaiGen
Build Process:
This plugin uses @wordpress/scripts build system. To build from source:
1. Install Node.js and npm
2. Run: npm install
3. Run: npm run build
The build/ directory is committed and used by WordPress at runtime; do not edit it directly.
For development: npm run start
For more details see the README.md file.
