Skip to content

Image Generation

Shows how to generate images from text descriptions via EdenAI.

This example assumes using EdenAI; is in scope and apiKey contains your EdenAI API key.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
using var client = new EdenAIClient(apiKey);

// Generate images from text descriptions using the EdenAI unified API.
// Supported providers include OpenAI (DALL-E), Stability AI, and Amazon.
var response = await client.Generation.ImageImageGenerationCreateAsync(
    request: new ImagegenerationGenerationRequest
    {
        Providers = ["openai"],
        Text = "A serene mountain landscape at sunset",
        Resolution = "1024x1024",
        NumImages = 1,
    });