Skip to content

Smart Resize

Integrate

Model id smart-resize
# 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/smart-resize?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
    "target_sizes": [
      "1024x1024",
      "1920x1080",
      "768x1344"
    ]
  }'

# 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"

Files like the example: $0.50 500 API credits · ≈ ₽52.73 your files are measured before the run Run it on this page

Get API key
Utility Image Editing 4K outputup to 4K #realism#typography#visual#ads

Recomposes an image to up to 10 target dimensions, useful for ad and crop variants

Utility · 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.

0 / 5000

Additional guidance for resizing: an empty value asks the model to keep the source content as faithful as possible. Any supplied instruction accompanies the automatically generated resizing prompt sent to nano-banana-pro.

•required image_url
Drop a file, or

Source image URL for resizing.

resolution default 1K

Internal resolution-tier hint establishing a minimum, not the final dimensions specified by `target_sizes`. If that tier cannot accommodate a requested size, smart resizing may automatically choose a higher one.

default 1

Per-size variant count for nano-banana-pro, determining the total returned image count as `len(target_sizes) * num_images_per_size`.

•required

Requested output dimensions as a list of `<width>x<height>` strings, for example `"1920x1080"`. Each target is covered by a nano-banana-pro preset chosen to be as small as possible while still covering the requested dimensions, giving an exact pixel match without upscaling. The image count for each size is one multiplied by `num_images_per_size`.

Advanced output_format · safety_tolerance · seed
output_format default png

Format for generated images.

safety_tolerance default 4

Safety tolerance: increasing this number makes filtering less strict for the internal nano-banana-pro /edit calls.

Optional reproducibility seed shared across all target sizes. When supplied, it is passed through to the internal nano-banana-pro /edit calls.

POST /run/smart-resize?wait=20 quote → $0.50
# 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/smart-resize?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
    "target_sizes": [
      "1024x1024",
      "1920x1080",
      "768x1344"
    ]
  }'

# 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 Smart Resize

Resizes a source image to arbitrary sizes by regenerating the composition rather than simply cropping. Give `target_sizes` as 1 to 10 strings like "1920x1080", with 1 to 4 variants each via `num_images_per_size`. An optional `prompt` of up to 5000 characters adds instructions. `resolution` is 1K, 2K or 4K, and output is png, jpeg or webp.

Parameters

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

NameType DefaultAllowed Description
image_urlrequired image
Typeurl · image
Source image URL for resizing.
target_sizesrequired
Typestring[]
≤ 10 items
Requested output dimensions as a list of `<width>x<height>` strings, for example `"1920x1080"`. Each target is covered by a nano-banana-pro preset chosen to be as small as possible while still covering the requested dimensions, giving an exact pixel match without upscaling. The image count for each size is one multiplied by `num_images_per_size`.
promptoptional
Typestring
Default
≤ 5,000 characters
Additional guidance for resizing: an empty value asks the model to keep the source content as faithful as possible. Any supplied instruction accompanies the automatically generated resizing prompt sent to nano-banana-pro.
num_images_per_sizeoptional
Typeinteger
Default1
1 – 4
Per-size variant count for nano-banana-pro, determining the total returned image count as `len(target_sizes) * num_images_per_size`.
resolutionoptional
Typeenum
Default1K
1K2K4K
Internal resolution-tier hint establishing a minimum, not the final dimensions specified by `target_sizes`. If that tier cannot accommodate a requested size, smart resizing may automatically choose a higher one.
output_formatoptional
Typeenum
Defaultpng
jpegpngwebp
Format for generated images.
safety_toleranceoptional
Typeenum
Default4
123456
Safety tolerance: increasing this number makes filtering less strict for the internal nano-banana-pro /edit calls.
seedoptional
Typeinteger | null
Optional reproducibility seed shared across all target sizes. When supplied, it is passed through to the internal nano-banana-pro /edit calls.
required Canonical name, also accepted

File parameters take a public https:// URL, a data: URI up to 10 MB, or the file_url of an upload. Files

Output

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "smart-resize",
  "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": 500,
    "usd": "0.50",
    "charged": 500,
    "refunded": 0
  },
  "input": {
    "image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
    "target_sizes": [
      "1024x1024",
      "1920x1080",
      "768x1344"
    ]
  },
  "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
      }
    ],
    "description": "string",
    "results": [
      {
        "images": [
          {}
        ],
        "description": "string",
        "width": 1024,
        "height": 768,
        "aspect_ratio": "string",
        "resolution": "string"
      }
    ]
  },
  "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}Combined image list with `num_images_per_size` entries for `target_sizes[0]` first, then equivalent groups for subsequent `target_sizes`. It includes every generated image in the same sequence as `results`.
description
stringDescription accompanying the generated images.
results
array of object {images, description, width, height, aspect_ratio, resolution}Requested width and height for each target, paired with the nano-banana-pro preset used during processing, identified by its aspect_ratio and resolution.

For AI agents: this page as Markdown is at https://doitong.com/en-US/developers/models/smart-resize.md. All models and guides: https://doitong.com/developers/llms.txt