3 minutes to read - Mar 30, 2023

The Stable Diffusion tutorial: How to use Lexica, the Stable Diffusion AI art image search engine

VISIT
The Stable Diffusion tutorial: How to use Lexica, the Stable Diffusion AI art image search engine
This tutorial will show you how to use Lexica, a new Stable Diffusion image search engine, that has millions of images generated by Stable Diffusion indexed. You can use it to just browse through images to get some inspiration or you can use their API to integrate it into your next project. The big advantage of working with Stable Diffusion based tools like Lexica is that you don't need to generate the images yourself - you can just use the ones that are already indexed. This saves lots of compute power and time.
Table of Contents
1How to use Lexica
2How to use Stable Diffusion based Lexica with the API

The site was created by Sharif Shameem, who hopes it “makes Stable Diffusion prompting a bit less of a dark art and more of a science.”

How to use Lexica

You can find the site at www.lexica.art. It's very simple and easy to use. You can search for images by entering a prompt in the search bar. The prompt can be anything you want, it can be a word, a sentence or even a paragraph.

As mentioned before, you can even generate images on the site as well. Just enter a prompt and click on the generate button. You can also change the parameters of the model like width, height and seed. Furthermore you can add things you want to exclude in your generation.

How to use Stable Diffusion based Lexica with the API

Furthermore, the Lexica team has added a new API feature to get programmatic access to the images. To use Lexica's search API, create a GET request with a query parameter q as your search term. For example, to search for the term "apples", you would make a request to:

GET https://lexica.art/api/v1/search?q=apples

You can even do reverse image search. Just send the image you want and Lexica will return the most similar images. This opens up a lot of possibilities for your next project or hackathon with stable diffusion. For a reverse image search, you can pass in the URL of an image as the query:

GET https://lexica.art/api/v1/search?q=https://media.gettyimages.com/photos/crete-senesi-countryside-in-summer-tuscany-italy-picture-id1411845730

The search response will look like this:

The API will return a JSON object containing an array of 50 image search results.

Article source
loading...