Image Generation
Image generation lets you create stunning visuals from text prompts using models like DALL·E, Gemini Imagen, and others.
There are three primary modes available:
🖌️ Image Creation – Generate a new image from a text description
✂️ Image Edit – Modify an existing image using a prompt
🎨 Image Variation – Create visual remixes or alternatives of an image
✅ 1. Image Creation (from Text)
🎨 The image is downloaded and converted into a Unity Texture2D
.
You can also save it directly using .SaveToDisk()
or convert it to PNG.
✅ 2. Image Edit (prompt + image)
✂️ The given image is used as a base, and the model performs localized edits.
✅ 3. Image Variation (image only)
🎨 A new image is generated based on the style and structure of the original.
📦 Example Output
Prompt:
"A futuristic city with flying cars"
Output: A 1024×1024 image showing a neon-lit cyberpunk skyline
🧩 Advanced Configuration (Per Provider)
Fluent API extensions allow you to customize behavior depending on the selected model.
🔵 OpenAI (DALL·E 2 & 3)
SetSize(ImageSize)
Set image resolution (_256x256
, _512x512
, _1024x1024
)
SetQuality(ImageQuality)
Choose quality (Standard
, HD
)
SetStyle(ImageStyle)
Define visual tone (Natural
, Vivid
)
SetMask(Texture2D)
Apply inpainting mask (for edits only)
🟢 Google (Gemini / Imagen)
SetAspectRatio(...)
Choose image layout: Square
, Portrait
, Landscape
SetPersonGeneration(...)
Control generation of human figures (e.g., allow, deny, unspecified)
🧠 Tips
DALL·E 3 only supports generation (not editing/variation) through the OpenAI API.
All outputs are automatically saved to a temporary location unless
SetOutputPath()
is used.Use
.AsTexture2D()
,.AsPNG()
, or.SaveToDisk()
depending on your workflow.Not all models support all features. Use
.SetModel(...)
early and tailor the configuration accordingly.
Last updated