Expand Canvas
About this tool
How to use it
- Choose this tool.
- Add one picture with Upload, or drag and drop it.
- Type how much to add above, below, left and right, or choose a shape under Or grow to this shape.
- Optionally describe what should appear in the new area.
- Press Generate, then download the result.
What you get back
Try Expand Canvas in the Studio
Use it from your code
cURL
curl -X POST "https://app.h2i.davixlabs.io/v1/ai/generation/expand" \
-H "X-Api-Key: $DAVIX_H2I_API_KEY" \
-F 'files=@document.pdf' \
-F 'on_unsupported=error' \
-F 'top=0' \
-F 'right=0'Node.js
const { DavixH2I } = require('@davixlabs/h2i-sdk');
const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.ai.generation.expand({
"files": 'document.pdf',
"on_unsupported": "error",
"top": 0,
"right": 0
});
console.log(result.data, result.requestId);PHP
<?php
require 'vendor/autoload.php';
$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->ai()->generation()->expand([
'files' => 'document.pdf',
'on_unsupported' => 'error',
'top' => 0,
'right' => 0,
]);
echo $result->requestId;