Design0: Effortless Design for Everyone

This is a submission for the Open Source AI Challenge with pgai and Ollama

What I Built

As a non-professional designer seeking to create attractive posts and cover images for my blogs and projects, I envisioned a tool that would allow me t…


This content originally appeared on DEV Community and was authored by ppaanngggg

This is a submission for the Open Source AI Challenge with pgai and Ollama

What I Built

As a non-professional designer seeking to create attractive posts and cover images for my blogs and projects, I envisioned a tool that would allow me to select a base image, highlight specific areas, and use natural language to instruct AI on desired edits, overcoming the unpredictability of current text-to-image generators.

Enter Design0—an AI-powered design tool I built to simplify image editing with natural language commands. Using Design0, you can search an image database by description (I've included 5,000 free Unsplash images for this demo). Once you've found your image, simply drag and drop to mask areas for editing, then write prompts describing your desired changes. Click "Edit" and watch the magic unfold! 🎉

Demo

Website

https://design0.app

Source Code

https://github.com/ppaanngggg/design0

Screenshots

  1. Search for the base image you want

    homepage

  2. Select the area you want to edit, then enter your prompt

    edit and prompt

  3. Click "Edit" and wait for the new image to generate

    final image

Tools Used

  1. pgvector: I use pgvector to store image embeddings as vector data types. I also added an HNSW index on the embeddings to accelerate search performance.

    CREATE TABLE IF NOT EXISTS images
    (
        id          varchar PRIMARY KEY,
        url         varchar,
        category    varchar,
        description varchar,
        embedding   vector(768)
    );
    
    CREATE INDEX IF NOT EXISTS images_embedding_idx ON images
        USING hnsw (embedding vector_cosine_ops);
    
  2. pgai: I use pgai to invoke Ollama's embed API and search for images based on the distance between embeddings.

    sql = f"SELECT id,url,category,description,embedding<=>ai.ollama_embed('nomic-embed-text', %s, host=>'{conf.ollama_host}') as distance FROM images"
    
  3. Ollama: I use Ollama to host the state-of-the-art, compact text embedding model nomic-embed-text. This model embeds both image descriptions and user queries, allowing us to search for images that match users' requirements.

Final Thoughts

This demo showcases my 2D image design tool. I aim to develop it into a fully functional SaaS platform, empowering non-professional users to create stunning designs on their own.

I use Ollama to host the embedding model, which qualifies me for the 'Open-source Models from Ollama' prize.


This content originally appeared on DEV Community and was authored by ppaanngggg


Print Share Comment Cite Upload Translate Updates
APA

ppaanngggg | Sciencx (2024-11-06T01:36:54+00:00) Design0: Effortless Design for Everyone. Retrieved from https://www.scien.cx/2024/11/06/design0-effortless-design-for-everyone/

MLA
" » Design0: Effortless Design for Everyone." ppaanngggg | Sciencx - Wednesday November 6, 2024, https://www.scien.cx/2024/11/06/design0-effortless-design-for-everyone/
HARVARD
ppaanngggg | Sciencx Wednesday November 6, 2024 » Design0: Effortless Design for Everyone., viewed ,<https://www.scien.cx/2024/11/06/design0-effortless-design-for-everyone/>
VANCOUVER
ppaanngggg | Sciencx - » Design0: Effortless Design for Everyone. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/11/06/design0-effortless-design-for-everyone/
CHICAGO
" » Design0: Effortless Design for Everyone." ppaanngggg | Sciencx - Accessed . https://www.scien.cx/2024/11/06/design0-effortless-design-for-everyone/
IEEE
" » Design0: Effortless Design for Everyone." ppaanngggg | Sciencx [Online]. Available: https://www.scien.cx/2024/11/06/design0-effortless-design-for-everyone/. [Accessed: ]
rf:citation
» Design0: Effortless Design for Everyone | ppaanngggg | Sciencx | https://www.scien.cx/2024/11/06/design0-effortless-design-for-everyone/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.