Sketch AI
1 tokenToolsConvert sketches to photorealistic renders
Overview
Sketch AI transforms hand-drawn sketches, line drawings, and rough floor plans into photorealistic renders. Upload your sketch and the AI generates a realistic interpretation. You can specify a design style and provide a reference image for style matching. Perfect for architects and designers who want to quickly visualize rough concepts.
Image input
Endpoint
POST /api/v1/generatebash
curl -X POST https://roomai.com/api/v1/generate \
-H "Authorization: Bearer rai_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{"model": "sketch", ...}'Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Required | Must be "sketch". sketch |
image | string | Required | URL of the sketch or line drawing. |
styles | string | Optional | Design style to apply to the render. ModernMinimalistScandinavianIndustrialMid-Century ModernContemporary |
style_transfer | string | Optional | URL of a reference image to match the visual style. |
prompt | string | Optional | Additional description of the sketch (e.g. "an open-plan kitchen with an island counter"). |
format | string | Optional | Output format. Default: png |
Request Example
json
{
"model": "sketch",
"image": "https://example.com/kitchen-sketch.jpg",
"styles": "modern",
"prompt": "open-plan kitchen with marble island and pendant lights"
}Response
Success (200)
json
{
"status": "success",
"result": {
"image_url": "https://storage.googleapis.com/...",
"model": "sketch",
"tokens_used": 1,
"processing_time_ms": 4500
}
}Error
json
{
"status": "error",
"error": {
"code": "INSUFFICIENT_TOKENS",
"message": "Not enough tokens",
"required": 1,
"balance": 0
}
}Code Examples
cURL
bash
curl -X POST https://roomai.com/api/v1/generate \
-H "Authorization: Bearer rai_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"model": "sketch",
"image": "https://example.com/kitchen-sketch.jpg",
"styles": "modern",
"prompt": "open-plan kitchen with marble island and pendant lights"
}'JavaScript / Node.js
javascript
const response = await fetch("https://roomai.com/api/v1/generate", {
method: "POST",
headers: {
"Authorization": "Bearer rai_live_your_api_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "sketch",
"image": "https://example.com/kitchen-sketch.jpg",
"styles": "modern",
"prompt": "open-plan kitchen with marble island and pendant lights"
}),
});
const data = await response.json();
if (data.status === "success") {
console.log("Image URL:", data.result.image_url);
console.log("Tokens used:", data.result.tokens_used);
} else {
console.error("Error:", data.error.message);
}Python
python
import requests
response = requests.post(
"https://roomai.com/api/v1/generate",
headers={
"Authorization": "Bearer rai_live_your_api_key",
"Content-Type": "application/json",
},
json={
"model": "sketch",
"image": "https://example.com/kitchen-sketch.jpg",
"styles": "modern",
"prompt": "open-plan kitchen with marble island and pendant lights"
},
)
data = response.json()
if data["status"] == "success":
print("Image URL:", data["result"]["image_url"])
print("Tokens used:", data["result"]["tokens_used"])
else:
print("Error:", data["error"]["message"])Tips
- 1Works with pencil sketches, pen drawings, architectural line drawings, and even rough digital sketches.
- 2Include a "prompt" to help the AI understand what the sketch represents.
- 3Use "style_transfer" with a reference photo to match a specific visual style from a magazine or portfolio.
- 4Clean, high-contrast sketches on white backgrounds produce the best results.