PHPackages                             openbackend/laravel-ai-image-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. openbackend/laravel-ai-image-generator

ActiveLibrary[Image &amp; Media](/categories/media)

openbackend/laravel-ai-image-generator
======================================

Advanced Laravel package for AI-powered image generation supporting multiple providers (OpenAI DALL-E, Stability AI, Midjourney) with comprehensive features

v1.1.6(9mo ago)010MITPHPPHP ^8.1|^8.2|^8.3|^8.4CI failing

Since Jul 29Pushed 9mo agoCompare

[ Source](https://github.com/openbackend/laravel-ai-image-generator)[ Packagist](https://packagist.org/packages/openbackend/laravel-ai-image-generator)[ Docs](https://github.com/openbackend/laravel-ai-image-generator)[ RSS](/packages/openbackend-laravel-ai-image-generator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (8)Versions (8)Used By (0)

Laravel AI Image Generator
==========================

[](#laravel-ai-image-generator)

[![Latest Version on Packagist](https://camo.githubusercontent.com/20384aded3301f27651d4a40677d8777ceddcbca200e505449a70ccc20dca32e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f70656e6261636b656e642f6c61726176656c2d61692d696d6167652d67656e657261746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/openbackend/laravel-ai-image-generator)[![Total Downloads](https://camo.githubusercontent.com/b6f4fd04ca69a618cb847a38480bfb20104c12d889581d865256ccbf466776fe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f70656e6261636b656e642f6c61726176656c2d61692d696d6167652d67656e657261746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/openbackend/laravel-ai-image-generator)[![PHP Version Require](https://camo.githubusercontent.com/c812d9ac94ba998d0ec1a7cb881e8aca74810862fdae78babfe3c4b9ab14ec4a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6f70656e6261636b656e642f6c61726176656c2d61692d696d6167652d67656e657261746f723f7374796c653d666c61742d737175617265)](https://packagist.org/packages/openbackend/laravel-ai-image-generator)[![License](https://camo.githubusercontent.com/5cf49ce56e2db0dc4a507641e9847534a7b32e55d6cad72e5d594b9cdcaa2094/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6f70656e6261636b656e642f6c61726176656c2d61692d696d6167652d67656e657261746f723f7374796c653d666c61742d737175617265)](https://packagist.org/packages/openbackend/laravel-ai-image-generator)

An advanced Laravel package for AI-powered image generation supporting multiple providers including OpenAI DALL-E, Stability AI, and Midjourney. Generate stunning images from text prompts with comprehensive features like automatic storage, thumbnails, rate limiting, and detailed analytics.

Features
--------

[](#features)

- 🎨 **Multiple AI Providers**: OpenAI DALL-E, Stability AI, Midjourney support
- 🔄 **Async Generation**: Support for background image generation
- 💾 **Automatic Storage**: Auto-download and store generated images
- 🖼️ **Thumbnail Generation**: Automatic thumbnail creation in multiple sizes
- 📊 **Analytics &amp; Tracking**: Comprehensive usage statistics and generation history
- 🛡️ **Rate Limiting**: Built-in rate limiting to prevent API abuse
- 🔒 **Content Filtering**: Safety checks for inappropriate content
- ⚡ **Caching**: Intelligent caching for improved performance
- 🎛️ **Artisan Commands**: CLI tools for easy management
- 🧪 **Comprehensive Testing**: Full test suite included
- 📝 **Detailed Logging**: Complete request/response logging
- 🎯 **Facade Support**: Easy-to-use Laravel facades

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Laravel 9.0, 10.0, or 11.0
- GuzzleHttp 7.5+
- Intervention Image 2.7+ or 3.0+ (optional, for thumbnails)

Installation
------------

[](#installation)

1. Install the package via Composer:

```
composer require openbackend/laravel-ai-image-generator
```

2. Publish the configuration file:

```
php artisan vendor:publish --provider="OpenBackend\AiImageGenerator\AiImageGeneratorServiceProvider" --tag="ai-image-generator-config"
```

3. Publish and run the migrations:

```
php artisan vendor:publish --provider="OpenBackend\AiImageGenerator\AiImageGeneratorServiceProvider" --tag="ai-image-generator-migrations"
php artisan migrate
```

4. Add your API keys to your `.env` file:

```
# OpenAI Configuration
OPENAI_API_KEY=your_openai_api_key_here
OPENAI_IMAGE_MODEL=dall-e-3

# Stability AI Configuration
STABILITY_API_KEY=your_stability_api_key_here

# Midjourney Configuration
MIDJOURNEY_API_KEY=your_midjourney_api_key_here
MIDJOURNEY_API_URL=your_midjourney_api_url_here
```

Quick Start
-----------

[](#quick-start)

```
use OpenBackend\AiImageGenerator\Facades\AIImageGenerator;

// Generate an image with default settings
$generation = AIImageGenerator::generate('A beautiful sunset over mountains');

echo $generation->url; // URL to the generated image
echo $generation->file_path; // Local file path (if auto-download enabled)
```

Advanced Usage
--------------

[](#advanced-usage)

```
// Generate with custom options
$generation = AIImageGenerator::generate('A futuristic city', [
    'size' => '1792x1024',
    'quality' => 'hd',
    'style' => 'natural',
    'model' => 'dall-e-3'
]);

// Use a specific provider
$generation = AIImageGenerator::provider('stability')
    ->generate('A magical forest', [
        'width' => 1024,
        'height' => 1024,
        'steps' => 50,
        'cfg_scale' => 7
    ]);

// Async generation (queued)
$generation = AIImageGenerator::generateAsync('A space station');
```

Artisan Commands
----------------

[](#artisan-commands)

```
# Generate an image from command line
php artisan ai-image:generate "A beautiful landscape" --provider=openai --size=1024x1024

# List available providers
php artisan ai-image:providers
```

Configuration
-------------

[](#configuration)

The package provides extensive configuration options in `config/aiimagegenerator.php`:

- Multiple AI provider support
- Storage and file management
- Rate limiting and security
- Logging and monitoring
- Image processing options
- Caching configuration

Testing
-------

[](#testing)

```
composer test
composer test-coverage
composer analyse
```

Credits
-------

[](#credits)

- [OpenBackend Organization](https://github.com/openbackend)
- [Rudra Ramesh](https://github.com/rudraramesh) - Lead Developer
- [All Contributors](../../contributors)

About OpenBackend
-----------------

[](#about-openbackend)

OpenBackend is an open-source organization focused on creating high-quality backend solutions and packages for modern web development. We specialize in Laravel packages, API development tools, and backend infrastructure solutions.

Visit us at [openbackend.dev](https://openbackend.dev) to explore more of our projects.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

Support
-------

[](#support)

- 📧 Email:
- 🐛 Issues: [GitHub Issues](https://github.com/openbackend/laravel-ai-image-generator/issues)
- 💬 Discussions: [GitHub Discussions](https://github.com/openbackend/laravel-ai-image-generator/discussions)
- 🌐 Website: [openbackend.dev](https://openbackend.dev)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance57

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

7

Last Release

287d ago

PHP version history (2 changes)v1.0.1PHP ^8.1

v1.1.4PHP ^8.1|^8.2|^8.3|^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/2ee24e4136339578d209efc1e185915bf09e79b3bdfa040e91900c58bd12c192?d=identicon)[rudraramesh](/maintainers/rudraramesh)

---

Top Contributors

[![rudraramesh](https://avatars.githubusercontent.com/u/54761880?v=4)](https://github.com/rudraramesh "rudraramesh (25 commits)")

---

Tags

laravelaiopenaidall-eartificial intelligenceimage-generationmidjourneystability-ai

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/openbackend-laravel-ai-image-generator/health.svg)

```
[![Health](https://phpackages.com/badges/openbackend-laravel-ai-image-generator/health.svg)](https://phpackages.com/packages/openbackend-laravel-ai-image-generator)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[smousss/laravel-globalize

Make Laravel projects translatable in a matter of seconds!

2266.3k](/packages/smousss-laravel-globalize)[batdan/midjourney-api-php

Generate images Midjourney (Discord API). URLs in prompt accepted

222.2k](/packages/batdan-midjourney-api-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
