Sketch to Real API
Transform hand-drawn sketches or simple outlines into fully realized, high-quality images.
GET/api/image/sketch-to-real-prompts
Retrieve a list of all available pre-defined styles and prompts for Sketch to Real.
Example Request
curl -X GET 'https://codingmantra.com/api/image/sketch-to-real-prompts'Example Response
{
"data": [
{
"id": "modern-villa",
"title": "Modern Minimalist Villa",
"categoryId": "architecture",
"categoryTitle": "Architecture & Buildings",
"style": "Photorealistic",
"demoImageUrl": "https://..."
},
// ... more prompts
]
}POST/api/image/sketch-to-real
Generate a realistic image from a sketch input.
Request Body
| Field | Type | Description |
|---|---|---|
| sketchImage | string | Required. The sketch image as a data URI. |
| prompt | string | Required. A description of the desired output. |
| style | string | Optional. The artistic style (e.g., 'Photorealistic', 'Cinematic'). |
| referenceImage | string | Optional. A data URI or URL of a reference image to guide the style. |
| negativePrompt | string | Optional. Elements to avoid in the generation. |
| outputShape | string | Optional. Default: `'1:1'`. |
| outputResult | string | Optional. `'base64'` (default) or `'url'`. |
Example Request
curl -X POST 'https://codingmantra.com/api/image/sketch-to-real' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{
"sketchImage": "data:image/png;base64,iVBORw0KGgo...",
"prompt": "a modern luxury villa in a forest",
"style": "Photorealistic",
"outputShape": "16:9"
}'Example Response
{
"data": {
"photoDataUri": "data:image/png;base64,..."
}
}