=== Srizon AI Image ===
Contributors: afzal_du
Donate link: https://www.paypal.com/paypalme/AfzalHossain22
Tags: ai, image generation, artificial intelligence, media, midjourney, flux, openai, background removal
Requires at least: 5.8
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Generate AI images and remove backgrounds using multiple AI providers (FLUX, Google, OpenAI, Midjourney) directly in WordPress editor and media library.

== Description ==

Srizon AI Image brings the power of multiple AI image generation providers directly into your WordPress workflow. Generate stunning images from text prompts and remove backgrounds from existing images without leaving your editor, with support for FLUX, Google Gemini (Nano Banana), OpenAI GPT Image, and Midjourney models.

**Key Features:**

* **AI Image Generation** - Create images from text prompts using multiple AI providers
* **Background Removal** - Remove backgrounds from images with one click (~$0.0006/image)
* **Multiple AI Providers** - Choose from FLUX, Google Imagen (Nano Banana), OpenAI GPT Image, and Midjourney
* **Block Editor Integration** - "Generate with AI" button in the Image block toolbar
* **Media Library Integration** - Generate images from Featured Image and Gallery modals via dedicated tab
* **Media Library Page** - "Generate with AI" and "Remove Background" buttons on the Media Library page
* **Bulk Background Removal** - Select multiple images and remove backgrounds in batch
* **Flexible Dimensions** - Preset sizes (Square, Landscape, Portrait, Wide, Tall) plus custom dimensions
* **Advanced Parameters** - Model-specific controls for Steps, CFG Scale, and Quality settings
* **Smart Model Memory** - Your last selected model is remembered for convenience
* **Seamless Workflow** - Generated images are automatically saved to your Media Library

**Supported AI Models for Image Generation:**

* **FLUX.2 Dev** - Fast and affordable image generation
* **Nano Banana (Google Gemini)** - Google's image generation model (~$0.04/image)
* **GPT Image 1.5 (OpenAI)** - OpenAI's image generation with quality options (~$0.04/image for Medium)
* **Midjourney V7** - High-quality artistic images (~$0.10 for 4 images)
* **Nano Banana 2 Pro (Google Gemini 3)** - Premium Google model (~$0.138/image)

**Background Removal:**

Remove backgrounds from any JPEG, PNG, or WebP image in your Media Library:
* Single image removal from attachment details
* Bulk removal from Media Library grid view
* Bulk action in Media Library list view
* Original images are preserved - new images created with "-nobg" suffix
* Cost: ~$0.0006 per image

**How It Works:**

1. Configure your Runware API key in Settings → Srizon AI Image
2. **To generate images:** In the block editor, add an Image block and click "Generate with AI" in the toolbar
3. Enter your prompt, select model and dimensions
4. Adjust advanced parameters if desired (Steps, CFG Scale, Quality)
5. Click Generate and your AI image is created and inserted
6. **To remove backgrounds:** Go to Media Library, select images, and click "Remove Background"

**Supported Locations:**

* Image block toolbar in Gutenberg editor
* Featured Image modal ("Generate with AI" tab)
* Media Library modal for galleries ("Generate with AI" tab)
* Media Library page (wp-admin/upload.php) - "Generate with AI" and "Remove Background" buttons
* Attachment details - "Remove Background" button

**Model-Specific Features:**

* **FLUX models** - Adjustable Steps (1-50) and CFG Scale (1-20) for fine-tuning
* **OpenAI/GPT Image** - Quality selector (High, Medium, Low, Auto)
* **Midjourney** - Generates 4 images per request, all saved to Media Library

**Third-Party Service: Runware API**

This plugin connects to the Runware API to generate images and remove backgrounds. When you use the plugin:

* For image generation: Your text prompt and parameters are sent to Runware's servers
* For background removal: Your image URL is sent to Runware's servers for processing
* The processed results are returned and saved to your Media Library

No data is sent automatically. The API is only called when you explicitly click a Generate or Remove Background button.

**Disclaimer:** This plugin is not affiliated with, endorsed by, or sponsored by Runware. It simply integrates with the Runware API as a third-party service. You will need your own Runware account and API key to use this plugin.

