Skip to content

Hunyuan Image · v2.1 · Text to Image

Integrate

Model id hunyuan-image/v2.1/text-to-image
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/hunyuan-image/v2.1/text-to-image?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

This request: $0.10 100 API credits · ≈ ₽10.73 Run it on this page

Get API key
Tencent Text to Image #text-to-image

Hunyuan Image 2.1 text-to-image with negative prompt, optional refiner and reprompting

Tencent · Image

Your first result goes here

Build a request below and run it with your API key. Outputs are copied to our storage, kept forever or 7 days for free.

Build a request

Controls are generated from the model schema. The code and the price update as you change them.

•required

Text instructions used to generate an image.

image_size default square_hd

Target dimensions for the generated image.

num_images default 1

Image count requested for generation.

Advanced negative_prompt · output_format · num_inference_steps · guidance_scale · seed · use_reprompt · use_refiner · enable_safety_checker
default

Concepts to discourage in the generated image, supplied as a negative prompt.

output_format default png

File format for the resulting image.

default 28

Count of denoising steps to perform.

default 3.5

Prompt-following strength: increase this value to make the model follow the prompt more strictly.

Reproducibility seed; None lets the system choose one at random instead of using a caller-specified value.

POST /run/hunyuan-image/v2.1/text-to-image?wait=20 quote → $0.10
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/hunyuan-image/v2.1/text-to-image?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Run this request

Your key stays in this browser: it is sent only to the Doitong API and saved (localStorage) only if you tick Remember. Get an API key

About Hunyuan Image · v2.1 · Text to Image

Generates images from a `prompt` and optional `negative_prompt`. `use_reprompt` is on by default, and `use_refiner` can be enabled for extra quality. Takes 1 to 50 inference steps, defaults to 28, and defaults to the square_hd size. Returns 1 to 4 images in png or jpeg.

Parameters

Send either the canonical name or the native name, not both. Canonical names

NameType DefaultAllowed Description
promptrequired
Typestring
Text instructions used to generate an image.
negative_promptoptional
Typestring
Default
Concepts to discourage in the generated image, supplied as a negative prompt.
image_sizeoptional
Typeobject
Defaultsquare_hd
square_hdsquareportrait_4_3portrait_16_9landscape_4_3landscape_16_9
Target dimensions for the generated image.
num_imagesoptional num_outputs
Typeinteger
Default1
1 – 4
Image count requested for generation.
num_inference_stepsoptional
Typeinteger
Default28
1 – 50
Count of denoising steps to perform.
guidance_scaleoptional
Typenumber
Default3.5
1 – 20
Prompt-following strength: increase this value to make the model follow the prompt more strictly.
seedoptional
Typeinteger | null
Reproducibility seed; None lets the system choose one at random instead of using a caller-specified value.
use_repromptoptional
Typeboolean
Defaulttrue
Enables prompt enhancement, which may improve results.
use_refineroptional
Typeboolean
Defaultfalse
Enables use of the refiner model to improve image quality.
enable_safety_checkeroptional
Typeboolean
Defaulttrue
Safety-checking switch whose off setting requires account authorization. Without that authorization, every request is checked regardless of the setting; true enables the checker.
output_formatoptional
Typeenum
Defaultpng
jpegpng
File format for the resulting image.
required Canonical name, also accepted

Output

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "hunyuan-image/v2.1/text-to-image",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 100,
    "usd": "0.10",
    "charged": 100,
    "refunded": 0
  },
  "input": {
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  },
  "output": {
    "images": [
      {
        "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
        "content_type": "image/jpeg",
        "file_name": "0-output.jpeg",
        "file_size": 1843200,
        "width": 1024,
        "height": 768
      }
    ],
    "seed": 42
  },
  "outputs": [
    {
      "type": "image",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_size": 1843200,
      "width": 1024,
      "height": 768,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
Your files, your choiceEvery outputs[].url is a copy on our storage: kept forever (paid per GB-month) or 7 days for free, by your account setting or ?storage=.
Same shape on every modeltype, url, content_type, width, height and duration, for images, video and audio alike. output is the model’s own result object.
Fields of output
images
array of object {url, content_type, file_name, file_size, width, height}List containing the generated images.
seed
integerBase seed used during generation.

For AI agents: this page as Markdown is at https://doitong.com/en-US/developers/models/hunyuan-image/v2.1/text-to-image.md. All models and guides: https://doitong.com/developers/llms.txt