AIDevKit - AI Suite for Unity
API ReferencesDiscordGlitch9
  • Introduction
    • AI Dev Kit 3.7.0
    • Troubleshooting
    • FAQ
    • Update Logs
  • Provider Setup
    • API Key Setup
    • OpenAI
    • Google Gemini
    • ElevenLabs
    • Ollama
    • OpenRouter
  • Editor Tools
    • Introduction
    • Editor Chat
    • Model Library
    • Voice Library
  • GEN Tasks
    • Overview
    • Prefixes
    • Response
    • Chat
    • Image
    • Video
    • SoundFX
    • Speech
    • Transcript
    • Voice Change
    • Audio Isolation
  • Advanced API (Pro)
    • Assistants
      • How it works
      • Creating custom functions
      • Creating assistants API
    • Realtime
  • Legacy API
    • OpenAI
      • 💬Chat completions
      • 🖼️Image operations
      • 🗣️Text to speech
      • 🎙️Speech to text
        • Recording real-time in Unity
      • 💾Files
      • 🔎Embeddings
      • 🛡️Moderations
      • ⚙️Fine-tuning
    • Google Gemini
      • 📝System instructions
      • 💬Text generation
      • ⚙️Fine-tuning
      • ▶️Fucntion calling
      • 🔎Embeddings
      • 🛡️Safety
      • 💻Code execution
  • Legacy Documents
    • AI Dev Kit 1.0
      • Preperation
      • Scriptable Toolkits
        • Chat Streamer
        • Image Generator
        • Voice Transcriber
        • Voice Generator
      • Editor Tools
      • Troubleshooting (Legacy)
        • ❗Build Error: The name 'UnityMenu' does not exist in the current context
        • ❗The type or namespace name 'AndroidJavaObject' could not be found
        • ❗The type or namaspace name 'Plastic' does not exist
        • ❗Build Error: The name 'Asset Database' does not exist in the current context
        • ❗'ModelData.Create(Provider, string, UnixTime?, string)': not all code paths return a value
      • Code Generators
        • C# Script Generator
        • Unity Component Generator
    • AI Dev Kit 2.0
      • Event Handlers
      • Editor Chat
      • Editor Vision (TTI, ITI)
      • Editor Speech (TTS)
      • Management Tools
        • Prompt History Viewer
        • AI Model Manager
        • TTS Voice Manager
        • OpenAI File Manager
        • OpenAI Assistant Manager
        • ElevenLabs Voice Library
Powered by GitBook
On this page
  • GENImage
  • GENInpaint
  • GENVariation
  1. GEN Tasks

Image

Generate or edit an image using a diffusion model

PreviousChatNextVideo

Last updated 2 hours ago

GENImage

returns

Generates an entirely new image from a text prompt using models like DALL·E, Gemini or Imagen. This is the primary entry point for creative image generation.

Generating an Image

Texture2D result = await "A cat surfing a wave"
    .GENImage()
    .SetModel(ImageModel.DallE3)
    .ExecuteAsync();

DALL·E-specific Configurations

Texture2D result = await "A cyberpunk city at night"
    .GENImage()
    .SetModel(ImageModel.DallE3)
    .SetSize(ImageSize._1024x1024)
    .SetQuality(ImageQuality.HD)
    .SetStyle(ImageStyle.Vivid)
    .ExecuteAsync();

Google-specific Configurations (Gemini, Imagen3)

Texture2D result = await "An astronaut riding a horse"
    .GENImage()
    .SetModel(GoogleModel.Gemini2_0_Flash_Exp_Image_Generation)
    .SetAspectRatio(AspectRatio.Square)
    .SetPersonGeneration(PersonGeneration.Unspecified)
    .ExecuteAsync();

Results are saved to a temporary location unless you call .SetOutputPath().


GENInpaint

Edits an existing image using a prompt. Ideal for adding, removing, or changing parts of an image.

Basic Usage

// The given image is used as a base, and the model performs localized edits.

Texture2D result = await myTexture
    .GENInpaint("Add a crown on the cat’s head")
    .SetModel(ImageModel.DallE2)
    .ExecuteAsync();
    
// You can provide a mask using InpaintPrompt if you need precise region control.

DALL·E 3 does not supports inpaint.


GENVariation

Creates new stylistic variants of an existing image. This is useful for generating concept variations or alternatives.

Only DALL·E 2 currently supports image variation.

Basic Usage

Texture2D result = await myTexture
    .GENImageVariation()
    .SetModel(OpenAIModel.DallE2)
    .ExecuteAsync();

returns

returns

GeneratedImage
GeneratedImage
GeneratedImage