Buckets:
| <meta charset="utf-8" /><meta name="hf:doc:metadata" content="{"title":"Pika H3 Flex","local":"pika-h3-flex","sections":[{"title":"جارٍ التحميل","local":"loading","sections":[{"title":"إعادة استخدام نموذج MiniMax-H3 المحمّل","local":"reusing-a-loaded-minimax-h3","sections":[],"depth":3}],"depth":2},{"title":"ما يختلف عن MiniMax-H3","local":"what-differs-from-minimax-h3","sections":[],"depth":2},{"title":"التوليد","local":"generation","sections":[],"depth":2},{"title":"PikaH3FlexModularPipeline","local":"diffusers.PikaH3FlexModularPipeline","sections":[],"depth":2},{"title":"PikaH3FlexBlocks","local":"diffusers.PikaH3FlexBlocks","sections":[],"depth":2},{"title":"PikaH3FlexImageReference","local":"diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexImageReference","sections":[],"depth":2},{"title":"PikaH3FlexVideoReference","local":"diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexVideoReference","sections":[],"depth":2},{"title":"PikaH3FlexAudioReference","local":"diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexAudioReference","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/225.C7fDjxOl.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"> | |
| <!--13wh65h--><meta name="hf:doc:metadata" content="{"title":"Pika H3 Flex","local":"pika-h3-flex","sections":[{"title":"Loading","local":"loading","sections":[{"title":"Reusing a loaded MiniMax-H3","local":"reusing-a-loaded-minimax-h3","sections":[],"depth":3}],"depth":2},{"title":"What differs from MiniMax-H3","local":"what-differs-from-minimax-h3","sections":[],"depth":2},{"title":"Generation","local":"generation","sections":[],"depth":2},{"title":"PikaH3FlexModularPipeline","local":"diffusers.PikaH3FlexModularPipeline","sections":[],"depth":2},{"title":"PikaH3FlexBlocks","local":"diffusers.PikaH3FlexBlocks","sections":[],"depth":2},{"title":"PikaH3FlexImageReference","local":"diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexImageReference","sections":[],"depth":2},{"title":"PikaH3FlexVideoReference","local":"diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexVideoReference","sections":[],"depth":2},{"title":"PikaH3FlexAudioReference","local":"diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexAudioReference","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="pika-h3-flex" 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="#pika-h3-flex"><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><!---->Pika H3 Flex<!----></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><a href="https://huggingface.co/Pika-Labs/Pika-H3-Flex" rel="nofollow">Pika H3 Flex</a> هو تدريب ما بعد التدريب الذي أجرته Pika على <a href="./minimax_h3">MiniMax-H3</a> ليصبح مولّدًا للفيديو والصوت في ست خطوات. يحتفظ بترتيب MiniMax-H3 المكدّس، ومشروط Qwen3-VL الخاص به، ووحدي VAE الخاصين به، ويغيّر شيئين: العيّّان، وهو جدول ثابت من ست خطوات يعيد الضجيج للتنبؤ النظيف في كل خطوة بدلًا من تحديث Euler، والأوزان، وهي زوج من محوّلات LoRA ذات رتبة 128 فوق قسمي محوّل MiniMax-H3. يخرج الفيديو وموسيقاه الصوتية المجسّمة المتزامنة من نفس التمريرات الأمامية الست.</p> <p>الإصدار هو المحوِّلات: محوِّل FL2VA (<code>fl2va/adapter.safetensors</code>) يقود قسم <code>transformer/</code> لتكييف النص وإطار النهاية، ومحوِّل Ref2VA (<code>ref2va/adapter.safetensors</code>) يقود <code>transformer_ref/</code> للإحالات متعددة الوسائط. المكوّنات الأساسية هي مكوّنات <a href="https://huggingface.co/MiniMaxAI/MiniMax-H3" rel="nofollow">MiniMaxAI/MiniMax-H3</a> دون تغيير، ويحمل المستودع نسخة منها حتى يتم تحميله بشكل مستقل.</p> <p>يُدمج Pika H3 Flex على شكل كتل <a href="../../modular_diffusers/overview">Modular Diffusers</a> فقط، تمامًا مثل MiniMax-H3: فالكُتل و<a href="/docs/diffusers/main/ar/api/pipelines/pika_h3_flex#diffusers.PikaH3FlexModularPipeline">PikaH3FlexModularPipeline</a> الخاصة بها هي التكامل بأكمله، ولا يوجد نصف <code>DiffusionPipeline</code>.</p> <!--[1--><h2 class="relative group"><a id="loading" 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="#loading"><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>modular_model_index.json</code> الذي يحدد مكونات MiniMax-H3 الأساسية وإعدادات المجدولَين، ثم يُحمَّل مُكيِّف سير العمل المحدد فوقها باستخدام <a href="/docs/diffusers/main/ar/api/loaders/lora#diffusers.loaders.MiniMaxH3LoraLoaderMixin.load_lora_weights">load_lora_weights()</a>. المكيِّفات هي تصريفات PEFT عادية لأسماء وحدات diffusers وتُحمَّل بمقياسها المُدرَّب (<code>alpha == rank</code>، 1.0).</p> <table><thead><tr><th>سير العمل</th><th>المدخلات</th><th>تقسيم Transformer</th><th>محوّل</th></tr></thead><tbody><tr><td><code>t2va</code></td><td><code>prompt</code></td><td><code>transformer/</code></td><td><code>fl2va/adapter.safetensors</code></td></tr><tr><td><code>fl2va</code></td><td><code>prompt</code> و<code>image</code> و/أو <code>last_image</code></td><td><code>transformer/</code></td><td><code>fl2va/adapter.safetensors</code></td></tr><tr><td><code>ref2va</code></td><td><code>prompt</code> و<code>references</code></td><td><code>transformer_ref/</code></td><td><code>ref2va/adapter.safetensors</code></td></tr></tbody></table> <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">"Pika-Labs/Pika-H3-Flex"</span>, workflow=<span class="hljs-string">"fl2va"</span>) | |
| pipe.load_components(dtype={<span class="hljs-string">"vae"</span>: torch.float32, <span class="hljs-string">"audio_vae"</span>: torch.float32, <span class="hljs-string">"default"</span>: torch.bfloat16}) | |
| pipe.load_lora_weights(<span class="hljs-string">"Pika-Labs/Pika-H3-Flex"</span>, weight_name=<span class="hljs-string">"fl2va/adapter.safetensors"</span>)<!----></pre></div><!----> <p>عند تمرير سير العمل، يتم تقليم الكتل إلى تلك المهمة، بحيث يُجلب فقط قسم الترانسفورمر الخاص بها، ويوجّه المُكيّف (adapter) إلى القسم الوحيد الموجود، ويقبل خط الأنابيب (pipeline) طلبات تلك المهمة وحدها — فخط أنابيب <code>fl2va</code> يحتاج إلى إطار رئيسي (keyframe)، بينما لا يتطلب خط أنابيب <code>t2va</code> أي إطار. أما خط الأنابيب الذي يحتفظ بكلا القسمين (المحمّل دون <code>workflow=</code>) فيحتاج إلى تحديد مكان وضع مُكيّف Ref2VA: <code>pipe.load_lora_weights(..., weight_name="ref2va/adapter.safetensors", load_into_transformer_ref=True)</code>. تُصدر كلا نموذجي VAE بدقة float32 ويُفكّ تشفيرهما بدقة float32، تمامًا كما يفعل الحزمة المُصدَرة؛ بينما يعمل كل ما عدا ذلك بدقة bfloat16.</p> <blockquote class="tip"><p><code>pipe.doc</code> يطبع ما يستقبله خط المعالجة أمامك وما يعيده — كل مدخل مع قيمته الافتراضية، والمكونات التي يتوقعها، والمخرجات التي ينتجها.</p></blockquote> <!--[2--><h3 class="relative group"><a id="reusing-a-loaded-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="#reusing-a-loaded-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></h3><!--]--><!----> <p>المكوّنات الأساسية هي مكوّنات MiniMax-H3، لذا فإن خط أنابيب MiniMax-H3 المحمّل مسبقاً يحتفظ بكل شيء باستثناء المجدولين (Schedulers) والمُكيّفات (Adapters). يجمع هذا القسم خط أنابيب Pika H3 Flex من تلك المكوّنات المحمّلة، ويُبقي كلا الخطين جاهزين جنباً إلى جنب: حيث يحتفظ <a href="/docs/diffusers/main/ar/api/modular_diffusers/pipeline_components#diffusers.ComponentsManager">ComponentsManager</a> بكل مكوّن مرة واحدة ويُحمّله (Offloads) لكلا الخطين، ويضيف خط أنابيب Pika H3 Flex مجديّه فقط، بينما تُقرر المُكيّفات أيّ نموذجين من النموذجين المشتركين ستشغّل محوّلات (Transformers) مشتركة.</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 | |
| dtype = {<span class="hljs-string">"vae"</span>: torch.float32, <span class="hljs-string">"audio_vae"</span>: torch.float32, <span class="hljs-string">"default"</span>: torch.bfloat16} | |
| manager = ComponentsManager() | |
| manager.enable_auto_cpu_offload(device=<span class="hljs-string">"cuda"</span>) | |
| <span class="hljs-comment"># The MiniMax-H3 pipeline already in use, with every workflow loaded. `collection` registers its components in the</span> | |
| <span class="hljs-comment"># manager under that name, so they can be fetched by it later.</span> | |
| minimax = ModularPipeline.from_pretrained(<span class="hljs-string">"MiniMaxAI/MiniMax-H3"</span>, components_manager=manager, collection=<span class="hljs-string">"minimax-h3"</span>) | |
| minimax.load_components(dtype=dtype) | |
| <span class="hljs-comment"># The Pika H3 Flex pipeline, in its own collection. Only its own components are loaded: the two schedulers.</span> | |
| pika = ModularPipeline.from_pretrained(<span class="hljs-string">"Pika-Labs/Pika-H3-Flex"</span>, components_manager=manager, collection=<span class="hljs-string">"pika-h3-flex"</span>) | |
| pika.load_components(names=[<span class="hljs-string">"scheduler"</span>, <span class="hljs-string">"audio_scheduler"</span>]) | |
| <span class="hljs-comment"># The rest comes from the MiniMax-H3 collection, and `update_components` puts it in the Pika H3 Flex pipeline.</span> | |
| shared = [<span class="hljs-string">"text_encoder"</span>, <span class="hljs-string">"tokenizer"</span>, <span class="hljs-string">"processor"</span>, <span class="hljs-string">"vae"</span>, <span class="hljs-string">"audio_vae"</span>, <span class="hljs-string">"transformer"</span>, <span class="hljs-string">"transformer_ref"</span>] | |
| pika.update_components(**{name: manager.get_one(name=name, collection=<span class="hljs-string">"minimax-h3"</span>) <span class="hljs-keyword">for</span> name <span class="hljs-keyword">in</span> shared}) | |
| <span class="hljs-comment"># The adapters go into the shared transformers.</span> | |
| pika.load_lora_weights(<span class="hljs-string">"Pika-Labs/Pika-H3-Flex"</span>, weight_name=<span class="hljs-string">"fl2va/adapter.safetensors"</span>) | |
| pika.load_lora_weights( | |
| <span class="hljs-string">"Pika-Labs/Pika-H3-Flex"</span>, weight_name=<span class="hljs-string">"ref2va/adapter.safetensors"</span>, load_into_transformer_ref=<span class="hljs-literal">True</span> | |
| )<!----></pre></div><!----> <p><code>print(manager)</code> يعرض النتيجة: يُذكر كل مكوّن مشترك مرة واحدة وينتمي إلى المجموعتين، وتضيف مجموعة Pika H3 Flex مجدولَيها، وتحمل التحوّلتان (transformers) مكيّفًا (adapter).</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-text "><!---->Models: | |
| Name_ID | Class | Size (GB) | Collection | |
| transformer_1397... | MiniMaxH3Transformer3DModel | 63.02 | minimax-h3 | |
| | | | pika-h3-flex | |
| transformer_ref_13... | MiniMaxH3Transformer3DModel | 63.02 | minimax-h3 | |
| | | | pika-h3-flex | |
| text_encoder_1397... | Qwen3VLForConditionalGeneration | 62.13 | minimax-h3 | |
| | | | pika-h3-flex | |
| vae_1397... | AutoencoderKLMiniMaxH3 | 9.70 | minimax-h3 | |
| | | | pika-h3-flex | |
| audio_vae_1397... | AutoencoderKLMiniMaxH3Audio | 0.56 | minimax-h3 | |
| | | | pika-h3-flex | |
| Other Components: | |
| ID | Class | Collection | |
| scheduler_1397... | MiniMaxH3Scheduler | minimax-h3 | |
| audio_scheduler_1397... | MiniMaxH3Scheduler | minimax-h3 | |
| scheduler_1397... | MiniMaxH3Scheduler | pika-h3-flex | |
| audio_scheduler_1397... | MiniMaxH3Scheduler | pika-h3-flex | |
| tokenizer_1397... | Qwen2Tokenizer | minimax-h3 | |
| | | pika-h3-flex | |
| processor_1397... | Qwen3VLProcessor | minimax-h3 | |
| | | pika-h3-flex | |
| Additional Component Info: | |
| transformer_1397...: | |
| Adapters: ['default_0'] | |
| transformer_ref_13...: | |
| Adapters: ['default_0']<!----></pre></div><!----> <p>تحدد المُكيّفات النموذج الذي تتبناه وحدات التحويل المشتركة. للعودة إلى MiniMax-H3، استدعِ <code>pika.disable_lora()</code>، وهذا كل ما يلزم: فطلب <code>minimax(...)</code> التالي سيقوم بتشغيل النموذج الأساسي. يُعيد <code>pika.enable_lora()</code> تفعيل Pika H3 Flex. لا يتم إعادة تحميل أي شيء في الفترة الفاصلة؛ بل يقوم المُدير بنقل كل مكوّن إلى المُسرّع أو إزالته عنه كلما وصلت إحدى المسارات إليه.</p> <!--[1--><h2 class="relative group"><a id="what-differs-from-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="#what-differs-from-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></h2><!--]--><!----> <ul><li><strong>ست خطوات، بدون <code>num_inference_steps</code>.</strong> يعمل كلا مثيلي <a href="/docs/diffusers/main/ar/api/schedulers/minimax_h3#diffusers.MiniMaxH3Scheduler">MiniMaxH3Scheduler</a> (<code>shift=12.0</code> للفيديو، <code>shift=3.0</code> للصوت) مع <code>stochastic_sampling</code> عبر إعداد <code>denoising_step_list</code> في خط المعالجة، وهو الجدول المنشور <code>[1000, 750, 500, 250, 100, 40, 0]</code>: تتنبأ كل خطوة بالعينة النظيفة، وتُعاد إضافة الضوضاء إليها بضوضاء جديدة حتى سيجما التالية في جميع الخطوات عدا الأخيرة. عدد الخطوات هو عقد المكيّف وليس مدخلاً.</li> <li><strong>ضوضاء جديدة في كل خطوة.</strong> يستخرج الطلب من <code>generator</code> بترتيب ثابت: سحب واحد لكل إطار مرجعي أو مرجع بصري لضوضاء الشرط، وضوضاء الفيديو، وضوضاء الصوت، ثم سحب إعادة الضوضاء للفيديو والصوت لكل من الخطوات الخمس الأولى. تمرير <code>latents</code> أو <code>audio_latents</code> يستبدل السحبين الأوليين ويُبقي الباقي كما هو.</li> <li><strong>تُقتطع الإطارات الرئيسية ولا يتم تمديدها.</strong> يتم اقتطاع إطار رئيسي من نوع <code>fl2va</code> من المنتصف ليتناسب مع نسبة أبعاد اللوحة عند دقته الخاصة، ثم يُعاد تحجيمه ليملأ اللوحة.</li> <li><strong>تتبع المراجع فئة دقة اللوحة.</strong> يولّد Pika H3 Flex على جدول دلاء — فئة 480p وفئة 768p، مع أحد عشر نسبة عرض إلى ارتفاع لكل فئة — ويخضع طلب <code>ref2va</code> لشرط فئة لوحته: تُرمَّز صورة المرجع بحافة قصيرة 1024 بكسل تحت فئة 768 و2048 بكسل من تلك الفئة فما فوق، بينما يُوضع مرجع الفيديو على قاعدة اللوحة الخاصة بتلك الفئة. كل مرجع فيديو أو صوت مستقل يعمل لمدة تتراوح بين ثانيتين و15 ثانية، ومجموع مدد الفيديو ومدد الصوت المستقل لا يتجاوز 15 ثانية لكل منهما.</li></ul> <!--[1--><h2 class="relative group"><a id="generation" 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"><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>الدلاء المُطلقة هي لوحات الرسم التي تم التحقق من Pika H3 Flex عليها. مرر أحدها كـ<code>height</code> و<code>width</code>:</p> <table><thead><tr><th></th><th>21:9</th><th>16:9</th><th>3:2</th><th>4:3</th><th>5:4</th><th>1:1</th><th>4:5</th><th>3:4</th><th>2:3</th><th>9:16</th><th>9:21</th></tr></thead><tbody><tr><td>480p</td><td>960x416</td><td>832x480</td><td>704x480</td><td>640x480</td><td>608x480</td><td>480x480</td><td>480x608</td><td>480x640</td><td>480x704</td><td>480x832</td><td>416x960</td></tr><tr><td>768p</td><td>1536x672</td><td>1344x768</td><td>1152x768</td><td>1024x768</td><td>960x768</td><td>768x768</td><td>768x960</td><td>768x1024</td><td>768x1152</td><td>768x1344</td><td>672x1536</td></tr></tbody></table> <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.</span> | |
| 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"># Create one pipeline for all supported workflows, then load the `fl2va` workflow's components, which is</span> | |
| <span class="hljs-comment"># enough to run both the fl2va and t2va requests below.</span> | |
| pipe = ModularPipeline.from_pretrained(<span class="hljs-string">"Pika-Labs/Pika-H3-Flex"</span>, components_manager=manager) | |
| pipe.load_components( | |
| workflow=<span class="hljs-string">"fl2va"</span>, dtype={<span class="hljs-string">"vae"</span>: torch.float32, <span class="hljs-string">"audio_vae"</span>: torch.float32, <span class="hljs-string">"default"</span>: torch.bfloat16} | |
| ) | |
| pipe.load_lora_weights(<span class="hljs-string">"Pika-Labs/Pika-H3-Flex"</span>, weight_name=<span class="hljs-string">"fl2va/adapter.safetensors"</span>) | |
| prompt = ( | |
| <span class="hljs-string">"integrated_multimodal_description: A cinematic close shot of a red ceramic cup on a wooden table beside an "</span> | |
| <span class="hljs-string">"open window. A soft breeze moves a linen curtain. The camera slowly pushes toward the cup as warm morning "</span> | |
| <span class="hljs-string">"light crosses the table.\n"</span> | |
| <span class="hljs-string">"overall_soundscape: Gentle wind through the window and faint birdsong outside. No speech.\n"</span> | |
| <span class="hljs-string">"non_diegetic_music: None.\n"</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 on the 480p 16:9 bucket, 5 seconds.</span> | |
| results = pipe( | |
| prompt=prompt, | |
| height=<span class="hljs-number">480</span>, | |
| width=<span class="hljs-number">832</span>, | |
| num_frames=<span class="hljs-number">124</span>, | |
| generator=torch.Generator(<span class="hljs-string">"cuda"</span>).manual_seed(<span class="hljs-number">42</span>), | |
| output=outputs | |
| ) | |
| <span class="hljs-comment"># First frame (and optionally `last_image`) to video + audio. The keyframe is center-cropped onto the canvas and</span> | |
| <span class="hljs-comment"># held as the first frame, so the prompt describes the keyframe and what happens from it.</span> | |
| image = load_image( | |
| <span class="hljs-string">"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/astronaut.jpg"</span> | |
| ) | |
| i2va_prompt = ( | |
| <span class="hljs-string">"For the target video, at 0.00 seconds into the target video, <Picture 1> (from [Shot 1]) is fully referenced.\n\n"</span> | |
| <span class="hljs-string">"integrated_multimodal_description: [Shot 1] Begin with the supplied image of a small toy astronaut figurine "</span> | |
| <span class="hljs-string">"standing on a grey rocky moon surface, holding a white egg-shaped object. Preserve the figurine, its orange "</span> | |
| <span class="hljs-string">"visor and the rocks. The astronaut slowly turns its helmet toward the camera and lifts the egg a little; fine "</span> | |
| <span class="hljs-string">"dust drifts up around its boots. The camera slowly pushes in in one continuous shot. By the end the astronaut "</span> | |
| <span class="hljs-string">"stands still, egg held up.\n\n"</span> | |
| <span class="hljs-string">"overall_soundscape: Soft low wind and faint crunch of dust under the boots. No speech.\n\n"</span> | |
| <span class="hljs-string">"non_diegetic_music: N/A\n"</span> | |
| ) | |
| results = pipe( | |
| prompt=i2va_prompt, | |
| image=image, | |
| height=<span class="hljs-number">480</span>, | |
| width=<span class="hljs-number">832</span>, | |
| num_frames=<span class="hljs-number">124</span>, | |
| generator=torch.Generator(<span class="hljs-string">"cuda"</span>).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">"pika_h3_flex_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>ref2va</code> مع قائمة مرتبة من المراجع — تصل إلى 9 صور، و3 مقاطع فيديو، و3 مقاطع صوتية، أي 12 عنصرًا إجمالًا — بالطريقة التي يتعامل بها MiniMax-H3، مع فئة مرجعية واحدة لكل نمط. وهو أيضًا الطلب الذي يتطلب أكبر قدر من الذاكرة: إذ تضيف المراجع صفوفها الخاصة إلى التسلسل، وعند دقة 768p يملأ المحول (transformer) وحده بطاقة ذاكرة سعتها 80 جيجابايت. لذلك، يبث المثال أدناه كتل المحول من ذاكرة المعالج المركزي (CPU) واحدة تلو الأخرى، بينما ينقل المدير المكونات الأخرى إلى الجهاز ومنه كما كان يفعل سابقًا. ينفذ هذا الطلب المرجعي بدقة 768p على بطاقة واحدة سعتها 80 جيجابايت؛ وبدون البث، ابقَ عند دقة 480p.</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.pika_h3_flex <span class="hljs-keyword">import</span> ( | |
| PikaH3FlexAudioReference, | |
| PikaH3FlexImageReference, | |
| PikaH3FlexVideoReference, | |
| ) | |
| 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">"Pika-Labs/Pika-H3-Flex"</span>, workflow=<span class="hljs-string">"ref2va"</span>, components_manager=manager | |
| ) | |
| pipe.load_components(dtype={<span class="hljs-string">"vae"</span>: torch.float32, <span class="hljs-string">"audio_vae"</span>: torch.float32, <span class="hljs-string">"default"</span>: torch.bfloat16}) | |
| pipe.load_lora_weights(<span class="hljs-string">"Pika-Labs/Pika-H3-Flex"</span>, weight_name=<span class="hljs-string">"ref2va/adapter.safetensors"</span>) | |
| <span class="hljs-comment"># Keep the transformer in CPU memory and bring in one block at a time while it runs.</span> | |
| pipe.transformer_ref.enable_group_offload( | |
| onload_device=torch.device(<span class="hljs-string">"cuda"</span>), | |
| offload_device=torch.device(<span class="hljs-string">"cpu"</span>), | |
| offload_type=<span class="hljs-string">"block_level"</span>, | |
| num_blocks_per_group=<span class="hljs-number">1</span>, | |
| use_stream=<span class="hljs-literal">True</span>, | |
| ) | |
| results = pipe( | |
| prompt=<span class="hljs-string">"subject_definitions: <Subject 1> is the woman in <Picture 1>. summary: [reference generation] <Subject 1> waves at the camera."</span>, | |
| references=[ | |
| PikaH3FlexImageReference.from_file(<span class="hljs-string">"subject.png"</span>), | |
| PikaH3FlexVideoReference.from_file(<span class="hljs-string">"motion_ref.mp4"</span>), <span class="hljs-comment"># frames, their `fps` and the soundtrack</span> | |
| PikaH3FlexAudioReference.from_file(<span class="hljs-string">"voice.wav"</span>), <span class="hljs-comment"># waveform and its `sample_rate`</span> | |
| ], | |
| height=<span class="hljs-number">768</span>, | |
| width=<span class="hljs-number">1344</span>, | |
| num_frames=<span class="hljs-number">124</span>, | |
| generator=torch.Generator(<span class="hljs-string">"cuda"</span>).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><!----> <!--[1--><h2 class="relative group"><a id="diffusers.PikaH3FlexModularPipeline" 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.PikaH3FlexModularPipeline"><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><!---->PikaH3FlexModularPipeline<!----></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.PikaH3FlexModularPipeline"><!----><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">PikaH3FlexModularPipeline</span></span></h3><!----> <a id="diffusers.PikaH3FlexModularPipeline" class="header-link invisible with-hover:group-hover:visible pr-2" href="#diffusers.PikaH3FlexModularPipeline"><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/pika_h3_flex/modular_pipeline.py#L211" 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 لتوليد الفيديو والصوت معًا باستخدام Pika H3 Flex، وهو نموذج MiniMax-H3 المدرّب بعد التدريب على ست خطوات: مسارات العمل <code>t2va</code> (نص فقط) و<code>fl2va</code> (إطار رئيسي أول و/أو أخير) مقابل نقطة التفتيش <code>transformer/</code> مع مُكيّف <code>fl2va</code>، ومسار العمل <code>ref2va</code> (مرجع شامل) مقابل <code>transformer_ref/</code> مع مُكيّف <code>ref2va</code>.</p> <p>المكوّنات الأساسية هي مكوّنات MiniMax-H3، وإصدار Pika H3 Flex عبارة عن زوج من محوِّلات LoRA ذات رتبة 128 فوق تقسيمَي transformer، لذا يتم تجميع خط المعالجة في خطوتين: يتم تحميل المكوّنات عبر <code>modular_model_index.json</code> الذي يسمّي المكوّنات الأساسية والمجدولين اثنين، ويتم تحميل المحوّل الخاص بعملية العمل المختارة باستخدام <a href="/docs/diffusers/main/ar/api/loaders/lora#diffusers.loaders.MiniMaxH3LoraLoaderMixin.load_lora_weights">load_lora_weights()</a>.</p> <div class="relative group rounded-md"><a id="diffusers.PikaH3FlexModularPipeline.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.PikaH3FlexModularPipeline.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> <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">"Pika-Labs/Pika-H3-Flex"</span>, workflow=<span class="hljs-string">"fl2va"</span>) | |
| pipe.load_components(dtype={<span class="hljs-string">"vae"</span>: torch.float32, <span class="hljs-string">"audio_vae"</span>: torch.float32, <span class="hljs-string">"default"</span>: torch.bfloat16}) | |
| pipe.load_lora_weights(<span class="hljs-string">"Pika-Labs/Pika-H3-Flex"</span>, weight_name=<span class="hljs-string">"fl2va/adapter.safetensors"</span>)<!----></pre></div><!----></div><!----> <p>على غرار MiniMax-H3، يقوم Pika H3 Flex بإزالة الضوضاء من <strong>تسلسل واحد مُجمَّع</strong> يحتضن في آنٍ واحد شروط النص، وكامنات شروط الإطار الرئيسي أو المرجع، وكامنات الصوت، وكامنات الفيديو، ولهذا السبب تمرر الكتل تخطيط صف بدلاً من متجهات لكل نمط، ولهذا السبب أيضاً يحمل خط الأنابيب مجدولين اثنين (<code>shift = 12.0</code> للفيديو، و<code>shift = 3.0</code> للصوت) يتم تشغيلهما داخل استدعاء واحد لتحويل الشبكات العصبية التحويلية. وعلى عكس MiniMax-H3، فإن المجدولين الاثنين هما من نوع <a href="/docs/diffusers/main/ar/api/schedulers/minimax_h3#diffusers.MiniMaxH3Scheduler">MiniMaxH3Scheduler</a> مع <code>stochastic_sampling</code> فوق قائمة خطوات إزالة الضوضاء الثابتة المكونة من ستة خطوات <code>denoising_step_list</code>: فلا يوجد <code>num_inference_steps</code>، بل يسحب كل خطوة ضوضاء جديدة من مولّد الطلب.</p> <p>المُكيِّفات مُقطَّرة التوجيه مثل أساسها: لا يوجد موجِّه، ولا <code>negative_prompt</code>، ولا <code>guidance_scale</code>، وتُنفَّذ في كل خطوة تمريرة أمامية واحدة بالضبط.</p> <p>يحمل هذا الوحدة حقائق النموذج التي تعتمد عليها كل وحدة فرعية — الهندسة المشتقة من الإعدادات كخصائص، والحسابات المتعلقة باللوحة والمستوى وعدد الإطارات كدوال — بينما تعيش عقود التكييف والتشفيش والضوضاء على الوحدات الفرعية نفسها.</p></div> <!--[1--><h2 class="relative group"><a id="diffusers.PikaH3FlexBlocks" 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.PikaH3FlexBlocks"><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><!---->PikaH3FlexBlocks<!----></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.PikaH3FlexBlocks"><!----><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">PikaH3FlexBlocks</span></span></h3><!----> <a id="diffusers.PikaH3FlexBlocks" class="header-link invisible with-hover:group-hover:visible pr-2" href="#diffusers.PikaH3FlexBlocks"><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/pika_h3_flex/modular_blocks_pika_h3_flex.py#L668" 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 لتوليد الفيديو والصوت معًا باستخدام Pika H3 Flex: مسارات العمل <code>t2va</code> (نص فقط)، و<code>fl2va</code> (إطار رئيسي أول و/أو أخير)، و<code>ref2va</code> (مرجع شامل)، يتم اختيارها بناءً على مدخلات <code>references</code> والإطارات الرئيسية. تعمل مسارات العمل <code>t2va</code> و<code>fl2va</code> على قسم <code>transformer</code> باستخدام محوّل <code>fl2va</code>، بينما تعمل <code>ref2va</code> على قسم <code>transformer_ref</code> باستخدام محوّل <code>ref2va</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) denoising_step_list (الافتراضي: [1000, | |
| 750, 500, 250, 100, 40, 0])</p> <p>المدخلات: | |
| references (<code>list</code>, <em>اختياري</em>): | |
| المراجع التي يُشترط عليها، <strong>بترتيب القراءة الذي يجب أن يتبعه النموذج</strong>: فترتيبها هو ما يحدد تسمياتها في عرض | |
| الموجّه ويحدد توزيعها على الساعة الدوّارة المشتركة، وبالتالي فإن أي ترتيب مختلف يُعد طلبًا مختلفًا. كل وحدة بيانات (dataclass) | |
| تتوافق مع نمط (modality) واحد، وكلها تحتفظ بوسائط في الذاكرة — إما <code>PikaH3FlexImageReference</code> (بحد أقصى 9)، أو | |
| <code>PikaH3FlexVideoReference</code> بمعدل إطارات <code>fps</code> خاص بها (بحد أقصى 3، حيث يُشترط أيضًا على المسار الصوتي | |
| <code>audio</code> الخاص بها)، أو <code>PikaH3FlexAudioReference</code> بمعدل أخذ عينات <code>sample_rate</code> خاص بها (بحد أقصى 3) — | |
| بإجمالي لا يتجاوز 12 مرجعًا، ولا يمكن أن تكون مراجع الصوت هي الوحيدة. كل مرجع فيديو أو مرجع صوت مستقل مدته من ثانيتين إلى 15 | |
| ثانية، ومجموع مدد الفيديو ومجموع مدد الصوت المستقل لا يتجاوز كل منهما 15 ثانية. هذه الكتل لا تفتح ملف وسائط أبدًا: استخدم | |
| طريقة الفئة <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 إطارًا في الثانية: من 120 إلى 360، أي من 5 إلى 15 ثانية، مع تقريبها لأعلى | |
| إلى أقرب قيمة من الشكل <code>17 * n + 5</code> يمكن لفك ترميز VAE للفيديو التعامل معها. لتوليد فيديو بطول المسار الصوتي | |
| المرجعي، مرّر <code>round(samples / sample_rate * 24)</code>. | |
| image (<code>Image</code>, <em>اختياري</em>): | |
| الإطار المفتاحي الذي يبدأ منه الفيديو. يتم اقتطاعه من المنتصف ليتناسب مع نسبة أبعاد اللوحة (canvas) ثم يُعاد تحجيمه عليها؛ | |
| واللوحة مشتقة افتراضيًا من نسبة أبعاده الخاصة. | |
| last_image (<code>Image</code>, <em>اختياري</em>): | |
| الإطار المفتاحي الذي ينتهي عنده الفيديو. يمكن تمريره بمفرده لتوليد <em>حتى</em> إطار معين. يتم اقتطاعه من المنتصف ليتناسب مع | |
| نسبة أبعاد اللوحة ثم يُعاد تحجيمه عليها، تمامًا مثل <code>image</code>. | |
| prompt (<code>str</code>): | |
| الموجّه الذي يوجه عملية التوليد، وهو نص واحد. | |
| normalized_references (<code>list</code>, <em>اختياري</em>): | |
| المراجع بعد تطبيعها في خطوة الإعداد، بترتيب الحزم. | |
| 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>. | |
| *<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.pika_h3_flex.PikaH3FlexImageReference" 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.pika_h3_flex.PikaH3FlexImageReference"><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><!---->PikaH3FlexImageReference<!----></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.pika_h3_flex.PikaH3FlexImageReference"><!----><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.pika_h3_flex.</span><span class="font-semibold">PikaH3FlexImageReference</span></span></h3><!----> <a id="diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexImageReference" class="header-link invisible with-hover:group-hover:visible pr-2" href="#diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexImageReference"><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/pika_h3_flex/references.py#L83" 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.pika_h3_flex.PikaH3FlexImageReference.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.pika_h3_flex.PikaH3FlexImageReference.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.pika_h3_flex.PikaH3FlexImageReference.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.pika_h3_flex.PikaH3FlexImageReference.from_file" class="header-link invisible with-hover:group-hover:visible pr-2" href="#diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexImageReference.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/pika_h3_flex/references.py#L99" 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.pika_h3_flex.PikaH3FlexImageReference.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.pika_h3_flex.PikaH3FlexImageReference.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>PikaH3FlexImageReference</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.pika_h3_flex.PikaH3FlexVideoReference" 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.pika_h3_flex.PikaH3FlexVideoReference"><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><!---->PikaH3FlexVideoReference<!----></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.pika_h3_flex.PikaH3FlexVideoReference"><!----><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.pika_h3_flex.</span><span class="font-semibold">PikaH3FlexVideoReference</span></span></h3><!----> <a id="diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexVideoReference" class="header-link invisible with-hover:group-hover:visible pr-2" href="#diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexVideoReference"><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/pika_h3_flex/references.py#L111" 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.pika_h3_flex.PikaH3FlexVideoReference.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.pika_h3_flex.PikaH3FlexVideoReference.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.pika_h3_flex.PikaH3FlexVideoReference.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.pika_h3_flex.PikaH3FlexVideoReference.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.pika_h3_flex.PikaH3FlexVideoReference.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.pika_h3_flex.PikaH3FlexVideoReference.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.pika_h3_flex.PikaH3FlexVideoReference.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.pika_h3_flex.PikaH3FlexVideoReference.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.pika_h3_flex.PikaH3FlexVideoReference.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.pika_h3_flex.PikaH3FlexVideoReference.from_file" class="header-link invisible with-hover:group-hover:visible pr-2" href="#diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexVideoReference.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/pika_h3_flex/references.py#L147" 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>PikaH3FlexVideoReference</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.pika_h3_flex.PikaH3FlexVideoReference.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.pika_h3_flex.PikaH3FlexVideoReference.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.pika_h3_flex.PikaH3FlexVideoReference.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>PikaH3FlexVideoReference</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>PikaH3FlexVideoReference</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.pika_h3_flex.PikaH3FlexAudioReference" 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.pika_h3_flex.PikaH3FlexAudioReference"><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><!---->PikaH3FlexAudioReference<!----></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.pika_h3_flex.PikaH3FlexAudioReference"><!----><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.pika_h3_flex.</span><span class="font-semibold">PikaH3FlexAudioReference</span></span></h3><!----> <a id="diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexAudioReference" class="header-link invisible with-hover:group-hover:visible pr-2" href="#diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexAudioReference"><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/pika_h3_flex/references.py#L174" 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.pika_h3_flex.PikaH3FlexAudioReference.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.pika_h3_flex.PikaH3FlexAudioReference.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.pika_h3_flex.PikaH3FlexAudioReference.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.pika_h3_flex.PikaH3FlexAudioReference.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.pika_h3_flex.PikaH3FlexAudioReference.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.pika_h3_flex.PikaH3FlexAudioReference.from_file" class="header-link invisible with-hover:group-hover:visible pr-2" href="#diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexAudioReference.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/pika_h3_flex/references.py#L193" 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>PikaH3FlexAudioReference</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.pika_h3_flex.PikaH3FlexAudioReference.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.pika_h3_flex.PikaH3FlexAudioReference.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.pika_h3_flex.PikaH3FlexAudioReference.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>PikaH3FlexAudioReference</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>PikaH3FlexAudioReference</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/pika_h3_flex.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, 225], | |
| data: [null,null], | |
| form: null, | |
| error: null | |
| }); | |
| }); | |
| } | |
| </script> | |
Xet Storage Details
- Size:
- 115 kB
- Xet hash:
- 40923f0535a97cb48208ba3723d5b332478c0ae3be8682ad957178eec9e6892e
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.