Download the PHP package basilicom/ai-image-generator-bundle without Composer
On this page you can find all versions of the php package basilicom/ai-image-generator-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package ai-image-generator-bundle
AI Image Generator Bundle
This is bundle utalizes common APIs for generative image AIs to generate images in the Pimcore Backend.
Installation
Make sure to also install the bundle via BundleSetupSubscriber
or console.
Support
Parameter | Text-To-Image | Variations | Upscaling | Inpainting | Background Inpainting |
---|---|---|---|---|---|
ClipDrop | X | X | X | - | X |
A1111 | X | X | X | X | X |
DreamStudio | X | X | X | X | ~ |
OpenAI | X | X | - | X | X |
Configuration
Usage
Generating images in documents
If no prompt is given, the prompt will be generated (and not translated!) from
- document SEO title
- document SEO description
- h1-Elements
- h2-Elements
- h3- and h4-elements if the previous mentioned sources are empty
Generating images in DataObjects
If no prompt is given, the prompt will be generated (and not translated!) by trying to access the following properties:
- key
- title
- name
- productName
- description
API
(POST) /admin/ai-images/generate/{context}-{id}
Generate an image based on a document or object context. If the prompt is empty, the budle-logic for prompting will take effect.
Parameter | Type | Example |
---|---|---|
context | string | document/object |
id | int | 123 |
prompt | string | a towel |
aspectRatio | string | 16:9 |
(POST) /admin/ai-images/upscale/{id}
Upscale image, while the target upscaling size is AI-Service specific
Parameter | Type | Default | Example |
---|---|---|---|
id | int | 123 |
(POST) /admin/ai-images/vary/{id}
Inpaint backgrounds where the background logic differ for provided AI-Services.
Parameter | Type | Default | Example |
---|---|---|---|
id | int | 123 | |
prompt | string | a towel |
Responses
Based on the Accept
-header, you can say if you want to have a JSON-response or the image itself.
Accept: application/json
Accept: image/jpeg
Using Stable Diffusion API
When running Automatic1111 locally, you can define http://host.docker.internal:7860
as your local API-url.
Additionally, make sure you started Automatic1111 with --api
:
If you want to know which models you have, call the Models-Endpoint and copy the name of a model of your choice.
Plugins used
- ControlNet with
canny
andip2p
- SD Upscaler Post Processor Script
Using LLM-driven prompt enhancing
In order to enhance prompts, we use local images of LLMs. There are three supported prompt enhancement services:
open_ai
(ChatGPT)basilicom
(a simple LLM implementation, see Docker Hub)ollama
(see Github)
Limitations
- the DreamStudio REST API does currently not support variations, I'll look forward to use the gRPC API
- ClipDrops text-to-image API can only create 1:1 images
Additional ideas
-
Prompting
- enhance prompts, especially for background inpainting, like
- generate prompt in lightbox before sending?
- background-inpainting for other service by using masks
- CLIP interrogate in order to optimize variation prompting
- allow variants by img2img and CLIP
- run IMG2IMG with low denoise on background-inpainting
- LCM for super fast preview generation => midjourney-like/inpainting-like image selection before upscaling, etc.
- outpainting via Thumbnail
- better error handling (warnings and fallbacks if credits exceeded)
- ComfyUI + Nodes to Python as fixed presets
- allow docker images with presets
- InvokeAI
Authors
Alexander Heidrich