Buckets:

mishig's picture
download
raw
45.6 kB
<meta charset="utf-8" /><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;ConsisID&quot;,&quot;local&quot;:&quot;consisid&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Tối ưu hóa bộ nhớ&quot;,&quot;local&quot;:&quot;memory-optimization&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Tải các điểm kiểm tra của mô hình&quot;,&quot;local&quot;:&quot;load-model-checkpoints&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Tạo video từ văn bản giữ nguyên danh tính&quot;,&quot;local&quot;:&quot;identity-preserving-text-to-video&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Tài nguyên&quot;,&quot;local&quot;:&quot;resources&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;ConsisIDPipeline&quot;,&quot;local&quot;:&quot;diffusers.ConsisIDPipeline&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;ConsisIDPipelineOutput&quot;,&quot;local&quot;:&quot;diffusers.pipelines.consisid.pipeline_output.ConsisIDPipelineOutput&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}"/>
<link href="/docs/diffusers/main/en/_app/immutable/entry/start.D3LnKZ4R.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/BF9UNEM9.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/DPnyVmXs.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/entry/app.C0rBoMxR.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/DSGUT_OW.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/C045MWWx.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/DnVIJfC5.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/DsnmJJEf.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/nodes/0.DTZsP_3B.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/IaDvMxLQ.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/nodes/158.64L-lLIL.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/bKdwVYpU.js" rel="modulepreload">
<!--19rjct6--><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;ConsisID&quot;,&quot;local&quot;:&quot;consisid&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Memory optimization&quot;,&quot;local&quot;:&quot;memory-optimization&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Load Model Checkpoints&quot;,&quot;local&quot;:&quot;load-model-checkpoints&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Identity-Preserving Text-to-Video&quot;,&quot;local&quot;:&quot;identity-preserving-text-to-video&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Resources&quot;,&quot;local&quot;:&quot;resources&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;ConsisIDPipeline&quot;,&quot;local&quot;:&quot;diffusers.ConsisIDPipeline&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;ConsisIDPipelineOutput&quot;,&quot;local&quot;:&quot;diffusers.pipelines.consisid.pipeline_output.ConsisIDPipelineOutput&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}"/><!---->
<link href="/docs/diffusers/main/en/_app/immutable/assets/0.tn0RQdqM.css" rel="modulepreload"> <!--[--><!--[0--><!--[--><!--[0--><!--[--><p></p> <!--[0--><h1 class="relative group"><a id="consisid" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#consisid"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->ConsisID<!----></span></h1><!--]--><!----> <div class="flex flex-wrap space-x-1"><img alt="LoRA" src="https://img.shields.io/badge/LoRA-d8b4fe?style=flat"/></div> <p><a href="https://huggingface.co/papers/2411.17440" rel="nofollow">Identity-Preserving Text-to-Video Generation by Frequency Decomposition</a> từ Đại học Bắc Kinh &amp; Đại học Rochester &amp; v.v., bởi Shenghai Yuan, Jinfa Huang, Xianyi He, Yunyang Ge, Yujun Shi, Liuhan Chen, Jiebo Luo, Li Yuan.</p> <p>Tóm tắt từ bài báo là:</p> <p><em>Việc tạo video từ văn bản có bảo toàn danh tính (IPT2V) nhằm mục đích tạo ra các video có độ trung thực cao với danh tính con người nhất quán. Đây là một nhiệm vụ quan trọng trong tạo video nhưng vẫn là một vấn đề mở đối với các mô hình sinh. Bài báo này đẩy lùi ranh giới kỹ thuật của IPT2V theo hai hướng chưa được giải quyết trong tài liệu: (1) Một pipeline không cần tinh chỉnh mà không phải tinh chỉnh lại từng trường hợp một, và (2) Một phương án điều khiển dựa trên Diffusion Transformer (DiT) có bảo toàn danh tính và nhận thức tần số. Để đạt được những mục tiêu này, chúng tôi đề xuất <strong>ConsisID</strong>, một mô hình IPT2V có thể điều khiển dựa trên DiT, không cần tinh chỉnh, để giữ cho danh tính con người <strong>id</strong>entity <strong>consis</strong>tent trong video được tạo ra. Lấy cảm hứng từ các phát hiện trước đó về phân tích tần số của vision/diffusion transformers, nó sử dụng các tín hiệu điều khiển danh tính trong miền tần số, nơi các đặc điểm khuôn mặt có thể được phân tách thành các đặc điểm toàn cục tần số thấp (ví dụ: hồ sơ, tỷ lệ) và các đặc điểm nội tại tần số cao (ví dụ: các dấu hiệu danh tính không bị ảnh hưởng bởi sự thay đổi tư thế). Thứ nhất, từ góc nhìn tần số thấp, chúng tôi giới thiệu một bộ trích xuất khuôn mặt toàn cục, mã hóa hình ảnh tham chiếu và các điểm chính của khuôn mặt vào không gian tiềm ẩn, tạo ra các đặc điểm được làm giàu với thông tin tần số thấp. Các đặc điểm này sau đó được tích hợp vào các lớp nông của mạng để giảm bớt các thách thức huấn luyện liên quan đến DiT. Thứ hai, từ góc nhìn tần số cao, chúng tôi thiết kế một bộ trích xuất khuôn mặt cục bộ để nắm bắt các chi tiết tần số cao và tiêm chúng vào các khối transformer, tăng cường khả năng của mô hình trong việc bảo toàn các đặc điểm chi tiết. Để tận dụng thông tin tần số cho việc bảo toàn danh tính, chúng tôi đề xuất một chiến lược huấn luyện phân cấp, biến đổi một mô hình tạo video được huấn luyện trước thông thường thành một mô hình IPT2V. Các thí nghiệm rộng rãi cho thấy rằng phương án nhận thức tần số mang tính trực giác của chúng tôi cung cấp một giải pháp điều khiển tối ưu cho các mô hình dựa trên DiT. Nhờ phương án này, <strong>ConsisID</strong> của chúng tôi đạt được kết quả xuất sắc trong việc tạo ra các video chất lượng cao, có bảo toàn danh tính, tạo bước tiến hướng tới IPT2V hiệu quả hơn. Trọng số mô hình của ConsID được công khai tại <a href="https://github.com/PKU-YuanGroup/ConsisID" rel="nofollow">https://github.com/PKU-YuanGroup/ConsisID</a>.</em></p> <blockquote class="tip"><p>Hãy chắc chắn xem qua <a href="../../using-diffusers/schedulers">hướng dẫn</a> về Schedulers để tìm hiểu cách khám phá sự đánh đổi giữa tốc độ và chất lượng của scheduler, và xem phần <a href="../../using-diffusers/loading#reusing-models-in-multiple-pipelines">tái sử dụng các thành phần giữa các pipeline</a> để tìm hiểu cách nạp các thành phần giống nhau vào nhiều pipeline một cách hiệu quả.</p></blockquote> <p>Pipeline này được đóng góp bởi <a href="https://github.com/SHYuanBest" rel="nofollow">SHYuanBest</a>. Mã nguồn gốc có thể được tìm thấy <a href="https://github.com/PKU-YuanGroup/ConsisID" rel="nofollow">tại đây</a>. Trọng số gốc có thể được tìm thấy tại <a href="https://huggingface.co/BestWishYsh" rel="nofollow">hf.co/BestWishYsh</a>.</p> <p>Có hai checkpoint chính thức của ConsisID cho việc tạo video từ văn bản mà vẫn giữ nguyên danh tính.</p> <table><thead><tr><th align="center">checkpoints</th><th align="center">dtype suy luận được khuyến nghị</th></tr></thead><tbody><tr><td align="center"><a href="https://huggingface.co/BestWishYsh/ConsisID-preview" rel="nofollow"><code>BestWishYsh/ConsisID-preview</code></a></td><td align="center">torch.bfloat16</td></tr><tr><td align="center"><a href="https://huggingface.co/BestWishYsh/ConsisID-preview" rel="nofollow"><code>BestWishYsh/ConsisID-1.5</code></a></td><td align="center">torch.bfloat16</td></tr></tbody></table> <!--[2--><h3 class="relative group"><a id="memory-optimization" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#memory-optimization"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->Tối ưu hóa bộ nhớ<!----></span></h3><!--]--><!----> <p>ConsisID cần khoảng 44 GB bộ nhớ GPU để giải mã 49 khung hình (6 giây video ở 8 FPS) với độ phân giải đầu ra 720x480 (Rộng x Cao), khiến việc chạy trên GPU tiêu dùng hoặc T4 Colab miễn phí trở nên không khả thi. Các tối ưu hóa bộ nhớ sau đây có thể được sử dụng để giảm dung lượng bộ nhớ. Để tái hiện, bạn có thể tham khảo <a href="https://gist.github.com/SHYuanBest/bc4207c36f454f9e969adbb50eaf8258" rel="nofollow">script này</a>.</p> <table><thead><tr><th align="left">Tính năng (chồng lên tính năng trước đó)</th><th align="left">Bộ nhớ tối đa đã cấp phát</th><th align="left">Bộ nhớ tối đa được dành</th></tr></thead><tbody><tr><td align="left">-</td><td align="left">37 GB</td><td align="left">44 GB</td></tr><tr><td align="left">enable_model_cpu_offload</td><td align="left">22 GB</td><td align="left">25 GB</td></tr><tr><td align="left">enable_sequential_cpu_offload</td><td align="left">16 GB</td><td align="left">22 GB</td></tr><tr><td align="left">vae.enable_slicing</td><td align="left">16 GB</td><td align="left">22 GB</td></tr><tr><td align="left">vae.enable_tiling</td><td align="left">5 GB</td><td align="left">7 GB</td></tr></tbody></table> <!--[1--><h2 class="relative group"><a id="load-model-checkpoints" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#load-model-checkpoints"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->Tải các điểm kiểm tra của mô hình<!----></span></h2><!--]--><!----> <p>Trọng số mô hình có thể được lưu trong các thư mục con riêng biệt trên Hub hoặc cục bộ, trong trường hợp đó, bạn nên sử dụng phương thức <a href="/docs/diffusers/main/vi/api/pipelines/overview#diffusers.DiffusionPipeline.from_pretrained">from_pretrained()</a>.</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> Đã sao chép</div><!----></button><!----></div> <pre class="language-python "><!----><span class="hljs-comment"># !pip install consisid_eva_clip insightface facexlib</span>
<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> ConsisIDPipeline
<span class="hljs-keyword">from</span> diffusers.pipelines.consisid.consisid_utils <span class="hljs-keyword">import</span> prepare_face_models, process_face_embeddings_infer
<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> snapshot_download
<span class="hljs-comment"># Download ckpts</span>
snapshot_download(repo_id=<span class="hljs-string">&quot;BestWishYsh/ConsisID-preview&quot;</span>, local_dir=<span class="hljs-string">&quot;BestWishYsh/ConsisID-preview&quot;</span>)
<span class="hljs-comment"># Load face helper model to preprocess input face image</span>
face_helper_1, face_helper_2, face_clip_model, face_main_model, eva_transform_mean, eva_transform_std = prepare_face_models(<span class="hljs-string">&quot;BestWishYsh/ConsisID-preview&quot;</span>, device=<span class="hljs-string">&quot;cuda&quot;</span>, dtype=torch.bfloat16) <span class="hljs-comment"># or &quot;mps&quot;, &quot;xpu&quot;, &quot;cpu&quot;</span>
<span class="hljs-comment"># Load consisid base model</span>
pipe = ConsisIDPipeline.from_pretrained(<span class="hljs-string">&quot;BestWishYsh/ConsisID-preview&quot;</span>, dtype=torch.bfloat16)
pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)<!----></pre></div><!----> <!--[1--><h2 class="relative group"><a id="identity-preserving-text-to-video" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#identity-preserving-text-to-video"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->Tạo video từ văn bản giữ nguyên danh tính<!----></span></h2><!--]--><!----> <p>Để tạo video từ văn bản mà vẫn giữ nguyên danh tính, hãy truyền vào một prompt văn bản và một hình ảnh chứa khuôn mặt rõ ràng (ví dụ: ưu tiên ảnh nửa người hoặc toàn thân). Mặc định, ConsisID tạo video 720x480 để đạt kết quả tốt nhất.</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> Đã sao chép</div><!----></button><!----></div> <pre class="language-python "><!----><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_video
prompt = <span class="hljs-string">&quot;The video captures a boy walking along a city street, filmed in black and white on a classic 35mm camera. His expression is thoughtful, his brow slightly furrowed as if he&#x27;s lost in contemplation. The film grain adds a textured, timeless quality to the image, evoking a sense of nostalgia. Around him, the cityscape is filled with vintage buildings, cobblestone sidewalks, and softly blurred figures passing by, their outlines faint and indistinct. Streetlights cast a gentle glow, while shadows play across the boy&#x27;s path, adding depth to the scene. The lighting highlights the boy&#x27;s subtle smile, hinting at a fleeting moment of curiosity. The overall cinematic atmosphere, complete with classic film still aesthetics and dramatic contrasts, gives the scene an evocative and introspective feel.&quot;</span>
image = <span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/consisid/consisid_input.png?download=true&quot;</span>
id_cond, id_vit_hidden, image, face_kps = process_face_embeddings_infer(face_helper_1, face_clip_model, face_helper_2, eva_transform_mean, eva_transform_std, face_main_model, <span class="hljs-string">&quot;cuda&quot;</span>, torch.bfloat16, image, is_align_face=<span class="hljs-literal">True</span>)
video = pipe(image=image, prompt=prompt, num_inference_steps=<span class="hljs-number">50</span>, guidance_scale=<span class="hljs-number">6.0</span>, use_dynamic_cfg=<span class="hljs-literal">False</span>, id_vit_hidden=id_vit_hidden, id_cond=id_cond, kps_cond=face_kps, generator=torch.Generator(<span class="hljs-string">&quot;cuda&quot;</span>).manual_seed(<span class="hljs-number">42</span>))
export_to_video(video.frames[<span class="hljs-number">0</span>], <span class="hljs-string">&quot;output.mp4&quot;</span>, fps=<span class="hljs-number">8</span>)<!----></pre></div><!----> <table><tbody><tr><th style="text-align: center;">Hình ảnh khuôn mặt</th><th style="text-align: center;">Video</th><th style="text-align: center;">Mô tả</th></tr><tr><td><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/consisid/consisid_image_0.png?download=true" style="height: auto; width: 600px;"/></td><td><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/consisid/consisid_output_0.gif?download=true" style="height: auto; width: 2000px;"/></td><td>Video, với phong cách hoạt hình được chế tác tinh tế, khắc họa một người phụ nữ tự tin cưỡi ngựa băng qua một khoảng rừng rậm rạp. Vẻ mặt của cô tập trung nhưng vẫn điềm tĩnh khi cô chỉnh chiếc mũ vành rộng bằng bàn tay điêu luyện. Cô mặc một chiếc váy bohemian bay bổng, uyển chuyển theo nhịp bước của con ngựa, chất vải trôi chảy mượt mà trong chuyển động hoạt hình. Ánh nắng chập chờn xuyên qua tán cây, tạo nên những họa tiết mềm mại, mang nét vẽ sơn dầu trên mặt đất rừng. Tư thế của cô đầy khí chất, thể hiện cả sự kiểm soát lẫn vẻ thanh lịch khi cô dẫn dắt con ngựa một cách dễ dàng. Phong cách hoạt hình nhẹ nhàng, lưu loát thêm vào cảnh một chất mơ màng, với vẻ điềm tĩnh của người phụ nữ và khung cảnh yên bình xung quanh gợi lên cảm giác tự do và hài hòa.</td></tr><tr><td><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/consisid/consisid_image_1.png?download=true" style="height: auto; width: 600px;"/></td><td><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/consisid/consisid_output_1.gif?download=true" style="height: auto; width: 2000px;"/></td><td>Video, với phong cách hoạt hình cuốn hút, cho thấy một người phụ nữ đứng giữa khu rừng tuyết, đôi mắt cô nheo lại trong sự tập trung khi đưa tay về phía trước. Cô khoác chiếc áo choàng màu xanh dương đậm, hơi thở hiện rõ trong không khí lạnh, được thể hiện bằng những nét vẽ mềm mại, huyền ảo. Một nụ cười nhẹ hiện trên môi khi cô triệu hồi một luồng phép thuật băng giá, chăm chú quan sát khi những cây cối và mặt đất xung quanh bắt đầu lấp lánh và đóng băng, phủ đầy những tinh thể băng mỏng manh. Chuyển động mượt mà của hoạt hình thổi hồn vào phép thuật, với lớp sương giá lan ra ngoài theo những hoa văn tinh xảo, lấp lánh. Môi trường được tô điểm bằng những sắc màu mềm mại như tranh nước, làm tăng thêm bầu không khí ma thuật, mơ màng. Tổng thể mang lại cảm giác yên bình nhưng đầy sức mạnh, với không khí mùa đông tĩnh lặng làm nổi bật vẻ đẹp tinh tế của khung cảnh đóng băng.</td></tr><tr><td><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/consisid/consisid_image_2.png?download=true" style="height: auto; width: 600px;"/></td><td><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/consisid/consisid_output_2.gif?download=true" style="height: auto; width: 2000px;"/></td><td>Đoạn hoạt hình khắc họa chân dung đầy chất thơ của một người bán bóng bay đứng trong làn gió nhẹ, được bắt trọn bằng những nét cọ mềm mại, mờ ảo gợi lên cảm giác của một ngày xuân thanh bình. Khuôn mặt anh được bao quanh bởi nụ cười dịu dàng, đôi mắt hơi nheo lại trước ánh nắng, trong khi vài sợi tóc bay phất phơ trong gió. Anh mặc một chiếc áo sơ mi màu pastel nhạt, và những quả bóng xung quanh anh đung đưa theo gió, thêm vào cảnh vật một nét vui tươi. Nền phía sau mờ dần nhẹ nhàng, với những nét phác gợi nhớ về một khu chợ hoặc công viên rực rỡ, làm nổi bật tâm trạng nhẹ nhàng mà dịu dàng của khoảnh khắc ấy.</td></tr><tr><td><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/consisid/consisid_image_3.png?download=true" style="height: auto; width: 600px;"/></td><td><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/consisid/consisid_output_3.gif?download=true" style="height: auto; width: 2000px;"/></td><td>Video ghi lại hình ảnh một cậu bé đi dọc theo một con phố trong thành phố, được quay bằng máy ảnh 35mm cổ điển với tông đen trắng. Vẻ mặt của cậu đầy suy tư, đôi mày hơi nhíu lại như thể đang chìm trong dòng suy nghĩ. Lớp hạt phim tạo thêm chất liệu thô ráp, mang tính vượt thời gian cho khung hình, gợi lên cảm giác hoài niệm. Xung quanh cậu, cảnh quan thành phố hiện lên với những tòa nhà cổ kính, lối đi lát đá cuội và những bóng người lướt qua mờ ảo, đường nét phôi pha và không rõ ràng. Ánh đèn đường tỏa ra một vầng sáng dịu dàng, trong khi những bóng đổ trải dài trên lối đi của cậu bé, thêm chiều sâu cho khung cảnh. Ánh sáng làm nổi bật nụ cười nhẹ nhàng của cậu, hé lộ một khoảnh khắc tò mò thoáng qua. Bầu không khí điện ảnh tổng thể, với thẩm mỹ của những khung hình phim cổ điển và sự tương phản kịch tính, mang lại cho cảnh quay một cảm giác gợi cảm và nội tâm.</td></tr><tr><td><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/consisid/consisid_image_4.png?download=true" style="height: auto; width: 600px;"/></td><td><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/consisid/consisid_output_4.gif?download=true" style="height: auto; width: 2000px;"/></td><td>Video có hình ảnh một em bé đội chiếc áo choàng siêu anh hùng rực rỡ, đứng đầy tự tin với hai cánh tay giơ cao trong tư thế mạnh mẽ. Em bé có vẻ mặt quyết tâm, đôi mắt mở to và đôi môi mím lại trong sự tập trung, như thể sẵn sàng đối mặt với thử thách. Bối cảnh trông vui nhộn, với những món đồ chơi nhiều màu sắc rải rác xung quanh và một tấm thảm mềm dưới chân, trong khi ánh nắng chiếu qua khung cửa sổ gần đó, làm nổi bật chiếc áo choàng bay phấp phới và tăng thêm ấn tượng về sự anh hùng. Bầu không khí tổng thể nhẹ nhàng và vui vẻ, với những biểu cảm của em bé nắm bắt được sự pha trộn giữa nét ngây thơ và nỗ lực dũng cảm đáng yêu, như thể thực sự sẵn sàng cứu rỗi cả ngày.</td></tr></tbody></table> <!--[1--><h2 class="relative group"><a id="resources" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#resources"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->Tài nguyên<!----></span></h2><!--]--><!----> <p>Tìm hiểu thêm về ConsisID với các tài nguyên sau.</p> <ul><li>Một <a href="https://www.youtube.com/watch?v=PhlgC-bI5SQ" rel="nofollow">video</a> minh họa các tính năng chính của ConsisID.</li> <li>Xem thêm chi tiết trong bài nghiên cứu <a href="https://hf.co/papers/2411.17440" rel="nofollow">Identity-Preserving Text-to-Video Generation by Frequency Decomposition</a>.</li></ul> <!--[1--><h2 class="relative group"><a id="diffusers.ConsisIDPipeline" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#diffusers.ConsisIDPipeline"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->ConsisIDPipeline<!----></span></h2><!--]--><!----> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><div><span class="group flex space-x-1.5 items-center text-gray-800 bg-gradient-to-r rounded-tr-lg -mt-4 -ml-4 pt-3 px-2.5" id="diffusers.ConsisIDPipeline"><!----><h3 class="!m-0"><span class="flex-1 break-all md:text-lg bg-gradient-to-r px-2.5 py-1.5 rounded-xl from-indigo-50/70 to-white dark:from-gray-900 dark:to-gray-950 dark:text-indigo-300 text-indigo-700"><svg class="mr-1.5 text-indigo-500 inline-block -mt-0.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width=".8em" height=".8em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path class="uim-quaternary" d="M20.23 7.24L12 12L3.77 7.24a1.98 1.98 0 0 1 .7-.71L11 2.76c.62-.35 1.38-.35 2 0l6.53 3.77c.29.173.531.418.7.71z" opacity=".25" fill="currentColor"></path><path class="uim-tertiary" d="M12 12v9.5a2.09 2.09 0 0 1-.91-.21L4.5 17.48a2.003 2.003 0 0 1-1-1.73v-7.5a2.06 2.06 0 0 1 .27-1.01L12 12z" opacity=".5" fill="currentColor"></path><path class="uim-primary" d="M20.5 8.25v7.5a2.003 2.003 0 0 1-1 1.73l-6.62 3.82c-.275.13-.576.198-.88.2V12l8.23-4.76c.175.308.268.656.27 1.01z" fill="currentColor"></path></svg><span class="font-light">lớp</span> <span class="font-medium">diffusers.</span><span class="font-semibold">ConsisIDPipeline</span></span></h3><!----> <a id="diffusers.ConsisIDPipeline" class="header-link invisible with-hover:group-hover:visible pr-2" href="#diffusers.ConsisIDPipeline"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></a> <!--[0--><a class="!ml-auto !text-gray-400 !no-underline text-sm flex items-center" href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/utils/dummy_torch_and_transformers_and_opencv_objects.py#L5" target="_blank"><span>&lt;</span> <span class="hidden md:block mx-0.5 hover:!underline">source</span> <span>></span></a><!--]--></span> <!--[0--><p class="font-mono text-xs md:text-sm !leading-relaxed !my-6"><span>(</span> <!--[--><span class="comma cursor-default"><span class="rounded hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black">*args<span class="opacity-60"></span></span></span><span class="comma cursor-default"><span class="rounded hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black">**kwargs<span class="opacity-60"></span></span></span><!--]--> <span>)</span> <!--[-1--><!--]--></p><!--]--> <div class="!mb-10 relative docstring-details "><!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--></div></div><!----> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><div><span class="group flex space-x-1.5 items-center text-gray-800 bg-gradient-to-r rounded-tr-lg -mt-4 -ml-4 pt-3 px-2.5" id="diffusers.ConsisIDPipeline.__call__"><!----><h4 class="!m-0"><span class="flex-1 rounded-xl py-0.5 break-all bg-gradient-to-r from-blue-50/60 to-white dark:from-gray-900 dark:to-gray-950 text-blue-700 dark:text-blue-300 font-medium px-2"><svg width="1em" height="1em" viewBox="0 0 32 33" class="mr-1 inline-block -mt-0.5" xmlns="http://www.w3.org/2000/svg"><path d="M5.80566 18.3545C4.90766 17.4565 4.90766 16.0005 5.80566 15.1025L14.3768 6.53142C15.2748 5.63342 16.7307 5.63342 17.6287 6.53142L26.1999 15.1025C27.0979 16.0005 27.0979 17.4565 26.1999 18.3545L17.6287 26.9256C16.7307 27.8236 15.2748 27.8236 14.3768 26.9256L5.80566 18.3545Z" fill="currentColor" fill-opacity="0.25"/><path fill-rule="evenodd" clip-rule="evenodd" d="M16.4801 13.9619C16.4801 12.9761 16.7467 12.5436 16.9443 12.3296C17.1764 12.078 17.5731 11.8517 18.2275 11.707C18.8821 11.5623 19.638 11.5342 20.4038 11.5582C20.7804 11.57 21.1341 11.5932 21.4719 11.6156L21.5263 11.6193C21.8195 11.6389 22.1626 11.6618 22.4429 11.6618V7.40825C22.3209 7.40825 22.1219 7.39596 21.7544 7.37149C21.4202 7.34925 20.9976 7.32115 20.5371 7.30672C19.6286 7.27824 18.4672 7.29779 17.3093 7.55377C16.1512 7.8098 14.8404 8.33724 13.8181 9.4452C12.7612 10.5907 12.2266 12.1236 12.2266 13.9619V15.0127H10.6836V19.2662H12.2266V26.6332H16.4801V19.2662H20.3394V15.0127H16.4801V13.9619Z" fill="currentColor"/></svg>__call__</span></h4><!----> <a id="diffusers.ConsisIDPipeline.__call__" class="header-link invisible with-hover:group-hover:visible pr-2" href="#diffusers.ConsisIDPipeline.__call__"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></a> <!--[-1--><!--]--></span> <!--[0--><p class="font-mono text-xs md:text-sm !leading-relaxed !my-6"><span>(</span> <!--[--><span class="comma cursor-default"><span class="rounded hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black">*args<span class="opacity-60"></span></span></span><span class="comma cursor-default"><span class="rounded hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black">**kwargs<span class="opacity-60"></span></span></span><!--]--> <span>)</span> <!--[-1--><!--]--></p><!--]--> <div class="!mb-10 relative docstring-details "><!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--></div></div><!----> <p>Gọi self như một hàm.</p></div></div> <!--[1--><h2 class="relative group"><a id="diffusers.pipelines.consisid.pipeline_output.ConsisIDPipelineOutput" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#diffusers.pipelines.consisid.pipeline_output.ConsisIDPipelineOutput"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->ConsisIDPipelineOutput<!----></span></h2><!--]--><!----> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><div><span class="group flex space-x-1.5 items-center text-gray-800 bg-gradient-to-r rounded-tr-lg -mt-4 -ml-4 pt-3 px-2.5" id="diffusers.pipelines.consisid.pipeline_output.ConsisIDPipelineOutput"><!----><h3 class="!m-0"><span class="flex-1 break-all md:text-lg bg-gradient-to-r px-2.5 py-1.5 rounded-xl from-indigo-50/70 to-white dark:from-gray-900 dark:to-gray-950 dark:text-indigo-300 text-indigo-700"><svg class="mr-1.5 text-indigo-500 inline-block -mt-0.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width=".8em" height=".8em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path class="uim-quaternary" d="M20.23 7.24L12 12L3.77 7.24a1.98 1.98 0 0 1 .7-.71L11 2.76c.62-.35 1.38-.35 2 0l6.53 3.77c.29.173.531.418.7.71z" opacity=".25" fill="currentColor"></path><path class="uim-tertiary" d="M12 12v9.5a2.09 2.09 0 0 1-.91-.21L4.5 17.48a2.003 2.003 0 0 1-1-1.73v-7.5a2.06 2.06 0 0 1 .27-1.01L12 12z" opacity=".5" fill="currentColor"></path><path class="uim-primary" d="M20.5 8.25v7.5a2.003 2.003 0 0 1-1 1.73l-6.62 3.82c-.275.13-.576.198-.88.2V12l8.23-4.76c.175.308.268.656.27 1.01z" fill="currentColor"></path></svg><span class="font-light">lớp</span> <span class="font-medium">diffusers.pipelines.consisid.pipeline_output.</span><span class="font-semibold">ConsisIDPipelineOutput</span></span></h3><!----> <a id="diffusers.pipelines.consisid.pipeline_output.ConsisIDPipelineOutput" class="header-link invisible with-hover:group-hover:visible pr-2" href="#diffusers.pipelines.consisid.pipeline_output.ConsisIDPipelineOutput"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></a> <!--[0--><a class="!ml-auto !text-gray-400 !no-underline text-sm flex items-center" href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/consisid/pipeline_output.py#L9" target="_blank"><span>&lt;</span> <span class="hidden md:block mx-0.5 hover:!underline">source</span> <span>></span></a><!--]--></span> <!--[0--><p class="font-mono text-xs md:text-sm !leading-relaxed !my-6"><span>(</span> <!--[--><span class="comma cursor-pointer"><span class="rounded hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black">frames<span class="opacity-60">: Tensor</span></span></span><!--]--> <span>)</span> <!--[-1--><!--]--></p><!--]--> <div class="!mb-10 relative docstring-details "><!--[-1--><!--]--> <!--[0--><p class="flex items-center font-semibold !mt-2 !mb-2 text-gray-800">Tham số <span class="flex-auto border-t-2 border-gray-100 dark:border-gray-700 ml-3"></span></p> <ul class="px-2"><!--[--><li class="text-base !pl-4 my-3 rounded "><span class="group flex space-x-1.5 items-start"><a id="diffusers.pipelines.consisid.pipeline_output.ConsisIDPipelineOutput.frames" class="header-link block pr-0.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#diffusers.pipelines.consisid.pipeline_output.ConsisIDPipelineOutput.frames"><span><svg class="text-smd" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!----><strong>frames</strong> (<code>torch.Tensor</code>, <code>np.ndarray</code>, hoặc list[list[PIL.Image.Image]]) —
danh sách các đầu ra video - Có thể là một danh sách lồng nhau có độ dài <code>batch_size,</code> trong đó mỗi danh sách con chứa
các chuỗi hình ảnh PIL đã khử nhiễu có độ dài <code>num_frames.</code> Nó cũng có thể là một mảng NumPy hoặc tensor Torch có hình dạng
<code>(batch_size, num_frames, channels, height, width)</code>.<!----></span></span></li><!--]--></ul><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--></div></div><!----> <p>Lớp đầu ra cho các pipeline ConsisID.</p></div> <a class="!text-gray-400 !no-underline text-sm flex items-center not-prose mt-4" href="https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/consisid.md" target="_blank"><svg class="mr-1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M31,16l-7,7l-1.41-1.41L28.17,16l-5.58-5.59L24,9l7,7z"></path><path d="M1,16l7-7l1.41,1.41L3.83,16l5.58,5.59L8,23l-7-7z"></path><path d="M12.419,25.484L17.639,6.552l1.932,0.518L14.351,26.002z"></path></svg><!----> <span><span class="underline">Update</span> on GitHub</span></a><!----> <p></p><!--]--><!----><!--]--><!--]--><!--]--> <!--[-1--><!--]--><!--]-->
<script>
{
__sveltekit_g37pnb = {
base: "/docs/diffusers/main/en",
assets: "/docs/diffusers/main/en"
};
const element = document.currentScript.parentElement;
Promise.all([
import("/docs/diffusers/main/en/_app/immutable/entry/start.D3LnKZ4R.js"),
import("/docs/diffusers/main/en/_app/immutable/entry/app.C0rBoMxR.js")
]).then(([kit, app]) => {
kit.start(app, element, {
node_ids: [0, 158],
data: [null,null],
form: null,
error: null
});
});
}
</script>

Xet Storage Details

Size:
45.6 kB
·
Xet hash:
e5109f9a713908b89ba5ec19fd562a7bbf385126c8938b46d8b5154fbef2bad4

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.