Buckets:

hf-doc-build/doc / diffusers /main /fr /api /pipelines /pika_h3_flex.html
mishig's picture
download
raw
109 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;Chargement&quot;,&quot;local&quot;:&quot;loading&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Réutilisation d'un MiniMax-H3 chargé&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;Différences par rapport à MiniMax-H3&quot;,&quot;local&quot;:&quot;what-differs-from-minimax-h3&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Génération&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> est l’entraînement post-entraînement de Pika de <a href="./minimax_h3">MiniMax-H3</a> en un générateur vidéo et audio en six étapes. Il conserve la séquence compacte de MiniMax-H3, son conditionneur Qwen3-VL et ses deux VAE, et modifie deux éléments : le sampleur, un calendrier fixe de six étapes qui ré-bruit la prédiction propre à chaque étape à la place de la mise à jour d’Euler, et les poids, une paire d’adaptateurs LoRA de rang 128 sur les deux partitions du transformeur MiniMax-H3. La vidéo et sa bande-son stéréo synchronisée sont produites par les mêmes six passes avant.</p> <p>La publication concerne les adaptateurs : l’adaptateur FL2VA (<code>fl2va/adapter.safetensors</code>) pilote la partition <code>transformer/</code> pour le conditionnement par le texte et les trames de fin de point, tandis que l’adaptateur Ref2VA (<code>ref2va/adapter.safetensors</code>) pilote <code>transformer_ref/</code> pour les références multimodales. Les composants de base proviennent de <a href="https://huggingface.co/MiniMaxAI/MiniMax-H3" rel="nofollow">MiniMaxAI/MiniMax-H3</a>, sans modification, et le dépôt en contient une copie afin de pouvoir être chargé de manière autonome.</p> <p>Pika H3 Flex est intégré uniquement sous forme de blocs <a href="../../modular_diffusers/overview">Modular Diffusers</a>, comme MiniMax-H3 : les blocs et leur <a href="/docs/diffusers/main/fr/api/pipelines/pika_h3_flex#diffusers.PikaH3FlexModularPipeline">PikaH3FlexModularPipeline</a> constituent l’intégralité de l’intégration, et il n’existe pas de moitié <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><!---->Chargement<!----></span></h2><!--]--><!----> <p>Un pipeline est assemblé en deux étapes : les composants sont chargés via un <code>modular_model_index.json</code> qui nomme les composants de base MiniMax-H3 et les deux configurations de planificateur, puis l'adaptateur du workflow sélectionné est chargé par-dessus avec <a href="/docs/diffusers/main/fr/api/loaders/lora#diffusers.loaders.MiniMaxH3LoraLoaderMixin.load_lora_weights">load_lora_weights()</a>. Les adaptateurs sont des dumps PEFT simples des noms de modules diffusers et se chargent à leur échelle d'entraînement (<code>alpha == rank</code>, 1.0).</p> <table><thead><tr><th>Flux de travail</th><th>Entrées</th><th>Partition du 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> et <code>image</code> et/ou <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> et <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> Copié</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>Passer le workflow élimine les blocs non pertinents pour cette tâche, de sorte que seule sa propre partition de transformeur est récupérée, que l’adaptateur achemine vers la partition présente et que le pipeline n’accepte que les requêtes de cette tâche — un pipeline <code>fl2va</code> nécessite une image clé, un <code>t2va</code> n’en prend aucune. Un pipeline qui détient les deux partitions (chargé sans <code>workflow=</code>) doit être informé de l’emplacement de l’adaptateur Ref2VA : <code>pipe.load_lora_weights(..., weight_name="ref2va/adapter.safetensors", load_into_transformer_ref=True)</code>. Les deux VAE sont publiés en float32 et décodent en float32, comme le fait le package publié ; tout le reste s’exécute en bfloat16.</p> <blockquote class="tip"><p><code>pipe.doc</code> affiche ce que le pipeline devant vous reçoit et renvoie — chaque entrée avec sa valeur par défaut, les composants qu’il attend et les sorties qu’il produit.</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><!---->Réutilisation d'un MiniMax-H3 chargé<!----></span></h3><!--]--><!----> <p>Les composants de base sont ceux de MiniMax-H3, de sorte qu’un pipeline MiniMax-H3 déjà chargé contient tout, à l’exception des deux planificateurs et des adaptateurs. Cette section assemble un pipeline Pika H3 Flex à partir de ces composants chargés et maintient les deux pipelines prêts côte à côte : un <a href="/docs/diffusers/main/fr/api/modular_diffusers/pipeline_components#diffusers.ComponentsManager">ComponentsManager</a> détient chaque composant une seule fois et le décharge pour les deux, le pipeline Pika H3 Flex n’ajoute que ses deux planificateurs, et les adaptateurs déterminent lequel des deux modèles les transformeurs partagés exécutent.</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> Copié</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> affiche le résultat : chaque composant partagé est listé une seule fois et appartient aux deux collections, la collection Pika H3 Flex ajoute ses deux planificateurs, et les deux transformers portent un adaptateur.</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> Copié</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>Les adaptateurs déterminent quel modèle les transformers partagés représentent. Pour revenir à MiniMax-H3, il suffit d’appeler <code>pika.disable_lora()</code> : la prochaine requête <code>minimax(...)</code> exécutera le modèle de base. <code>pika.enable_lora()</code> réactive Pika H3 Flex. Rien n’est rechargé entre-temps ; le gestionnaire déplace chaque composant sur ou hors de l’accélérateur au fur et à mesure que chaque pipeline y accède.</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><!---->Différences par rapport à MiniMax-H3<!----></span></h2><!--]--><!----> <ul><li><strong>Six étapes, sans <code>num_inference_steps</code>.</strong> Les deux instances de <a href="/docs/diffusers/main/fr/api/schedulers/minimax_h3#diffusers.MiniMaxH3Scheduler">MiniMaxH3Scheduler</a> (<code>shift=12.0</code> pour la vidéo, <code>shift=3.0</code> pour l’audio) fonctionnent avec <code>stochastic_sampling</code> sur la configuration <code>denoising_step_list</code> du pipeline, à savoir le calendrier publié <code>[1000, 750, 500, 250, 100, 40, 0]</code> : chaque étape prédit l’échantillon propre, et toutes sauf la dernière le re-bruitent avec du bruit frais jusqu’au sigma suivant. Le nombre d’étapes fait partie du contrat de l’adaptateur et n’est pas une entrée.</li> <li><strong>Bruit neuf à chaque étape.</strong> Une requête puise dans son <code>generator</code> dans un ordre fixe : un tirage par image clé ou référence visuelle pour le bruit de conditionnement, le bruit vidéo, le bruit audio, puis les tirages de re-bruitage vidéo et audio de chacune des cinq premières étapes. Passer <code>latents</code> ou <code>audio_latents</code> remplace les deux tirages initiaux et laisse le reste en place.</li> <li><strong>Les images clés sont recadrées, pas étirées.</strong> Une image clé <code>fl2va</code> est recadrée au centre selon le ratio d’aspect du canevas à sa propre résolution, puis redimensionnée pour couvrir le canevas.</li> <li><strong>Les références suivent le niveau de résolution du canevas.</strong> Pika H3 Flex génère selon un tableau de buckets — un niveau 480p et un niveau 768p, chacun avec onze rapports d’aspect — et une requête <code>ref2va</code> est conditionnée par le niveau de son canevas : une référence image est encodée avec un côté court de 1024 pixels en dessous du niveau 768 et de 2048 pixels à partir de ce niveau, tandis qu’une référence vidéo est soumise à la règle de canevas propre au niveau. Chaque référence vidéo ou audio autonome dure de 2 à 15 secondes, et la somme des durées des vidéos ainsi que celle des audios autonomes est au maximum de 15 secondes.</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><!---->Génération<!----></span></h2><!--]--><!----> <p>Les buckets publiés sont les canevas sur lesquels Pika H3 Flex a été validé. Passez-en un en tant que <code>height</code> et <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> Copié</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>Le workflow <code>ref2va</code> prend en entrée une liste ordonnée de références — jusqu’à 9 images, 3 vidéos et 3 extraits audio, soit 12 au total — de la même manière que MiniMax-H3, avec une classe de référence par modalité. C’est également la requête qui nécessite le plus de mémoire : les références ajoutent leurs propres lignes à la séquence, et à 768p, le seul transformateur sature une carte de 80 Go. L’exemple ci-dessous diffuse donc les blocs du transformateur depuis la mémoire CPU un par un, tandis que le gestionnaire déplace les autres composants sur et hors de l’appareil comme auparavant. Il exécute une requête de référence à 768p sur une carte de 80 Go ; sans le streaming, limitez-vous à 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> Copié</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">classe</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>Un ModularPipeline pour la génération conjointe vidéo + audio avec Pika H3 Flex, le MiniMax-H3 post-entraîné en six étapes : les workflows <code>t2va</code> (texte uniquement) et <code>fl2va</code> (image clé première et/ou dernière) contre le checkpoint <code>transformer/</code> avec l’adaptateur <code>fl2va</code>, et le workflow <code>ref2va</code> (référence omnidirectionnelle) contre <code>transformer_ref/</code> avec l’adaptateur <code>ref2va</code>.</p> <p>Les composants de base sont ceux de MiniMax-H3, et la version Pika H3 Flex est constituée d’une paire d’adaptateurs LoRA de rang 128 superposés aux deux partitions du transformer. Le pipeline est donc assemblé en deux étapes : les composants sont chargés via un <code>modular_model_index.json</code> qui nomme les composants de base et les deux planificateurs, puis l’adaptateur du workflow sélectionné est chargé avec <a href="/docs/diffusers/main/fr/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> Copié</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>Comme MiniMax-H3, Pika H3 Flex débruite <strong>une séquence empaquetée</strong> qui contient à la fois le conditionnement textuel, les latents de conditionnement de la clé d'image ou de référence, les latents audio et les latents vidéo. C'est pourquoi les blocs transmettent une disposition par ligne plutôt que des tenseurs par modalité, et pourquoi le pipeline utilise deux planificateurs (<code>shift = 12.0</code> pour la vidéo, <code>shift = 3.0</code> pour l'audio) qui sont exécutés au sein d'un seul appel au transformeur. Contrairement à MiniMax-H3, les deux planificateurs sont des instances de <a href="/docs/diffusers/main/fr/api/schedulers/minimax_h3#diffusers.MiniMaxH3Scheduler">MiniMaxH3Scheduler</a> avec <code>stochastic_sampling</code> sur la liste fixe de six étapes <code>denoising_step_list</code> : il n'y a pas de <code>num_inference_steps</code>, et chaque étape tire un nouveau bruit du générateur de la requête.</p> <p>Les adaptateurs sont distillés par guidage, tout comme leur modèle de base : il n’y a ni guideur, ni <code>negative_prompt</code>, ni <code>guidance_scale</code>, et chaque étape exécute exactement un seul passage avant.</p> <p>Ce module contient les informations du modèle sur lesquelles chaque bloc s’appuie — la géométrie dérivée de la configuration sous forme de propriétés, ainsi que les calculs de canevas, de niveau et de nombre de frames sous forme de fonctions — tandis que les contrats de conditionnement, d’encodage et de bruit sont définis directement sur les blocs eux-mêmes.</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">classe</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>Blocs de pipeline modulaires automatiques pour la génération conjointe vidéo + audio avec Pika H3 Flex : les workflows <code>t2va</code> (texte uniquement), <code>fl2va</code> (image clé de début et/ou de fin) et <code>ref2va</code> (référence omnidirectionnelle), sélectionnés via les entrées <code>references</code> et image clé. Les workflows <code>t2va</code> et <code>fl2va</code> exécutent la partition <code>transformer</code> avec l’adaptateur <code>fl2va</code>, tandis que <code>ref2va</code> utilise la partition <code>transformer_ref</code> avec l’adaptateur <code>ref2va</code> ; chargez donc l’adaptateur correspondant au workflow de la requête.
Sans <code>workflow=</code>, le chargement des composants récupère <strong>les deux</strong> partitions du transformer de 61,7 Go — passez-en une pour ne charger que ce dont la tâche a besoin.</p> <p>Workflows pris en charge :</p> <ul><li><code>t2va</code> : nécessite <code>prompt</code></li> <li><code>fl2va</code> : nécessite <code>prompt</code>, <code>image</code> ou <code>prompt</code>, <code>last_image</code></li> <li><code>ref2va</code> : nécessite <code>prompt</code>, <code>references</code></li></ul> <p>Composants :
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>Configurations :
canvas_short_edge (par défaut : 768) canvas_max_pixels (par défaut : 1032192) denoising_step_list (par défaut : [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>Sorties :
videos (<code>list</code>) :
La vidéo générée.
audio (<code>Tensor</code>) :
La bande-son générée, de forme <code>(1, 2, num_samples)</code>.
sampling_rate (<code>int</code>) :
Taux d'échantillonnage de la bande-son générée en 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">classe</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">Paramètres <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> ou <code>torch.Tensor</code>) —
L’image de référence : une image, un tableau de forme <code>(height, width, 3)</code> ou un tenseur de forme <code>(3, height, width)</code>, en <code>uint8</code> ou
en virgule flottante sur <code>[0, 1]</code>. Elle ne contraint jamais la géométrie générée — elle est encodée sur un côté court propre à elle, 2048 pour le checkpoint publié, quelle que soit la toile générée par la requête.<!----></span></span></li><!--]--></ul><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--></div></div><!----> <p>Une référence de sujet, de style ou de scène : au maximum 9 par requête.</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">Paramètres <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> ou <code>os.PathLike</code>) — Chemin ou URL de l'image.<!----></span></span></li><!--]--></ul><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--></div></div><!----> <p>Chargez un fichier image dans un <code>PikaH3FlexImageReference</code>, via <a href="/docs/diffusers/main/fr/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">classe</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">Paramètres <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> ou <code>torch.Tensor</code>) —
Les images de référence : une liste d’images, un tableau de forme <code>(num_frames, height, width, 3)</code> ou un tenseur de forme <code>(num_frames, 3, height, width)</code>, <code>uint8</code> ou à virgule flottante sur <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>facultatif</em>, valeur par défaut 24.0) —
La fréquence d’images <code>frames</code> porte, ce qui positionne les blocs visuels de la référence sur la grille 2
fps du conditionneur. L’horloge propre à MiniMax-H3 est de 24 fps, donc toute autre fréquence est rééchantillonnée dessus en supprimant et en dupliquant des images entières — ce qui en fait le champ à régler correctement lorsque les images proviennent d’un fichier.<!----></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> de forme <code>(channels, num_samples)</code>, <em>facultatif</em>) —
La bande-son de cette vidéo, mono ou stéréo, conditionnée en tant que référence de la référence elle-même plutôt que comme référence de la vidéo. Si omise, la référence se conditionne uniquement sur le mouvement.<!----></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>facultatif</em>) —
Le taux auquel <code>audio</code> transporte ses échantillons. S’il est omis, le taux propre à la VAE audio est utilisé, ce qui laisse les échantillons inchangés ; tout autre taux entraîne un rééchantillonnage vers celui-ci.<!----></span></span></li><!--]--></ul><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--></div></div><!----> <p>Référence de mouvement et de caméra : au maximum 3 par requête, conditionnées ensemble avec leur propre bande-son.</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">Paramètres <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> ou <code>os.PathLike</code>) — Chemin ou URL de la vidéo.<!----></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"><!---->Retourne<!----></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>les <code>(num_frames, height, width, 3)</code> <code>uint8</code> images à la fréquence d’images déclarée par le conteneur, accompagnées de sa piste audio et du taux d’échantillonnage de cette piste lorsqu’un flux audio est présent.</p>
<!----></div><!--]--> <!--[-1--><!--]--></div></div><!----> <p>Décoder un fichier vidéo en <code>PikaH3FlexVideoReference</code>, à la résolution, à la fréquence d’images et avec la piste audio qu’il contient.</p> <p>Les taux sont appliqués à la référence, ce qui est l’objectif de décoder de cette manière plutôt qu’avec <a href="/docs/diffusers/main/fr/api/utilities#diffusers.utils.load_video">load_video()</a> : MiniMax-H3 rééchantillonne une référence sur son propre 24 fps, de sorte qu’un taux de perte en cours de route est une requête conditionnée à la mauvaise vitesse, sans aucun avertissement. Un conteneur dont les métadonnées sont incorrectes est corrigé en écrasant <code>fps</code> ou <code>sample_rate</code> sur la référence renvoyée.</p> <p>Nécessite <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">classe</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">Paramètres <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> de forme <code>(channels, num_samples)</code>) —
La forme d’onde de référence, mono ou stéréo.<!----></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>facultatif</em>) —
Le taux auquel <code>audio</code> transporte ses échantillons. S’il est omis, le taux propre à la VAE audio est utilisé, ce qui laisse les échantillons inchangés ; tout autre taux entraîne un rééchantillonnage vers celui-ci.<!----></span></span></li><!--]--></ul><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--></div></div><!----> <p>Référence vocale ou musicale : au maximum 3 par requête, et jamais seule — une référence audio doit être associée à au moins une référence image ou vidéo. Elle n’atteint jamais le conditionneur et est encodée uniquement par le VAE audio.</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">Paramètres <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> ou <code>os.PathLike</code>) — Chemin ou URL de l’audio, ou d’une vidéo dont la bande-son est extraite.<!----></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"><!---->Retourne<!----></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>le signal audio flottant 32 bits de forme <code>(channels, num_samples)</code> à la fréquence d'échantillonnage déclarée par le conteneur.</p>
<!----></div><!--]--> <!--[-1--><!--]--></div></div><!----> <p>Décoder un fichier audio en <code>PikaH3FlexAudioReference</code>, au taux d'échantillonnage qu'il contient.</p> <p>Nécessite <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:
109 kB
·
Xet hash:
15d3eee9d4418667ce81bf33244471a7cb99360f1eb64f5ec85ab5edbd52523a

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