Build AI Live Portrait FaceDance app in minutes with Each API

Build AI Live Portrait FaceDance app in minutes with Each API

Create an AI Live Portrait FaceDance App with Each API in Minutes

Hello, I'm Enes! Today, I'll show you how you can create an amazing AI Live Portrait FaceDance app in just a few minutes using the powerful Each API. Whether you are an experienced developer or just starting out, Each API makes the process incredibly simple and efficient. Let's get started and see how you can do it.

What is Each API?

Each API is a platform that simplifies the development of AI-focused applications. By offering access to over 40 AI models, it provides a comprehensive toolkit for creating innovative applications like FaceDance. This allows you to create high-quality, AI-powered features without needing extensive technical knowledge.

Creating Your AI Live Portrait FaceDance App

Step 1: Sign Up and Log In to Each API

First, you need to go to the Each API website and sign up. After signing up, log in.

Step 2: Go to the AI Flow Page

After logging in, go to the "AI Flow" page from the main menu and click the "Create Workflow" button to go to the workflow creation page.

Step 3: Name Your Flow and Add Models

Give your flow a suitable name. Use the "Add Item" button to add the models you need. For your FaceDance app, select the "Face to Video Generation" model and the "Video Convert" model in sequence and add them to the flow. 

Step 4: Add the Necessary Inputs

From the "Inputs" panel, create parameter names for the inputs you need and then map them to the model. After adding the models, enter the parameter values you created in the input section.

             

                      


Step 5: Create the Model

Enter the output of the first model into the input section of the added model and click the "Create" button to create your flow. Your model is now ready to use in your app.

Step 6: Test the Flow

In the final step, use the "Trigger" button to test your flow. That's it! Your perfect FaceDance app is now ready. You can integrate this app into your application or add it to your mobile app.

       

Step 7: Integrate the Flow into a Mobile App

Select the HTTP section from the documentation, copy the code here, and the rest is up to you.

Step 8: Trigger the Flow

Create an HTTP request with the information from the copied code. Important points: flowId, apikey, executionId, as you will use these details in the response.


const [executionId, setExecutionId] = useState('');
const flowId = 'aca2e44c-d43d-4c08-a9e9-bc8de530c8df';
  const apiKey = '***************';


  useEffect(() => {
    const fetchData = async () => {
      try {
        const inputData = {
          input: {
            face_image: imageUri,
            driving_video: drivingVideoUri,
          },
        };
        const response = await axios.post(
          `https://flows.eachlabs.ai/api/v1/${flowId}/trigger`,
          inputData,
          {
            headers: {
              'Content-Type': 'application/json',
              'X-API-Key': apiKey,
            },
          },
        );


        if (response.data.trigger_id) {
          setExecutionId(response.data.trigger_id);
        } else {
          throw new Error('No execution ID received');
        }
      } catch (error) {
        console.error(`Error: ${error.message}`);
        setError(true);
        setErrorMessage(`Error: ${error.message}`);
        setLoading(false);
      }
    };


    fetchData();
  }, []);

Step 9: Get Results in the FaceDance App

After successfully running the flow, it's time to see your results. You can access details about which model was active, the returned result, and how long it took in the history section of the flow page, or display the result in the mobile app.

 


useEffect(() => {
    if (executionId) {
      const checkStatus = async () => {
        try {
          const result = await axios.get(
            `https://console.eachlabs.ai/flows-api/api/v1/${flowId}/executions/${executionId}`,
            {
              headers: {
                'Content-Type': 'application/json',
                'X-API-Key': apiKey,
              },
            },
          );
         
          if (result.data && result.data.output) {
            setOutputUrl(result.data.output);
            clearInterval(intervalId);
          } else {
            throw new Error('No output available yet');
          }
        } catch (error) {
          console.error(`Error: ${error.message}`);
          setError(true);
          setErrorMessage(`Error: ${error.message}`);
        } finally {
          setLoading(false);
        }
      };

      const intervalId = setInterval(checkStatus, 5000);
      return () => clearInterval(intervalId);
    }
  }, [executionId]);

Creating Other Flows

You can create many other AI-focused flows like FaceDance. With the vast range of models offered by Each API, you have everything you need to execute various AI projects. Additionally, you can explore ready-made flow templates and quickly kickstart your projects. The flows you create are only limited by your imagination.

Advantages of Each API

  • Speed and Efficiency: Each API automates complex tasks, saving you time and effort, enabling you to bring your app to market faster.
  • High Quality: Advanced AI models ensure your FaceDance animations are smooth, realistic, and impressive.
  • Developer Support: Each API offers extensive resources and support to guide you through every step.

Who is Each API For?

Each API is perfect for developers and mobile app publishers who want to create eye-catching and innovative AI-focused applications. If you want to accelerate your development process and stand out in the app market, Each API is the solution to turn to.

Start Today

Join the Each community and start creating your AI Live Portrait FaceDance app immediately. With Each API, you can bring your creative ideas to life in no time. The possibilities are endless, so why wait? Discover how Each can transform your app development experience.