HELP: Image generator using prompt

Hello, I have a plan to build an n8n system integrated with lovable.
The idea is basically, in lovable the user can upload an image and I have a specific prompt I want to apply on this image then generate a new image using that prompt after that sending it back to the user.

How to implement such workflow in n8n. kindly with details because im new here :slight_smile:

Hi there, roughly the step by step is like this

  1. Webhook Trigger Node
  • Add a Webhook node as the starting point of your workflow.
  • Set it to POST and capture the image file and any metadata from Lovable.
  • You’ll use this webhook URL in Lovable to trigger the workflow when an image is uploaded.
  1. Handle the Uploaded Image
  • Use the openai analyze an image node to analyze your image
  • dont forget to fill in the prompt
  1. AI Image Generation
  • Use the openai create an image node to generate your image
  • fil in the prompt on what kind of image do you want to make
  1. Return the New Image
  • Add a Respond to Webhook node to send back the generated image.

Sounds great! :+1:

Hi @Mohamed_Abu_Baker ,

Everything mentioned above by @fahmiiireza looks great, and this will be the go-to flow that you should follow.

  • However, it’s important to also consider the security aspect. If you share the direct webhook URL with Loveable while making the actual call in the production app, that URL can potentially be exposed.
  • Even if you implement authentication, the webhook URL may still be visible to anyone inspecting the network traffic and anyone can abuse your system.

To make it secure, you can ask Loveable to use Supabase secrets to store the webhook URL. A straightforward approach would be to have Loveable retrieve the webhook URL from Supabase secrets on the server side. This ensures the endpoint is never exposed in the client and remains secure.

For further clarity, I’m also sharing a YouTube video that explains the same concept I just mentioned here.

Hope this helps!