Generate blog posts and social media content with GPT-4.1 and Pexels images
AI Content Generator with Auto Pexels Image Matching This n8n template demonstrates how to use AI to generate engaging content and automatically find matching royalty-free images based on the content context. Use case...
Template notes
AI Content Generator with Auto Pexels Image Matching
This n8n template demonstrates how to use AI to generate engaging content and automatically find matching royalty-free images based on the content context.
Use cases are many: Try creating blog posts with hero images, generating social media content with visuals or drafting email newsletters with relevant photos.
Good to know
- At time of writing, Pexels offers free API access with up to 200 requests per hour. See [Pexels API](https://www.pexels.com/api) for updated info. - OpenAI API costs vary by model. GPT-4.1 mini is cheaper while normal GPT-4.1 and above offer deeper content generation but cost more per request. - Using the floating JavaScript node can reduce token usage by processing content and keyword extraction in a single prompt.
How it works
1. We'll collect a content topic or idea via a manual form trigger. 2. OpenAI generates initial content based on your input topic. 3. The AI extracts suitable keywords from the generated content to find matching images. 4. The keywords are sent to Pexels API, which searches for relevant royalty-free stock images. 5. OpenAI creates the final polished content that complements the selected image. 6. The result is displayed as a formatted HTML template combining content and image together.
How to use