Buckets:

hf-doc-build/doc / diffusers /main /id /api /pipelines /pika_h3_flex.html
mishig's picture
download
raw
108 kB
<meta charset="utf-8" /><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;Pika H3 Flex&quot;,&quot;local&quot;:&quot;pika-h3-flex&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Memuat&quot;,&quot;local&quot;:&quot;loading&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Memanfaatkan kembali MiniMax-H3 yang dimuat&quot;,&quot;local&quot;:&quot;reusing-a-loaded-minimax-h3&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Apa yang berbeda dari MiniMax-H3&quot;,&quot;local&quot;:&quot;what-differs-from-minimax-h3&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Generasi&quot;,&quot;local&quot;:&quot;generation&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;PikaH3FlexModularPipeline&quot;,&quot;local&quot;:&quot;diffusers.PikaH3FlexModularPipeline&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;PikaH3FlexBlocks&quot;,&quot;local&quot;:&quot;diffusers.PikaH3FlexBlocks&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;PikaH3FlexImageReference&quot;,&quot;local&quot;:&quot;diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexImageReference&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;PikaH3FlexVideoReference&quot;,&quot;local&quot;:&quot;diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexVideoReference&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;PikaH3FlexAudioReference&quot;,&quot;local&quot;:&quot;diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexAudioReference&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}"/>
<link href="/docs/diffusers/main/en/_app/immutable/entry/start.D3LnKZ4R.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/BF9UNEM9.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/DPnyVmXs.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/entry/app.C0rBoMxR.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/DSGUT_OW.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/C045MWWx.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/DnVIJfC5.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/DsnmJJEf.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/nodes/0.DTZsP_3B.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/IaDvMxLQ.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/nodes/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="{&quot;title&quot;:&quot;Pika H3 Flex&quot;,&quot;local&quot;:&quot;pika-h3-flex&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Loading&quot;,&quot;local&quot;:&quot;loading&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Reusing a loaded MiniMax-H3&quot;,&quot;local&quot;:&quot;reusing-a-loaded-minimax-h3&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;What differs from MiniMax-H3&quot;,&quot;local&quot;:&quot;what-differs-from-minimax-h3&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Generation&quot;,&quot;local&quot;:&quot;generation&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;PikaH3FlexModularPipeline&quot;,&quot;local&quot;:&quot;diffusers.PikaH3FlexModularPipeline&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;PikaH3FlexBlocks&quot;,&quot;local&quot;:&quot;diffusers.PikaH3FlexBlocks&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;PikaH3FlexImageReference&quot;,&quot;local&quot;:&quot;diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexImageReference&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;PikaH3FlexVideoReference&quot;,&quot;local&quot;:&quot;diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexVideoReference&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;PikaH3FlexAudioReference&quot;,&quot;local&quot;:&quot;diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexAudioReference&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}"/><!---->
<link href="/docs/diffusers/main/en/_app/immutable/assets/0.tn0RQdqM.css" rel="modulepreload"> <!--[--><!--[0--><!--[--><!--[0--><!--[--><p></p> <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> adalah hasil post-training Pika dari <a href="./minimax_h3">MiniMax-H3</a> menjadi generator video dan audio enam langkah. Model ini mempertahankan packed sequence dari MiniMax-H3, conditioner Qwen3-VL-nya, dan kedua VAE-nya, serta mengubah dua hal: sampler, yaitu jadwal enam langkah tetap yang melakukan re-noising pada prediksi bersih di setiap langkah sebagai pengganti pembaruan Euler, dan bobot, yaitu sepasang adapter LoRA rank-128 di atas dua partisi transformer MiniMax-H3. Video beserta soundtrack stereo yang tersinkronisasi dihasilkan dari enam forward pass yang sama.</p> <p>Rilis ini adalah adapter: adapter FL2VA (<code>fl2va/adapter.safetensors</code>) menggerakkan partisi <code>transformer/</code> untuk kondisioning teks dan endpoint-frame, sedangkan adapter Ref2VA (<code>ref2va/adapter.safetensors</code>) menggerakkan <code>transformer_ref/</code> untuk referensi multimodal. Komponen dasarnya adalah milik <a href="https://huggingface.co/MiniMaxAI/MiniMax-H3" rel="nofollow">MiniMaxAI/MiniMax-H3</a>, tanpa perubahan, dan repositori ini menyertakan salinannya agar dapat dimuat secara mandiri.</p> <p>Pika H3 Flex terintegrasi hanya sebagai blok <a href="../../modular_diffusers/overview">Modular Diffusers</a>, seperti MiniMax-H3: blok-blok tersebut beserta <a href="/docs/diffusers/main/id/api/pipelines/pika_h3_flex#diffusers.PikaH3FlexModularPipeline">PikaH3FlexModularPipeline</a> merupakan keseluruhan integrasi, dan tidak ada bagian <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><!---->Memuat<!----></span></h2><!--]--><!----> <p>Sebuah pipeline dirakit dalam dua langkah: komponen dimuat melalui <code>modular_model_index.json</code> yang menyebutkan komponen dasar MiniMax-H3 dan dua konfigurasi scheduler, kemudian adapter dari workflow yang dipilih dimuat di atasnya dengan <a href="/docs/diffusers/main/id/api/loaders/lora#diffusers.loaders.MiniMaxH3LoraLoaderMixin.load_lora_weights">load_lora_weights()</a>. Adapter tersebut adalah dump PEFT polos dari nama modul diffusers dan dimuat pada skala latihannya (<code>alpha == rank</code>, 1.0).</p> <table><thead><tr><th>Alur Kerja</th><th>Input</th><th>Partisi Transformer</th><th>Adapter</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> dan <code>image</code> dan/atau <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> dan <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> Disalin</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">&quot;Pika-Labs/Pika-H3-Flex&quot;</span>, workflow=<span class="hljs-string">&quot;fl2va&quot;</span>)
pipe.load_components(dtype={<span class="hljs-string">&quot;vae&quot;</span>: torch.float32, <span class="hljs-string">&quot;audio_vae&quot;</span>: torch.float32, <span class="hljs-string">&quot;default&quot;</span>: torch.bfloat16})
pipe.load_lora_weights(<span class="hljs-string">&quot;Pika-Labs/Pika-H3-Flex&quot;</span>, weight_name=<span class="hljs-string">&quot;fl2va/adapter.safetensors&quot;</span>)<!----></pre></div><!----> <p>Menyampaikan workflow memangkas blok ke tugas tersebut, sehingga hanya partisi transformer miliknya yang diambil, adapter mengarahkan ke satu partisi yang ada, dan pipeline hanya menerima permintaan untuk tugas tersebut — pipeline <code>fl2va</code> membutuhkan keyframe, sedangkan <code>t2va</code> tidak mengambil apa pun. Pipeline yang memegang kedua partisi (dimuat tanpa <code>workflow=</code>) perlu diberi tahu ke mana adapter Ref2VA harus pergi: <code>pipe.load_lora_weights(..., weight_name="ref2va/adapter.safetensors", load_into_transformer_ref=True)</code>. Kedua VAE dirilis dalam float32 dan didekode dalam float32, sebagaimana dilakukan oleh paket yang dirilis; semuanya lainnya berjalan dalam bfloat16.</p> <blockquote class="tip"><p><code>pipe.doc</code> menampilkan apa yang diterima dan dikembalikan oleh pipeline di depan Anda — setiap input beserta nilai default-nya, komponen yang diharapkan, dan output yang dihasilkan.</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><!---->Memanfaatkan kembali MiniMax-H3 yang dimuat<!----></span></h3><!--]--><!----> <p>Komponen dasarnya adalah milik MiniMax-H3, sehingga pipeline MiniMax-H3 yang sudah dimuat menyimpan semua hal kecuali dua scheduler dan adapter. Bagian ini merangkai pipeline Pika H3 Flex dari komponen-komponen yang sudah dimuat tersebut dan menjaga kedua pipeline tetap siap berdampingan: satu <a href="/docs/diffusers/main/id/api/modular_diffusers/pipeline_components#diffusers.ComponentsManager">ComponentsManager</a> menyimpan setiap komponen sekali dan melakukan offload untuk keduanya, pipeline Pika H3 Flex hanya menambahkan dua scheduler-nya, dan adapter menentukan model mana dari dua model tersebut yang dijalankan oleh transformer bersama.</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> Disalin</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">&quot;vae&quot;</span>: torch.float32, <span class="hljs-string">&quot;audio_vae&quot;</span>: torch.float32, <span class="hljs-string">&quot;default&quot;</span>: torch.bfloat16}
manager = ComponentsManager()
manager.enable_auto_cpu_offload(device=<span class="hljs-string">&quot;cuda&quot;</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">&quot;MiniMaxAI/MiniMax-H3&quot;</span>, components_manager=manager, collection=<span class="hljs-string">&quot;minimax-h3&quot;</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">&quot;Pika-Labs/Pika-H3-Flex&quot;</span>, components_manager=manager, collection=<span class="hljs-string">&quot;pika-h3-flex&quot;</span>)
pika.load_components(names=[<span class="hljs-string">&quot;scheduler&quot;</span>, <span class="hljs-string">&quot;audio_scheduler&quot;</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">&quot;text_encoder&quot;</span>, <span class="hljs-string">&quot;tokenizer&quot;</span>, <span class="hljs-string">&quot;processor&quot;</span>, <span class="hljs-string">&quot;vae&quot;</span>, <span class="hljs-string">&quot;audio_vae&quot;</span>, <span class="hljs-string">&quot;transformer&quot;</span>, <span class="hljs-string">&quot;transformer_ref&quot;</span>]
pika.update_components(**{name: manager.get_one(name=name, collection=<span class="hljs-string">&quot;minimax-h3&quot;</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">&quot;Pika-Labs/Pika-H3-Flex&quot;</span>, weight_name=<span class="hljs-string">&quot;fl2va/adapter.safetensors&quot;</span>)
pika.load_lora_weights(
<span class="hljs-string">&quot;Pika-Labs/Pika-H3-Flex&quot;</span>, weight_name=<span class="hljs-string">&quot;ref2va/adapter.safetensors&quot;</span>, load_into_transformer_ref=<span class="hljs-literal">True</span>
)<!----></pre></div><!----> <p><code>print(manager)</code> menampilkan hasilnya: setiap komponen bersama terdaftar sekali dan termasuk dalam kedua koleksi, koleksi Pika H3 Flex menambahkan dua penjadwalnya, dan kedua transformer membawa 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> Disalin</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: [&#x27;default_0&#x27;]
transformer_ref_13...:
Adapters: [&#x27;default_0&#x27;]<!----></pre></div><!----> <p>Adaptor menentukan model mana yang digunakan oleh transformer bersama. Untuk kembali ke MiniMax-H3, panggil <code>pika.disable_lora()</code>, dan itu saja: permintaan <code>minimax(...)</code> berikutnya akan menjalankan model dasar. <code>pika.enable_lora()</code> mengaktifkan kembali Pika H3 Flex. Tidak ada yang dimuat ulang di antaranya; manajer memindahkan setiap komponen ke dan dari akselerator saat salah satu pipeline mencapainya.</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><!---->Apa yang berbeda dari MiniMax-H3<!----></span></h2><!--]--><!----> <ul><li><strong>Enam langkah, tanpa <code>num_inference_steps</code>.</strong> Kedua instans <a href="/docs/diffusers/main/id/api/schedulers/minimax_h3#diffusers.MiniMaxH3Scheduler">MiniMaxH3Scheduler</a> (<code>shift=12.0</code> untuk video, <code>shift=3.0</code> untuk audio) dijalankan dengan <code>stochastic_sampling</code> di atas konfigurasi <code>denoising_step_list</code> pipeline, yaitu jadwal yang dirilis <code>[1000, 750, 500, 250, 100, 40, 0]</code>: setiap langkah memprediksi sampel bersih, dan semua langkah kecuali yang terakhir menambahkan kembali noise baru ke sigma berikutnya. Jumlah langkah adalah kontrak adapter dan bukan merupakan input.</li> <li><strong>Derah baru di setiap langkah.</strong> Permintaan mengambil dari <code>generator</code> dalam urutan tetap: satu pengambilan per keyframe atau referensi visual untuk derah kondisioning, derah video, derah audio, dan kemudian pengambilan re-noising video dan audio dari masing-masing lima langkah pertama. Menyalurkan <code>latents</code> atau <code>audio_latents</code> menggantikan dua pengambilan awal dan membiarkan sisanya tetap ada.</li> <li><strong>Keyframes dipotong (cropped), bukan diregangkan.</strong> Keyframe <code>fl2va</code> dipotong di tengah sesuai rasio aspek kanvas pada resolusi aslinya, lalu di-resize ke kanvas.</li> <li><strong>Referensi mengikuti tier resolusi kanvas.</strong> Pika H3 Flex menghasilkan pada tabel bucket — tier 480p dan tier 768p, masing-masing dengan sebelas rasio aspek — dan permintaan <code>ref2va</code> dikondisikan berdasarkan tier kanvasnya: referensi gambar dikodekan pada sisi pendek 1024 piksel di bawah tier 768 dan 2048 dari tier tersebut ke atas, dan referensi video ditempatkan pada aturan kanvas tier itu sendiri. Setiap referensi video atau audio mandiri berjalan selama 2 hingga 15 detik, dan durasi video serta durasi audio mandiri masing-masing berjumlah maksimal 15 detik.</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><!---->Generasi<!----></span></h2><!--]--><!----> <p>Bucket yang dirilis adalah kanvas tempat Pika H3 Flex divalidasi. Gunakan salah satunya sebagai <code>height</code> dan <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> Disalin</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">&quot;cuda&quot;</span>) <span class="hljs-comment"># or &quot;mps&quot;, &quot;xpu&quot;, &quot;cpu&quot;</span>
<span class="hljs-comment"># Create one pipeline for all supported workflows, then load the `fl2va` workflow&#x27;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">&quot;Pika-Labs/Pika-H3-Flex&quot;</span>, components_manager=manager)
pipe.load_components(
workflow=<span class="hljs-string">&quot;fl2va&quot;</span>, dtype={<span class="hljs-string">&quot;vae&quot;</span>: torch.float32, <span class="hljs-string">&quot;audio_vae&quot;</span>: torch.float32, <span class="hljs-string">&quot;default&quot;</span>: torch.bfloat16}
)
pipe.load_lora_weights(<span class="hljs-string">&quot;Pika-Labs/Pika-H3-Flex&quot;</span>, weight_name=<span class="hljs-string">&quot;fl2va/adapter.safetensors&quot;</span>)
prompt = (
<span class="hljs-string">&quot;integrated_multimodal_description: A cinematic close shot of a red ceramic cup on a wooden table beside an &quot;</span>
<span class="hljs-string">&quot;open window. A soft breeze moves a linen curtain. The camera slowly pushes toward the cup as warm morning &quot;</span>
<span class="hljs-string">&quot;light crosses the table.\n&quot;</span>
<span class="hljs-string">&quot;overall_soundscape: Gentle wind through the window and faint birdsong outside. No speech.\n&quot;</span>
<span class="hljs-string">&quot;non_diegetic_music: None.\n&quot;</span>
)
outputs = [<span class="hljs-string">&quot;videos&quot;</span>, <span class="hljs-string">&quot;audio&quot;</span>, <span class="hljs-string">&quot;sampling_rate&quot;</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">&quot;cuda&quot;</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">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/astronaut.jpg&quot;</span>
)
i2va_prompt = (
<span class="hljs-string">&quot;For the target video, at 0.00 seconds into the target video, &lt;Picture 1&gt; (from [Shot 1]) is fully referenced.\n\n&quot;</span>
<span class="hljs-string">&quot;integrated_multimodal_description: [Shot 1] Begin with the supplied image of a small toy astronaut figurine &quot;</span>
<span class="hljs-string">&quot;standing on a grey rocky moon surface, holding a white egg-shaped object. Preserve the figurine, its orange &quot;</span>
<span class="hljs-string">&quot;visor and the rocks. The astronaut slowly turns its helmet toward the camera and lifts the egg a little; fine &quot;</span>
<span class="hljs-string">&quot;dust drifts up around its boots. The camera slowly pushes in in one continuous shot. By the end the astronaut &quot;</span>
<span class="hljs-string">&quot;stands still, egg held up.\n\n&quot;</span>
<span class="hljs-string">&quot;overall_soundscape: Soft low wind and faint crunch of dust under the boots. No speech.\n\n&quot;</span>
<span class="hljs-string">&quot;non_diegetic_music: N/A\n&quot;</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">&quot;cuda&quot;</span>).manual_seed(<span class="hljs-number">42</span>),
output=outputs,
)
encode_video(
results[<span class="hljs-string">&quot;videos&quot;</span>][<span class="hljs-number">0</span>],
fps=<span class="hljs-number">24</span>,
output_path=<span class="hljs-string">&quot;pika_h3_flex_fl2va.mp4&quot;</span>,
audio=results[<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-number">0</span>],
audio_sample_rate=results[<span class="hljs-string">&quot;sampling_rate&quot;</span>],
)<!----></pre></div><!----> <p>Workflow <code>ref2va</code> menerima daftar referensi yang terurut — hingga 9 gambar, 3 video, dan 3 klip audio, total 12 — dengan cara yang sama seperti MiniMax-H3, yaitu satu kelas referensi per modalitas. Ini juga merupakan permintaan yang membutuhkan memori paling banyak: referensi menambahkan baris mereka sendiri ke dalam urutan, dan pada resolusi 768p, transformer saja sudah memenuhi kartu 80 GB. Oleh karena itu, contoh di bawah ini melakukan streaming blok transformer dari memori CPU satu per satu, sementara manager memindahkan komponen lainnya ke perangkat dan keluar darinya seperti sebelumnya. Contoh ini menjalankan permintaan referensi 768p pada satu kartu 80 GB; tanpa streaming, batasi pada 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> Disalin</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">&quot;cuda&quot;</span>) <span class="hljs-comment"># or &quot;mps&quot;, &quot;xpu&quot;, &quot;cpu&quot;</span>
pipe = ModularPipeline.from_pretrained(
<span class="hljs-string">&quot;Pika-Labs/Pika-H3-Flex&quot;</span>, workflow=<span class="hljs-string">&quot;ref2va&quot;</span>, components_manager=manager
)
pipe.load_components(dtype={<span class="hljs-string">&quot;vae&quot;</span>: torch.float32, <span class="hljs-string">&quot;audio_vae&quot;</span>: torch.float32, <span class="hljs-string">&quot;default&quot;</span>: torch.bfloat16})
pipe.load_lora_weights(<span class="hljs-string">&quot;Pika-Labs/Pika-H3-Flex&quot;</span>, weight_name=<span class="hljs-string">&quot;ref2va/adapter.safetensors&quot;</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">&quot;cuda&quot;</span>),
offload_device=torch.device(<span class="hljs-string">&quot;cpu&quot;</span>),
offload_type=<span class="hljs-string">&quot;block_level&quot;</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">&quot;subject_definitions: &lt;Subject 1&gt; is the woman in &lt;Picture 1&gt;. summary: [reference generation] &lt;Subject 1&gt; waves at the camera.&quot;</span>,
references=[
PikaH3FlexImageReference.from_file(<span class="hljs-string">&quot;subject.png&quot;</span>),
PikaH3FlexVideoReference.from_file(<span class="hljs-string">&quot;motion_ref.mp4&quot;</span>), <span class="hljs-comment"># frames, their `fps` and the soundtrack</span>
PikaH3FlexAudioReference.from_file(<span class="hljs-string">&quot;voice.wav&quot;</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">&quot;cuda&quot;</span>).manual_seed(<span class="hljs-number">42</span>),
output=[<span class="hljs-string">&quot;videos&quot;</span>, <span class="hljs-string">&quot;audio&quot;</span>, <span class="hljs-string">&quot;sampling_rate&quot;</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">kelas</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>&lt;</span> <span class="hidden md:block mx-0.5 hover:!underline">source</span> <span>></span></a><!--]--></span> <!--[0--><p class="font-mono text-xs md:text-sm !leading-relaxed !my-6"><span>(</span> <!--[--><span class="comma cursor-default"><span class="rounded hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black">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 untuk generasi video + audio bersama dengan Pika H3 Flex, MiniMax-H3 enam langkah yang telah dilatih ulang: alur kerja <code>t2va</code> (hanya teks) dan <code>fl2va</code> (keyframe pertama dan/atau terakhir) terhadap partisi checkpoint <code>transformer/</code> dengan adapter <code>fl2va</code>, serta alur kerja <code>ref2va</code> (omni-reference) terhadap <code>transformer_ref/</code> dengan adapter <code>ref2va</code>.</p> <p>Komponen dasarnya adalah milik MiniMax-H3, dan rilis Pika H3 Flex adalah sepasang adapter LoRA rank-128 di atas dua partisi transformer, sehingga pipeline dirakit dalam dua langkah: komponen dimuat melalui <code>modular_model_index.json</code> yang menyebutkan komponen dasar dan dua scheduler, dan adapter dari workflow yang dipilih dimuat dengan <a href="/docs/diffusers/main/id/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> Disalin</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">&quot;Pika-Labs/Pika-H3-Flex&quot;</span>, workflow=<span class="hljs-string">&quot;fl2va&quot;</span>)
pipe.load_components(dtype={<span class="hljs-string">&quot;vae&quot;</span>: torch.float32, <span class="hljs-string">&quot;audio_vae&quot;</span>: torch.float32, <span class="hljs-string">&quot;default&quot;</span>: torch.bfloat16})
pipe.load_lora_weights(<span class="hljs-string">&quot;Pika-Labs/Pika-H3-Flex&quot;</span>, weight_name=<span class="hljs-string">&quot;fl2va/adapter.safetensors&quot;</span>)<!----></pre></div><!----></div><!----> <p>Seperti MiniMax-H3, Pika H3 Flex melakukan denoising pada <strong>satu sequence yang dikemas</strong> yang memuat kondisioning teks, latens kondisioning keyframe atau referensi, latens audio, dan latens video sekaligus. Inilah mengapa blok-blok tersebut meneruskan tata letak baris (row layout) alih-alih tensor per-modalitas, dan mengapa pipeline membawa dua scheduler (<code>shift = 12.0</code> untuk video, <code>shift = 3.0</code> untuk audio) yang di-step di dalam satu panggilan transformer. Berbeda dengan MiniMax-H3, kedua scheduler tersebut adalah instance <a href="/docs/diffusers/main/id/api/schedulers/minimax_h3#diffusers.MiniMaxH3Scheduler">MiniMaxH3Scheduler</a> dengan <code>stochastic_sampling</code> di atas <code>denoising_step_list</code> enam langkah yang tetap: tidak ada <code>num_inference_steps</code>, dan setiap langkah menarik noise baru dari generator permintaan.</p> <p>Adaptor-adaptor ini di-distilasi dengan panduan, sama seperti basisnya: tidak ada guider, tidak ada <code>negative_prompt</code> dan tidak ada <code>guidance_scale</code>, dan setiap langkah menjalankan tepat satu forward pass.</p> <p>Modul ini membawa fakta model yang menjadi acuan setiap blok — geometri yang diturunkan dari config sebagai properti, serta aritmetika kanvas, tier, dan jumlah frame sebagai fungsi — sementara kontrak conditioning, encoding, dan noise berada langsung di blok-blok tersebut.</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">kelas</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>&lt;</span> <span class="hidden md:block mx-0.5 hover:!underline">source</span> <span>></span></a><!--]--></span> <!--[0--><p class="font-mono text-xs md:text-sm !leading-relaxed !my-6"><span>(</span> <!--[--><!--]--> <span>)</span> <!--[-1--><!--]--></p><!--]--> <div class="!mb-10 relative docstring-details "><!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--></div></div><!----> <p>Auto Modular pipeline blocks untuk generasi video + audio bersama dengan Pika H3 Flex: alur kerja <code>t2va</code> (teks saja), <code>fl2va</code> (keyframe pertama dan/atau terakhir), serta <code>ref2va</code> (omni-reference), yang dipilih berdasarkan input <code>references</code> dan keyframe. Alur kerja <code>t2va</code> dan <code>fl2va</code> menjalankan partisi <code>transformer</code> dengan adapter <code>fl2va</code>, sedangkan <code>ref2va</code> menjalankan partisi <code>transformer_ref</code> dengan adapter <code>ref2va</code>, sehingga muatlah adapter dari alur kerja yang diambil oleh permintaan tersebut. Tanpa <code>workflow=</code>, pemuatan komponen akan menarik <strong>kedua</strong> partisi transformer berukuran 61,7GB — berikan salah satunya untuk hanya memuat apa yang dibutuhkan tugas.</p> <p>Alur kerja yang didukung:</p> <ul><li><code>t2va</code>: membutuhkan <code>prompt</code></li> <li><code>fl2va</code>: membutuhkan <code>prompt</code>, <code>image</code> atau <code>prompt</code>, <code>last_image</code></li> <li><code>ref2va</code>: membutuhkan <code>prompt</code>, <code>references</code></li></ul> <p>Komponen:
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>Konfigurasi:
canvas_short_edge (default: 768) canvas_max_pixels (default: 1032192) denoising_step_list (default: [1000,
750, 500, 250, 100, 40, 0])</p> <p>Inputs:
references (<code>list</code>, <em>optional</em>):
The references to condition on, <strong>in the order the model should read them</strong>: the order labels them in the
prompt presentation and lays them out on the shared rotary clock, so a different order is a different
request. One dataclass per modality, all holding in-memory media — a <code>PikaH3FlexImageReference</code> (at
most 9), a <code>PikaH3FlexVideoReference</code> at its own <code>fps</code> (at most 3, whose <code>audio</code> soundtrack is
conditioned on as well), or a <code>PikaH3FlexAudioReference</code> at its own <code>sample_rate</code> (at most 3) — for at
most 12 references in total, and audio references cannot be the only ones. Every video or standalone
audio reference runs 2 to 15 seconds, and the video durations and the standalone audio durations each sum
to at most 15 seconds. These blocks never open a media file: decode with each class’s <code>from_file</code> classmethod, which brings the rates along.
height (<code>int</code>, <em>optional</em>):
Height of the generated video in pixels, a multiple of 32.
width (<code>int</code>, <em>optional</em>):
Width of the generated video in pixels, a multiple of 32.
num_frames (<code>int</code>, <em>optional</em>):
Number of frames to generate, at the fixed 24 fps: 120 to 360, i.e. 5 to 15 seconds, snapped up to the
next <code>17 * n + 5</code> the video VAE can decode. To generate a video as long as a reference soundtrack, pass <code>round(samples / sample_rate * 24)</code>.
image (<code>Image</code>, <em>optional</em>):
Keyframe the video starts from. It is center-cropped to the canvas’ aspect ratio and resized onto it; the
canvas by default is derived from its own aspect ratio.
last_image (<code>Image</code>, <em>optional</em>):
Keyframe the video ends on. Can be passed on its own to generate <em>up to</em> a frame. It is center-cropped to
the canvas’ aspect ratio and resized onto it, like <code>image</code>.
prompt (<code>str</code>):
The prompt to guide generation, a single string.
normalized_references (<code>list</code>, <em>optional</em>):
The references normalized by the setup step, in packed order.
keyframes (<code>list</code>, <em>optional</em>):
The keyframes put onto the target canvas, in packed order.
condition_latents (<code>list</code>, <em>optional</em>):
The encoded video conditioning latents, one per image and video reference in packed order. Their shape is
where every reference block’s geometry comes from.
audio_condition_latents (<code>list</code>, <em>optional</em>):
The encoded audio conditioning rows, one per audio-bearing reference in packed order.
generator (<code>Generator</code>, <em>optional</em>):
The generator of the request. The conditioning noise is drawn from it first, one draw per condition,
before the noise of the generated rows.
latents (<code>Tensor</code>):
Pre-generated video noise of shape <code>(1, 24, num_latent_frames, latent_height, latent_width)</code>, used
instead of the draw.
audio_latents (<code>Tensor</code>):
Pre-generated audio noise of shape <code>(2, 32, num_audio_latents)</code>.
*<em>denoiser_input_fields (<code>None</code>,</em>optional<em>):
The structural description of the packed sequence the transformer reads by name: <code>token_tags</code>, <code>position_ids</code> and the three row-index tensors.
attention_kwargs (<code>dict</code>,</em>optional<em>):
Additional kwargs for attention processors.
keyframe_anchors (<code>tuple</code>,</em>optional<em>, defaults to ()):
Which end of the video every keyframe is anchored to, in packed order.
output_type (<code>str</code>,</em>optional*, defaults to pil):
Output format: ‘pil’, ‘np’ or ‘pt’.</p> <p>Output:
videos (<code>list</code>):
Video yang dihasilkan.
audio (<code>Tensor</code>):
Soundtrack yang dihasilkan, dengan bentuk <code>(1, 2, num_samples)</code>.
sampling_rate (<code>int</code>):
Sample rate dari soundtrack yang dihasilkan dalam Hz.</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">kelas</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>&lt;</span> <span class="hidden md:block mx-0.5 hover:!underline">source</span> <span>></span></a><!--]--></span> <!--[0--><p class="font-mono text-xs md:text-sm !leading-relaxed !my-6"><span>(</span> <!--[--><span class="comma cursor-pointer"><span class="rounded hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black">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">Parameter <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> atau <code>torch.Tensor</code>) —
Gambar referensi: sebuah gambar, array <code>(height, width, 3)</code> atau tensor <code>(3, height, width)</code>, <code>uint8</code> atau
floating point pada <code>[0, 1]</code>. Gambar ini tidak pernah mengikat geometri yang dihasilkan — ia di-encode pada sisi pendeknya
sendiri, 2048 untuk checkpoint yang dirilis, apa pun kanvas yang dihasilkan oleh permintaan.<!----></span></span></li><!--]--></ul><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--></div></div><!----> <p>Referensi subjek, gaya, atau adegan: maksimal 9 per permintaan.</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>&lt;</span> <span class="hidden md:block mx-0.5 hover:!underline">source</span> <span>></span></a><!--]--></span> <!--[0--><p class="font-mono text-xs md:text-sm !leading-relaxed !my-6"><span>(</span> <!--[--><span class="comma cursor-pointer"><span class="rounded hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black">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">Parameter <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> atau <code>os.PathLike</code>) — Path atau URL dari gambar.<!----></span></span></li><!--]--></ul><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--></div></div><!----> <p>Muat file gambar ke dalam <code>PikaH3FlexImageReference</code>, melalui <a href="/docs/diffusers/main/id/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">kelas</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>&lt;</span> <span class="hidden md:block mx-0.5 hover:!underline">source</span> <span>></span></a><!--]--></span> <!--[0--><p class="font-mono text-xs md:text-sm !leading-relaxed !my-6"><span>(</span> <!--[--><span class="comma cursor-pointer"><span class="rounded hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black">frames<span class="opacity-60">: 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">Parameter <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> atau <code>torch.Tensor</code>) —
Frame referensi: daftar gambar, array <code>(num_frames, height, width, 3)</code> atau tensor <code>(num_frames, 3, height, width)</code>, <code>uint8</code> atau floating point di <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>opsional</em>, default 24.0) —
Laju frame yang dibawa oleh <code>frames</code>, yang menentukan penempatan blok visual referensi pada grid 2 fps conditioner. Jam internal MiniMax-H3 sendiri adalah 24 fps, sehingga laju lain akan diresample ke laju tersebut dengan membuang dan menduplikasi frame utuh — hal ini menjadikan parameter ini yang harus diatur dengan benar ketika frame berasal dari file.<!----></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> dengan bentuk <code>(channels, num_samples)</code>, <em>opsional</em>) —
Soundtrack video ini, mono atau stereo, yang dikondisikan sebagai milik referensi itu sendiri, bukan sebagai referensi dari dirinya sendiri. Jika diabaikan, referensi hanya dikondisikan berdasarkan gerakan.<!----></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>opsional</em>) —
Laju di mana <code>audio</code> membawa sampelnya. Jika dibiarkan kosong, laju yang digunakan adalah laju bawaan VAE audio, sehingga sampel tidak diubah; laju lain akan melakukan resampling ke laju tersebut.<!----></span></span></li><!--]--></ul><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--></div></div><!----> <p>Referensi gerakan dan kamera: maksimal 3 per permintaan, dikondisikan bersama dengan soundtrack-nya sendiri.</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>&lt;</span> <span class="hidden md:block mx-0.5 hover:!underline">source</span> <span>></span></a><!--]--></span> <!--[0--><p class="font-mono text-xs md:text-sm !leading-relaxed !my-6"><span>(</span> <!--[--><span class="comma cursor-pointer"><span class="rounded hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black">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">Parameter <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> atau <code>os.PathLike</code>) — Path atau URL dari video.<!----></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"><!---->Mengembalikan<!----></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>frame <code>(num_frames, height, width, 3)</code> <code>uint8</code> pada laju frame yang dilaporkan oleh kontainer, membawa soundtrack-nya dan laju sampel soundtrack tersebut ketika memiliki stream audio.</p>
<!----></div><!--]--> <!--[-1--><!--]--></div></div><!----> <p>Decode file video menjadi <code>PikaH3FlexVideoReference</code>, pada resolusi, frame rate, dan soundtrack yang dibawanya.</p> <p>Laju tersebut mendarat pada referensi, yang merupakan inti dari proses decoding dengan cara ini alih-alih menggunakan <a href="/docs/diffusers/main/id/api/utilities#diffusers.utils.load_video">load_video()</a>: MiniMax-H3 melakukan resampling referensi ke 24 fps miliknya sendiri, sehingga laju frame yang hilang saat input adalah permintaan yang dikondisikan pada kecepatan yang salah, tanpa ada mekanisme untuk memperingatkannya. Kontainer yang metadatanya salah dikoreksi dengan menimpa <code>fps</code> atau <code>sample_rate</code> pada referensi yang dikembalikan.</p> <p>Memerlukan <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">kelas</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>&lt;</span> <span class="hidden md:block mx-0.5 hover:!underline">source</span> <span>></span></a><!--]--></span> <!--[0--><p class="font-mono text-xs md:text-sm !leading-relaxed !my-6"><span>(</span> <!--[--><span class="comma cursor-pointer"><span class="rounded hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black">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">Parameter <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> dengan bentuk <code>(channels, num_samples)</code>) —
Gelombang referensi, mono atau stereo.<!----></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>opsional</em>) —
Laju di mana <code>audio</code> membawa sampelnya. Jika dibiarkan kosong, laju yang digunakan adalah laju bawaan VAE audio, sehingga sampel tidak diubah; laju lain akan melakukan resampling ke laju tersebut.<!----></span></span></li><!--]--></ul><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--></div></div><!----> <p>Referensi suara atau musik: maksimal 3 per permintaan, dan tidak pernah berdiri sendiri — referensi audio harus dipasangkan dengan setidaknya satu referensi gambar atau video. Referensi ini tidak pernah mencapai conditioner dan hanya dienkod oleh audio 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>&lt;</span> <span class="hidden md:block mx-0.5 hover:!underline">source</span> <span>></span></a><!--]--></span> <!--[0--><p class="font-mono text-xs md:text-sm !leading-relaxed !my-6"><span>(</span> <!--[--><span class="comma cursor-pointer"><span class="rounded hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black">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">Parameter <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> atau <code>os.PathLike</code>) — Path atau URL dari audio, atau dari video yang soundtrack-nya diambil.<!----></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"><!---->Mengembalikan<!----></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>waveform float32 <code>(channels, num_samples)</code> pada laju sampel yang dilaporkan oleh kontainer.</p>
<!----></div><!--]--> <!--[-1--><!--]--></div></div><!----> <p>Decode file audio menjadi <code>PikaH3FlexAudioReference</code>, pada laju sampel yang dibawanya.</p> <p>Memerlukan <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:
108 kB
·
Xet hash:
2df29de983d832f2cd705506bdf3b62265e6e30722b344a20fa3799b1093b590

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