codewithRiz / image-2-animation

huggingface.co
Total runs: 0
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Model's Last Updated: October 25 2024
image-to-video

Introduction of image-2-animation

Model Details of image-2-animation

LivePortrait: Efficient Portrait Animation with Stitching and Retargeting Control

This is a replica of the official Space for the paper: LivePortrait: Efficient Portrait Animation with Stitching and Retargeting Control .

How to Use This Model

You can use this model to animate a portrait image by following the steps below:

Requirements

Ensure you have flask and pyngrok installed, and the model repository cloned. You can also set up the environment and run the code on Google Colab for easy access.

Running the Model on Google Colab
  1. Install required packages:

    !pip install flask pyngrok
    
  2. Clone the repository:

    !git clone https://huggingface.co/codewithRiz/image-2-animation
    
  3. Install the required dependencies:

    !pip install -r /content/image-2-animation/requirements.txt
    
  4. Set up the authentication token for Ngrok:

    from pyngrok import ngrok
    ngrok.set_auth_token("YOUR_NGROK_AUTH_TOKEN")
    
  5. Initialize the model handler:

    import sys
    sys.path.append('/content/image-2-animation')
    from handler import EndpointHandler
    
    handler = EndpointHandler()
    
  6. Upload the source image and driving video:

    from google.colab import files
    uploaded_files = files.upload()  # This opens a file upload dialog
    
    source_image = None
    driving_video = None
    
    for filename in uploaded_files.keys():
        if filename.lower().endswith(('.jpg', '.jpeg', '.png')):
            source_image = filename
        elif filename.lower().endswith(('.mp4', '.avi')):
            driving_video = filename
    
    # Ensure both the image and video are uploaded
    if not source_image:
        print("Please upload a valid source image (jpg, png).")
        sys.exit(1)
    
    if not driving_video:
        print("Please upload a valid driving video (mp4, avi).")
        sys.exit(1)
    
  7. Define input data for inference and run the model:

    payload = {
        "source": source_image,  # Uploaded source image
        "driving": driving_video  # Uploaded driving video
    }
    
    response = handler(payload)
    
    if 'output_path' in response:
        output_path = response['output_path']
        print(f"Inference completed. Output saved at: {output_path}")
        
        # Download the output video
        files.download(output_path)  # Download the file to the user's machine
    else:
        print(response)
    
Inference Details
  • Upload a source image (jpg, png) and a driving video (mp4, avi).
  • The model will generate an animated video using the input image and driving video.
  • The output will be saved, and you can download it directly from the Colab interface.

Runs of codewithRiz image-2-animation on huggingface.co

0
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs

More Information About image-2-animation huggingface.co Model

More image-2-animation license Visit here:

https://choosealicense.com/licenses/apache-2.0

image-2-animation huggingface.co

image-2-animation huggingface.co is an AI model on huggingface.co that provides image-2-animation's model effect (), which can be used instantly with this codewithRiz image-2-animation model. huggingface.co supports a free trial of the image-2-animation model, and also provides paid use of the image-2-animation. Support call image-2-animation model through api, including Node.js, Python, http.

image-2-animation huggingface.co Url

https://huggingface.co/codewithRiz/image-2-animation

codewithRiz image-2-animation online free

image-2-animation huggingface.co is an online trial and call api platform, which integrates image-2-animation's modeling effects, including api services, and provides a free online trial of image-2-animation, you can try image-2-animation online for free by clicking the link below.

codewithRiz image-2-animation online free url in huggingface.co:

https://huggingface.co/codewithRiz/image-2-animation

image-2-animation install

image-2-animation is an open source model from GitHub that offers a free installation service, and any user can find image-2-animation on GitHub to install. At the same time, huggingface.co provides the effect of image-2-animation install, users can directly use image-2-animation installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

image-2-animation install url in huggingface.co:

https://huggingface.co/codewithRiz/image-2-animation

Url of image-2-animation

image-2-animation huggingface.co Url

Provider of image-2-animation huggingface.co

codewithRiz
ORGANIZATIONS

Other API from codewithRiz

huggingface.co

Total runs: 26
Run Growth: -2
Growth Rate: -7.69%
Updated:June 18 2025
huggingface.co

Total runs: 2
Run Growth: 0
Growth Rate: 0.00%
Updated:May 21 2025