Skip to content

Generate images from a reference image

Uses the same image endpoint with subject_reference to perform image-to-image generation.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
using var client = new MiniMaxClient(apiKey);

var response = await client.Image.CreateImageGenerationAsync(
    model: "image-01",
    prompt: "Turn this portrait into a cinematic magazine cover with warm golden-hour lighting and shallow depth of field.",
    subjectReference:
    [
        new ImageSubjectReference
        {
            Type = ImageSubjectReferenceType.Character,
            ImageFile = "https://cdn.hailuoai.com/prod/2025-08-12-17/video_cover/1754990600020238321-411603868533342214-cover.jpg",
        },
    ],
    responseFormat: ImageGenerationRequestResponseFormat.Url,
    n: 1);

Console.WriteLine($"image_url: {response.Data?.ImageUrls?.FirstOrDefault()}");