Complete Workflow Tutorial

Complete Workflow Tutorial

Learn how to combine multiple models to create complex AI generation workflows.

Overview

This tutorial shows how to chain multiple WaveSpeedAI models together to create a complete content generation workflow.

Example: Text → Image → Video → Digital Human

Create a talking head video from just a text description:

  1. Generate a face image (Text-to-Image)
  2. Generate speech audio (Text-to-Speech)
  3. Animate with lip sync (Digital Human)

Step 1: Generate a Face Image

curl --location --request POST 'https://api.wavespeed.ai/api/v3/wavespeed-ai/flux-dev' \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${WAVESPEED_API_KEY}" \
--data-raw '{
  "prompt": "Professional headshot of a young woman, neutral expression, studio lighting, white background, high quality",
  "size": "1024*1024",
  "num_inference_steps": 28,
  "guidance_scale": 3.5,
  "seed": -1
}'

Save the outputs[0] URL from the response — you’ll need it for step 3.

Step 2: Generate Speech Audio

curl --location --request POST 'https://api.wavespeed.ai/api/v3/minimax/speech-2.6-hd' \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${WAVESPEED_API_KEY}" \
--data-raw '{
  "text": "Hello! Welcome to WaveSpeedAI. Let me show you how easy it is to create AI-generated content.",
  "voice_id": "Friendly_Person",
  "emotion": "happy",
  "speed": 1
}'

Save the outputs[0] URL from the response — you’ll need it for step 3.

Step 3: Create Digital Human Video

Use the image and audio URLs from the previous steps:

curl --location --request POST 'https://api.wavespeed.ai/api/v3/wavespeed-ai/infinitetalk' \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${WAVESPEED_API_KEY}" \
--data-raw '{
  "image": "https://...your-generated-face-image...",
  "audio": "https://...your-generated-audio...",
  "resolution": "480p",
  "seed": -1
}'

The final video will be in outputs[0].

Example: Character Animation

Make a person in an image follow movements from a reference video:

  1. Upload your image (the person to animate)
  2. Upload a reference video (the movements to follow)
  3. Generate the animated video

Step 1: Upload Files

Upload your image and reference video to get URLs.

Step 2: Generate Animation

curl --location --request POST 'https://api.wavespeed.ai/api/v3/wavespeed-ai/wan-2.2/animate' \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${WAVESPEED_API_KEY}" \
--data-raw '{
  "image": "https://your-uploaded-image-url",
  "video": "https://your-reference-video-url",
  "mode": "replace",
  "resolution": "480p",
  "seed": -1
}'

The person in your image will replicate the movements and expressions from the reference video.

Example: Batch Generation with LoRA

Generate multiple consistent images using a trained LoRA by making multiple API calls with different seeds or prompts:

# Image 1
curl --location --request POST 'https://api.wavespeed.ai/api/v3/wavespeed-ai/flux-dev-lora' \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${WAVESPEED_API_KEY}" \
--data-raw '{
  "prompt": "p3r5on standing in a city street",
  "loras": [{"path": "your-lora-path", "scale": 0.8}],
  "size": "1024*1024",
  "num_inference_steps": 28,
  "guidance_scale": 3.5,
  "seed": 1
}'
 
# Image 2
curl --location --request POST 'https://api.wavespeed.ai/api/v3/wavespeed-ai/flux-dev-lora' \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${WAVESPEED_API_KEY}" \
--data-raw '{
  "prompt": "p3r5on sitting in a coffee shop",
  "loras": [{"path": "your-lora-path", "scale": 0.8}],
  "size": "1024*1024",
  "num_inference_steps": 28,
  "guidance_scale": 3.5,
  "seed": 2
}'

Best Practices

Error Handling

  • Check the status field in responses
  • Implement retries for failed requests
  • Use webhooks for long-running tasks

Cost Management

  • Test with lower resolution first
  • Use webhooks instead of polling for long tasks
  • Monitor credit usage via API

Rate Limiting

  • Add small delays between requests when making many calls
  • Use webhooks to avoid polling overhead
  • Batch similar operations when possible

Next Steps

© 2025 WaveSpeedAI. All rights reserved.