Upscale Image

March 2, 2026

Table of contents

  1. Request Headers
  2. Request Body
  3. Responses
  4. Examples
  5. Try It

Upscale a generated image to higher resolution (2K, 4K, or 8K). Requires a completed image generation job from POST /images.

Upscale is asynchronous — poll GET /images/jobid for the result.

https://api.useapi.net/v1/dreamina/images/upscale

Request Headers

Authorization: Bearer {API token}
Content-Type: application/json

Request Body

{
  "jobid": "j0302140530123456789i-u12345-US:[email protected]:dreamina",
  "imageIndex": 0,
  "upscaleResolution": "4k"
}
  • jobid is required. The job ID of a completed image generation job from POST /images.
  • imageIndex is optional. Index of the image to upscale from the source job (0-3, default: 0). Each generation produces up to 4 images.
  • upscaleResolution is optional. Target resolution (default: 4k). Supported values: 2k, 4k, 8k.
  • originalImageStrength is optional. How much of the original image to preserve (0-1, default: 0.65).
  • detailStrength is optional. Detail enhancement level (0-1, default: 0.5).
  • replyUrl is optional, webhook URL for job status callbacks.
  • replyRef is optional, custom reference string passed back in webhook callbacks.
  • maxJobs is optional, override max concurrent jobs for this request (1-50).

Responses

  • 200 OK

    Upscale job created. Poll GET /images/jobid for the result.

    {
      "jobid": "j0302140630123456789I-u12345-US:[email protected]:dreamina",
      "type": "upscale",
      "status": "created",
      "model": "seedream-4.0",
      "created": "2026-03-02T14:06:30.123Z",
      "request": {
        "jobid": "j0302140530123456789i-u12345-US:[email protected]:dreamina",
        "imageIndex": 0,
        "resolution": "4k"
      },
      "response": {
        "forecastCost": 0
      },
      "code": 200
    }
    
  • 400 Bad Request

    Validation error.

    {
      "error": "Parameter jobid is required"
    }
    
    {
      "error": "Source image job is created, must be completed"
    }
    
  • 401 Unauthorized

    Invalid API token.

    {
      "error": "Unauthorized"
    }
    
  • 404 Not Found

    Source image job not found.

    {
      "error": "Source image job not found"
    }
    

Examples

  • curl -X POST \
         -H "Authorization: Bearer YOUR_API_TOKEN" \
         -H "Content-Type: application/json" \
         -d '{
           "jobid": "j0302140530123456789i-u12345-US:[email protected]:dreamina",
           "imageIndex": 0,
           "upscaleResolution": "4k"
         }' \
         "https://api.useapi.net/v1/dreamina/images/upscale"
    
  • const token = 'YOUR_API_TOKEN';
    
    const response = await fetch('https://api.useapi.net/v1/dreamina/images/upscale', {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${token}`,
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        jobid: 'j0302140530123456789i-u12345-US:[email protected]:dreamina',
        imageIndex: 0,
        upscaleResolution: '4k'
      })
    });
    
    const result = await response.json();
    console.log('Upscale job:', result.jobid);
    
    // Poll for completion
    const poll = async (jobid) => {
      while (true) {
        const res = await fetch(`https://api.useapi.net/v1/dreamina/images/${jobid}`, {
          headers: { 'Authorization': `Bearer ${token}` }
        });
        const job = await res.json();
        if (job.status === 'completed') {
          console.log('Upscaled:', job.response.images[0].width, 'x', job.response.images[0].height);
          return job;
        }
        if (job.status === 'failed') throw new Error(job.error);
        await new Promise(r => setTimeout(r, 10000));
      }
    };
    
    await poll(result.jobid);
    
  • import requests
    import time
    
    token = 'YOUR_API_TOKEN'
    
    response = requests.post(
        'https://api.useapi.net/v1/dreamina/images/upscale',
        headers={
            'Authorization': f'Bearer {token}',
            'Content-Type': 'application/json'
        },
        json={
            'jobid': 'j0302140530123456789i-u12345-US:[email protected]:dreamina',
            'imageIndex': 0,
            'upscaleResolution': '4k'
        }
    )
    
    result = response.json()
    print(f"Upscale job: {result['jobid']}")
    
    # Poll for completion
    jobid = result['jobid']
    while True:
        job = requests.get(
            f'https://api.useapi.net/v1/dreamina/images/{jobid}',
            headers={'Authorization': f'Bearer {token}'}
        ).json()
    
        if job['status'] == 'completed':
            img = job['response']['images'][0]
            print(f"Upscaled: {img['width']}x{img['height']}")
            break
        if job['status'] == 'failed':
            raise Exception(job.get('error'))
    
        time.sleep(10)
    

Try It