mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 13:18:18 +00:00
1.8 KiB
1.8 KiB
Image Generation
You can use Khoj to generate images from text prompts. You can get deeper into the details of our image generation flow in this blog post: https://blog.khoj.dev/posts/how-khoj-generates-images/.
To generate images, you just need to provide a prompt to Khoj in which the image generation is in the instructions. Khoj will automatically detect the image generation intent, augment your generation prompt, and then create the image. Here are some examples:
| Prompt | Image |
|---|---|
| Paint a picture of the plants I got last month, pixar-animation | ![]() |
| Create a picture of my dream house, based on my interests | ![]() |
Setup (Self-Hosting)
You have a couple of image generation options.
OpenAI
- Get an OpenAI API key.
- Setup your OpenAI API key, if you haven't already. See instructions here
- Create a text to image config at http://localhost:42110/server/admin/database/texttoimagemodelconfig/. We recommend the
model namedall-e-3. Make sure to associate it with the OpenAI API chat configuration you setup in step 2 withOpenai configfield.
Flux
- You need a Replicate API key. You can find one here.
- Create a new Text to Image Model. Set the
typetoReplicate. We recommend themodel nameblack-forest-labs/flux-1.1-pro.
Stable Diffusion
- Get an API key from Stable Diffusion.
- Create a new Text to Image Model. Set the
typetoStabilityai. We recommend themodel namesd3-large.

