Raw schema
{
"type": "object",
"properties": {
"input_key": {
"type": "string",
"description": "The image: the `input_key` upload_photo answered with, or a File ID the user copied from their CraterView.ai workspace."
},
"params": {
"type": "object",
"properties": {
"scale": {
"type": "number",
"minimum": 1,
"maximum": 4,
"default": 4,
"description": "Enlargement factor, from 1 to 4; it need not be a whole number. The result is your image, or the region you name, this many times larger in each direction, rounded down to whole pixels. Send scale, width or height, only one; with none, the factor is 4. With binning, the largest factor is 4 divided by the block's side, and that is the default: 2 at 2x2, 4/3 at 3x3 and 1 at 4x4. The image and the result must fit your key's limits; if not, name a smaller region or enlarge less.\n"
},
"width": {
"type": "integer",
"minimum": 1,
"description": "The width of the result in pixels, instead of a scale; the height keeps the proportions of your image or region. From 1 to 4 times the width worked on, or with binning from 1 to 4 divided by the block's side. Send width, height or scale, only one.\n"
},
"height": {
"type": "integer",
"minimum": 1,
"description": "The height of the result in pixels, instead of a scale; the width keeps the proportions of your image or region. From 1 to 4 times the height worked on, or with binning from 1 to 4 divided by the block's side. Send width, height or scale, only one.\n"
},
"roi": {
"type": "object",
"additionalProperties": false,
"required": [
"x",
"y",
"width",
"height"
],
"properties": {
"x": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"y": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"width": {
"type": "number",
"exclusiveMinimum": 0,
"maximum": 1
},
"height": {
"type": "number",
"exclusiveMinimum": 0,
"maximum": 1
}
},
"description": "The part of the image to work on, as fractions of the width and height of **the image you send**, from the top left. Everything outside it is discarded first, so a region is how a large image fits your key's limits at full detail. Omit it for the whole image. If you cropped the file yourself, use the cropped image's coordinates, not the original's. A region past an edge is trimmed to the image.\n"
},
"binning": {
"type": "string",
"enum": [
"off",
"2x2",
"3x3",
"4x4"
],
"default": "off",
"description": "Simple noise reduction by pixel binning of your image or region before it is enlarged: off, or 2x2, 3x3 or 4x4, where each square block of that many pixels is averaged into one. Binning takes noise out, more with a larger block, and costs enlargement: the largest scale is 4 divided by the block's side, 2 at 2x2, 4/3 at 3x3 and 1 at 4x4, and that is the scale you get if you send no size. In return the image or region may be larger by the block's area. It is for a noisy photograph you are enlarging, from low light or a high ISO, and never a way to fit a larger clean image: on a clean one it redraws the finest texture, so name a region with roi instead. To take noise out without enlarging, use Denoise, which does that much better.\n"
},
"output_format": {
"type": "string",
"enum": [
"auto",
"png",
"jpeg",
"webp"
],
"default": "auto",
"description": "The format of the result. auto keeps the format you sent, except HEIC and HEIF, which prefer JPEG, and TIFF, which comes back as PNG. Any format is a preference, and the result is PNG where it cannot hold the image whole: JPEG holds no alpha channel and at most 65,500 pixels a side, WebP at most 16,383 pixels a side, and both 8 bits per channel. A deeper image keeps its depth, colours keep their space, and greyscale comes back as colour (RGB). WebP halves colour resolution; PNG and JPEG keep it whole. result.output.content_type says which format came back.\n"
},
"quality": {
"type": "integer",
"minimum": 96,
"maximum": 100,
"default": 96,
"description": "Encoder quality for jpeg and webp.\n"
}
},
"description": "Settings for this model. Leave out anything not asked for: each has a default.\n\nscale: left out, the largest factor whose result fits inside the model's size limit for this account is used — not the model's own default, which a whole photograph usually cannot have.\n\nroi: **look at the image and name the subject.** Everything outside it is discarded, so what comes back is made from this part alone — a face in a group photograph, a sign in the distance, the animal rather than the field — and it may be any shape that fits the subject. A region is how a large photograph gets the full factor on the part worth enlarging."
}
},
"required": [
"input_key"
],
"additionalProperties": false
}