Generate Images

Mirako's image generation capabilities allow you to create stunning images featuring your custom avatars, all based on the text prompts you provide.

The image generation API takes the following inputs:

  • Prompt: A detailed description of the image you want to create, including description of the scene, style, and the avatar you want to include.
  • Avatar ID: The unique identifier of the avatar you want to feature in the image. If you don't specify an avatar, a generic avatar will be used.
  • Aspect Ratio: The desired aspect ratio for the image (e.g. 16:9, 1:1)
  • Seed: An optional seed value for reproducibility. If not provided, a random seed will be used.
  • Images (optional): Up to 5 labeled images for text-image-to-image generation.

Quick Start

Using the CLI Tool

To quickly generating images, you can use the Mirako CLI tool and run in termina

sh
mirako image generate -p "A professional headshot of middle-aged man in a modern office environment, wearing a business suit, with soft lighting, arm-crossed." --aspect-ratio 1:1

This command will start the image generation process with the specified prompt and aspect ratio. The CLI will handle the API calls and provide you with the generated image once it's ready.

You can also generate images with reference images (text-image-to-image):

sh
# Generate image with avatar wearing a specific t-shirt from reference image
mirako image generate -p "Professional photo of <my_avatar_id> wearing the [tshirt] in urban setting" --aspect-ratio 16:9 --labeled-image tshirt_design.jpg:tshirt

The --labeled-image flag allows you to upload reference images with labels. Use the format path/to/image.jpg:label to assign a label to the image, then reference it in your prompt using [label]. Although image labeling is highly recommended, you can also use --image flag for unlabeled images.

Generate Images with Avatar

To generate images featuring a specific avatar, just embed the actual avatar Id in you prompt. Like we can modify the prompt if we want to swap the subject of the above image with the desired avatar:

sh
# Replace <my_avatar_id> with your actual avatar ID (i.e. in UUID format)
mirako image generate -p "A professional headshot of <my_avatar_id> in a modern office environment, wearing a business suit, with soft lighting, arm-crossed." --aspect-ratio 1:1

You can run mirako image generate --help to see all available options.

Dive Deeper