Processing images with OpenAI assistant

Hello,

I would like to automate process of image processing.

Now, I have custom Assistant through WebUI of OpenAI with instructions.
I also have files locally and trigger set when I add to a local folder.
I can also encode image to base 64, but…

One option through OpenAI node is to “analyze image” and another is to use “Assistant”, but it only points to include text. I do believe that according to API documentation, there is another JSON field to include format [“image”]. Is that missing from Assistant OpenAI node ?

Would it help if I just encode image and put it in ? (Doesnt seems to…)

Or should I use HTTP Request node ?

I dont want to upload my images to OpenAI backend and later refer it, as I think this is non-optimal solution.

Relevant documentation:

Thanks !

EDIT: Also, is it really the best to resize Full HD image to 500x500px as I read somewhere ?

  • n8n version: 1.60.1
  • Database (default: SQLite): Local files
  • **n8n EXECUTIONS_PROCESS setting (default: own, main): **
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: Linux
1 Like

Welcome to the community @frank_9 !

Tip for sharing information

Pasting your n8n workflow


Ensure to copy your n8n workflow and paste it in the code block, that is in between the pairs of triple backticks, which also could be achieved by clicking </> (preformatted text) in the editor and pasting in your workflow.

```
<your workflow>
```

That implies to any JSON output you would like to share with us.


Open AI node has two modes to work with images specifically, namely “Analyze Image” and “Generate Image”. The former has an option to provide reference to the binary as it intends to submit the image for analyses as depicted below.

@ihortom I think @frank_9 is referring to the n8n Open AI Assistant node which doesnt seem to have an option within n8n for handling images or files. The Open AI documentation for assistants (https://platform.openai.com/docs/assistants/deep-dive#managing-threads-and-messages) says that messages can include text, images, and files but within n8n there is only the option to pass through text to the AI assistant. The workarounds are suboptimal.

It would be nice for the n8n Open AI assistsnt node to be updated to include the ability to include files/images too so that the full capabilities of the assistant can be utilitised through this particular node.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.