Storing and Searching Your Stable Diffusion Images
Store your Stable Diffusion, MidJourney, Dall-E and more images using a simple interface or API. Gain access to file analytics, management, visibility and more.
The AI-revolution is amongst us. This means an explosion in content created by tools like Stable Diffusion, MidJourney, Dall-E, and many many more. Something I've been asking myself is where is everyone storing these? Today it's just pictures, but soon it will be videos, texts, even powerpoint presentations.
According to OpenAI:
More than 3 million people are already using DALL·E to extend their creativity and speed up their workflows, generating over 4 million images a day.
I've been building Mixpeek as an "intelligence layer" on top of traditional cold storage, serving up headless version control, indexing, searching, and analytics for developers that want to enhance their application's search experience.
This will be a quick tutorial in which we will use HuggingFace's stableDiffusion
library to generate an image, store it in Mixpeek's indexer, then quickly retrieve it.
Generate the Image
from diffusers import StableDiffusionPipeline, DPMSolverMultistepScheduler
model_id = "stabilityai/stable-diffusion-2-1"
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
pipe = pipe.to("cuda")
image = pipe("a photo of an astronaut riding a horse on mars").images[0]
image.save("astronaut_rides_horse.png")
Index the Image
from mixpeek import Mixpeek
mix = Mixpeek("YOUR_API_KEY")
# store the stable diffusion output in your own mixpeek cloud store
mix.index(
"astronaut_rides_horse.png",
description="a photo of an astronaut riding a horse on mars",
tags="stable-diffusion, space, animal, scifi",
save=True
)
Search your Assets
mix.search("space horse")
[
{
"file_id": "63a86c1bf1fc46279ef7614d",
"filename": "astronaut_rides_horse.png",
"importance": "95%"
},
{
"file_id": "63a86c21f1fc46279ef7614e",
"filename": "cowboy_on_mars.png",
"importance": "72%"
}
]
On top of search we have the following capabilities across the tooling
and analytics
API set to make your life easier:
- Analytics - See which searches are most popular, which yield no results, and which lead to a conversion (clickthrough)
- Deduplication - Find similar appearing images to reduce redundancies
- Alerts - Become notified when similar assets are added to your Mixpeek directory
- Many, many more.
Mixpeek is a multimodal indexing and search service. We offer managed APIs that are faster, cheaper, and more relevant than the competition all while providing impressive tooling on top.