How to upload image to AI Node

How can I upload an image to an AI Agent Node?

If I want to use an OpenRouter AI, how can I simply pass the image to the AI ​​Agent node?

Would sending the base64 directly to the prompt solve the problem?

1 Like

Yes, base64 works well for OpenRouter. Convert your image to base64, then pass it in the prompt like “Here’s an image: [base64_string]” or use the message format with image_url if OpenRouter supports it. The AI Node should handle it directly. Test with a small image first to confirm the encoding is right.

2 Likes

You also need to make sure the OpenRouter Model supports vision mode, otherwise it will not work

Hi @Luis_Miguel Welcome!
You have to consider what kjooleng have said and please stick with these models listed below:
GPTs above 4o models including.
Gemini 2.5 and higher
Claude Models above 3.7 sonnet

So that you have no quality issue while processing image data, but i would HIGHLY recommend using the GEMINI node for doing image scanning stuff as it is by far the best one i have used.

1 Like

Yes, base64 approach works! Here’s how:

1. First get your image as base64 using the “Read Binary File” or HTTP node

2. In the AI Agent node, instead of simple text prompt, use this in the message:

{

“role”: “user”,

“content”: [

{

  "type": "image_url",

  "image_url": {

    "url": "data:image/jpeg;base64,{{ $json.data }}"

  }

},

{

  "type": "text", 

  "text": "Your question about the image here"

}

]

}

3. Make sure your OpenRouter model supports vision

(e.g. gpt-4o, claude-3, llava etc.)

Note: AI Agent node doesn’t have a native image input —

you must pass it via the “Messages” parameter manually

using the above structure.