← All N8N workflows
AI & researchChain LLMCodeEdit ImageHTTP RequestLM Chat Google Gemini

information edit image and resize edit image and multistep edit image

Configured with Chain LLM, Edit Image, HTTP Request, LM Chat Google Gemini, and additional nodes. Review the connections and setup before adapting this template.

Workflow preview
TriggerWhen clicking ‘Testworkflow’Manual TriggerAI & modelsGoogle Gemini ChatModelLM Chat Google GeminiTransformStructured OutputParserOutput Parser StructuredFiles / mediaGet InfoEdit ImageFiles / mediaResize For AIEdit ImageCodeCalculate PositioningCodeFiles / mediaApply Caption to ImageEdit ImageTransformMerge Image & CaptionMergeTransformMerge Caption &PositionsMergeWeb / APIGet ImageHTTP RequestAI & modelsImage Captioning AgentChain LLM

Node categories in this workflow

  • Trigger
  • AI & models
  • Transform
  • Files / media
  • Code
  • Web / API

Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.

Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.

How it works

The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.

Workflow node names, types, and operations
NodeCategoryTypeOperation
When clicking ‘Test workflow’TriggerManual TriggerSee node parameters
Google Gemini Chat ModelAI & modelsLM Chat Google GeminiSee node parameters
Structured Output ParserTransformOutput Parser StructuredSee node parameters
Get InfoFiles / mediaEdit Imageinformation
Resize For AIFiles / mediaEdit Imageresize
Calculate PositioningCodeCodeSee node parameters
Apply Caption to ImageFiles / mediaEdit ImagemultiStep
Merge Image & CaptionTransformMergeSee node parameters
Merge Caption & PositionsTransformMergeSee node parameters
Get ImageWeb / APIHTTP RequestSee node parameters
Image Captioning AgentAI & modelsChain LLMSee node parameters

Setup

  1. Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
  2. Connect your own credentials through n8n’s credential store. Replace REPLACE_WITH_* values with your resource identifiers.
  3. Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
  4. Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.

Requirements

An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.

Credential types declared in the source

  • googlePalmApi

Workflow notes

Try it out!

Try it out!

This workflow takes an image and generates a caption for it using AI. The OpenAI node has been able to do this for a while but this workflow demonstrates how to achieve the same with other multimodal vision models such as Google's Gemini.

Additional, we'll use the Edit Image node to overlay the generated caption onto the image. This can be useful for publications or can be repurposed for copyrights and/or watermarks.

Need Help?

Join the Discord or ask in the Forum!

1. Import an Image

1. Import an Image

Read more about the HTTP request node

For this demonstration, we'll grab an image off Pexels.com - a popular free stock photography site - by using the HTTP request node to download.

In your own workflows, this can be replaces by other triggers such as webhooks.

2. Using Vision Model to Generate Caption

2. Using Vision Model to Generate Caption

Learn more about the Basic LLM Chain

n8n's basic LLM node supports multimodal input by allowing you to specify either a binary or an image url to send to a compatible LLM. This makes it easy to start utilising this powerful feature for visual classification or OCR tasks which have previously depended on more dedicated OCR models.

Here, we've simply passed our image binary as a "user message" option, asking the LLM to help us generate a caption title and text which is appropriate for the given subject. Once generated, we'll pass this text along with the image to combine them both.

3. Overlay Caption on Image

3. Overlay Caption on Image

Read more about the Edit Image node

Finally, we’ll perform some basic calculations to place the generated caption onto the image. With n8n's user-friendly image editing features, this can be done entirely within the workflow!

The Code node tool is ideal for these types of calculations and is used here to position the caption at the bottom of the image. To create the overlay, the Edit Image node enables us to insert text onto the image, which we’ll use to add the generated caption.

Sticky Note4

FIG 1. Example input image with AI generated caption

information edit image and resize edit image and multistep edit image

information edit image and resize edit image and multistep edit image

Purpose and structure

This folder contains the information edit image and resize edit image and multistep edit image workflow. Its executable nodes use chainLlm, code, editImage, httpRequest, lmChatGoogleGemini, manualTrigger, merge, outputParserStructured. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.

Setup

Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.

Entry points

When clicking ‘Test workflow’

Verification

Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.

Attribution

https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Code/0577_Code_Editimage_Update_Webhook.json MIT; preserve source notices.

More in AI & research