Buckets:
| <meta charset="utf-8" /><meta name="hf:doc:metadata" content="{"title":"MiniMax-H3","local":"minimax-h3","sections":[{"title":"تخطيط نقطة التفتيش","local":"checkpoint-layout","sections":[],"depth":2},{"title":"جدولان زمنيان","local":"two-schedulers","sections":[],"depth":2},{"title":"قيود التوليد","local":"generation-constraints","sections":[],"depth":2},{"title":"الذاكرة","local":"memory","sections":[],"depth":2},{"title":"النص والإطارات المفتاحية","local":"text-and-keyframes","sections":[],"depth":2},{"title":"مرجع شامل","local":"omni-references","sections":[{"title":"الجيل كمرجع","local":"a-generation-as-a-reference","sections":[],"depth":3}],"depth":2},{"title":"MiniMaxH3ModularPipeline","local":"diffusers.MiniMaxH3ModularPipeline","sections":[],"depth":2},{"title":"MiniMaxH3Blocks","local":"diffusers.MiniMaxH3Blocks","sections":[],"depth":2},{"title":"MiniMaxH3ImageReference","local":"diffusers.modular_pipelines.minimax_h3.MiniMaxH3ImageReference","sections":[],"depth":2},{"title":"MiniMaxH3VideoReference","local":"diffusers.modular_pipelines.minimax_h3.MiniMaxH3VideoReference","sections":[],"depth":2},{"title":"MiniMaxH3AudioReference","local":"diffusers.modular_pipelines.minimax_h3.MiniMaxH3AudioReference","sections":[],"depth":2}],"depth":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/213.YQK23m03.js" rel="modulepreload"> | |
| <link href="/docs/diffusers/main/en/_app/immutable/chunks/bKdwVYpU.js" rel="modulepreload"> | |
| <link href="/docs/diffusers/main/en/_app/immutable/chunks/D0iXbNom.js" rel="modulepreload"> | |
| <!--1oh9kud--><meta name="hf:doc:metadata" content="{"title":"MiniMax-H3","local":"minimax-h3","sections":[{"title":"Checkpoint layout","local":"checkpoint-layout","sections":[],"depth":2},{"title":"Two schedulers","local":"two-schedulers","sections":[],"depth":2},{"title":"Generation constraints","local":"generation-constraints","sections":[],"depth":2},{"title":"Memory","local":"memory","sections":[],"depth":2},{"title":"Text and keyframes","local":"text-and-keyframes","sections":[],"depth":2},{"title":"Omni-references","local":"omni-references","sections":[{"title":"A generation as a reference","local":"a-generation-as-a-reference","sections":[],"depth":3}],"depth":2},{"title":"MiniMaxH3ModularPipeline","local":"diffusers.MiniMaxH3ModularPipeline","sections":[],"depth":2},{"title":"MiniMaxH3Blocks","local":"diffusers.MiniMaxH3Blocks","sections":[],"depth":2},{"title":"MiniMaxH3ImageReference","local":"diffusers.modular_pipelines.minimax_h3.MiniMaxH3ImageReference","sections":[],"depth":2},{"title":"MiniMaxH3VideoReference","local":"diffusers.modular_pipelines.minimax_h3.MiniMaxH3VideoReference","sections":[],"depth":2},{"title":"MiniMaxH3AudioReference","local":"diffusers.modular_pipelines.minimax_h3.MiniMaxH3AudioReference","sections":[],"depth":2}],"depth":1}"/><!----> | |
| <link href="/docs/diffusers/main/en/_app/immutable/assets/0.tn0RQdqM.css" rel="modulepreload"> <!--[--><!--[0--><!--[--><!--[0--><!--[--><p></p> <div class="items-center shrink-0 min-w-[100px] max-sm:min-w-[50px] justify-end ml-auto flex" style="float: inline-end; margin-inline-start: 10px; display: inline-flex; position: relative; z-index: 10;"><div dir="ltr" class="inline-flex rounded-md max-sm:rounded-sm"><button class="inline-flex items-center gap-1 h-7 max-sm:h-7 px-2 max-sm:px-1.5 text-sm font-medium text-gray-800 border border-r-0 rounded-l-md max-sm:rounded-l-sm border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-live="polite"><span class="inline-flex items-center justify-center rounded-md p-0.5 max-sm:p-0 hover:text-gray-800 dark:hover:text-gray-200"><svg class="sm:size-3.5 size-3" 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><!----></span> <span dir="auto">Copy page</span></button> <button class="inline-flex items-center justify-center w-6 max-sm:w-5 h-7 max-sm:h-7 disabled:pointer-events-none text-sm text-gray-500 hover:text-gray-700 dark:hover:text-white rounded-r-md max-sm:rounded-r-sm border border-l transition border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-haspopup="menu" aria-expanded="false" aria-label="Open copy menu"><svg class="transition-transform text-gray-400 overflow-visible sm:size-3.5 size-3 rotate-0" width="1em" height="1em" viewBox="0 0 12 7" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L6 6L11 1" stroke="currentColor"></path></svg><!----></button></div> <!--[-1--><!--]--></div><!----> <!--[0--><h1 class="relative group"><a id="minimax-h3" 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="#minimax-h3"><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><!---->MiniMax-H3<!----></span></h1><!--]--><!----> <div class="flex flex-wrap space-x-1"><a href="https://huggingface.co/docs/diffusers/main/en/tutorials/using_peft_for_inference" target="_blank" rel="noopener"><img alt="LoRA" src="https://img.shields.io/badge/LoRA-d8b4fe?style=flat"/></a></div> <p>يولّد MiniMax-H3 الفيديو وموسيقاه الخلفية معًا. يقوم محوّل واحد بإزالة الضوضاء من تسلسل واحد مُجمّع يحتوي على شروط النص، ووسائط الشروط، والقيم الكامنة المستهدفة للفيديو والصوت. لا يوجد مُصوِّت منفصل ولا مسار معالجة لاحقة للصوت: فالفيديو والصوت ينبثقان من حلقة إزالة الضوضاء نفسها.</p> <p>يمكنك العثور على نقاط التفتيش الأصلية لنموذج MiniMax-H3 تحت منظمة <a href="https://huggingface.co/MiniMaxAI" rel="nofollow">MiniMaxAI</a>.</p> <p>يُدمج MiniMax-H3 على شكل كتل <a href="../../modular_diffusers/overview">Modular Diffusers</a> فقط، تمامًا كما هو الحال مع <a href="./anima">Anima</a>: فالكُتل و<a href="/docs/diffusers/main/ar/api/pipelines/minimax_h3#diffusers.MiniMaxH3ModularPipeline">MiniMaxH3ModularPipeline</a> الخاصة بها هي التكامل بأكمله، ولا يوجد نصف <code>DiffusionPipeline</code>.</p> <!--[1--><h2 class="relative group"><a id="checkpoint-layout" 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="#checkpoint-layout"><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><!---->تخطيط نقطة التفتيش<!----></span></h2><!--]--><!----> <p>تم إصدار MiniMax-H3 على شكل قسمَي نقطة تفتيش يتشاركان كل المكوّنات باستثناء محوّل التحويل (transformer)، لذا يضع تحويل diffusers كلاهما في <strong>مستودع واحد</strong>:</p> <table><thead><tr><th>مجلد فرعي</th><th>سير العمل</th></tr></thead><tbody><tr><td><code>transformer/</code></td><td><code>t2va</code> (نص فقط)، <code>fl2va</code> (الإطار المفتاحي الأول و/أو الأخير)</td></tr><tr><td><code>transformer_ref/</code></td><td><code>ref2va</code> (مزيج مرتب من مراجع الصور والفيديو والصوت)</td></tr></tbody></table> <p>كل شيء عدا محوّل التحويل (transformer)، أي نموذج VAE للفيديو، ونموذج VAE للصوت، ومُشكِّل Qwen3-VL، ومُرمّز ومعالج هذا المُشكِّل، والمُجدوِلين، هو مشترك ويُخزَّن مرة واحدة.</p> <p>المُشكِّل هو <code>Qwen3VLForConditionalGeneration</code>، وتقرأ MiniMax-H3 الحالة المخفية <em>غير المُعايَرة</em> بعد طبقة المُفكِّك الخمسين بدلاً من الطبقة الأخيرة، لذا يُستخدم نقطة الفحص الكاملة المُطلَقة مع عدم استخدام رأس نموذج اللغة الخاص بها.</p> <p>جميع المهام الثلاث هي مسارات عمل ضمن <a href="/docs/diffusers/main/ar/api/pipelines/minimax_h3#diffusers.MiniMaxH3Blocks">MiniMaxH3Blocks</a> الواحد، ويحمل المستودع ملف <code>modular_model_index.json</code> واحدًا يسمّي كل مكوّن مع مواصفات تحميله الخاصة. لخدمة مهمة واحدة، مرّر مسار العمل إلى <code>from_pretrained</code>: فهو يحتفظ فقط بمكوّنات ذلك المسار، لذا فإن توقيع خط الأنابيب (<code>pipe.doc</code>) يوثّق مدخلات تلك المهمة تحديدًا، ولا تُعلن إلا مكوّنات تلك المهمة، ويجلب <code>load_components</code> مجلداتها الفرعية تحديدًا — فخط أنابيب <code>t2va</code> / <code>fl2va</code> لا يلمس <code>transformer_ref/</code> أبدًا، وخط أنابيب <code>ref2va</code> لا يلمس <code>transformer/</code> أبدًا.</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> تم النسخ</div><!----></button><!----></div> <pre class="language-py "><!----><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> ModularPipeline | |
| pipe = ModularPipeline.from_pretrained(<span class="hljs-string">"MiniMaxAI/MiniMax-H3"</span>, workflow=<span class="hljs-string">"ref2va"</span>) | |
| pipe.load_components(dtype=torch.bfloat16)<!----></pre></div><!----> <blockquote class="tip"><p><code>pipe.doc</code> يطبع ما تستقبله خط المعالجة أمامك وما تعيده — كل مدخل مع قيمته الافتراضية، والمكونات التي تتوقعها والمخرجات التي تنتجها. عند تقليصها إلى مسار عمل واحد، تصف تلك المهمة بدقة، وهو أسرع طريقة لمعرفة ما يحتاجه طلب قبل إرساله.</p></blockquote> <p>لإبقاء كل سير عمل متاح على خط أنابيب واحد بدلاً من ذلك، اترك حجة <code>workflow</code> فارغة: فسيقوم خط الأنابيب بعد ذلك باختيار سير العمل لكل استدعاء من المدخلات التي يُمرَّر بها.</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> تم النسخ</div><!----></button><!----></div> <pre class="language-py "><!---->pipe = ModularPipeline.from_pretrained(<span class="hljs-string">"MiniMaxAI/MiniMax-H3"</span>)<!----></pre></div><!----> <p>يمكن أن يستمر <em>التحميل</em> على شكل دورة عمل واحدة في كل مرة. تستدعي هذه الدعوة <code>transformer/</code> وكل المكوّنات المشتركة، والتي تخدم كلًا من <code>t2va</code> و<code>fl2va</code>:</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> تم النسخ</div><!----></button><!----></div> <pre class="language-py "><!---->pipe.load_components(workflow=<span class="hljs-string">"t2va"</span>, dtype=torch.bfloat16)<!----></pre></div><!----> <p>استدعاء <code>load_components()</code> عادي دون تحديد <code>workflow=</code> يجلب <strong>كلا</strong> قسمي التحويلي بحجم 61.7 جيجابايت، وهو ما يتيح لخط أنابيب واحد تقديم جميع سير العمل الثلاثة دون الحاجة إلى استدعاء تحميل آخر. اقرنه مع <a href="/docs/diffusers/main/ar/api/modular_diffusers/pipeline_components#diffusers.ComponentsManager">ComponentsManager</a> والتفريغ التلقائي: تبقى الأوزان في ذاكرة الوصول العشوائي للمضيف، وينقل المدير إلى المعالج التسريعي فقط ما يحتاجه كل خطوة، لذا عندما يطلب مُزيل الضوضاء <code>ref2va</code> الجهاز، تقوم الاستراتيجية بتفريغ ما يكفي من العناصر لتحرير مساحة كافية. راجع <a href="#memory">الذاكرة</a> للوصفات.</p> <!--[1--><h2 class="relative group"><a id="two-schedulers" 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="#two-schedulers"><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><!---->جدولان زمنيان<!----></span></h2><!--]--><!----> <p>تتدرّج كامنات الفيديو والصوت على جدولين مختلفين داخل استدعاء واحد لتحوّل (transformer) في كل خطوة، ولهذا تتوقع الكتل وجود مثيلين من <a href="/docs/diffusers/main/ar/api/schedulers/minimax_h3#diffusers.MiniMaxH3Scheduler">MiniMaxH3Scheduler</a>: <code>scheduler</code> لكامنات الفيديو (<code>shift=12.0</code> في نقاط التفتيش المنشورة) و<code>audio_scheduler</code> لكامنات الصوت (<code>shift=3.0</code>).</p> <p>تخضع كلتا تقسيمات الترانسفورمر للتقطير الموجّه، لذا ينطبق هذا على كل سير عمل: فالتوجيه مدمج في الأوزان، ولا يوجد موجّه، ولا <code>negative_prompt</code> ولا <code>guidance_scale</code>، وتُنفَّذ كل خطوة بتمريرة أمامية واحدة بالضبط.</p> <!--[1--><h2 class="relative group"><a id="generation-constraints" 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="#generation-constraints"><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><!---->قيود التوليد<!----></span></h2><!--]--><!----> <ul><li><strong>24 إطارًا في الثانية، من 5 إلى 15 ثانية.</strong> يتم تقريب <code>num_frames</code> إلى أقرب قيمة من الشكل <code>17 * n + 5</code> يمكن لنموذج VAE الخاص بالفيديو فك ترميزها، ويجب أن تبقى المدة الناتجة ضمن هذه النطاق.</li> <li><strong>حافة قصيرة بطول 768 بكسل.</strong> القيم الافتراضية لـ <code>height</code> و<code>width</code> هي أبعاد MiniMax-H3 الخاصة بالنسبة لأبعاد الإطار المفتاحي الأول (أو 16:9 في حال عدم وجوده)، ويجب أن تكون مضاعفات للرقم 32.</li> <li><strong>مولّد واحد، ثلاث عمليات سحب.</strong> يقوم الطلب بسحب ضوضاء إطار المفتاح أو شرط المرجع أولاً، ثم ضوضاء الفيديو، ثم ضوضاء الصوت، جميعها من <code>generator</code> المُمرَّر إليه، لذا فإن تشغيلين من نفس حالة المولّد يعيدان نفس الفيديو والموسيقى التصويرية. تمرير <code>latents</code> أو <code>audio_latents</code> يستبدل عملية السحب المقابلة.</li> <li><strong>يُحسب <code>num_inference_steps</code> نقاط شبكة سيجما</strong>، بما في ذلك <code>0</code> النهائي، لذا فإنه يقلل من تقييم النموذج مرة واحدة.</li></ul> <!--[1--><h2 class="relative group"><a id="memory" 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"><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><!---->الذاكرة<!----></span></h2><!--]--><!----> <p>يبلغ حجم المحوّل وحده 61.7 غيغابايت في bfloat16، بينما يضيف مشروط Qwen3-VL 62.1 غيغابايت إضافية، لذا تعتمد وصفة التحميل على العتاد. تُعدّ اللوحات الأصغر حجماً أكبر رافعة سرعة في جميع الإعدادات: لا يتعين أن تكون <code>height</code> و<code>width</code> مضاعفات لـ 32 فحسب، بل إن 960x544 يعمل أسرع بنحو 2.3 مرة لكل خطوة مقارنةً بحجم التدريب 1344x768.</p> <p>على بطاقة واحدة بسعة 80 جيجابايت، سجّل المكونات في <a href="/docs/diffusers/main/ar/api/modular_diffusers/pipeline_components#diffusers.ComponentsManager">ComponentsManager</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> تم النسخ</div><!----></button><!----></div> <pre class="language-py "><!----><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> ComponentsManager, ModularPipeline | |
| manager = ComponentsManager() | |
| pipe = ModularPipeline.from_pretrained(<span class="hljs-string">"MiniMaxAI/MiniMax-H3"</span>, components_manager=manager) | |
| pipe.load_components(workflow=<span class="hljs-string">"t2va"</span>, dtype=torch.bfloat16) | |
| manager.enable_auto_cpu_offload(device=<span class="hljs-string">"cuda"</span>, memory_reserve_margin=<span class="hljs-string">"12GB"</span>) <span class="hljs-comment"># or "mps", "xpu", "cpu"</span> | |
| pipe.transformer.set_attention_backend(<span class="hljs-string">"_flash_3_hub"</span>) <span class="hljs-comment"># Hopper, roughly 3x faster; kernels fetched from the Hub</span><!----></pre></div><!----> <p>على بطاقة استهلاكية (24 إلى 32 جيجابايت)، قم بتكميم المكوّنين الكبيرين إلى int8 أثناء تحميلهما، وانقل كتل المحوّل من ذاكرة المعالج المركزية. كل ما يلي يستخدم محمّلات مدعومة فقط، دون أي تعديلات، ويعمل مباشرةً من نقطة التفتيش bfloat16:</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> تم النسخ</div><!----></button><!----></div> <pre class="language-py "><!----><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> MiniMaxH3Transformer3DModel, ModularPipeline, TorchAoConfig | |
| <span class="hljs-keyword">from</span> diffusers.hooks <span class="hljs-keyword">import</span> apply_group_offloading | |
| <span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Qwen3VLForConditionalGeneration | |
| <span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TorchAoConfig <span class="hljs-keyword">as</span> TransformersTorchAoConfig | |
| <span class="hljs-keyword">from</span> torchao.quantization <span class="hljs-keyword">import</span> Int8WeightOnlyConfig | |
| pipe = ModularPipeline.from_pretrained(<span class="hljs-string">"MiniMaxAI/MiniMax-H3"</span>) | |
| pipe.update_components( | |
| transformer=MiniMaxH3Transformer3DModel.from_pretrained( | |
| <span class="hljs-string">"MiniMaxAI/MiniMax-H3"</span>, subfolder=<span class="hljs-string">"transformer"</span>, dtype=torch.bfloat16, | |
| quantization_config=TorchAoConfig( | |
| Int8WeightOnlyConfig(version=<span class="hljs-number">2</span>), | |
| modules_to_not_convert=[ | |
| <span class="hljs-string">"proj_in"</span>, <span class="hljs-string">"audio_proj_in"</span>, <span class="hljs-string">"context_embedder"</span>, <span class="hljs-string">"time_embedder"</span>, <span class="hljs-string">"time_proj"</span>, | |
| <span class="hljs-string">"token_refiner"</span>, <span class="hljs-string">"norm_out"</span>, <span class="hljs-string">"proj_out"</span>, <span class="hljs-string">"audio_proj_out"</span>, | |
| ], | |
| ), | |
| low_cpu_mem_usage=<span class="hljs-literal">False</span>, | |
| ), | |
| text_encoder=Qwen3VLForConditionalGeneration.from_pretrained( | |
| <span class="hljs-string">"MiniMaxAI/MiniMax-H3"</span>, subfolder=<span class="hljs-string">"text_encoder"</span>, dtype=torch.bfloat16, | |
| quantization_config=TransformersTorchAoConfig( | |
| Int8WeightOnlyConfig(version=<span class="hljs-number">2</span>), | |
| modules_to_not_convert=[<span class="hljs-string">"model.visual"</span>, <span class="hljs-string">"model.language_model.embed_tokens"</span>, <span class="hljs-string">"model.language_model.norm"</span>, <span class="hljs-string">"lm_head"</span>], | |
| ), | |
| ), | |
| ) | |
| pipe.load_components(workflow=<span class="hljs-string">"t2va"</span>, dtype=torch.bfloat16) | |
| <span class="hljs-comment"># version=2 int8 tensors are pinnable, which streamed offload needs, and freezing removes the one autograd</span> | |
| <span class="hljs-comment"># path the quantized tensors cannot serve.</span> | |
| pipe.transformer.requires_grad_(<span class="hljs-literal">False</span>) | |
| pipe.text_encoder.requires_grad_(<span class="hljs-literal">False</span>) | |
| offload = <span class="hljs-built_in">dict</span>(onload_device=torch.device(<span class="hljs-string">"cuda"</span>), offload_device=torch.device(<span class="hljs-string">"cpu"</span>), use_stream=<span class="hljs-literal">True</span>) | |
| pipe.transformer.enable_group_offload(offload_type=<span class="hljs-string">"block_level"</span>, num_blocks_per_group=<span class="hljs-number">1</span>, **offload) | |
| apply_group_offloading(pipe.text_encoder.model, offload_type=<span class="hljs-string">"leaf_level"</span>, **offload) | |
| pipe.vae.to(<span class="hljs-string">"cuda"</span>) <span class="hljs-comment"># or "mps", "xpu", "cpu"</span> | |
| pipe.audio_vae.to(<span class="hljs-string">"cuda"</span>)<!----></pre></div><!----> <p>على ذاكرة 12 إلى 16 جيجابايت، تعمل الوصفة نفسها مع تفريغ مجموعة VAE الخاصة بالفيديو أيضًا (<code>offload_type="leaf_level"</code>، بدون تدفق) ولوحة صغيرة مثل 960x544. توقع أن تقيم الأوزان في ذاكرة RAM على المضيف: حوالي 75 جيجابايت منها عند int8.</p> <p>مع بطاقتين لا حاجة إلى تفريغ أي شيء: قسّم خط الأنابيب إلى نصفين وضع كل نصف على جهازه الخاص.</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> تم النسخ</div><!----></button><!----></div> <pre class="language-py "><!----><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> ComponentsManager, ModularPipeline | |
| workflow = ModularPipeline.from_pretrained(<span class="hljs-string">"MiniMaxAI/MiniMax-H3"</span>).blocks.get_workflow(<span class="hljs-string">"t2va"</span>) | |
| text_manager = ComponentsManager() | |
| text_manager.enable_auto_cpu_offload(device=<span class="hljs-string">"cuda:1"</span>) | |
| conditioner = workflow.sub_blocks.pop(<span class="hljs-string">"text_encoder"</span>).init_pipeline( | |
| <span class="hljs-string">"MiniMaxAI/MiniMax-H3"</span>, components_manager=text_manager | |
| ) | |
| conditioner.load_components(dtype=torch.bfloat16) | |
| manager = ComponentsManager() | |
| manager.enable_auto_cpu_offload(device=<span class="hljs-string">"cuda:0"</span>) | |
| rest = workflow.init_pipeline(<span class="hljs-string">"MiniMaxAI/MiniMax-H3"</span>, components_manager=manager) | |
| rest.load_components(dtype=torch.bfloat16) | |
| prompt = <span class="hljs-string">"A red fox trotting through a snowy pine forest, snow crunching underfoot"</span> | |
| state = conditioner(prompt=prompt) | |
| results = rest( | |
| state=state, | |
| num_frames=<span class="hljs-number">124</span>, | |
| generator=torch.Generator().manual_seed(<span class="hljs-number">42</span>), | |
| output=[<span class="hljs-string">"videos"</span>, <span class="hljs-string">"audio"</span>, <span class="hljs-string">"sampling_rate"</span>], | |
| )<!----></pre></div><!----> <p>يعمل بطاقان بسعة 80 جيجابايت على كامل bfloat16 بهذه الطريقة: حيث يتسع كل نصف على بطاقته الخاصة، فلا يُعاد أي شيء إلى ذاكرة المضيف بعد أن يصبح مقيمًا. وتقوم بطاقتان بسعة 48 جيجابايت بالشيء نفسه باستخدام تحميل int8 المذكور أعلاه على كلا المكوّنين.</p> <!--[1--><h2 class="relative group"><a id="text-and-keyframes" 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="#text-and-keyframes"><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><!---->النص والإطارات المفتاحية<!----></span></h2><!--]--><!----> <p>يتناول <a href="/docs/diffusers/main/ar/api/pipelines/minimax_h3#diffusers.MiniMaxH3Blocks">MiniMaxH3Blocks</a> توليد الفيديو والصوت من النص، والشروط بناءً على الإطارات الرئيسية. يمكن أن يكون الإطار الرئيسي هو الإطار الذي يبدأ منه الفيديو (<code>image</code>)، أو الإطار الذي ينتهي عليه (<code>last_image</code>)، أو كلاهما معًا.</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> تم النسخ</div><!----></button><!----></div> <pre class="language-py "><!----><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> ComponentsManager, ModularPipeline | |
| <span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image | |
| <span class="hljs-keyword">from</span> diffusers.utils.export_utils <span class="hljs-keyword">import</span> encode_video | |
| <span class="hljs-comment"># 61.7GB of transformer and 62.1GB of conditioner do not sit on one accelerator, so the components are</span> | |
| <span class="hljs-comment"># registered in a manager that moves each one on and off as the blocks reach it. See [Memory](#memory).</span> | |
| manager = ComponentsManager() | |
| manager.enable_auto_cpu_offload(device=<span class="hljs-string">"cuda"</span>) <span class="hljs-comment"># or "mps", "xpu", "cpu"</span> | |
| pipe = ModularPipeline.from_pretrained(<span class="hljs-string">"MiniMaxAI/MiniMax-H3"</span>, components_manager=manager) | |
| pipe.load_components(workflow=<span class="hljs-string">"fl2va"</span>, dtype=torch.bfloat16) | |
| prompt = <span class="hljs-string">"A red fox trotting through a snowy pine forest, snow crunching underfoot"</span> | |
| <span class="hljs-comment"># `output=` returns exactly the named outputs instead of the whole pipeline state.</span> | |
| outputs = [<span class="hljs-string">"videos"</span>, <span class="hljs-string">"audio"</span>, <span class="hljs-string">"sampling_rate"</span>] | |
| <span class="hljs-comment"># Text to video + audio.</span> | |
| results = pipe(prompt=prompt, num_frames=<span class="hljs-number">124</span>, generator=torch.Generator().manual_seed(<span class="hljs-number">42</span>), output=outputs) | |
| <span class="hljs-comment"># First frame (and optionally last frame) to video + audio. The canvas follows the first keyframe.</span> | |
| image = load_image( | |
| <span class="hljs-string">"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/astronaut.jpg"</span> | |
| ) | |
| results = pipe(prompt=prompt, image=image, num_frames=<span class="hljs-number">124</span>, generator=torch.Generator().manual_seed(<span class="hljs-number">42</span>), output=outputs) | |
| encode_video( | |
| results[<span class="hljs-string">"videos"</span>][<span class="hljs-number">0</span>], | |
| fps=<span class="hljs-number">24</span>, | |
| output_path=<span class="hljs-string">"minimax_h3_fl2va.mp4"</span>, | |
| audio=results[<span class="hljs-string">"audio"</span>][<span class="hljs-number">0</span>], | |
| audio_sample_rate=results[<span class="hljs-string">"sampling_rate"</span>], | |
| )<!----></pre></div><!----> <p>يتم توليد الفيديو والصوت معًا ويخرجان من الاستدعاء كمخرجات منفصلة، <code>videos</code> و<code>audio</code>، إلى جانب <code>sampling_rate</code> الذي يحمله المسار الصوتي؛ ويُترك دمجهما في ملف واحد على المستدعي، مثلًا باستخدام <a href="/docs/diffusers/main/ar/api/utilities#diffusers.utils.encode_video">encode_video()</a>.</p> <!--[1--><h2 class="relative group"><a id="omni-references" 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="#omni-references"><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><!---->مرجع شامل<!----></span></h2><!--]--><!----> <p>يعتمد سير عمل <code>ref2va</code> على قائمة مرتبة من المراجع: ما يصل إلى 9 صور، و3 مقاطع فيديو، و3 مقاطع صوتية، أي 12 مرجعًا إجمالًا. الترتيب هنا دلالي؛ فهو يحدد المراجع في عرض الموجّه (<code>"<Picture 1>"</code>، <code>"<Audio 1>"</code>، <code>"<Video 1>"</code>)، كما أنه يُقدّم الساعة الدوّارة المشتركة للصوت/الفيديو، لذا فإن إعادة ترتيب المراجع نفسها تُشكّل طلبًا مختلفًا.</p> <p>على عكس الإطارات المفتاحية أعلاه، لا تربط المراجع الهندسة المولّدة: فهي تُرمَّز عند دقتها الخاصة، بينما يكون الإطار المستهدف افتراضيًا بنسبة 16:9 الخاصة بـ MiniMax-H3.</p> <p>توجد فئة مرجعية واحدة لكل نمط، حيث تحتفظ كل فئة بوسائط في الذاكرة والمعدل الذي تنقل به الوسائط:</p> <table><thead><tr><th>مرجع</th><th>وسائط</th><th>السرعة التي يعلن عنها</th></tr></thead><tbody><tr><td><a href="/docs/diffusers/main/ar/api/pipelines/minimax_h3#diffusers.modular_pipelines.minimax_h3.MiniMaxH3ImageReference">MiniMaxH3ImageReference</a></td><td><code>image</code></td><td>—</td></tr><tr><td><a href="/docs/diffusers/main/ar/api/pipelines/minimax_h3#diffusers.modular_pipelines.minimax_h3.MiniMaxH3VideoReference">MiniMaxH3VideoReference</a></td><td><code>frames</code>، و<code>audio</code> لموسيقاه</td><td><code>fps</code>، بقيمة افتراضية تبلغ 24.0 الخاصة بـ MiniMax-H3، و<code>sample_rate</code></td></tr><tr><td><a href="/docs/diffusers/main/ar/api/pipelines/minimax_h3#diffusers.modular_pipelines.minimax_h3.MiniMaxH3AudioReference">MiniMaxH3AudioReference</a></td><td><code>audio</code></td><td><code>sample_rate</code>، حيث تكون القيمة الافتراضية هي</td></tr></tbody></table> <p>المعدلات هي الأساس الذي يُعاد أخذ عينات كل شيء منه: تُعاد أخذ عينات الإطارات إلى معدل 24 إطارًا في الثانية الخاص بـ MiniMax-H3 نفسه عن طريق حذف إطارات كاملة وتكرارها، وتُعاد أخذ عينات الموجة الصوتية إلى معدل أخذ العينات الخاص بوحدة VAE الصوتية. يمرّ المحتوى الإعلامي بمعدلات MiniMax-H3 الخاصة به دون أي تعديل، لذا لا يتعين على البيانات المنتَجة بمعدل آخر سوى الإشارة إلى ذلك.</p> <p>يُبنى المرجع بأحد طريقتين: إما عبر فك الترميز من ملف وسائط باستخدام طريقة الفئة <code>from_file</code> الخاصة بالفئة، أو عبر بنائه مباشرةً من وسائط الطلب التي يحتفظ بها بالفعل في الذاكرة — وهو الأسلوب الذي تُغذّى به جولة سابقة في العملية (انظر <a href="#a-generation-as-a-reference">الجولة كمرجع</a>).</p> <p>لا تفتح الكتل ملف وسائط أبدًا — فك ترميز المسار هو مسؤولية المستدعي، كما هو الحال في كل مكان آخر في المكتبة. يقوم كل فئة مرجعية بذلك من خلال طريقة الفئة <code>from_file</code>، التي تقبل مسارًا أو عنوان URL (فيديو وصوت عبر <a href="https://github.com/PyAV-Org/PyAV" rel="nofollow">PyAV</a>) وتعيد مرجعًا يحمل المعدلات التي يبلغ عنها الحاوية — يجلب الفيديو معدل إطاراته وموسيقاه المصاحبة معه. يُفضَّل استخدام <code>from_file</code> على <a href="/docs/diffusers/main/ar/api/utilities#diffusers.utils.load_video">load_video()</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> تم النسخ</div><!----></button><!----></div> <pre class="language-py "><!----><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> ComponentsManager, ModularPipeline | |
| <span class="hljs-keyword">from</span> diffusers.modular_pipelines.minimax_h3 <span class="hljs-keyword">import</span> ( | |
| MiniMaxH3AudioReference, | |
| MiniMaxH3ImageReference, | |
| MiniMaxH3VideoReference, | |
| ) | |
| <span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_video | |
| <span class="hljs-keyword">from</span> diffusers.utils.export_utils <span class="hljs-keyword">import</span> encode_video | |
| <span class="hljs-comment"># `ref2va` is a workflow of the one MiniMax-H3 pipeline; selecting it loads only the `transformer_ref/`</span> | |
| <span class="hljs-comment"># checkpoint partition, and the manager moves each component on and off the accelerator in turn.</span> | |
| manager = ComponentsManager() | |
| manager.enable_auto_cpu_offload(device=<span class="hljs-string">"cuda"</span>) <span class="hljs-comment"># or "mps", "xpu", "cpu"</span> | |
| pipe = ModularPipeline.from_pretrained(<span class="hljs-string">"MiniMaxAI/MiniMax-H3"</span>, workflow=<span class="hljs-string">"ref2va"</span>, components_manager=manager) | |
| pipe.load_components(dtype=torch.bfloat16) | |
| subject = MiniMaxH3ImageReference.from_file( | |
| <span class="hljs-string">"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/astronaut.jpg"</span> | |
| ) | |
| <span class="hljs-comment"># Decoding a file brings its rates along: the video its own frame rate and its soundtrack, the clip its sample rate.</span> | |
| results = pipe( | |
| prompt=<span class="hljs-string">"The character speaks in time with the reference recording, natural lip movement"</span>, | |
| references=[ | |
| subject, | |
| MiniMaxH3VideoReference.from_file( | |
| <span class="hljs-string">"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/hiker.mp4"</span> | |
| ), | |
| MiniMaxH3AudioReference.from_file(<span class="hljs-string">"voice.wav"</span>), | |
| ], | |
| num_frames=<span class="hljs-number">124</span>, | |
| output=[<span class="hljs-string">"videos"</span>, <span class="hljs-string">"audio"</span>, <span class="hljs-string">"sampling_rate"</span>], | |
| ) | |
| <span class="hljs-comment"># Frames a request already holds declare the rate they carry — `load_video` does not preserve it.</span> | |
| motion = load_video(<span class="hljs-string">"motion_ref.mp4"</span>) | |
| results = pipe( | |
| prompt=<span class="hljs-string">"The subject walks toward camera, matching the reference video's shot rhythm"</span>, | |
| references=[subject, MiniMaxH3VideoReference(frames=motion, fps=<span class="hljs-number">30.0</span>)], | |
| num_frames=<span class="hljs-number">124</span>, | |
| output=[<span class="hljs-string">"videos"</span>, <span class="hljs-string">"audio"</span>, <span class="hljs-string">"sampling_rate"</span>], | |
| ) | |
| encode_video( | |
| results[<span class="hljs-string">"videos"</span>][<span class="hljs-number">0</span>], | |
| fps=<span class="hljs-number">24</span>, | |
| output_path=<span class="hljs-string">"minimax_h3_ref2va.mp4"</span>, | |
| audio=results[<span class="hljs-string">"audio"</span>][<span class="hljs-number">0</span>], | |
| audio_sample_rate=results[<span class="hljs-string">"sampling_rate"</span>], | |
| )<!----></pre></div><!----> <p><code>num_frames</code> مطلوب لـ <code>ref2va</code>. ولتوليد فيديو بطول يطابق بالضبط مقطع الصوت المرجعي، احسبه من المقطع — <code>round(samples / sample_rate * 24)</code> — وسيُقرَّب إلى أقرب قيمة من الشكل <code>17 * n + 5</code> التي يمكن لـ VAE الخاص بالفيديو فك ترميزها؛ ويجب أن يبقى المدة الناتجة ضمن النطاق من 5 إلى 15 ثانية الذي تولده MiniMax-H3.</p> <!--[2--><h3 class="relative group"><a id="a-generation-as-a-reference" 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="#a-generation-as-a-reference"><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><!---->الجيل كمرجع<!----></span></h3><!--]--><!----> <p>بما أن سير العمل تتشارك خط أنابيب واحدًا، يمكن تمرير توليد <code>t2va</code> مباشرةً كمرجع <code>ref2va</code> — وقد صُمم منشئ الذاكرة لهذا التحويل تحديدًا. الوسائط المولّدة تكون بالفعل بمعدلات MiniMax-H3 الخاصة (الإطارات بمعدل 24 إطارًا في الثانية، والموسيقى التصويرية بمعدل عينة VAE الصوتي)، لذا لا يحتاج المرجع إلى أي معاملات معدل، ولا يتم إعادة الترميز عبر حاوية خاسرة في الطريق:</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> تم النسخ</div><!----></button><!----></div> <pre class="language-py "><!----><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> ComponentsManager, ModularPipeline | |
| <span class="hljs-keyword">from</span> diffusers.modular_pipelines.minimax_h3 <span class="hljs-keyword">import</span> MiniMaxH3VideoReference | |
| manager = ComponentsManager() | |
| manager.enable_auto_cpu_offload(device=<span class="hljs-string">"cuda"</span>) <span class="hljs-comment"># or "mps", "xpu", "cpu"</span> | |
| <span class="hljs-comment"># The full pipeline holds every workflow and picks one per call from the inputs. Loading without a</span> | |
| <span class="hljs-comment"># `workflow=` brings both transformer partitions in one call, so the `ref2va` request that follows the</span> | |
| <span class="hljs-comment"># `t2va` generation needs no further loading.</span> | |
| pipe = ModularPipeline.from_pretrained(<span class="hljs-string">"MiniMaxAI/MiniMax-H3"</span>, components_manager=manager) | |
| pipe.load_components(dtype=torch.bfloat16) | |
| results = pipe( | |
| prompt=<span class="hljs-string">"An astronaut hiking through the mountains, humming a tune"</span>, | |
| num_frames=<span class="hljs-number">124</span>, | |
| output=[<span class="hljs-string">"videos"</span>, <span class="hljs-string">"audio"</span>, <span class="hljs-string">"sampling_rate"</span>], | |
| ) | |
| reference = MiniMaxH3VideoReference( | |
| frames=results[<span class="hljs-string">"videos"</span>][<span class="hljs-number">0</span>], | |
| audio=results[<span class="hljs-string">"audio"</span>][<span class="hljs-number">0</span>], | |
| sample_rate=results[<span class="hljs-string">"sampling_rate"</span>], | |
| ) | |
| results = pipe( | |
| prompt=<span class="hljs-string">"The same astronaut now walks along a beach at sunset, humming the same tune"</span>, | |
| references=[reference], | |
| num_frames=<span class="hljs-number">124</span>, | |
| output=[<span class="hljs-string">"videos"</span>, <span class="hljs-string">"audio"</span>, <span class="hljs-string">"sampling_rate"</span>], | |
| )<!----></pre></div><!----> <!--[1--><h2 class="relative group"><a id="diffusers.MiniMaxH3ModularPipeline" 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.MiniMaxH3ModularPipeline"><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><!---->MiniMaxH3ModularPipeline<!----></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.MiniMaxH3ModularPipeline"><!----><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">فئة</span> <span class="font-medium">diffusers.</span><span class="font-semibold">MiniMaxH3ModularPipeline</span></span></h3><!----> <a id="diffusers.MiniMaxH3ModularPipeline" class="header-link invisible with-hover:group-hover:visible pr-2" href="#diffusers.MiniMaxH3ModularPipeline"><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/modular_pipelines/minimax_h3/modular_pipeline.py#L150" target="_blank"><span><</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">blocks<span class="opacity-60">: diffusers.modular_pipelines.modular_pipeline.ModularPipelineBlocks | None = None</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">pretrained_model_name_or_path<span class="opacity-60">: str | os.PathLike | None = None</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">components_manager<span class="opacity-60">: diffusers.modular_pipelines.components_manager.ComponentsManager | None = None</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">collection<span class="opacity-60">: str | None = None</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">workflow<span class="opacity-60">: str | None = None</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">modular_config_dict<span class="opacity-60">: dict[str, typing.Any] | None = None</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">config_dict<span class="opacity-60">: dict[str, typing.Any] | None = None</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>خط أنابيب ModularPipeline لتوليد الفيديو والصوت معًا باستخدام MiniMax-H3: مسارات العمل <code>t2va</code> (نص فقط) و<code>fl2va</code> (الإطار المفتاحي الأول و/أو الأخير) مقابل تقسيم نقطة التفتيش <code>transformer/</code>، ومسار العمل <code>ref2va</code> (مرجع شامل) مقابل <code>transformer_ref/</code>. يحتوي مستودع واحد على كلا التقسيمين، وعند اختيار مسار عمل يتم تحميل</p> <div class="relative group rounded-md"><a id="diffusers.MiniMaxH3ModularPipeline.example" 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.MiniMaxH3ModularPipeline.example"><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> <p>خاص:</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> تم النسخ</div><!----></button><!----></div> <pre class="language-py "><!---->pipe = ModularPipeline.from_pretrained(<span class="hljs-string">"MiniMaxAI/MiniMax-H3"</span>, workflow=<span class="hljs-string">"ref2va"</span>)<!----></pre></div><!----><!----></div><!----> <p>يقوم MiniMax-H3 بإزالة الضوضاء من <strong>تسلسل واحد مُجمَّع</strong> يحتوي في آنٍ واحد على شروط النص، ومتغيرات شروط الإطارات الرئيسية، ومتغيرات الصوت، ومتغيرات الفيديو، ولهذا السبب تمرر الكتل تخطيط صف بدلاً من متجهات لكل نمط، ولهذا السبب أيضاً تحمل خط المعالجة مجدولين اثنين (<code>shift = 12.0</code> للفيديو، <code>shift = 3.0</code> للصوت) يتم تشغيلهما داخل استدعاء واحد لتحويلة.</p> <p>النقطة المحفوظة مُقطّرة بتوجيه: التوجيه مُدمج في الأوزان، لذا لا يوجد موجّه، ولا <code>negative_prompt</code> ولا <code>guidance_scale</code>، وكل خطوة تُنفّذ تمريرة أمامية واحدة بالضبط.</p> <p>MiniMax-H3 هو معياري فقط: هذا المسار ومكوّناته هو التكامل الكامل، ولا يوجد جزء من <code>DiffusionPipeline</code>. يحمل هذا الوحدة حقائق النموذج التي تعتمد عليها كل المكوّنات — هندسة مشتقة من الإعداد كخصائص، وحسابات اللوحة وعدد الإطارات كدوال — بينما تعيش عقود التكييف والتشفيش والضوضاء على المكوّنات نفسها.</p> <div class="relative group rounded-md"><a id="diffusers.MiniMaxH3ModularPipeline.example-2" 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.MiniMaxH3ModularPipeline.example-2"><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> <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> تم النسخ</div><!----></button><!----></div> <pre class="language-py "><!----><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> ModularPipeline | |
| pipe = ModularPipeline.from_pretrained(<span class="hljs-string">"MiniMaxAI/MiniMax-H3"</span>) | |
| pipe.load_components(dtype=torch.bfloat16)<!----></pre></div><!----></div><!----></div> <!--[1--><h2 class="relative group"><a id="diffusers.MiniMaxH3Blocks" 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.MiniMaxH3Blocks"><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><!---->MiniMaxH3Blocks<!----></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.MiniMaxH3Blocks"><!----><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">فئة</span> <span class="font-medium">diffusers.</span><span class="font-semibold">MiniMaxH3Blocks</span></span></h3><!----> <a id="diffusers.MiniMaxH3Blocks" class="header-link invisible with-hover:group-hover:visible pr-2" href="#diffusers.MiniMaxH3Blocks"><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/modular_pipelines/minimax_h3/modular_blocks_minimax_h3.py#L659" target="_blank"><span><</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>)</span> <!--[-1--><!--]--></p><!--]--> <div class="!mb-10 relative docstring-details "><!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--></div></div><!----> <p>كتل خط أنابيب Auto Modular لتوليد الفيديو والصوت معًا باستخدام MiniMax-H3: مسارات العمل <code>t2va</code> (نص فقط)، و<code>fl2va</code> (إطار رئيسي أولي و/أو أخير)، و<code>ref2va</code> (مرجع شامل)، يتم اختيارها بناءً على مدخلات <code>references</code> والإطارات الرئيسية. في حال عدم تحديد <code>workflow=</code>، فإن تحميل المكونات يجلب <strong>كلا</strong> قسمي محوّل 61.7GB — مرّر أحد القسمين لتحميل ما تحتاجه المهمة فقط.</p> <p>سير العمل المدعومة:</p> <ul><li><code>t2va</code>: يتطلب <code>prompt</code></li> <li><code>fl2va</code>: يتطلب <code>prompt</code> أو <code>image</code> أو <code>prompt</code> و<code>last_image</code></li> <li><code>ref2va</code>: يتطلب <code>prompt</code>، <code>references</code></li></ul> <p>المكوّنات: | |
| image_processor (<code>VaeImageProcessor</code>) text_encoder (<code>Qwen3VLForConditionalGeneration</code>) tokenizer | |
| (<code>Qwen2Tokenizer</code>) processor (<code>Qwen3VLProcessor</code>) vae (<code>AutoencoderKLMiniMaxH3</code>) audio_vae | |
| (<code>AutoencoderKLMiniMaxH3Audio</code>) scheduler (<code>MiniMaxH3Scheduler</code>) audio_scheduler (<code>MiniMaxH3Scheduler</code>) | |
| transformer_ref (<code>MiniMaxH3Transformer3DModel</code>) transformer (<code>MiniMaxH3Transformer3DModel</code>) video_processor | |
| (<code>VideoProcessor</code>)</p> <p>الإعدادات: | |
| canvas_short_edge (الافتراضي: 768) canvas_max_pixels (الافتراضي: 1032192) reference_image_short_edge (الافتراضي: | |
| 2048)</p> <p>المدخلات: | |
| references (<code>list</code>, <em>اختياري</em>): | |
| المراجع التي يُشترط عليها، <strong>بترتيب القراءة الذي يجب أن يتبعه النموذج</strong>: فترتيبها هو ما يحدد تسمياتها في عرض | |
| الموجّه ويحدد توزيعها على الساعة الدوّارة المشتركة، وبالتالي فإن أي ترتيب مختلف يُعد طلبًا مختلفًا. كل فئة بيانات (dataclass) | |
| تتوافق مع نمط (modality) واحد، وكلها تحتفظ بوسائط في الذاكرة — إما <code>MiniMaxH3ImageReference</code> (بحد أقصى 9)، أو | |
| <code>MiniMaxH3VideoReference</code> بمعدل إطارات <code>fps</code> خاص بها (بحد أقصى 3، حيث يُشترط أيضًا على المسار الصوتي | |
| <code>audio</code> الخاص بها)، أو <code>MiniMaxH3AudioReference</code> بمعدل أخذ عينات <code>sample_rate</code> خاص بها (بحد أقصى 3) — | |
| بإجمالي لا يتجاوز 12 مرجعًا، ولا يمكن أن تكون مراجع الصوت هي الوحيدة. هذه الكتل لا تفتح ملف وسائط أبدًا: | |
| قم بفك الترميز باستخدام طريقة الفئة <code>from_file</code> الخاصة بكل فئة، والتي تجلب معها معدلات الإطارات وأخذ العينات. | |
| height (<code>int</code>, <em>اختياري</em>): | |
| ارتفاع الفيديو المولّد بالبكسل، ويجب أن يكون مضاعفًا للرقم 32. | |
| width (<code>int</code>, <em>اختياري</em>): | |
| عرض الفيديو المولّد بالبكسل، ويجب أن يكون مضاعفًا للرقم 32. | |
| num_frames (<code>int</code>, <em>اختياري</em>): | |
| عدد الإطارات المراد توليدها، بمعدل ثابت 24 إطارًا في الثانية. يتم تقريب العدد لأعلى إلى أقرب قيمة من الشكل <code>17 * n + 5</code> | |
| يمكن لـ VAE الخاص بالفيديو فك ترميزها؛ ويجب أن يبقى المدة الناتجة بين 5 و15 ثانية. لتوليد فيديو بطول المسار الصوتي | |
| المرجعي، مرّر <code>round(samples / sample_rate * 24)</code>. | |
| image (<code>Image</code>, <em>اختياري</em>): | |
| الإطار المفتاحي الذي يبدأ منه الفيديو. يتم <em>تمديده</em> على اللوحة المستهدفة، والتي تُشتق افتراضيًا من نسبة | |
| أبعاده الخاصة. | |
| last_image (<code>Image</code>, <em>اختياري</em>): | |
| الإطار المفتاحي الذي ينتهي عنده الفيديو. يمكن تمريره بمفرده لتوليد <em>حتى</em> إطار معين. عند دمجه مع <code>image</code>، يكون هو المتبوع | |
| للإطارين ويُقصّ بطريقة الغطاء (cover-crop) على اللوحة. | |
| prompt (<code>str</code>): | |
| الموجّه الذي يوجه عملية التوليد، وهو نص واحد. | |
| normalized_references (<code>list</code>, <em>اختياري</em>): | |
| المراجع المُعدّلة (normalized) بواسطة خطوة الإعداد، بترتيب الحزم. | |
| keyframes (<code>list</code>, <em>اختياري</em>): | |
| الإطارات المفتاحية الموضوعة على اللوحة المستهدفة، بترتيب الحزم. | |
| condition_latents (<code>list</code>, <em>اختياري</em>): | |
| متجهات الحالة الكامنة (latents) المشفرة للشروط الخاصة بالفيديو، واحدة لكل مرجع صورة وفيديو بترتيب الحزم. شكلها هو | |
| المصدر الذي تأتي منه هندسة كل كتلة مراجع. | |
| audio_condition_latents (<code>list</code>, <em>اختياري</em>): | |
| صفوف الشروط الصوتية المشفرة، واحدة لكل مرجع يحتوي على صوت بترتيب الحزم. | |
| generator (<code>Generator</code>, <em>اختياري</em>): | |
| المولّد الخاص بالطلب. يُسحب ضجيج الشروط منه أولًا، بسحب واحد لكل شرط، | |
| قبل سحب ضجيج الصفوف المولّدة. | |
| latents (<code>Tensor</code>): | |
| ضجيج فيديو مُولّد مسبقًا بشكل <code>(1, 24, num_latent_frames, latent_height, latent_width)</code>، يُستخدم | |
| بدلًا من السحب من المولّد. | |
| audio_latents (<code>Tensor</code>): | |
| ضجيج صوتي مُولّد مسبقًا بشكل <code>(2, 32, num_audio_latents)</code>. | |
| num_inference_steps (<code>int</code>, <em>اختياري</em>, الافتراضي 50): | |
| عدد خطوات إزالة الضجيج. | |
| *<em>denoiser_input_fields (<code>None</code>,</em>اختياري<em>): | |
| الوصف الهيكلي للتسلسل المُجمّع الذي يقرأه محول التحويل (transformer) بالاسم: <code>token_tags</code>، <code>position_ids</code> | |
| والمصفوفات الثلاث لمؤشرات الصفوف. | |
| attention_kwargs (<code>dict</code>,</em>اختياري<em>): | |
| معلمات إضافية لمعالجات الانتباه (attention processors). | |
| keyframe_anchors (<code>tuple</code>,</em>اختياري<em>, الافتراضي ()): | |
| أي طرف من الفيديو يُثبَّت عليه كل إطار مفتاحي، بترتيب الحزم. | |
| output_type (<code>str</code>,</em>اختياري*، الافتراضي pil): | |
| صيغة الإخراج: ‘pil’ أو ‘np’ أو ‘pt’.</p> <p>المخرجات: | |
| فيديوهات (<code>list</code>): | |
| الفيديو المولّد. | |
| صوت (<code>Tensor</code>): | |
| الموسيقى التصويرية المولّدة، ذات الشكل <code>(1, 2, num_samples)</code>. | |
| معدل العينة (<code>int</code>): | |
| معدل عينة الموسيقى التصويرية المولّدة بالهرتز.</p></div> <!--[1--><h2 class="relative group"><a id="diffusers.modular_pipelines.minimax_h3.MiniMaxH3ImageReference" 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.modular_pipelines.minimax_h3.MiniMaxH3ImageReference"><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><!---->MiniMaxH3ImageReference<!----></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.modular_pipelines.minimax_h3.MiniMaxH3ImageReference"><!----><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">فئة</span> <span class="font-medium">diffusers.modular_pipelines.minimax_h3.</span><span class="font-semibold">MiniMaxH3ImageReference</span></span></h3><!----> <a id="diffusers.modular_pipelines.minimax_h3.MiniMaxH3ImageReference" class="header-link invisible with-hover:group-hover:visible pr-2" href="#diffusers.modular_pipelines.minimax_h3.MiniMaxH3ImageReference"><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/modular_pipelines/minimax_h3/references.py#L82" target="_blank"><span><</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">image<span class="opacity-60">: typing.Union[PIL.Image.Image, numpy.ndarray, torch.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">المعاملات <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.modular_pipelines.minimax_h3.MiniMaxH3ImageReference.image" 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.modular_pipelines.minimax_h3.MiniMaxH3ImageReference.image"><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>image</strong> (<code>PIL.Image.Image</code> أو <code>np.ndarray</code> أو <code>torch.Tensor</code>) — | |
| الصورة المرجعية: صورة، أو مصفوفة بأبعاد <code>(height, width, 3)</code>، أو متجه بأبعاد <code>(3, height, width)</code>، بنوع <code>uint8</code> أو | |
| نقاط عائمة ضمن المدى <code>[0, 1]</code>. لا تُقيّد هذه الصورة أبداً الهندسة المولّدة — إذ يتم ترميزها على حافة قصيرة خاصة بها، بمقدار 2048 للنقطة المرجعية المُصدَرة، بغض النظر عن حجم اللوحة الذي تولّده الطلبات.<!----></span></span></li><!--]--></ul><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--></div></div><!----> <p>مرجع للموضوع أو الأسلوب أو المشهد: بحد أقصى 9 لكل طلب.</p> <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.modular_pipelines.minimax_h3.MiniMaxH3ImageReference.from_file"><!----><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>from_file</span></h4><!----> <a id="diffusers.modular_pipelines.minimax_h3.MiniMaxH3ImageReference.from_file" class="header-link invisible with-hover:group-hover:visible pr-2" href="#diffusers.modular_pipelines.minimax_h3.MiniMaxH3ImageReference.from_file"><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/modular_pipelines/minimax_h3/references.py#L98" target="_blank"><span><</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">media<span class="opacity-60"></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">المعاملات <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.modular_pipelines.minimax_h3.MiniMaxH3ImageReference.from_file.media" 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.modular_pipelines.minimax_h3.MiniMaxH3ImageReference.from_file.media"><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>media</strong> (<code>str</code> أو <code>os.PathLike</code>) — مسار الصورة أو رابطها.<!----></span></span></li><!--]--></ul><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--></div></div><!----> <p>حمّل ملف صورة إلى <code>MiniMaxH3ImageReference</code> من خلال <a href="/docs/diffusers/main/ar/api/utilities#diffusers.utils.load_image">load_image()</a>.</p></div></div> <!--[1--><h2 class="relative group"><a id="diffusers.modular_pipelines.minimax_h3.MiniMaxH3VideoReference" 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.modular_pipelines.minimax_h3.MiniMaxH3VideoReference"><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><!---->MiniMaxH3VideoReference<!----></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.modular_pipelines.minimax_h3.MiniMaxH3VideoReference"><!----><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">فئة</span> <span class="font-medium">diffusers.modular_pipelines.minimax_h3.</span><span class="font-semibold">MiniMaxH3VideoReference</span></span></h3><!----> <a id="diffusers.modular_pipelines.minimax_h3.MiniMaxH3VideoReference" class="header-link invisible with-hover:group-hover:visible pr-2" href="#diffusers.modular_pipelines.minimax_h3.MiniMaxH3VideoReference"><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/modular_pipelines/minimax_h3/references.py#L110" target="_blank"><span><</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">: typing.Union[list[PIL.Image.Image], numpy.ndarray, torch.Tensor]</span></span></span><span class="comma cursor-pointer"><span class="rounded hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black">fps<span class="opacity-60">: float | None = None</span></span></span><span class="comma cursor-pointer"><span class="rounded hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black">audio<span class="opacity-60">: typing.Optional[torch.Tensor] = None</span></span></span><span class="comma cursor-pointer"><span class="rounded hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black">sample_rate<span class="opacity-60">: int | None = None</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">المعاملات <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.modular_pipelines.minimax_h3.MiniMaxH3VideoReference.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.modular_pipelines.minimax_h3.MiniMaxH3VideoReference.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>list[PIL.Image.Image]</code> أو <code>np.ndarray</code> أو <code>torch.Tensor</code>) — | |
| الإطارات المرجعية: قائمة من الصور، أو مصفوفة بأبعاد <code>(num_frames, height, width, 3)</code>، أو متجه بأبعاد <code>(num_frames, 3, height, width)</code>، من نوع <code>uint8</code> أو أرقام عشرية ضمن المدى <code>[0, 1]</code>.<!----></span></span></li><li class="text-base !pl-4 my-3 rounded "><span class="group flex space-x-1.5 items-start"><a id="diffusers.modular_pipelines.minimax_h3.MiniMaxH3VideoReference.fps" 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.modular_pipelines.minimax_h3.MiniMaxH3VideoReference.fps"><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>fps</strong> (<code>float</code>, <em>اختياري</em>، القيمة الافتراضية 24.0) — | |
| معدل الإطارات الذي تحمله <code>frames</code>، وهو ما يحدد موضع كتل الرؤية الخاصة بالمرجع على شبكة 2 | |
| fps الخاصة بالمشروط. الساعة الداخلية الخاصة بـ MiniMax-H3 هي 24 fps، لذا يتم إعادة أخذ عينات أي معدل آخر عليها عن طريق حذف وتكرار إطارات كاملة — مما يجعل هذا الحقل هو ما يجب ضبطه بشكل صحيح عندما تكون الإطارات قد جاءت من ملف.<!----></span></span></li><li class="text-base !pl-4 my-3 rounded "><span class="group flex space-x-1.5 items-start"><a id="diffusers.modular_pipelines.minimax_h3.MiniMaxH3VideoReference.audio" 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.modular_pipelines.minimax_h3.MiniMaxH3VideoReference.audio"><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>audio</strong> (<code>torch.Tensor</code> من الشكل <code>(channels, num_samples)</code>، <em>اختياري</em>) — | |
| موسيقى هذا الفيديو، أحادية أو ستيريو، تُشترط كمرجع خاص بها وليس كمرجع مستقل. عند إهمالها، يُشترط المرجع على الحركة فقط.<!----></span></span></li><li class="text-base !pl-4 my-3 rounded "><span class="group flex space-x-1.5 items-start"><a id="diffusers.modular_pipelines.minimax_h3.MiniMaxH3VideoReference.sample_rate" 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.modular_pipelines.minimax_h3.MiniMaxH3VideoReference.sample_rate"><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>sample_rate</strong> (<code>int</code>, <em>اختياري</em>) — | |
| المعدل الذي تنقل به <code>audio</code> عيناتها. إذا تُرك دون تحديد، فهو معدل VAE الصوتي نفسه، مما يترك العينات دون تغيير؛ أما أي معدل آخر فيتم إعادة أخذ عينات الصوت عليه.<!----></span></span></li><!--]--></ul><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--></div></div><!----> <p>مرجع للحركة والكاميرا: بحد أقصى 3 لكل طلب، مشروطًا معًا مع موسيقاه الخاصة.</p> <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.modular_pipelines.minimax_h3.MiniMaxH3VideoReference.from_file"><!----><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>from_file</span></h4><!----> <a id="diffusers.modular_pipelines.minimax_h3.MiniMaxH3VideoReference.from_file" class="header-link invisible with-hover:group-hover:visible pr-2" href="#diffusers.modular_pipelines.minimax_h3.MiniMaxH3VideoReference.from_file"><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/modular_pipelines/minimax_h3/references.py#L146" target="_blank"><span><</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">media<span class="opacity-60"></span></span></span><!--]--> <span>)</span> <!--[0--><span class="font-bold">→</span> <span class="rounded hover:bg-gray-400 cursor-pointer"><!----><span><code>MiniMaxH3VideoReference</code></span><!----></span><!--]--></p><!--]--> <div class="!mb-10 relative docstring-details "><!--[-1--><!--]--> <!--[0--><p class="flex items-center font-semibold !mt-2 !mb-2 text-gray-800">المعاملات <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.modular_pipelines.minimax_h3.MiniMaxH3VideoReference.from_file.media" 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.modular_pipelines.minimax_h3.MiniMaxH3VideoReference.from_file.media"><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>media</strong> (<code>str</code> أو <code>os.PathLike</code>) — مسار أو عنوان URL للفيديو.<!----></span></span></li><!--]--></ul><!--]--> <!--[-1--><!--]--> <!--[0--><div id="diffusers.modular_pipelines.minimax_h3.MiniMaxH3VideoReference.from_file.returns" class="flex items-center font-semibold space-x-3 text-base !mt-0 !mb-0 text-gray-800 rounded "><p class="text-base"><!---->يعيد<!----></p> <!--[0--><!----> | |
| <p><code>MiniMaxH3VideoReference</code></p> | |
| <!----><!--]--> <span class="flex-auto border-t-2 border-gray-100 dark:border-gray-700"></span></div> <div class="text-base"><!----> | |
| <p>الإطارات <code>(num_frames, height, width, 3)</code> من نوع <code>uint8</code> بمعدل الإطارات الذي يبلّغ عنه الحاوية، مع حملها لمسار الصوت ومعدل عينات ذلك المسار عندما يحتوي على تدفق صوتي.</p> | |
| <!----></div><!--]--> <!--[-1--><!--]--></div></div><!----> <p>فكّ ترميز ملف فيديو إلى <code>MiniMaxH3VideoReference</code>، بالدقة ومعدل الإطارات والموسيقى التصويرية التي يحملها.</p> <p>تستقر المعدّلات على المرجع، وهذا هو الهدف من فك الترميز بهذه الطريقة بدلاً من <a href="/docs/diffusers/main/ar/api/utilities#diffusers.utils.load_video">load_video()</a>: يعيد MiniMax-H3 أخذ عينات من المرجع بمعدّل 24 إطاراً في الثانية الخاص به، لذا فإن معدل الإطارات المفقود أثناء الإدخال هو طلب مشروط بسرعة خاطئة، ولا يوجد ما يُثار بشأنه. يتم تصحيح الحاوية التي بياناتها الوصفية خاطئة عن طريق تجاوز <code>fps</code> أو <code>sample_rate</code> على المرجع المُعاد.</p> <p>يتطلب <a href="https://github.com/PyAV-Org/PyAV" rel="nofollow">PyAV</a>.</p></div></div> <!--[1--><h2 class="relative group"><a id="diffusers.modular_pipelines.minimax_h3.MiniMaxH3AudioReference" 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.modular_pipelines.minimax_h3.MiniMaxH3AudioReference"><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><!---->MiniMaxH3AudioReference<!----></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.modular_pipelines.minimax_h3.MiniMaxH3AudioReference"><!----><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">class</span> <span class="font-medium">diffusers.modular_pipelines.minimax_h3.</span><span class="font-semibold">MiniMaxH3AudioReference</span></span></h3><!----> <a id="diffusers.modular_pipelines.minimax_h3.MiniMaxH3AudioReference" class="header-link invisible with-hover:group-hover:visible pr-2" href="#diffusers.modular_pipelines.minimax_h3.MiniMaxH3AudioReference"><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/modular_pipelines/minimax_h3/references.py#L172" target="_blank"><span><</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">audio<span class="opacity-60">: Tensor</span></span></span><span class="comma cursor-pointer"><span class="rounded hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black">sample_rate<span class="opacity-60">: int | None = None</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">المعاملات <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.modular_pipelines.minimax_h3.MiniMaxH3AudioReference.audio" 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.modular_pipelines.minimax_h3.MiniMaxH3AudioReference.audio"><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>audio</strong> (<code>torch.Tensor</code> من الشكل <code>(channels, num_samples)</code>) — | |
| الموجة المرجعية، أحادية أو ستيريو.<!----></span></span></li><li class="text-base !pl-4 my-3 rounded "><span class="group flex space-x-1.5 items-start"><a id="diffusers.modular_pipelines.minimax_h3.MiniMaxH3AudioReference.sample_rate" 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.modular_pipelines.minimax_h3.MiniMaxH3AudioReference.sample_rate"><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>sample_rate</strong> (<code>int</code>, <em>اختياري</em>) — | |
| المعدل الذي تنقل به <code>audio</code> عيناتها. إذا تُرك دون تحديد، فهو معدل VAE الصوتي نفسه، مما يترك العينات دون تغيير؛ أما أي معدل آخر فيتم إعادة أخذ عينات الصوت عليه.<!----></span></span></li><!--]--></ul><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--></div></div><!----> <p>مرجع صوتي أو موسيقي: بحد أقصى 3 لكل طلب، ولا يُستخدم أبدًا بمفرده — إذ يجب أن يُقرن المرجع الصوتي بمرجع صورة أو فيديو واحد على الأقل. لا يصل هذا المرجع إلى المُشكِّل (conditioner) بل يُرمَّز بواسطة VAE الصوتي وحده.</p> <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.modular_pipelines.minimax_h3.MiniMaxH3AudioReference.from_file"><!----><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>from_file</span></h4><!----> <a id="diffusers.modular_pipelines.minimax_h3.MiniMaxH3AudioReference.from_file" class="header-link invisible with-hover:group-hover:visible pr-2" href="#diffusers.modular_pipelines.minimax_h3.MiniMaxH3AudioReference.from_file"><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/modular_pipelines/minimax_h3/references.py#L191" target="_blank"><span><</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">media<span class="opacity-60"></span></span></span><!--]--> <span>)</span> <!--[0--><span class="font-bold">→</span> <span class="rounded hover:bg-gray-400 cursor-pointer"><!----><span><code>MiniMaxH3AudioReference</code></span><!----></span><!--]--></p><!--]--> <div class="!mb-10 relative docstring-details "><!--[-1--><!--]--> <!--[0--><p class="flex items-center font-semibold !mt-2 !mb-2 text-gray-800">المعاملات <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.modular_pipelines.minimax_h3.MiniMaxH3AudioReference.from_file.media" 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.modular_pipelines.minimax_h3.MiniMaxH3AudioReference.from_file.media"><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>media</strong> (<code>str</code> أو <code>os.PathLike</code>) — مسار أو عنوان URL للصوت، أو لفيديو يُستخرج منه المسار الصوتي.<!----></span></span></li><!--]--></ul><!--]--> <!--[-1--><!--]--> <!--[0--><div id="diffusers.modular_pipelines.minimax_h3.MiniMaxH3AudioReference.from_file.returns" class="flex items-center font-semibold space-x-3 text-base !mt-0 !mb-0 text-gray-800 rounded "><p class="text-base"><!---->يعيد<!----></p> <!--[0--><!----> | |
| <p><code>MiniMaxH3AudioReference</code></p> | |
| <!----><!--]--> <span class="flex-auto border-t-2 border-gray-100 dark:border-gray-700"></span></div> <div class="text-base"><!----> | |
| <p>موجة الصوت <code>(channels, num_samples)</code> من نوع float32 عند معدل العينة الذي يبلّغ عنه الحاوية.</p> | |
| <!----></div><!--]--> <!--[-1--><!--]--></div></div><!----> <p>فكّ ترميز ملف صوتي إلى <code>MiniMaxH3AudioReference</code>، بمعدل العينة الذي يحمله.</p> <p>يتطلب <a href="https://github.com/PyAV-Org/PyAV" rel="nofollow">PyAV</a>.</p></div></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/minimax_h3.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, 213], | |
| data: [null,null], | |
| form: null, | |
| error: null | |
| }); | |
| }); | |
| } | |
| </script> | |
Xet Storage Details
- Size:
- 132 kB
- Xet hash:
- f0081bb9fa79cf37de080f1dc8728120338d61884c73a0d8970c7d5e9f5bad25
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.