> 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

Clore.ai पर एकल छवियों से यथार्थवादी एनिमेटेड पोर्ट्रेट बनाएँ

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

{% 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. विज़िट करें [CLORE.AI मार्केटप्लेस](https://clore.ai/marketplace)
2. GPU प्रकार, VRAM और कीमत के अनुसार फ़िल्टर करें
3. चुनें **ऑन-डिमांड** (स्थिर दर) या **स्पॉट** (बोली मूल्य)
4. अपना ऑर्डर कॉन्फ़िगर करें:
   * Docker इमेज चुनें
   * पोर्ट सेट करें (SSH के लिए TCP, वेब UI के लिए HTTP)
   * यदि आवश्यक हो तो environment variables जोड़ें
   * स्टार्टअप कमांड दर्ज करें
5. भुगतान चुनें: **CLORE**, **BTC**या **USDT/USDC**
6. ऑर्डर बनाएं और डिप्लॉयमेंट की प्रतीक्षा करें

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

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

## LivePortrait क्या है?

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.11.0-cuda12.8-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
```

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

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

* एआई इन्फ्लुएंसर और वर्चुअल एंकर
* ग्राहक सेवा अवतार
* शैक्षिक प्रस्तुतकर्ता

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

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

### मनोरंजन

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

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

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

## मूल उपयोग

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

```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"प्रसंस्करण {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="पोर्ट्रेट छवि"),
        gr.Video(label="ड्राइविंग वीडियो")
    ],
    outputs=gr.Video(label="एनिमेटेड पोर्ट्रेट"),
    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="नमस्ते! हमारे प्रस्तुतिकरण में आपका स्वागत है.",
    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) *वर्तमान दरों के लिए।*

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

* का उपयोग करें **स्पॉट** बाधित किए जा सकने वाले कार्य के लिए मार्केट — लगभग एक-तिहाई सर्वरों की स्पॉट कीमत ऑन-डिमांड से कम होती है (मध्य \~13% छूट), बाकी उससे मेल खाते हैं
* से भुगतान करें **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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
