Skip to Content

Image Generation - MyTokenGate

1. Introduction

Image models work in two ways:

  • Text-to-image: hand over a prompt and get an image
  • Image-to-image: pass one or more reference images along with the prompt, to produce a variant or hold a subject steady

Image-to-image is what you want when the same person or object has to survive a change of scene or pose. It is far steadier than describing that subject in words.

See the Image Generation API for full details.

2. Supported Models

ModelNotes
doubao-seedream-5-0-260128Seedream 5.0, general text-to-image and multi-reference
Doubao-Seedream-5.0-ProPro tier of the same family, stronger on detail and in-image text
qwen-image-3.0Qwen image, strong Chinese semantics
qwen-image-3.0-proPro tier of the same family
wan2.7-image-proWan 2.7, realistic and commercial work
gpt-image-2Best when instructions and in-image text must be followed precisely

The model list reports supported aspect ratios and pricing per model; treat that response as authoritative.

3. Request Parameters

ParameterTypeDescription
modelstringRequired, the model ID
promptstringYour prompt
sizestringPixel size like 1024x1024, or a tier: 1K, 2K, 3K, 4K. A tier maps to a fixed edge, e.g. 2K is 2048×2048
imagestringOne reference image, URL or data URI
imagesstring[]Multiple reference images, up to 6. When both are sent, images wins
watermarkbooleanWhether to watermark; if omitted, the upstream default applies
nnumberNumber of images, currently limited to 1

To get several different results, send several requests. An n above 1 is rejected.

4. Prompt Guidance

The more specific the prompt, the more control you have.

  • Be concrete: not “a beach at sunset”, but “a quiet beach at sunset, sky turning orange-red, waves lapping the sand, a small boat in the distance”
  • Name the mood: words like “warm”, “mysterious”, “energetic” steer style
  • State the style when you have one: “impressionist”, “surreal”
  • Avoid empty words: “beautiful” and “nice” give the model nothing concrete
  • Exclude with negations: “a beach at sunset, but no boats”
  • Split complex scenes: generate a base image first, then refine from it

A sample prompt:

A futuristic eco-friendly skyscraper in central Tokyo. The building incorporates lush vertical gardens on every floor, with cascading plants and trees lining glass terraces. Solar panels and wind turbines are integrated into the structure’s design, reflecting a sustainable future. The Tokyo Tower is visible in the background, contrasting the modern eco-architecture with traditional city landmarks.

5. Billing

Image generation is billed per image, with input and output metered separately:

MeterMeaning
image_output_per_imageCharged once per generated image
image_input_per_imageCharged once per reference image passed in

Reference images cost money. The same prompt with four reference images costs four input-image units more than with none. Unit prices vary by model; see Billing.

Failed generations are not charged — the pre-authorisation is released.

6. Code Examples

With the OpenAI SDK:

from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://gateway.mytokengate.com/v1", ) response = client.images.generate( model="doubao-seedream-5-0-260128", prompt="A convenience store glass door on a rainy night, cold white light, realistic", size="2K", watermark=False, ) print(response.data[0].url)

Multiple reference images (not an OpenAI standard field, so pass it through extra_body):

response = client.images.generate( model="doubao-seedream-5-0-260128", prompt="The same person at the store counter, medium shot, cold white light", size="2K", extra_body={ "images": [ "https://example.com/scene.jpg", "https://example.com/person.jpg", ], "watermark": False, }, )

Reference images must be reachable over public HTTPS.

7. Try It and Call It

  • Try it: sign in to the console and open the Image tab in the Playground
  • Call it: see the Image Generation API
Last updated on