* [Runware Website](https://runware.ai)
* [Runware Pricing](https://runware.ai/pricing)
* [Runware API Documentation](https://docs.runware.ai)

== Installation ==

1. Upload the `srizon-ai-image` folder to the `/wp-content/plugins/` directory
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Go to Settings → Srizon AI Image
4. Enter your Runware API key
5. Start generating images and removing backgrounds!

**Getting a Runware API Key:**

1. Go to [runware.ai](https://runware.ai)
2. Create an account or sign in
3. Add funds to your account (required for image generation)
4. Navigate to your dashboard
5. Generate an API key
6. Copy the key and paste it in the plugin settings

== Frequently Asked Questions ==

= Do I need a Runware account? =

Yes, you need a Runware account with an API key. Runware provides access to multiple AI image generation providers through a single API.

= How much does it cost? =

Pricing varies by feature:

**Image Generation:**
* FLUX.2 Dev - Very affordable (check Runware pricing)
* Nano Banana (Google) - ~$0.04/image
* GPT Image 1.5 (OpenAI) - ~$0.04/image for Medium quality
* Midjourney V7 - ~$0.10 for 4 images
* Nano Banana 2 Pro (Google) - ~$0.138/image

**Background Removal:**
* ~$0.0006 per image

Visit [Runware Pricing](https://runware.ai/pricing) for current rates.

= What image sizes are supported? =

The plugin supports: Square (1024x1024), Landscape (1536x1024), Portrait (1024x1536), Wide (1792x1024), Tall (1024x1792), and Custom dimensions (256-2048px).

= What are Steps and CFG Scale? =

These are advanced parameters available for FLUX models:
* **Steps** - Number of inference steps (1-50). More steps can improve quality but take longer.
* **CFG Scale** - Classifier-free guidance scale (1-20). Higher values follow the prompt more closely.

= What are the Quality options for GPT Image? =

OpenAI's GPT Image model supports quality settings:
* **High** - Best quality, higher cost
* **Medium** - Balanced quality and cost
* **Low** - Faster generation, lower cost
* **Auto** - Let the model decide

= Why does Midjourney generate 4 images? =

Midjourney's API requires generating images in sets of 4. All 4 images are saved to your Media Library, and you can choose which one to use.

= Where are generated images stored? =

All generated images are saved to your WordPress Media Library as PNG files.

= Can I use this with the Classic Editor? =

The block editor toolbar integration requires Gutenberg. However, you can still generate images via the Media Library page or Featured Image modal.

= Does the plugin remember my model selection? =

Yes! The plugin remembers your last selected model and will default to it the next time you generate an image.

= What image formats are supported for background removal? =

Background removal supports JPEG, PNG, and WebP images.

= Does background removal modify my original image? =

No, the original image is preserved. A new image is created with "-nobg.png" suffix.

= Can I remove backgrounds from multiple images at once? =

Yes! Select multiple images in the Media Library grid view and click "Remove Background" to process them in batch.

= Why does background removal require a live website? =

The Runware API needs to access your images via URL. Images on localhost or behind authentication may not be accessible to the API.

== Screenshots ==

1. Settings page with API key configuration
2. Generate with AI button in Image block toolbar
3. Image generation modal with prompt, model, and dimension options
4. Advanced parameters for FLUX models (Steps, CFG Scale)
5. Quality selector for GPT Image model
6. Generate with AI tab in Featured Image modal
7. Generate with AI button on Media Library page
8. Midjourney multi-image generation
9. Remove Background button in Media Library
10. Background removal progress indicator

== Changelog ==

= 1.0.0 =
* Initial release
* **Image Generation Features:**
  * Block editor Image block toolbar integration
  * Media Library modal tab for Featured Image and Gallery
  * Media Library page button for direct generation
  * Support for multiple AI providers via Runware API:
    * FLUX.2 Dev
    * Nano Banana (Google Imagen)
    * GPT Image 1.5 (OpenAI)
    * Midjourney V7
    * Nano Banana 2 Pro (Google Imagen)
  * Advanced parameters (Steps, CFG Scale) for FLUX models
  * Quality settings for OpenAI GPT Image
  * Multi-image support for Midjourney (4 images per request)
  * Model selection memory via localStorage
  * Preset and custom dimension options
* **Background Removal Features:**
  * Single image background removal from attachment details
  * Bulk background removal from Media Library grid view
  * Bulk action in Media Library list view
  * Progress indicator for batch processing
  * Original image preservation
* Settings page with API key management

== Upgrade Notice ==

= 1.0.0 =
Initial release of Srizon AI Image with AI image generation and background removal features.
