DALL-E light module
Generative AI Incubator
Edition |
Incubator (services) |
||
Git |
|||
Latest |
|
The DALL-E light module makes DALL-E’s public API accessible and usable through Magnolia. The following functions are provided:
-
Generating and storing images based on text (see Create image)
-
Creating image variants (see Create image variation)
-
Creating modified images (see Create image edit)
Prerequisites
-
You must have a DALL-E account.
-
You should have already installed the JavaScript UI module.
This light module is at the INCUBATOR level. |
License
@magnolia-services/dall-e
is open source software licensed as MIT.
Installing the light module
Installing the DALL-E light module light module is very simple.
-
You need to make sure the light module is integrated as part of your Magnolia project. This typically means you have this light module saved under your Magnolia project’s
light-modules
directory.For more on light modules in Magnolia, see here. -
Next, you’ll need to generate an API key via your DALL-E account.
-
You’ll need to copy that API key as you’ll need it in the following places in this light module:
Replacement spotsIn the following files in this light module, replace
DALL_E_TOKEN
with your newly-generated DALL-E API key.-
/dialogs/generateAsset.yaml Ln 24, Col 33
-
/dialogs/generateEdit.yaml Ln 34, Col 33
-
/dialogs/generateVariation.yaml Ln 26, Col 33
-
-
Register an imaging configuration
Since Dall-E expects a rectangular image in the tested version, the module currently uses the following imaging endpoint to always send the images delivered to DAll-E in the same format.
'dall-e':
'class': 'info.magnolia.imaging.operations.ImageOperationChain'
'mgnl:checksum': '8B158E9B3DD455A0D53D4ED03E9F4FB1'
'outputFormat':
'formatName': 'png'
'quality': 100
'operations':
'load':
'class': 'info.magnolia.imaging.operations.load.FromBinaryNode'
'resize':
'class': 'info.magnolia.imaging.operations.cropresize.AutoCropAndResize'
'targetHeight': '800'
'targetWidth': '800'
'parameterProviderFactory':
'class': 'info.magnolia.imaging.parameters.BinaryJcrNodePathParameterProviderFactory'