Discussions

Ask a Question
Back to All

How to create vertical (9:16) videos with D-ID's /talks endpoint?

Hello,

I'm trying to generate vertical videos (9:16 aspect ratio) for social media content using D-ID's /talks endpoint, but I'm having difficulty getting anything other than square videos.

I'm using n8n as my workflow automation tool and sending requests to the D-ID API. My image source is already in a 9:16 ratio, but the output videos are always square (1080x1080 or other square dimensions regardless of the resolution value I set).

Here's my current request body:

{
  "source_url": "https://my-bucket.s3.region.amazonaws.com/image/filename.png",
  "driver_url": "bank://lively/driver-05",
  "name": "filename",
  "script": {
    "type": "audio",
    "audio_url": "s3://d-id-audios-prod/google-oauth2|123456789/AbCdEfGhIjKlMnOpQrSt/filename.wav"
  },
  "config": {
    "result_format": "mp4",
    "fluent": true,
    "output_resolution": 1080,
    "driver_expressions": {
      "expressions": [
        {
          "start_frame": 0,
          "expression": "happy",
          "intensity": 0.7
        }
      ]
    }
  }
}

I've tried:

  1. Different values for output_resolution (720, 1080, 1280)
  2. Trying to set output_resolution as an object with width and height properties, but this returns a validation error: "invalid float number"
  3. Different driver_url options

In every case, the resulting video is always square. According to the n8n interface, output_resolution is documented as a double value between 150 and 1280, and the description says "The output resolution sets the maximum height or width of the output video. The aspect ratio is preserved from the source image."

However, it seems the aspect ratio is not being preserved in my case. The metadata in the response shows "resolution": [1080, 1080] even though my source image is in 9:16 format.

Has anyone successfully created vertical videos with the /talks endpoint? Is there a specific parameter I'm missing or a different approach I should take?

Thank you for your help!