n8n

How to Generate PiAPI Image to Video Content?

Turn a simple text idea into a short motion clip with one run. Ideal for content creators and social media teams that need fast visuals without jumping between tools.

The flow starts on a manual click, then calls PiAPI to create an image task from your prompt. A status check and wait loop polls until the image is ready. A code step picks a random image URL from the results. That image feeds a PiAPI video task that adds motion based on the prompt. Another status check and wait loop runs until the video is done. The final step returns both the main video link and a watermark free link so you can publish right away. This design removes handoffs and keeps the whole job in one place.

You need a PiAPI account and an API key. Add the API key to the HTTP Request nodes that talk to PiAPI, and write your text prompt in the Basic Prompt node. Click Test workflow to run it end to end. Expect a ready to share video link in minutes. Great for product teasers, story posts, and quick campaign assets where teams want a repeatable way to go from words to motion.

What are the key features?

  • Manual start lets you control when each content job runs.
  • HTTP calls create an image task in PiAPI from your text prompt.
  • If and Wait nodes poll the image task until it is ready without human checks.
  • Code step selects a random temporary image URL from the results.
  • HTTP call starts a video generation task using the selected image and prompt.
  • If and Wait nodes poll the video task until the final file is ready.
  • Code step outputs both the video link and a watermark free link for download.
  • Header authentication uses an API key so requests stay secure.

What are the benefits?

  • Reduce manual work from hours to minutes by linking image and video steps in one run
  • Automate over 90 percent of the image to video process with status checks and waits
  • Eliminate copy paste errors by passing URLs between steps automatically
  • Handle more content requests per day by removing tool switching
  • Unify image creation and video generation in a single workflow

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with PiAPI. See the Tools Required section above for links to create accounts with these services.
  3. In your PiAPI account, create an API key from the API page and copy it to your clipboard.
  4. Open the Basic Prompt HTTP Request node in n8n. In the Credential to connect with field, click Create new credential, choose an API Key type if shown, or set the x-api-key header directly in the node. Paste your PiAPI key into the x-api-key header.
  5. Open the Midjourney Image Generator node and repeat the same credential step so the x-api-key header is set. Ensure Send Headers is enabled.
  6. Open the Kling Video Generator node and add the same x-api-key header. Confirm the request body includes image_url and prompt as provided by the template.
  7. Open the Get Video node and add the x-api-key header so status checks can read the task details.
  8. In the Basic Prompt node, edit the prompt text to match your visual idea. Keep the model and task type fields as they are.
  9. Click Test workflow. Watch the execution. The image task should move through wait and status checks until an image URL is selected, then the video task will start and finish.
  10. If you see an unauthorized error, verify the x-api-key value and that the header name is exact. If tasks stall, increase the Wait node durations or re run the check nodes.
  11. When complete, open the Get Final Video URL node output to copy the video_url or the watermark free URL for publishing.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

PIAPI

Sign up

Free plan: $0 / mo (API access to basic APIs); Pay-as-you-go Kling video from $0.16 per 5s standard video

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.