LightGlue DISK

LIGHTGLUE_DISK

Finds the points two pictures have in common and pairs them up: send two photos of one scene and get the matching points with a confidence, for stitching, alignment, camera pose and 3D work. Fine-tune it on your own picture pairs.

Utilitieskeypoint-matchingfeature-matchingimage-registrationstitching3d-reconstructionapache-2.0Fine-tunable
LightGlue DISK: Utilities model on Kainguru

About LightGlue DISK

Capabilities

  • Point pairs — the matching points of two pictures, each in its own picture's pixels, best first, with a confidence for every pair
  • Any two views — photos of the same scene from different positions, scales or lighting
  • You set the effort — up to 4096 keypoints a picture, with the pictures scaled to between 256 and 1600 pixels on the longer side
  • Fine-tunable — train the matcher on pairs from your own pictures

Good to know

  • Pictures are PNG, JPEG or WebP, up to 30 MB and 40 megapixels each, at least 32 pixels a side and at most 8 times longer than wide. Both are scaled to the resolution you ask for (1024 pixels on the longer side by default) before keypoints are found; the points come back in the pictures' own pixels as displayed (after their EXIF rotation), with pixel centres at whole numbers as in OpenCV.
  • A point is matched with at most one point of the other picture. The threshold (0.1 by default) keeps the pairs whose confidence is above it; raise it for fewer, surer pairs.
  • Fine-tuning takes one ZIP (at most 4 GB, 5000 entries, no password) with a manifest.jsonl of 4 to 1000 lines, each either {"file": "a.jpg"}, a picture the trainer warps into two random views of itself, or {"image0": "a.jpg", "image1": "b.jpg", "homography": [[...], [...], [...]]}, a real pair whose 3 x 3 homography takes pixels of the first picture to pixels of the second. Paths are relative to the manifest, and manifest.jsonl is at most 16 MB.
  • Only the matcher learns; the keypoint finder stays as published. Training uses views of at most 640 pixels on the longer side with 512 keypoints each, counts a pair as matched where the homography puts a point within 3 pixels of a point of the other view, and stops after 5,000 steps or 9 hours, whichever comes first, keeping what it learned.

Attribution

LightGlue by Philipp Lindenberger, Paul-Edouard Sarlin and Marc Pollefeys (cvg/LightGlue) and DISK by Michal Tyszkiewicz, Pascal Fua and Eduard Trulls (cvlab-epfl/disk), both released under the Apache License 2.0; run with Kornia (Apache License 2.0).

LightGlue DISK inputs and output

NameTypeRequiredDefaultDetails
image0fileYes—The first picture: PNG, JPEG or WebP, at most 30 MB and 40 megapixels, at least 32 pixels a side.
1–2048 characters · image/png, jpeg, webp
image1fileYes—The second picture, held to the same limits.
1–2048 characters · image/png, jpeg, webp
max_keypointsintegerNo2048The most keypoints found in each picture; more finds more matches and takes longer.
64–4096
thresholdnumberNo0.1Lowest confidence of a returned match, 0 to 1; higher returns fewer, surer matches.
0–1
resolutionintegerNo1024The longer side, in pixels, both pictures are scaled to before keypoints are found.
256–1600

Output. JSON: {"image0": {"width", "height", "keypoints"}, "image1": {...}, "count", "matches": [[x0, y0, x1, y1, score], ...]} best first; x, y in pixels of each picture.

Run LightGlue DISK with the API

Send your API key in the X-API-Key header. The run is asynchronous: submit it, then poll it until it finishes. Create an API key.

cURL
curl -X POST "https://api.kainguru.com/api/v1/executions?mlFlowId=LIGHTGLUE_DISK" \
  -H "X-API-Key: kg_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {
    "image0": "https://example.com/input.png",
    "image1": "https://example.com/input.png",
    "max_keypoints": 2048,
    "resolution": 1024,
    "threshold": 0.1
  },
  "outputFormat": "json"
}'

# Poll until the execution reaches a terminal state
curl "https://api.kainguru.com/api/v1/executions/{executionId}" \
  -H "X-API-Key: kg_your_api_key"
Python
from kainguru import KainguruClient

with KainguruClient(api_key="kg_your_api_key", base_url="https://api.kainguru.com/api") as client:
    submitted = client.executions.execute(
        "LIGHTGLUE_DISK",
        {
          "image0": "https://example.com/input.png",
          "image1": "https://example.com/input.png",
          "max_keypoints": 2048,
          "resolution": 1024,
          "threshold": 0.1
        },
        output_format="json",
    )
    result = client.executions.await_completion(submitted.id)
    print(result.execution.output)

Fine-tune LightGlue DISK

You can fine-tune LightGlue DISK on your own data and run the tuned model through the same API. Dataset: One ZIP (at most 4 GB, no password) with the pictures and a manifest.jsonl of 4 to 1000 lines: {"file"} for a picture to warp into pairs, or {"image0", "image1", "homography"}. More rules: Good to know, in the README.

The steps are in the docs.

LightGlue DISK pricing

Price per image: 0.0874 credits ($0.000874). The price is shown again before every run; all prices are on the pricing page.

Licence and source

SAM 2.1 Hiera Large: Utilities model on Kainguru
Utilities

SAM 2.1 Hiera Large

Click or draw a box on an object and get back a mask outlining it.

Fine-tunable
Grounded SAM 2: Utilities model on Kainguru
Utilities

Grounded SAM 2

Outlines the things you name in a picture, such as "red car, person with a helmet", with a mask and a box for each one.

Fine-tunable
Depth Anything v2 Small: Utilities model on Kainguru
Utilities

Depth Anything v2 Small

Turns any photo into a depth map that shows which parts are near and which are far.

Fine-tunable
DWPose Wholebody: Utilities model on Kainguru
Utilities

DWPose Wholebody

Finds every person in a photo and returns 133 keypoints for each: body, feet, face and both hands, as JSON in the…

Fine-tunable
MODNet Portrait Matting: Utilities model on Kainguru
Utilities

MODNet Portrait Matting

Cuts people out of photos with a soft alpha matte that keeps hair and fine edges, and returns the cutout or the matte…

Fine-tunable
Prithvi-EO 2.0 Sen1Floods11: Utilities model on Kainguru
Utilities

Prithvi-EO 2.0 Sen1Floods11

Maps water and floods from satellite images: send a Sentinel-2 GeoTIFF and get a water mask at the image's size, with…

Fine-tunable