API Reference

request and response description

Background Generation contract

Below, you can see all possible options for the request body. See the AI Background Options and Image generation I/O sections to learn more about Background Generation options.

{
  "output": {
    "destination": "storage://storage-name/path/"
    "number_of_images": 4,
    "format": "png"
  },
  "object": {
    "image_url": "storage://storage-name/path/image.png",
    "placement_type": "absolute" | "original",
    "rotation_degree": 0,
    "scale": 1,
    "position": {
      "x": 0.5,
      "y": 0.5
    }
  },
  "scene": {
    "template_url": "storage://storage-name/path/template.png",
    "template_mode": "transform" | "adjust" | "lock",
    "color": "#aece8c",
    "view": "top",
    "prompt": "on the wooden table in the dark room",
    "negative_prompt": "watermark, low quality",
    "steps": 25,
    "aspect_ratio": "1:1"
  }
}

Request

POST /v1-ea/scene/create HTTP/1.1
Host: api.claid.ai
Authorization: Bearer {YOUR_API_KEY}
Content-Type: application/json

{
  "object": {
    "image_url": "https://images.claid.ai/photoshoot-templates/docs/product.png",
    "rotation_degree": 0.0,
    "scale": 0.55,
    "position": {
      "x": 0.35,
      "y": 0.5
    }
  },
  "scene": {
    "template_url": "https://images.claid.ai/photoshoot-templates/docs/scene.png",
    "template_mode": "transform",
    "view": "front",
    "prompt": "marble countertop, marble wall background, monochromatic, bokeh, closeup, professional product photography"
  },
  "output": {
    "number_of_images": 1,
    "format": "png"
  }
}

Read a response

Once you have made the request to https://api.claid.ai/v1-ea/scene/create you will get a response with information about input text and output images.

Image information is shown in the response:

Parameter
Type
Description

ext

string

File extension. Will have png value

mps

integer

Megapixel count

mime

string

MIME type (also known as ‘media type’)

width

integer

Image width in pixels

height

integer

Image height in pixels

format

string

File format. Will have png value

tmp_url

string

Temporary URL of a processed image. Will be empty if output is specified

Response body

{
    "data": {
        "input": {
                "ext": "png",
		"mps": 1.817323,
		"mime": "image/png",
		"format": "PNG",
		"width": 773,
		"height": 2351
        },
        "output": [
            {
                "ext": "png",
                "mps": 1.048576,
                "mime": "image/png",
                "format": "PNG",
                "width": 1024,
                "height": 1024,
                "tmp_url": "https://dl.claid.ai/efca3eae-2eb5-4952-ae83-b300ce41ab90/4bede5530f994346a3ca52d4ae6631a0.png"
            },
            {
               "ext": "png",
                "mps": 1.048576,
                "mime": "image/png",
                "format": "PNG",
                "width": 1024,
                "height": 1024,
                "tmp_url": "https://dl.claid.ai/72226dad-8311-4927-9879-8bb4f3ca38c4/55ccc333e60e463d820e908c899348df.png"
            },
        ]
    }
}

Headers:

See the Request Headers and Response Headers to learn about headers.

Last updated