Skip to main content
Use reference-image search when you have a visual direction for a moodboard, presentation or page and want image candidates to review. Lightdrift accepts an image, a text description, or both. Image-plus-text search lets you supply the visual reference and describe what should matter in the new result. Similarity is not identity verification. A search can return a visually related scene without depicting the same place or object. This example retrieves candidates; it does not select, license or publish an image for you.

Prepare one reference

Choose a JPEG, PNG or WebP image you are authorized to submit. The documented input limits are 5 MiB and 20 megapixels. Images are resized to a maximum 1024-pixel edge before embedding. Check pixel dimensions in your image editor; the script below only checks file size and extension. Set LIGHTDRIFT_API_KEY through your environment’s secret controls. Save this as reference_search.py:
Run one search:
Replace the text with your actual brief. To search only from the reference, omit query. To use a public HTTPS image instead of a local file, send image_url instead of image_base64; do not send both image fields. See Search for the supported controls. A successful search currently costs 0.005(0.005 (5 per 1,000), including a successful response with degraded ranking. Returning five candidates is one search. The script does not retry automatically. Confirm the current price before running it.

Read the response before using an image

The saved JSON retains the whole response, including query_id, candidate metadata and any relaxed or degraded fields. Inspect the previews, actual dimensions and source pages. Keep the full rights object with a selected asset; saving only the file URL loses the information needed to carry credits into your workflow. Check source-declared permission flags and attribution. Unknown values remain unresolved. Lightdrift reports the source’s rights declarations, rather than clearing every use of a person’s likeness, a logo, a building or an artwork. See Rights answers. File URLs can redirect to signed downloads. Follow redirects when fetching a selected file and don’t treat the final signed URL as a permanent asset address. Keep the asset ID and source metadata so your application can retrieve current details later.

Reference search or similar-image lookup?

Similar-image lookup excludes its seed and does not use text reranking. An asset outside the current index is not a valid similarity seed, even if its metadata remains retrievable. Use the reference workflow when your starting point is an external image. Try Lightdrift with one visual brief. Record whether a result fits the brief and can be used with its required credit, or what prevented that decision. Request fields and limits were checked against the live API schema and documentation on September 26, 2026. The script has not been run against an authenticated paid search; no retrieval-quality or latency result is claimed.