> For the complete documentation index, see [llms.txt](https://docs.clore.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.clore.ai/guides/guides_v2-hi/talking-heads/liveportrait.md).

# LivePortrait

एकल छवियों से वास्तविक दिखने वाले एनिमेटेड पोर्ट्रेट बनाएं।

{% hint style="success" %}
सभी उदाहरणों को GPU सर्वरों पर चलाया जा सकता है जिन्हें के माध्यम से किराए पर लिया जाता है [CLORE.AI मार्केटप्लेस](https://clore.ai/marketplace).
{% endhint %}

{% hint style="info" %}
इस मार्गदर्शिका के सभी उदाहरणों को GPU सर्वरों पर चलाया जा सकता है जिन्हें के माध्यम से किराए पर लिया जाता है [CLORE.AI मार्केटप्लेस](https://clore.ai/marketplace) मार्केटप्लेस।
{% endhint %}

## CLORE.AI पर किराए पर लेना

1. &#x20;पर जाएँ [CLORE.AI मार्केटप्लेस](https://clore.ai/marketplace)
2. GPU प्रकार, VRAM और कीमत द्वारा फ़िल्टर करें
3. चुनें **ऑन-डिमांड** (निर्धारित दर) या **स्पॉट** (बिड कीमत)
4. अपना ऑर्डर कॉन्फ़िगर करें:
   * Docker इमेज चुनें
   * पोर्ट सेट करें (SSH के लिए TCP, वेब UI के लिए HTTP)
   * ज़रूरत होने पर पर्यावरण चर जोड़ें
   * स्टार्टअप कमांड दर्ज करें
5. भुगतान चुनें: **CLORE**, **BTC**, या **USDT/USDC**
6. ऑर्डर बनाएँ और डिप्लॉयमेंट की प्रतीक्षा करें

### अपने सर्वर तक पहुँचें

* कनेक्शन विवरण खोजें **मेरे ऑर्डर्स**
* वेब इंटरफेस: HTTP पोर्ट URL का उपयोग करें
* SSH: `ssh -p <port> root@<proxy-address>`

## लाइवपोर्ट्रेट क्या है?

Kuaishou का LivePortrait सक्षम करता है:

* किसी भी पोर्ट्रेट को ड्राइविंग वीडियो से एनिमेट करें
* सिंगल फोटो से वीडियो एनिमेशन
* अभिव्यक्ति और पोस ट्रांसफर
* रीयल-टाइम सक्षम इन्फरेंस

## संसाधन

* **GitHub:** [KwaiVGI/LivePortrait](https://github.com/KwaiVGI/LivePortrait)
* **पेपर:** [LivePortrait पेपर](https://arxiv.org/abs/2407.03168)
* **HuggingFace:** [KwaiVGI/LivePortrait](https://huggingface.co/KwaiVGI/LivePortrait)
* **डेमो:** [HuggingFace Space](https://huggingface.co/spaces/KwaiVGI/LivePortrait)

## अनुशंसित हार्डवेयर

| घटक     | न्यूनतम      | अनुशंसित      | सर्वोत्तम     |
| ------- | ------------ | ------------- | ------------- |
| GPU     | RTX 3070 8GB | RTX 4080 16GB | RTX 4090 24GB |
| VRAM    | 8GB          | 16GB          | 24GB          |
| CPU     | 4 कोर        | 8 कोर         | 16 कोर        |
| RAM     | 16GB         | 32GB          | 64GB          |
| स्टोरेज | 30GB SSD     | 50GB NVMe     | 100GB NVMe    |
| इंटरनेट | 100 Mbps     | 500 Mbps      | 1 Gbps        |

## CLORE.AI पर त्वरित डिप्लॉय

**Docker इमेज:**

```
pytorch/pytorch:2.5.1-cuda12.4-cudnn9-devel
```

**पोर्ट्स:**

```
22/tcp
7860/http
```

**कमांड:**

```bash
cd /workspace && \
git clone https://github.com/KwaiVGI/LivePortrait.git && \
cd LivePortrait && \
pip install -r requirements.txt && \
python app.py
```

## अपनी सेवा तक पहुँच

डिप्लॉयमेंट के बाद, अपना खोजें `http_pub` URL में **मेरे ऑर्डर्स**:

1. पर जाएँ **मेरे ऑर्डर्स** पृष्ठ
2. अपने ऑर्डर पर क्लिक करें
3. खोजें `http_pub` URL (उदा., `abc123.clorecloud.net`)

उपयोग करें `https://YOUR_HTTP_PUB_URL` के बजाय `localhost` नीचे दिए गए उदाहरणों में।

## स्थापना

```bash
git clone https://github.com/KwaiVGI/LivePortrait.git
cd LivePortrait
pip install -r requirements.txt

# प्री-ट्रेंड मॉडल डाउनलोड करें
huggingface-cli download KwaiVGI/LivePortrait --local-dir pretrained_weights
```

## आप क्या बना सकते हैं

### वर्चुअल अवतार

* AI इन्फ्लुएंसर्स और वर्चुअल एंकर्स
* कस्टमर सर्विस अवतार
* शैक्षिक प्रस्तुतकर्ता

### सामग्री निर्माण

* सोशल मीडिया सामग्री
* मार्केटिंग सामग्री
* म्यूजिक वीडियो कॉन्सेप्ट

### मनोरंजन

* ऐतिहासिक फोटो को एनिमेट करें
* करेक्टर एनिमेशन
* इंटरैक्टिव अनुभव

### पेशेवर उपयोग

* वीडियो कॉन्फ्रेंसिंग अवतार
* प्रेजेंटेशन असिस्टेंट
* ट्रेनिंग सिमुलेशन

## मूल उपयोग

### कमांड लाइन

```bash
python inference.py \
    --source_image path/to/portrait.jpg \
    --driving_video path/to/driving.mp4 \
    --output_path output.mp4
```

### Python API

```python
from liveportrait import LivePortraitPipeline

# पाइपलाइन इनिशियलाइज़ करें
pipeline = LivePortraitPipeline(
    device="cuda",
    model_path="./pretrained_weights"
)

# पोर्ट्रेट एनिमेट करें
result = pipeline.animate(
    source_image="portrait.jpg",
    driving_video="driving.mp4"
)

result.save("animated_portrait.mp4")
```

## अभिव्यक्ति नियंत्रण के साथ पोर्ट्रेट

```python
from liveportrait import LivePortraitPipeline
import cv2

pipeline = LivePortraitPipeline(device="cuda")

# विशिष्ट अभिव्यक्तियों को नियंत्रित करें
expressions = {
    "smile": 0.8,
    "eyebrow_raise": 0.3,
    "head_pitch": -5,  # डिग्री
    "head_yaw": 10
}

result = pipeline.animate_with_expression(
    source_image="portrait.jpg",
    expressions=expressions,
    num_frames=60,
    fps=30
)

result.save("expression_controlled.mp4")
```

## बैच प्रोसेसिंग

```python
import os
from liveportrait import LivePortraitPipeline

pipeline = LivePortraitPipeline(device="cuda")

# समान ड्राइविंग वीडियो से कई पोर्ट्रेट एनिमेट करें
portraits = [
    "portrait1.jpg",
    "portrait2.jpg",
    "portrait3.jpg"
]

driving = "speech_driving.mp4"
output_dir = "./animated"
os.makedirs(output_dir, exist_ok=True)

for i, portrait in enumerate(portraits):
    print(f"Processing {i+1}/{len(portraits)}: {portrait}")

    result = pipeline.animate(
        source_image=portrait,
        driving_video=driving
    )

    result.save(f"{output_dir}/animated_{i:03d}.mp4")
```

## Gradio इंटरफ़ेस

```python
import gradio as gr
from liveportrait import LivePortraitPipeline
import tempfile

pipeline = LivePortraitPipeline(device="cuda")

def animate(source_image, driving_video):
    with tempfile.NamedTemporaryFile(suffix=".mp4", delete=False) as f:
        result = pipeline.animate(
            source_image=source_image,
            driving_video=driving_video
        )
        result.save(f.name)
        return f.name

demo = gr.Interface(
    fn=animate,
    inputs=[
        gr.Image(type="filepath", label="Portrait Image"),
        gr.Video(label="Driving Video")
    ],
    outputs=gr.Video(label="Animated Portrait"),
    title="LivePortrait - किसी भी पोर्ट्रेट को एनिमेट करें",
    description="एक पोर्ट्रेट और एक ड्राइविंग वीडियो अपलोड करें ताकि एक एनिमेटेड वीडियो बनाया जा सके। CLORE.AI GPU सर्वरों पर चल रहा है।"
)

demo.launch(server_name="0.0.0.0", server_port=7860)
```

## रीयल-टाइम वेबकैम एनिमेशन

```python
import cv2
from liveportrait import LivePortraitPipeline

pipeline = LivePortraitPipeline(device="cuda")

# स्रोत पोर्ट्रेट लोड करें
source = cv2.imread("portrait.jpg")
pipeline.set_source(source)

# वेबकैम खोलें
cap = cv2.VideoCapture(0)

while True:
    ret, frame = cap.read()
    if not ret:
        break

    # वर्तमान फ्रेम को ड्राइविंग के रूप में उपयोग करके एनिमेट करें
    animated = pipeline.animate_frame(frame)

    cv2.imshow("LivePortrait", animated)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

cap.release()
cv2.destroyAllWindows()
```

## TTS के साथ एकीकरण

टेक्स्ट-टू-स्पीच के साथ बोलने वाले अवतार बनाएं:

```python
from liveportrait import LivePortraitPipeline
from TTS.api import TTS

# स्पीच जेनरेट करें
tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2")
tts.tts_to_file(
    text="Hello! Welcome to our presentation.",
    file_path="speech.wav",
    speaker_wav="reference_voice.wav",
    language="en"
)

# ऑडियो से लिप-सिंक ड्राइविंग वीडियो जेनरेट करें

# (अलग लिप-सिंक टूल या पहले से बने ड्राइविंग वीडियो का उपयोग करते हुए)

# पोर्ट्रेट एनिमेट करें
pipeline = LivePortraitPipeline(device="cuda")
result = pipeline.animate(
    source_image="presenter.jpg",
    driving_video="lip_sync_driving.mp4"
)
result.save("talking_avatar.mp4")
```

## प्रदर्शन

| रिज़ॉल्यूशन | GPU      | FPS | लेटेंसी |
| ----------- | -------- | --- | ------- |
| 256x256     | RTX 3070 | 30  | 33ms    |
| 256x256     | RTX 4090 | 60+ | 16ms    |
| 512x512     | RTX 4090 | 30  | 33ms    |
| 512x512     | A100     | 45  | 22ms    |

## सामान्य समस्याएँ और समाधान

### चेहरा नहीं पाया गया

**समस्या:** "स्रोत छवि में कोई चेहरा नहीं पाया गया"

**समाधान:**

* सुनिश्चित करें कि चेहरा स्पष्ट रूप से दिखाई दे और सामने की ओर हो
* स्रोत छवि में अच्छी लाइटिंग का उपयोग करें
* चेहरे पर फोकस करने के लिए छवि को क्रॉप करें
* न्यूनतम फेस साइज: 128x128 पिक्सेल

### गति मेल नहीं खाती

**समस्या:** एनिमेशन ड्राइविंग वीडियो का पालन नहीं करता

**समाधान:**

* स्पष्ट चेहरे की चाल वाले ड्राइविंग वीडियो का उपयोग करें
* सुनिश्चित करें कि ड्राइविंग वीडियो में चेहरे की ओरिएंटेशन समान हो
* विभिन्न ड्राइविंग वीडियो आज़माएँ

### गुणवत्ता समस्याएँ

**समस्या:** आउटपुट धुंधला या विकृत दिखता है

**समाधान:**

```python

# उच्च गुणवत्ता सेटिंग्स का उपयोग करें
result = pipeline.animate(
    source_image=source,
    driving_video=driving,
    output_size=512,  # उच्च रेज़ोल्यूशन
    enhance_face=True  # फेस एनहांसमेंट सक्षम करें
)
```

### रीयल-टाइम लैग

**समस्या:** वेबकैम एनिमेशन लैगी है

**समाधान:**

* छोटी आउटपुट रेज़ोल्यूशन (256x256) का उपयोग करें
* TensorRT अनुकूलन सक्षम करें
* रीयल-टाइम के लिए RTX 4090 या बेहतर का उपयोग करें

```python
pipeline = LivePortraitPipeline(
    device="cuda",
    use_tensorrt=True  # TensorRT सक्षम करें
)
```

### ऑडियो सिंक समस्याएँ

**समस्या:** होंठ की हलचल ऑडियो से मेल नहीं खाती

**समाधान:**

* ऑडियो-से-ड्राइविंग वीडियो जेनरेशन का उपयोग करें
* पोस्ट-प्रोसेसिंग में वीडियो टाइमिंग समायोजित करें
* बेहतर लिप-सिंक के लिए Wav2Lip का उपयोग करें

## समस्या निवारण

### चेहरा नहीं मिला

* सुनिश्चित करें कि स्रोत में चेहरा स्पष्ट रूप से दिखाई दे
* सामने की ओर वाली फोटो का उपयोग करें
* इमेज रेज़ोल्यूशन की जाँच करें (512+ अनुशंसित)

### एनिमेशन अप्राकृतिक दिखता है

* स्रोत और ड्राइविंग वीडियो में चेहरे के कोण समान होने चाहिए
* ड्राइविंग वीडियो में अत्यधिक भाव-भंगिमाओं से बचें
* छोटे ड्राइविंग क्लिप का उपयोग करें

### आउटपुट वीडियो भ्रष्ट है

* ffmpeg इंस्टॉल करें: `apt install ffmpeg`
* आउटपुट फ़ॉर्मेट संगतता की जाँच करें
* पर्याप्त डिस्क स्थान सुनिश्चित करें

### CUDA त्रुटियाँ

* अनुकूल PyTorch संस्करण इंस्टॉल करें
* जाँच करें कि CUDA संस्करण आवश्यकताओं से मेल खाता है

## लागत अनुमान

सामान्य CLORE.AI मार्केटप्लेस दरें (2024 के अनुसार):

| GPU       | घंटा दर | दैनिक दर | 4-घंटे सत्र |
| --------- | ------- | -------- | ----------- |
| RTX 3060  | \~$0.03 | \~$0.70  | \~$0.12     |
| RTX 3090  | \~$0.06 | \~$1.50  | \~$0.25     |
| RTX 4090  | \~$0.10 | \~$2.30  | \~$0.40     |
| A100 40GB | \~$0.17 | \~$4.00  | \~$0.70     |
| A100 80GB | \~$0.25 | \~$6.00  | \~$1.00     |

*कीमतें प्रदाता और माँग के अनुसार बदलती हैं। वर्तमान दरों के लिए जाँच करें* [*CLORE.AI मार्केटप्लेस*](https://clore.ai/marketplace) *।*

**पैसे बचाएँ:**

* उपयोग करें **स्पॉट** लचीले वर्कलोड के लिए मार्केट (अकसर 30-50% सस्ता)
* के साथ भुगतान करें **CLORE** टोकन
* विभिन्न प्रदाताओं के बीच कीमतों की तुलना करें

## अगले कदम

* [SadTalker](/guides/guides_v2-hi/talking-heads/sadtalker.md) - वैकल्पिक टॉकिंग हेड
* [Wav2Lip](/guides/guides_v2-hi/talking-heads/wav2lip.md) - बेहतर लिप-सिंक
* [XTTS](/guides/guides_v2-hi/audio-and-voice/xtts-coqui.md) - वॉइस जेनरेशन


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.clore.ai/guides/guides_v2-hi/talking-heads/liveportrait.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
