To add images you can do one of two things:

  1. Upload it to the github repository manually, outside of the Lovable UI
  2. Share an external image URL in the chat. a. Note: This will not work if the server hosting the URL has chosen to block external websites from using it with “CORS”

Below, we’ll walk you through the two methods.

By default, if Lovable recognizes the need to use images in your projects, it will use placeholder images - gray, neutral images to improve user experience and orientation.

Using the techniques described below, you can replace those placeholder images with more relevant, and contextually meaningful images.

Using an external image URL

One way to add images to your project is by referencing an image from an external URL. This method allows you to use images hosted on external platforms like Unsplash, Imgur, or any other image-hosting service. Be mindful of use copyrights!

Here’s how to prompt Lovable to use an external image:

  • First, find the image you want to use. For example, you can visit a site like Unsplash, select an image, and copy its URL.
  • In your project prompt, simply tell Lovable to use that image by specifying the URL. For example:
Use the image from this URL 
https://upload.wikimedia.org/wikipedia/commons/thumb/7/73/Pale_Blue_Dot.png/442px-Pale_Blue_Dot.png 
for the hero section image.


Using images from your GitHub public directory

Another method to add images to your Lovable project is by using images uploaded to the public directory of your connected GitHub repository. Here’s how you can do it:

Connect your GitHub repository - Ensure your project is connected to your GitHub repo. Here’s how to connect your repo.

Locate the public folder - Inside your GitHub repository, navigate to the public directory. This folder is typically used for hosting assets like images that can be referenced in your project. Click on Add file and then from a dropdown, select Upload files option.

Upload an image - The next step is to transfer your image to your repo

  • Drag and drop the image into the public folder, or

  • Click on the “choose your files” link to browse and select the image file.

Commit the changes - After selecting your image, write a simple commit message (e.g., “Adding image files to be used in the app”) and click “Commit changes” to save the file to your repo.

Get the image path - Once the file is uploaded, select it and then click on the copy icon next to the file name to copy the image’s path. This path will be used in your Lovable prompt.

Use the image in Lovable - You can now reference this image in your project by using a prompt like the following:

Add an additional image to the hero section. 
This time, use this one from my local repo: public/c-64-close-up.jpg.jpeg

Be sure to use your image name and path you copied in the previous step.

Uploading large images to your GitHub repo can cause it to grow in size, which can affect Lovable performance (longer repo cloning times, slower startup of previews/sandbox).

Try to optimize your images before uploading them to your public folder by compressing them and using dimensions that are relevant to your use case. For example, don’t use a full HD-sized image if it will only be displayed as a small icon.

Using Base64 encoding

The third method to add images is by using Base64 encoding. While this is an option, we don’t recommend it, as it converts the image into a long textual string that can consume a significant portion of your project’s context. However, if you wish to use Base64 encoding, follow these steps:

  1. Upload your image to a Lovable-built project by one of our community members. Thanks, ntindle!
  2. Once the image is uploaded, the app will generate a Base64-encoded string for your image.
  3. Copy the Base64 string and use it in Lovable by using a prompt like this:
Now add the third image to the hero section. 
Use this Base64 encoding: 
iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAofSURBVHgB7VhdjFVXFd5r7X3OHf6nxgds2jChpVWMFKImmFiZJm1iYi2TJj7YhwJJU61CwaSWkqhooiKxhtgaf5oQwBdUEpsmWrSJOLUhPlmorTYWq0BLMTaEofN3zzl7r+W39rnEAjPMUB760nOzc+7Z52d/+1vf+vY6x7n3tqvbyF3l9oE3frREurSCmRe6xGp9IRXKyZ3Q0Hfu5LJ7/uauYntHAK977bE1Tt29SfkuFbeI1Ck5QHKsmigycaLkE2loiIszTsJhYv/MiZvu/rW7wu2KAH7wn7vWx0DfaJQGhEkFfKmBElWAEWdAiRIA4T9HVoB0ITotALZoyJUnoi9/+PpNd8wa6KwArn5510AVdE/DtAajuEiUmzrKAAEUINEUkNDQJyQhsfNJxSfmMmoKiagDwJ0IkC8qlQ+cWrb69ZnG5pku+PSRHQN9Lh6aI7qmI0IlyCqALBg0g6hiUEGcYxxDhMpspwhYVQM4xqVSMugD0SWoLlVkpRP3i8XHnl9+VQDXA9w81kNzkwz0SXIAaKO4AnQVSQkInKf8EMpgLSL4qZMMFuA9joMIYq4S0Fc40RKIS/C+FEMcWHzspeXvCOCWI9v7yyYemgdw81JyAElzALCvBzIAXCEABlYNKFgjAruUcQIk4g32gAmMOswDbAJ4IAOJIOCSgkXfj3nted+ZYwunwxGmOzHvLbfdF3HAYw7etWKlPB9tf5xhOMvfxgnG9UCJnQA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IzkZk0ow8NNDdN/o4jGqxGoLMoY+6fDse078Uf2/nEObz33IPsfRNG1eQGDlyEdaGhP4K1CJbAC3gyHtAL0Tau7p3DWa3xuiFF7cEh2K21ogpncQXurLiLp371lfU3n7pigLZ9/Ls/fSk2tBHhfhOD1oDVKIZGujWAaaBriAu93oBh0KLmGLC3gMKIEuPY102lNWhELeEs6F1ME8D8BFaTR/5+34f/cDkMs/p49PsHNlyvffN/WVO4ziyxwipRhYIrDlo5W2VKYCx03CMzkbUThCymIlUlstaVCZmMDC4tgxNWEKm4ONkob39+80f/MtPYs/789vSmTQsbFx6ELdyLpQx0UV7Sal8iZrAZKqRbADiAmL2MI59T6APQMlW+I7AiaaiMyZf7T8e4+x9bPzk6m3Gv+APm/o0PXxt9uD02fOckhZubAJ/D28Zk0UcGcgJeGIuOdjXEydCH9C+xL07jut+OL6RfDX/5trErGe+qPgE/vnHntVFpMb4ZLut25i6YjLy46nSo9n1vVIFGGzf39PiC4tiBhz/zH/fe9i5t/wPh3w4BN34V0AAAAABJRU5ErkJggg==


Keep in mind that this is a real Base64 encoding, so you can use it as an example prompt.

Explore more and learn from examples

To help you better understand how to integrate images using the methods outlined above, we have a project you can explore: Lovable Project Example. In this project, you can see the actual prompts and how each method works in practice.

Additionally, here’s a public GitHub repository that includes the commits, uploaded images, and full implementation details. You can view the repository here: GitHub: Adding Images Example.

Feel free to explore the project and repository to deepen your understanding and improve your implementation skills.