PHPackages                             naturalgroove/laravel-filament-image-generator-field - 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. naturalgroove/laravel-filament-image-generator-field

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

naturalgroove/laravel-filament-image-generator-field
====================================================

A Laravel Filament plugin that generates images using AI directly in Admin Panel

1.05(1y ago)161.3k7[2 issues](https://github.com/naturalGroove/laravel-filament-image-generator-field/issues)MITPHPPHP ^8.1

Since May 3Pushed 1y ago1 watchersCompare

[ Source](https://github.com/naturalGroove/laravel-filament-image-generator-field)[ Packagist](https://packagist.org/packages/naturalgroove/laravel-filament-image-generator-field)[ Docs](https://github.com/naturalgroove/laravel-filament-image-generator-field)[ RSS](/packages/naturalgroove-laravel-filament-image-generator-field/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (15)Versions (7)Used By (0)

Image Generator Form Field for Laravel Filament
===============================================

[](#image-generator-form-field-for-laravel-filament)

[![Latest Version on Packagist](https://camo.githubusercontent.com/486788496f945f117c42734f8cab1b651c085556400fdd762dbaedeb7e367419/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e61747572616c47726f6f76652f6c61726176656c2d66696c616d656e742d696d6167652d67656e657261746f722d6669656c642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/naturalGroove/laravel-filament-image-generator-field)[![GitHub Tests Action Status](https://camo.githubusercontent.com/a9149f47eeb05fcadfd0670fc893d3e7168ef8babde4981e12b07e6ebc064ae2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6e61747572616c47726f6f76652f6c61726176656c2d66696c616d656e742d696d6167652d67656e657261746f722d6669656c642f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/naturalGroove/laravel-filament-image-generator-field/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/4978377e93e1b4b38abe275d2f7856144d533ca5c37d0f6323c269c80538c37e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6e61747572616c47726f6f76652f6c61726176656c2d66696c616d656e742d696d6167652d67656e657261746f722d6669656c642f6669782d7068702d636f64652d7374796c696e672e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/naturalGroove/laravel-filament-image-generator-field/actions?query=workflow%3A%22Fix+PHP+code+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/53a6bf21505aec290ceaf6c4df71c953878b93893293b18fca8c7252ccfa0435/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e61747572616c47726f6f76652f6c61726176656c2d66696c616d656e742d696d6167652d67656e657261746f722d6669656c642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/naturalGroove/laravel-filament-image-generator-field)

This custom field allows you to generate images with different sizes and formats using AI models like OpenAI DALL-E. It extends the FileUpload field and adds a button to open the image generator modal where you can set the sizes and formats of the generated images.

[![filament image generator ai](https://camo.githubusercontent.com/3696096f01e8380252357f3f3bf0bcc20fd2757fb8028fa8411d3f70cc4f2b02/68747470733a2f2f6e6574736576656e2e6465762f66696c616d656e742d696d6167652d67656e657261746f722d6669656c642f73637265656e73686f74732f706c7567696e2d73686f77636173652e77656270)](https://camo.githubusercontent.com/3696096f01e8380252357f3f3bf0bcc20fd2757fb8028fa8411d3f70cc4f2b02/68747470733a2f2f6e6574736576656e2e6465762f66696c616d656e742d696d6167652d67656e657261746f722d6669656c642f73637265656e73686f74732f706c7567696e2d73686f77636173652e77656270)

Installation
============

[](#installation)

Before you begin, you must have the Laravel Filament package installed and configured. If you haven't done this yet, you can find the installation instructions [here](https://filamentadmin.com/docs/installation).

Prerequisites
-------------

[](#prerequisites)

Default Image Generator is set to OpenAI DALL-E (version 3). You should have an API key to use it. You can get it [here](https://platform.openai.com/). After You get the API key, you should set it in your .env file:

```
OPEN_AI_DALL_E_API_KEY=your-api-key
```

Install the package via composer
--------------------------------

[](#install-the-package-via-composer)

Run the following command in your terminal to install the package:

```
composer require naturalGroove/laravel-filament-image-generator-field
```

You can publish the config file with:

```
php artisan vendor:publish --tag="filament-image-generator-field-config"
```

Configuration file lets you set the default image generator and the available image generators for the field.

Optionally, you can publish the views to customize the field:

```
php artisan vendor:publish --tag="filament-image-generator-field-views"
```

Usage
-----

[](#usage)

[![screenshot](https://camo.githubusercontent.com/3cf638d4ba512d348540d4593655deed98a3ebe60dbd036f5d00a7db1515a8f5/68747470733a2f2f6e6574736576656e2e6465762f66696c616d656e742d696d6167652d67656e657261746f722d6669656c642f73637265656e73686f74732f706c7567696e2d73637265656e636173742e706e67)](https://camo.githubusercontent.com/3cf638d4ba512d348540d4593655deed98a3ebe60dbd036f5d00a7db1515a8f5/68747470733a2f2f6e6574736576656e2e6465762f66696c616d656e742d696d6167652d67656e657261746f722d6669656c642f73637265656e73686f74732f706c7567696e2d73637265656e636173742e706e67)

Just add new Field or replace your FileUpload field with ImageGenerator field in your form schema definition:

```
use \NaturalGroove\Filament\ImageGeneratorField\Forms\Components\ImageGenerator;

[...]
public static function form(Form $form): Form
{
    return $form
        ->schema([
            ImageGenerator::make('photo'),
        ]);
```

If You are replacing the FileUpload field:

```
use \NaturalGroove\Filament\ImageGeneratorField\Forms\Components\ImageGenerator;

    [...]
-   FileUpload::make('photo'),
+   ImageGenerator::make('photo'),
```

You could use all the same options as FileUpload field, for example:

```
use \NaturalGroove\Filament\ImageGeneratorField\Forms\Components\ImageGenerator;

ImageGenerator::make('photo')
    ->imageEditor()
    ->disk('private'),
```

This plugin comes with a default image generator set to OpenAI DALL-E. You can select which version of the model you want to use when defining the field:

```
ImageGenerator::make('photo'
    ->imageGenerator('openai-dall-e-3'),
```

There are predefined shortcuts for the image generators:

```
ImageGenerator::make('photo')
    ->openaiDallE2(); // equivalent to ->imageGenerator('openai-dall-e-2')

ImageGenerator::make('photo')
    ->openaiDallE3(); // equivalent to ->imageGenerator('openai-dall-e-3')
```

Depending on the image generator you choose, there are different options you can set. For example Dall-E 2 allows to set the number of images generated.

After you add the field to your form, you should see a button next to the file input. When you click the button, the image generator modal will open.

[![screenshot](https://camo.githubusercontent.com/ebea34b459bc0309f92616e1f2c200d2315dd8cbd8279e5dc1c8975b36d93330/68747470733a2f2f6e6574736576656e2e6465762f66696c616d656e742d696d6167652d67656e657261746f722d6669656c642f73637265656e73686f74732f6669656c642d776974682d627574746f6e2e77656270)](https://camo.githubusercontent.com/ebea34b459bc0309f92616e1f2c200d2315dd8cbd8279e5dc1c8975b36d93330/68747470733a2f2f6e6574736576656e2e6465762f66696c616d656e742d696d6167652d67656e657261746f722d6669656c642f73637265656e73686f74732f6669656c642d776974682d627574746f6e2e77656270)

Adding custom image generators
------------------------------

[](#adding-custom-image-generators)

You can add custom image generators by impolemeting the `NaturalGroove\Filament\ImageGeneratorField\Contracts\AIImageGenerator` interface. Your class should have the all the methods from the interface and should be registered in the config file. Format of returned array should be the same as in the example below:

```
use NaturalGroove\Filament\ImageGeneratorField\Contracts\AIImageGenerator;

class MyCustomImageGenerator implements AIImageGenerator
{
    public function generate(string $prompt, int $n = 1, array $params = []): array
    {
        // your implementation

        return [
            [
                'url' => 'https://example.com/image.jpg'
            ]
            [...]
        ];
    }

}
```

[![screenshot](https://camo.githubusercontent.com/bc64b29a2ba87bdf57177ac049b1a069f11dab15d2f3821e1d9579c53cb16090/68747470733a2f2f6e6574736576656e2e6465762f66696c616d656e742d696d6167652d67656e657261746f722d6669656c642f73637265656e73686f74732f6d6f64616c2d776974682d73686f772d616c6c2d6f7074696f6e732e77656270)](https://camo.githubusercontent.com/bc64b29a2ba87bdf57177ac049b1a069f11dab15d2f3821e1d9579c53cb16090/68747470733a2f2f6e6574736576656e2e6465762f66696c616d656e742d696d6167652d67656e657261746f722d6669656c642f73637265656e73686f74732f6d6f64616c2d776974682d73686f772d616c6c2d6f7074696f6e732e77656270)

Upcoming features
-----------------

[](#upcoming-features)

- Add more image generators
- Add functionality to edit your uploaded image with AI models (img2img)
- Add more options to the field

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Grzegorz Adamczyk](https://github.com/naturalGroove)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity54

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 ~44 days

Recently: every ~55 days

Total

6

Last Release

517d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b7f6fcfc381b325ea30800697598d22248af798f0480c87c45da06df4c7791ef?d=identicon)[naturalGroove](/maintainers/naturalGroove)

---

Top Contributors

[![naturalGroove](https://avatars.githubusercontent.com/u/59738752?v=4)](https://github.com/naturalGroove "naturalGroove (11 commits)")

---

Tags

laravellaravel-filamentnaturalGroovelaravel-filament-cmslaravel-filament-pluginlaravel-filament-image-generator-fieldai-image-generator

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/naturalgroove-laravel-filament-image-generator-field/health.svg)

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

###  Alternatives

[maestroerror/laragent

Power of AI Agents in your Laravel project

630106.4k](/packages/maestroerror-laragent)[joshembling/image-optimizer

Optimize your Filament images before they reach your database.

111145.4k12](/packages/joshembling-image-optimizer)[joaopaulolndev/filament-pdf-viewer

Filament package to show pdf document viewer

104147.2k3](/packages/joaopaulolndev-filament-pdf-viewer)[saasykit/laravel-open-graphy

An awesome open graph image (social cards) generator package for Laravel.

13057.0k](/packages/saasykit-laravel-open-graphy)[ace-of-aces/laravel-image-transform-url

Easy, URL-based image transformations inspired by Cloudflare Images.

1756.4k](/packages/ace-of-aces-laravel-image-transform-url)[danihidayatx/image-optimizer

Optimize your Filament images before they reach your database. Forked from joshembling/image-optimizer for Filament v4 &amp; v5 support.

254.4k](/packages/danihidayatx-image-optimizer)

PHPackages © 2026

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