Generate AI images from form inputs with Kavel’s anonymous API
Ready for 3.0What this workflow does
This workflow has 11 nodes and runs when someone submits an n8n form (“AI image generator”). It uses only n8n's built-in nodes. It also calls kavel.ai over HTTP.
How it runs
Trigger: When someone submits an n8n form (“AI image generator”).
- Prepare request (Code): runs custom JavaScript code
- Start generation (HTTP Request): calls kavel.ai (POST)
- Free quota used up? (If): checks a condition and branches into true / false
- Out of free quota (Edit Fields (Set)): sets 1 field: message
- Wait: waits 20 seconds
- Check status (HTTP Request): calls kavel.ai
- Image ready? (If): checks a condition and branches into true / false
- Download image (HTTP Request): calls an HTTP API
- Generation failed? (If): checks a condition and branches into true / false
- Report failure (Edit Fields (Set)): sets 1 field: message
HTTP calls to: kavel.ai
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (6)
- n8n Form Trigger
n8n-nodes-base.formTrigger - Code
n8n-nodes-base.code - HTTP Request
n8n-nodes-base.httpRequest - If
n8n-nodes-base.if - Edit Fields (Set)
n8n-nodes-base.set - Wait
n8n-nodes-base.wait
From the author
Quick overview This workflow collects an image prompt and aspect ratio via an n8n form, then uses Kavel’s anonymous text-to-image API to generate and download the resulting image, with handling for free-tier quota limits and generation failures. How it works…