Plus plan

Sketch to image / room redesign / try-on

Turn a sketch, room photo or person photo into a finished image
POST
/v1/ai/generation/sketch

About this tool

This tool has three uses. It can turn a rough drawing into a finished picture, redesign a photo of a room in a new style, or show a person wearing a garment from a second picture (a virtual try-on). You choose which one you need, and you can keep the layout as it is. It uses AI (a computer program that creates images), so results can vary.
For example, you have a photo of your living room and you want to see it in a bright Scandinavian style with white and oak colours.

How to use it

  1. Choose this tool.
  2. Add your picture with Upload, or drag and drop it. For try-on, add a second picture of the garment.
  3. Under What is the picture, choose A sketch, A room or A person.
  4. Fill in the extra choices that appear, such as the room type, colours or what should be worn.
  5. Press Generate, then download the result.

What you get back

You get a new picture based on your sketch, room or person photo. You can download it or ask for several versions to compare.
TEST IT LIVE

Try Sketch to image / room redesign / try-on in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
AI
Plan
Plus
Method
POST
Endpoint
/v1/ai/generation/sketch
Tool ID
ai.generation.sketch
Authentication
API key
Accepts
Text and settings
Background jobs
Yes
Usage group
Ai
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/ai/generation/sketch" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'files=@document.pdf' \
  -F 'on_unsupported=error' \
  -F 'n=1' \
  -F 'output_format=png'

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.sketch({
    "files": 'document.pdf',
    "on_unsupported": "error",
    "n": 1,
    "output_format": "png"
  });
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()->sketch([
    'files' => 'document.pdf',
    'on_unsupported' => 'error',
    'n' => 1,
    'output_format' => 'png',
]);
echo $result->requestId;
FAQ

Frequently asked questions

Finish a sketch, redesign a room photo in a style, or show a person wearing a garment from a second picture. Readiness: unbenchmarked (see GET /v1/ai/capabilities/generation.sketch).

Classification: ai. Deterministic stages: upload content sniffing, input image normalisation (Sharp), generated image validation and re-encoding (Sharp), signed-URL output.

Sketch to image / room redesign / try-on works from text and settings, so no file is needed. Every input is optional.

Not on the Free plan: Sketch to image / room redesign / try-on is available on the Plus plan and above. Free accounts can upgrade any time to use it. Each run uses credits from your monthly allowance.

Send a POST request to /v1/ai/generation/sketch with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.