Buckets:
| <meta charset="utf-8" /><meta name="hf:doc:metadata" content="{"title":"Pika H3 Flex","local":"pika-h3-flex","sections":[{"title":"Carregando","local":"loading","sections":[{"title":"Reutilizando um MiniMax-H3 carregado","local":"reusing-a-loaded-minimax-h3","sections":[],"depth":3}],"depth":2},{"title":"O que difere do MiniMax-H3","local":"what-differs-from-minimax-h3","sections":[],"depth":2},{"title":"Geração","local":"generation","sections":[],"depth":2},{"title":"PikaH3FlexModularPipeline","local":"diffusers.PikaH3FlexModularPipeline","sections":[],"depth":2},{"title":"PikaH3FlexBlocks","local":"diffusers.PikaH3FlexBlocks","sections":[],"depth":2},{"title":"PikaH3FlexImageReference","local":"diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexImageReference","sections":[],"depth":2},{"title":"PikaH3FlexVideoReference","local":"diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexVideoReference","sections":[],"depth":2},{"title":"PikaH3FlexAudioReference","local":"diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexAudioReference","sections":[],"depth":2}],"depth":1}"/> | |
| <link href="/docs/diffusers/main/en/_app/immutable/entry/start.D3LnKZ4R.js" rel="modulepreload"> | |
| <link href="/docs/diffusers/main/en/_app/immutable/chunks/BF9UNEM9.js" rel="modulepreload"> | |
| <link href="/docs/diffusers/main/en/_app/immutable/chunks/DPnyVmXs.js" rel="modulepreload"> | |
| <link href="/docs/diffusers/main/en/_app/immutable/entry/app.C0rBoMxR.js" rel="modulepreload"> | |
| <link href="/docs/diffusers/main/en/_app/immutable/chunks/DSGUT_OW.js" rel="modulepreload"> | |
| <link href="/docs/diffusers/main/en/_app/immutable/chunks/C045MWWx.js" rel="modulepreload"> | |
| <link href="/docs/diffusers/main/en/_app/immutable/chunks/DnVIJfC5.js" rel="modulepreload"> | |
| <link href="/docs/diffusers/main/en/_app/immutable/chunks/DsnmJJEf.js" rel="modulepreload"> | |
| <link href="/docs/diffusers/main/en/_app/immutable/nodes/0.DTZsP_3B.js" rel="modulepreload"> | |
| <link href="/docs/diffusers/main/en/_app/immutable/chunks/IaDvMxLQ.js" rel="modulepreload"> | |
| <link href="/docs/diffusers/main/en/_app/immutable/nodes/225.C7fDjxOl.js" rel="modulepreload"> | |
| <link href="/docs/diffusers/main/en/_app/immutable/chunks/bKdwVYpU.js" rel="modulepreload"> | |
| <link href="/docs/diffusers/main/en/_app/immutable/chunks/D0iXbNom.js" rel="modulepreload"> | |
| <!--13wh65h--><meta name="hf:doc:metadata" content="{"title":"Pika H3 Flex","local":"pika-h3-flex","sections":[{"title":"Loading","local":"loading","sections":[{"title":"Reusing a loaded MiniMax-H3","local":"reusing-a-loaded-minimax-h3","sections":[],"depth":3}],"depth":2},{"title":"What differs from MiniMax-H3","local":"what-differs-from-minimax-h3","sections":[],"depth":2},{"title":"Generation","local":"generation","sections":[],"depth":2},{"title":"PikaH3FlexModularPipeline","local":"diffusers.PikaH3FlexModularPipeline","sections":[],"depth":2},{"title":"PikaH3FlexBlocks","local":"diffusers.PikaH3FlexBlocks","sections":[],"depth":2},{"title":"PikaH3FlexImageReference","local":"diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexImageReference","sections":[],"depth":2},{"title":"PikaH3FlexVideoReference","local":"diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexVideoReference","sections":[],"depth":2},{"title":"PikaH3FlexAudioReference","local":"diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexAudioReference","sections":[],"depth":2}],"depth":1}"/><!----> | |
| <link href="/docs/diffusers/main/en/_app/immutable/assets/0.tn0RQdqM.css" rel="modulepreload"> <!--[--><!--[0--><!--[--><!--[0--><!--[--><p></p> <div class="items-center shrink-0 min-w-[100px] max-sm:min-w-[50px] justify-end ml-auto flex" style="float: inline-end; margin-inline-start: 10px; display: inline-flex; position: relative; z-index: 10;"><div dir="ltr" class="inline-flex rounded-md max-sm:rounded-sm"><button class="inline-flex items-center gap-1 h-7 max-sm:h-7 px-2 max-sm:px-1.5 text-sm font-medium text-gray-800 border border-r-0 rounded-l-md max-sm:rounded-l-sm border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-live="polite"><span class="inline-flex items-center justify-center rounded-md p-0.5 max-sm:p-0 hover:text-gray-800 dark:hover:text-gray-200"><svg class="sm:size-3.5 size-3" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----></span> <span dir="auto">Copy page</span></button> <button class="inline-flex items-center justify-center w-6 max-sm:w-5 h-7 max-sm:h-7 disabled:pointer-events-none text-sm text-gray-500 hover:text-gray-700 dark:hover:text-white rounded-r-md max-sm:rounded-r-sm border border-l transition border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-haspopup="menu" aria-expanded="false" aria-label="Open copy menu"><svg class="transition-transform text-gray-400 overflow-visible sm:size-3.5 size-3 rotate-0" width="1em" height="1em" viewBox="0 0 12 7" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L6 6L11 1" stroke="currentColor"></path></svg><!----></button></div> <!--[-1--><!--]--></div><!----> <!--[0--><h1 class="relative group"><a id="pika-h3-flex" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#pika-h3-flex"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->Pika H3 Flex<!----></span></h1><!--]--><!----> <div class="flex flex-wrap space-x-1"><a href="https://huggingface.co/docs/diffusers/main/en/tutorials/using_peft_for_inference" target="_blank" rel="noopener"><img alt="LoRA" src="https://img.shields.io/badge/LoRA-d8b4fe?style=flat"/></a></div> <p><a href="https://huggingface.co/Pika-Labs/Pika-H3-Flex" rel="nofollow">Pika H3 Flex</a> é o pós-treino da Pika do <a href="./minimax_h3">MiniMax-H3</a> para um gerador de vídeo e áudio em seis etapas. Ele mantém a sequência empacotada do MiniMax-H3, seu condicionador Qwen3-VL e seus dois VAEs, e altera duas coisas: o amostrador, um cronograma fixo de seis etapas que re-ruidifica a predição limpa a cada etapa no lugar da atualização Euler, e os pesos, um par de adaptadores LoRA de rank-128 sobre as duas partições do transformador MiniMax-H3. O vídeo e sua trilha sonora estéreo sincronizada saem das mesmas seis passadas de frente.</p> <p>O lançamento são os adaptadores: o adaptador FL2VA (<code>fl2va/adapter.safetensors</code>) controla a partição <code>transformer/</code> para condicionamento de texto e de quadro de extremidade, e o adaptador Ref2VA (<code>ref2va/adapter.safetensors</code>) controla o <code>transformer_ref/</code> para referências multimodais. Os componentes base são os do <a href="https://huggingface.co/MiniMaxAI/MiniMax-H3" rel="nofollow">MiniMaxAI/MiniMax-H3</a>, inalterados, e o repositório inclui uma cópia deles para que ele seja carregado de forma independente.</p> <p>Pika H3 Flex é integrado apenas como blocos de <a href="../../modular_diffusers/overview">Modular Diffusers</a>, assim como o MiniMax-H3: os blocos e seu <a href="/docs/diffusers/main/pt/api/pipelines/pika_h3_flex#diffusers.PikaH3FlexModularPipeline">PikaH3FlexModularPipeline</a> constituem toda a integração, e não há uma metade <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><!---->Carregando<!----></span></h2><!--]--><!----> <p>Um pipeline é montado em duas etapas: os componentes são carregados por meio de um <code>modular_model_index.json</code> que nomeia os componentes base do MiniMax-H3 e as duas configurações de agendador, em seguida, o adaptador do workflow selecionado é carregado por cima com <a href="/docs/diffusers/main/pt/api/loaders/lora#diffusers.loaders.MiniMaxH3LoraLoaderMixin.load_lora_weights">load_lora_weights()</a>. Os adaptadores são dumps PEFT simples dos nomes dos módulos do diffusers e são carregados na escala em que foram treinados (<code>alpha == rank</code>, 1.0).</p> <table><thead><tr><th>Fluxo de trabalho</th><th>Entradas</th><th>Particionamento do 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> e <code>image</code> e/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> e <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> Copiado</div><!----></button><!----></div> <pre class="language-py "><!----><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> ModularPipeline | |
| pipe = ModularPipeline.from_pretrained(<span class="hljs-string">"Pika-Labs/Pika-H3-Flex"</span>, workflow=<span class="hljs-string">"fl2va"</span>) | |
| pipe.load_components(dtype={<span class="hljs-string">"vae"</span>: torch.float32, <span class="hljs-string">"audio_vae"</span>: torch.float32, <span class="hljs-string">"default"</span>: torch.bfloat16}) | |
| pipe.load_lora_weights(<span class="hljs-string">"Pika-Labs/Pika-H3-Flex"</span>, weight_name=<span class="hljs-string">"fl2va/adapter.safetensors"</span>)<!----></pre></div><!----> <p>Ao passar o workflow, os blocos são podados para aquela tarefa, de modo que apenas a partição do transformer correspondente é obtida, o roteador do adapter direciona para a única partição presente e o pipeline aceita apenas as solicitações daquela tarefa — um pipeline <code>fl2va</code> requer um keyframe, enquanto um <code>t2va</code> não recebe nenhum. Um pipeline que mantém ambas as partições (carregado sem <code>workflow=</code>) precisa ser informado para onde o adapter Ref2VA deve ir: <code>pipe.load_lora_weights(..., weight_name="ref2va/adapter.safetensors", load_into_transformer_ref=True)</code>. Os dois VAEs são liberados em float32 e decodificam em float32, assim como o pacote liberado faz; todo o resto é executado em bfloat16.</p> <blockquote class="tip"><p><code>pipe.doc</code> exibe o que o pipeline à sua frente recebe e retorna — cada entrada com seu valor padrão, os componentes que ele espera e as saídas que ele produz.</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><!---->Reutilizando um MiniMax-H3 carregado<!----></span></h3><!--]--><!----> <p>Os componentes base são os do MiniMax-H3, portanto, um pipeline do MiniMax-H3 que já está carregado contém tudo, exceto os dois agendadores e os adaptadores. Esta seção monta um pipeline Pika H3 Flex a partir desses componentes carregados e mantém ambos os pipelines prontos lado a lado: um <a href="/docs/diffusers/main/pt/api/modular_diffusers/pipeline_components#diffusers.ComponentsManager">ComponentsManager</a> mantém cada componente uma única vez e o descarrega para ambos, o pipeline Pika H3 Flex adiciona apenas seus dois agendadores, e os adaptadores decidem qual dos dois modelos os transformers compartilhados executam.</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> Copiado</div><!----></button><!----></div> <pre class="language-py "><!----><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> ComponentsManager, ModularPipeline | |
| dtype = {<span class="hljs-string">"vae"</span>: torch.float32, <span class="hljs-string">"audio_vae"</span>: torch.float32, <span class="hljs-string">"default"</span>: torch.bfloat16} | |
| manager = ComponentsManager() | |
| manager.enable_auto_cpu_offload(device=<span class="hljs-string">"cuda"</span>) | |
| <span class="hljs-comment"># The MiniMax-H3 pipeline already in use, with every workflow loaded. `collection` registers its components in the</span> | |
| <span class="hljs-comment"># manager under that name, so they can be fetched by it later.</span> | |
| minimax = ModularPipeline.from_pretrained(<span class="hljs-string">"MiniMaxAI/MiniMax-H3"</span>, components_manager=manager, collection=<span class="hljs-string">"minimax-h3"</span>) | |
| minimax.load_components(dtype=dtype) | |
| <span class="hljs-comment"># The Pika H3 Flex pipeline, in its own collection. Only its own components are loaded: the two schedulers.</span> | |
| pika = ModularPipeline.from_pretrained(<span class="hljs-string">"Pika-Labs/Pika-H3-Flex"</span>, components_manager=manager, collection=<span class="hljs-string">"pika-h3-flex"</span>) | |
| pika.load_components(names=[<span class="hljs-string">"scheduler"</span>, <span class="hljs-string">"audio_scheduler"</span>]) | |
| <span class="hljs-comment"># The rest comes from the MiniMax-H3 collection, and `update_components` puts it in the Pika H3 Flex pipeline.</span> | |
| shared = [<span class="hljs-string">"text_encoder"</span>, <span class="hljs-string">"tokenizer"</span>, <span class="hljs-string">"processor"</span>, <span class="hljs-string">"vae"</span>, <span class="hljs-string">"audio_vae"</span>, <span class="hljs-string">"transformer"</span>, <span class="hljs-string">"transformer_ref"</span>] | |
| pika.update_components(**{name: manager.get_one(name=name, collection=<span class="hljs-string">"minimax-h3"</span>) <span class="hljs-keyword">for</span> name <span class="hljs-keyword">in</span> shared}) | |
| <span class="hljs-comment"># The adapters go into the shared transformers.</span> | |
| pika.load_lora_weights(<span class="hljs-string">"Pika-Labs/Pika-H3-Flex"</span>, weight_name=<span class="hljs-string">"fl2va/adapter.safetensors"</span>) | |
| pika.load_lora_weights( | |
| <span class="hljs-string">"Pika-Labs/Pika-H3-Flex"</span>, weight_name=<span class="hljs-string">"ref2va/adapter.safetensors"</span>, load_into_transformer_ref=<span class="hljs-literal">True</span> | |
| )<!----></pre></div><!----> <p><code>print(manager)</code> exibe o resultado: cada componente compartilhado é listado uma vez e pertence a ambas as coleções, a coleção Pika H3 Flex adiciona seus dois agendadores e os dois transformers carregam um adaptador.</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> Copiado</div><!----></button><!----></div> <pre class="language-text "><!---->Models: | |
| Name_ID | Class | Size (GB) | Collection | |
| transformer_1397... | MiniMaxH3Transformer3DModel | 63.02 | minimax-h3 | |
| | | | pika-h3-flex | |
| transformer_ref_13... | MiniMaxH3Transformer3DModel | 63.02 | minimax-h3 | |
| | | | pika-h3-flex | |
| text_encoder_1397... | Qwen3VLForConditionalGeneration | 62.13 | minimax-h3 | |
| | | | pika-h3-flex | |
| vae_1397... | AutoencoderKLMiniMaxH3 | 9.70 | minimax-h3 | |
| | | | pika-h3-flex | |
| audio_vae_1397... | AutoencoderKLMiniMaxH3Audio | 0.56 | minimax-h3 | |
| | | | pika-h3-flex | |
| Other Components: | |
| ID | Class | Collection | |
| scheduler_1397... | MiniMaxH3Scheduler | minimax-h3 | |
| audio_scheduler_1397... | MiniMaxH3Scheduler | minimax-h3 | |
| scheduler_1397... | MiniMaxH3Scheduler | pika-h3-flex | |
| audio_scheduler_1397... | MiniMaxH3Scheduler | pika-h3-flex | |
| tokenizer_1397... | Qwen2Tokenizer | minimax-h3 | |
| | | pika-h3-flex | |
| processor_1397... | Qwen3VLProcessor | minimax-h3 | |
| | | pika-h3-flex | |
| Additional Component Info: | |
| transformer_1397...: | |
| Adapters: ['default_0'] | |
| transformer_ref_13...: | |
| Adapters: ['default_0']<!----></pre></div><!----> <p>Os adaptadores decidem qual modelo os transformers compartilhados representam. Para voltar ao MiniMax-H3, chame <code>pika.disable_lora()</code>, e é isso: a próxima requisição <code>minimax(...)</code> executa o modelo base. <code>pika.enable_lora()</code> reativa o Pika H3 Flex. Nada é recarregado no intervalo; o gerenciador move cada componente para dentro e para fora do acelerador conforme cada pipeline o alcança.</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><!---->O que difere do MiniMax-H3<!----></span></h2><!--]--><!----> <ul><li><strong>Seis etapas, sem <code>num_inference_steps</code>.</strong> Ambas as instâncias de <a href="/docs/diffusers/main/pt/api/schedulers/minimax_h3#diffusers.MiniMaxH3Scheduler">MiniMaxH3Scheduler</a> (<code>shift=12.0</code> para vídeo, <code>shift=3.0</code> para áudio) executam com <code>stochastic_sampling</code> sobre a configuração <code>denoising_step_list</code> do pipeline, a agenda publicada <code>[1000, 750, 500, 250, 100, 40, 0]</code>: cada etapa prevê a amostra limpa, e todas, exceto a última, a re-ruidam com ruído novo até o próximo sigma. O número de etapas é o contrato do adaptador e não é uma entrada.</li> <li><strong>Ruído novo a cada etapa.</strong> Uma solicitação extrai de seu <code>generator</code> em uma ordem fixa: uma extração por keyframe ou referência visual para o ruído de condicionamento, o ruído do vídeo, o ruído do áudio e, em seguida, as extrações de re-ruído do vídeo e do áudio de cada uma das cinco primeiras etapas. Passar <code>latents</code> ou <code>audio_latents</code> substitui as duas extrações iniciais e mantém as demais no lugar.</li> <li><strong>Os keyframes são recortados, não esticados.</strong> Um keyframe <code>fl2va</code> é recortado centralmente para a proporção do canvas na sua própria resolução e redimensionado para o canvas.</li> <li><strong>As referências seguem a resolução da camada do canvas.</strong> O Pika H3 Flex gera em uma tabela de buckets — uma camada de 480p e uma camada de 768p, cada uma com onze proporções de aspecto — e uma solicitação <code>ref2va</code> é condicionada pela camada do seu canvas: uma referência de imagem é codificada com um lado curto de 1024 pixels abaixo da camada de 768 e 2048 a partir dela para cima, e uma referência de vídeo é submetida à regra de canvas própria da camada. Cada referência de vídeo ou de áudio independente tem duração de 2 a 15 segundos, e as durações dos vídeos e as durações dos áudios independentes somam no máximo 15 segundos cada.</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><!---->Geração<!----></span></h2><!--]--><!----> <p>Os buckets liberados são os canvases nos quais o Pika H3 Flex foi validado. Passe um deles como <code>height</code> e <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> Copiado</div><!----></button><!----></div> <pre class="language-py "><!----><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> ComponentsManager, ModularPipeline | |
| <span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image | |
| <span class="hljs-keyword">from</span> diffusers.utils.export_utils <span class="hljs-keyword">import</span> encode_video | |
| <span class="hljs-comment"># 61.7GB of transformer and 62.1GB of conditioner do not sit on one accelerator, so the components are</span> | |
| <span class="hljs-comment"># registered in a manager that moves each one on and off as the blocks reach it.</span> | |
| manager = ComponentsManager() | |
| manager.enable_auto_cpu_offload(device=<span class="hljs-string">"cuda"</span>) <span class="hljs-comment"># or "mps", "xpu", "cpu"</span> | |
| <span class="hljs-comment"># Create one pipeline for all supported workflows, then load the `fl2va` workflow's components, which is</span> | |
| <span class="hljs-comment"># enough to run both the fl2va and t2va requests below.</span> | |
| pipe = ModularPipeline.from_pretrained(<span class="hljs-string">"Pika-Labs/Pika-H3-Flex"</span>, components_manager=manager) | |
| pipe.load_components( | |
| workflow=<span class="hljs-string">"fl2va"</span>, dtype={<span class="hljs-string">"vae"</span>: torch.float32, <span class="hljs-string">"audio_vae"</span>: torch.float32, <span class="hljs-string">"default"</span>: torch.bfloat16} | |
| ) | |
| pipe.load_lora_weights(<span class="hljs-string">"Pika-Labs/Pika-H3-Flex"</span>, weight_name=<span class="hljs-string">"fl2va/adapter.safetensors"</span>) | |
| prompt = ( | |
| <span class="hljs-string">"integrated_multimodal_description: A cinematic close shot of a red ceramic cup on a wooden table beside an "</span> | |
| <span class="hljs-string">"open window. A soft breeze moves a linen curtain. The camera slowly pushes toward the cup as warm morning "</span> | |
| <span class="hljs-string">"light crosses the table.\n"</span> | |
| <span class="hljs-string">"overall_soundscape: Gentle wind through the window and faint birdsong outside. No speech.\n"</span> | |
| <span class="hljs-string">"non_diegetic_music: None.\n"</span> | |
| ) | |
| outputs = [<span class="hljs-string">"videos"</span>, <span class="hljs-string">"audio"</span>, <span class="hljs-string">"sampling_rate"</span>] | |
| <span class="hljs-comment"># Text to video + audio on the 480p 16:9 bucket, 5 seconds.</span> | |
| results = pipe( | |
| prompt=prompt, | |
| height=<span class="hljs-number">480</span>, | |
| width=<span class="hljs-number">832</span>, | |
| num_frames=<span class="hljs-number">124</span>, | |
| generator=torch.Generator(<span class="hljs-string">"cuda"</span>).manual_seed(<span class="hljs-number">42</span>), | |
| output=outputs | |
| ) | |
| <span class="hljs-comment"># First frame (and optionally `last_image`) to video + audio. The keyframe is center-cropped onto the canvas and</span> | |
| <span class="hljs-comment"># held as the first frame, so the prompt describes the keyframe and what happens from it.</span> | |
| image = load_image( | |
| <span class="hljs-string">"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/astronaut.jpg"</span> | |
| ) | |
| i2va_prompt = ( | |
| <span class="hljs-string">"For the target video, at 0.00 seconds into the target video, <Picture 1> (from [Shot 1]) is fully referenced.\n\n"</span> | |
| <span class="hljs-string">"integrated_multimodal_description: [Shot 1] Begin with the supplied image of a small toy astronaut figurine "</span> | |
| <span class="hljs-string">"standing on a grey rocky moon surface, holding a white egg-shaped object. Preserve the figurine, its orange "</span> | |
| <span class="hljs-string">"visor and the rocks. The astronaut slowly turns its helmet toward the camera and lifts the egg a little; fine "</span> | |
| <span class="hljs-string">"dust drifts up around its boots. The camera slowly pushes in in one continuous shot. By the end the astronaut "</span> | |
| <span class="hljs-string">"stands still, egg held up.\n\n"</span> | |
| <span class="hljs-string">"overall_soundscape: Soft low wind and faint crunch of dust under the boots. No speech.\n\n"</span> | |
| <span class="hljs-string">"non_diegetic_music: N/A\n"</span> | |
| ) | |
| results = pipe( | |
| prompt=i2va_prompt, | |
| image=image, | |
| height=<span class="hljs-number">480</span>, | |
| width=<span class="hljs-number">832</span>, | |
| num_frames=<span class="hljs-number">124</span>, | |
| generator=torch.Generator(<span class="hljs-string">"cuda"</span>).manual_seed(<span class="hljs-number">42</span>), | |
| output=outputs, | |
| ) | |
| encode_video( | |
| results[<span class="hljs-string">"videos"</span>][<span class="hljs-number">0</span>], | |
| fps=<span class="hljs-number">24</span>, | |
| output_path=<span class="hljs-string">"pika_h3_flex_fl2va.mp4"</span>, | |
| audio=results[<span class="hljs-string">"audio"</span>][<span class="hljs-number">0</span>], | |
| audio_sample_rate=results[<span class="hljs-string">"sampling_rate"</span>], | |
| )<!----></pre></div><!----> <p>O workflow <code>ref2va</code> aceita uma lista ordenada de referências — até 9 imagens, 3 vídeos e 3 clipes de áudio, 12 no total — da mesma forma que o MiniMax-H3, com uma classe de referência por modalidade. É também a solicitação que exige mais memória: as referências adicionam suas próprias linhas à sequência, e em 768p o transformer sozinho ocupa uma GPU de 80 GB. O exemplo abaixo, portanto, faz o streaming dos blocos do transformer da memória do CPU um por vez, enquanto o manager move os outros componentes para dentro e para fora do dispositivo como antes. Ele executa uma solicitação de referência em 768p em uma GPU de 80 GB; sem o streaming, mantenha-se em 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> Copiado</div><!----></button><!----></div> <pre class="language-py "><!----><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> ComponentsManager, ModularPipeline | |
| <span class="hljs-keyword">from</span> diffusers.modular_pipelines.pika_h3_flex <span class="hljs-keyword">import</span> ( | |
| PikaH3FlexAudioReference, | |
| PikaH3FlexImageReference, | |
| PikaH3FlexVideoReference, | |
| ) | |
| manager = ComponentsManager() | |
| manager.enable_auto_cpu_offload(device=<span class="hljs-string">"cuda"</span>) <span class="hljs-comment"># or "mps", "xpu", "cpu"</span> | |
| pipe = ModularPipeline.from_pretrained( | |
| <span class="hljs-string">"Pika-Labs/Pika-H3-Flex"</span>, workflow=<span class="hljs-string">"ref2va"</span>, components_manager=manager | |
| ) | |
| pipe.load_components(dtype={<span class="hljs-string">"vae"</span>: torch.float32, <span class="hljs-string">"audio_vae"</span>: torch.float32, <span class="hljs-string">"default"</span>: torch.bfloat16}) | |
| pipe.load_lora_weights(<span class="hljs-string">"Pika-Labs/Pika-H3-Flex"</span>, weight_name=<span class="hljs-string">"ref2va/adapter.safetensors"</span>) | |
| <span class="hljs-comment"># Keep the transformer in CPU memory and bring in one block at a time while it runs.</span> | |
| pipe.transformer_ref.enable_group_offload( | |
| onload_device=torch.device(<span class="hljs-string">"cuda"</span>), | |
| offload_device=torch.device(<span class="hljs-string">"cpu"</span>), | |
| offload_type=<span class="hljs-string">"block_level"</span>, | |
| num_blocks_per_group=<span class="hljs-number">1</span>, | |
| use_stream=<span class="hljs-literal">True</span>, | |
| ) | |
| results = pipe( | |
| prompt=<span class="hljs-string">"subject_definitions: <Subject 1> is the woman in <Picture 1>. summary: [reference generation] <Subject 1> waves at the camera."</span>, | |
| references=[ | |
| PikaH3FlexImageReference.from_file(<span class="hljs-string">"subject.png"</span>), | |
| PikaH3FlexVideoReference.from_file(<span class="hljs-string">"motion_ref.mp4"</span>), <span class="hljs-comment"># frames, their `fps` and the soundtrack</span> | |
| PikaH3FlexAudioReference.from_file(<span class="hljs-string">"voice.wav"</span>), <span class="hljs-comment"># waveform and its `sample_rate`</span> | |
| ], | |
| height=<span class="hljs-number">768</span>, | |
| width=<span class="hljs-number">1344</span>, | |
| num_frames=<span class="hljs-number">124</span>, | |
| generator=torch.Generator(<span class="hljs-string">"cuda"</span>).manual_seed(<span class="hljs-number">42</span>), | |
| output=[<span class="hljs-string">"videos"</span>, <span class="hljs-string">"audio"</span>, <span class="hljs-string">"sampling_rate"</span>], | |
| )<!----></pre></div><!----> <!--[1--><h2 class="relative group"><a id="diffusers.PikaH3FlexModularPipeline" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#diffusers.PikaH3FlexModularPipeline"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->PikaH3FlexModularPipeline<!----></span></h2><!--]--><!----> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><div><span class="group flex space-x-1.5 items-center text-gray-800 bg-gradient-to-r rounded-tr-lg -mt-4 -ml-4 pt-3 px-2.5" id="diffusers.PikaH3FlexModularPipeline"><!----><h3 class="!m-0"><span class="flex-1 break-all md:text-lg bg-gradient-to-r px-2.5 py-1.5 rounded-xl from-indigo-50/70 to-white dark:from-gray-900 dark:to-gray-950 dark:text-indigo-300 text-indigo-700"><svg class="mr-1.5 text-indigo-500 inline-block -mt-0.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width=".8em" height=".8em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path class="uim-quaternary" d="M20.23 7.24L12 12L3.77 7.24a1.98 1.98 0 0 1 .7-.71L11 2.76c.62-.35 1.38-.35 2 0l6.53 3.77c.29.173.531.418.7.71z" opacity=".25" fill="currentColor"></path><path class="uim-tertiary" d="M12 12v9.5a2.09 2.09 0 0 1-.91-.21L4.5 17.48a2.003 2.003 0 0 1-1-1.73v-7.5a2.06 2.06 0 0 1 .27-1.01L12 12z" opacity=".5" fill="currentColor"></path><path class="uim-primary" d="M20.5 8.25v7.5a2.003 2.003 0 0 1-1 1.73l-6.62 3.82c-.275.13-.576.198-.88.2V12l8.23-4.76c.175.308.268.656.27 1.01z" fill="currentColor"></path></svg><span class="font-light">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><</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>Uma ModularPipeline para geração conjunta de vídeo + áudio com Pika H3 Flex, o MiniMax-H3 pós-treinado de seis etapas: os fluxos de trabalho <code>t2va</code> (apenas texto) e <code>fl2va</code> (primeiro e/ou último keyframe) contra o checkpoint da partição <code>transformer/</code> com o adaptador <code>fl2va</code>, e o fluxo de trabalho <code>ref2va</code> (referência omni) contra <code>transformer_ref/</code> com o adaptador <code>ref2va</code>.</p> <p>Os componentes base são os do MiniMax-H3, e a liberação Pika H3 Flex é um par de adaptadores LoRA de rank-128 sobre as duas partições do transformer, de modo que um pipeline é montado em duas etapas: os componentes são carregados por meio de um <code>modular_model_index.json</code> que nomeia os componentes base e os dois schedulers, e o adaptador do workflow selecionado é carregado com <a href="/docs/diffusers/main/pt/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> Copiado</div><!----></button><!----></div> <pre class="language-py "><!----><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> ModularPipeline | |
| pipe = ModularPipeline.from_pretrained(<span class="hljs-string">"Pika-Labs/Pika-H3-Flex"</span>, workflow=<span class="hljs-string">"fl2va"</span>) | |
| pipe.load_components(dtype={<span class="hljs-string">"vae"</span>: torch.float32, <span class="hljs-string">"audio_vae"</span>: torch.float32, <span class="hljs-string">"default"</span>: torch.bfloat16}) | |
| pipe.load_lora_weights(<span class="hljs-string">"Pika-Labs/Pika-H3-Flex"</span>, weight_name=<span class="hljs-string">"fl2va/adapter.safetensors"</span>)<!----></pre></div><!----></div><!----> <p>Assim como o MiniMax-H3, o Pika H3 Flex remove o ruído de <strong>uma sequência empacotada</strong> que contém, de uma só vez, a condição de texto, os latentes de condição de quadro-chave ou de referência, os latentes de áudio e os latentes de vídeo. É por isso que os blocos passam um layout de linha em vez de tensores por modalidade, e por isso o pipeline carrega dois agendadores (<code>shift = 12.0</code> para vídeo, <code>shift = 3.0</code> para áudio) que são executados dentro de uma única chamada do transformer. Diferentemente do MiniMax-H3, os dois agendadores são instâncias de <a href="/docs/diffusers/main/pt/api/schedulers/minimax_h3#diffusers.MiniMaxH3Scheduler">MiniMaxH3Scheduler</a> com <code>stochastic_sampling</code> sobre a lista fixa de seis etapas <code>denoising_step_list</code>: não há <code>num_inference_steps</code>, e cada etapa extrai novo ruído do gerador da solicitação.</p> <p>Os adaptadores são destilados por orientação, assim como sua base: não há um guia, nem <code>negative_prompt</code> e nem <code>guidance_scale</code>, e cada etapa executa exatamente uma passagem de frente.</p> <p>Este módulo carrega os fatos do modelo em que cada bloco se baseia — a geometria derivada da configuração como propriedades, a tela, a aritmética de nível e contagem de quadros como funções — e os contratos de condicionamento, codificação e ruído estão nos próprios blocos.</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><</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>Blocos de pipeline Auto Modular para geração conjunta de vídeo + áudio com Pika H3 Flex: os fluxos de trabalho <code>t2va</code> (apenas texto), <code>fl2va</code> (primeiro e/ou último keyframe) e <code>ref2va</code> (referência omni), selecionados pelas entradas de <code>references</code> e keyframe. Os fluxos de trabalho <code>t2va</code> e <code>fl2va</code> executam a partição <code>transformer</code> com o adaptador <code>fl2va</code> e o <code>ref2va</code> executa a partição <code>transformer_ref</code> com o adaptador <code>ref2va</code>, portanto carregue o adaptador do fluxo de trabalho que a solicitação utiliza. Sem um <code>workflow=</code>, o carregamento dos componentes traz <strong>ambas</strong> as partições de transformer de 61,7GB — passe um para carregar apenas o que a tarefa precisa.</p> <p>Fluxos de trabalho suportados:</p> <ul><li><code>t2va</code>: requer <code>prompt</code></li> <li><code>fl2va</code>: requer <code>prompt</code>, <code>image</code> ou <code>prompt</code>, <code>last_image</code></li> <li><code>ref2va</code>: requer <code>prompt</code>, <code>references</code></li></ul> <p>Componentes: | |
| 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>Configs: | |
| canvas_short_edge (padrão: 768) canvas_max_pixels (padrão: 1032192) denoising_step_list (padrão: [1000, | |
| 750, 500, 250, 100, 40, 0])</p> <p>Entradas: | |
| references (<code>list</code>, <em>opcional</em>): | |
| As referências para condicionar, <strong>na ordem em que o modelo deve lê-las</strong>: a ordem as rotula na | |
| apresentação do prompt e as posiciona no relógio rotativo compartilhado, de modo que uma ordem diferente é uma | |
| solicitação diferente. Uma dataclass por modalidade, todas contendo mídia em memória — um <code>PikaH3FlexImageReference</code> (no | |
| máximo 9), um <code>PikaH3FlexVideoReference</code> em seu próprio <code>fps</code> (no máximo 3, cuja trilha sonora <code>audio</code> também é | |
| condicionada) ou um <code>PikaH3FlexAudioReference</code> em sua própria <code>sample_rate</code> (no máximo 3) — para no | |
| máximo 12 referências no total, e referências de áudio não podem ser as únicas. Cada referência de vídeo ou de | |
| áudio independente tem de 2 a 15 segundos, e as durações de vídeo e as durações de áudio independente somam | |
| no máximo 15 segundos cada. Esses blocos nunca abrem um arquivo de mídia: decodifique com o classmethod <code>from_file</code> de cada classe, que traz as taxas junto. | |
| height (<code>int</code>, <em>opcional</em>): | |
| Altura do vídeo gerado em pixels, um múltiplo de 32. | |
| width (<code>int</code>, <em>opcional</em>): | |
| Largura do vídeo gerado em pixels, um múltiplo de 32. | |
| num_frames (<code>int</code>, <em>opcional</em>): | |
| Número de quadros a gerar, na taxa fixa de 24 fps: de 120 a 360, ou seja, de 5 a 15 segundos, arredondado para | |
| o próximo <code>17 * n + 5</code> que o VAE de vídeo pode decodificar. Para gerar um vídeo tão longo quanto uma trilha sonora de referência, passe <code>round(samples / sample_rate * 24)</code>. | |
| image (<code>Image</code>, <em>opcional</em>): | |
| Keyframe a partir do qual o vídeo começa. Ele é recortado centralmente para a proporção de aspecto do canvas e redimensionado para ele; o | |
| canvas, por padrão, é derivado de sua própria proporção de aspecto. | |
| last_image (<code>Image</code>, <em>opcional</em>): | |
| Keyframe no qual o vídeo termina. Pode ser passado sozinho para gerar <em>até</em> um quadro. Ele é recortado centralmente para | |
| a proporção de aspecto do canvas e redimensionado para ele, como <code>image</code>. | |
| prompt (<code>str</code>): | |
| O prompt para guiar a geração, uma única string. | |
| normalized_references (<code>list</code>, <em>opcional</em>): | |
| As referências normalizadas pela etapa de configuração, em ordem empacotada. | |
| keyframes (<code>list</code>, <em>opcional</em>): | |
| Os keyframes colocados no canvas de destino, em ordem empacotada. | |
| condition_latents (<code>list</code>, <em>opcional</em>): | |
| Os latentes de condicionamento de vídeo codificados, um por referência de imagem e vídeo em ordem empacotada. Sua forma é | |
| onde a geometria de cada bloco de referência vem. | |
| audio_condition_latents (<code>list</code>, <em>opcional</em>): | |
| As linhas de condicionamento de áudio codificadas, uma por referência com áudio em ordem empacotada. | |
| generator (<code>Generator</code>, <em>opcional</em>): | |
| O gerador da solicitação. O ruído de condicionamento é extraído dele primeiro, uma extração por condição, | |
| antes do ruído das linhas geradas. | |
| latents (<code>Tensor</code>): | |
| Ruído de vídeo pré-gerado de forma <code>(1, 24, num_latent_frames, latent_height, latent_width)</code>, usado | |
| no lugar da extração. | |
| audio_latents (<code>Tensor</code>): | |
| Ruído de áudio pré-gerado de forma <code>(2, 32, num_audio_latents)</code>. | |
| *<em>denoiser_input_fields (<code>None</code>,</em>opcional<em>): | |
| A descrição estrutural da sequência empacotada que o transformer lê por nome: <code>token_tags</code>, <code>position_ids</code> e os três tensores de índice de linha. | |
| attention_kwargs (<code>dict</code>,</em>opcional<em>): | |
| Kwargs adicionais para processadores de atenção. | |
| keyframe_anchors (<code>tuple</code>,</em>opcional<em>, padrão ()): | |
| A qual extremidade do vídeo cada keyframe está ancorado, em ordem empacotada. | |
| output_type (<code>str</code>,</em>opcional*, padrão pil): | |
| Formato de saída: ‘pil’, ‘np’ ou ‘pt’.</p> <p>Saídas: | |
| videos (<code>list</code>): | |
| O vídeo gerado. | |
| audio (<code>Tensor</code>): | |
| A trilha sonora gerada, de forma <code>(1, 2, num_samples)</code>. | |
| sampling_rate (<code>int</code>): | |
| Taxa de amostragem da trilha sonora gerada em 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><</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">Parâmetros <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>) — | |
| A imagem de referência: uma imagem, um array <code>(height, width, 3)</code> ou um tensor <code>(3, height, width)</code>, <code>uint8</code> ou | |
| ponto flutuante em <code>[0, 1]</code>. Ela nunca vincula a geometria gerada — é codificada em uma borda curta própria, 2048 para o checkpoint liberado, independentemente do canvas que a solicitação gera.<!----></span></span></li><!--]--></ul><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--></div></div><!----> <p>Uma referência de sujeito, estilo ou cena: no máximo 9 por solicitação.</p> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><div><span class="group flex space-x-1.5 items-center text-gray-800 bg-gradient-to-r rounded-tr-lg -mt-4 -ml-4 pt-3 px-2.5" id="diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexImageReference.from_file"><!----><h4 class="!m-0"><span class="flex-1 rounded-xl py-0.5 break-all bg-gradient-to-r from-blue-50/60 to-white dark:from-gray-900 dark:to-gray-950 text-blue-700 dark:text-blue-300 font-medium px-2"><svg width="1em" height="1em" viewBox="0 0 32 33" class="mr-1 inline-block -mt-0.5" xmlns="http://www.w3.org/2000/svg"><path d="M5.80566 18.3545C4.90766 17.4565 4.90766 16.0005 5.80566 15.1025L14.3768 6.53142C15.2748 5.63342 16.7307 5.63342 17.6287 6.53142L26.1999 15.1025C27.0979 16.0005 27.0979 17.4565 26.1999 18.3545L17.6287 26.9256C16.7307 27.8236 15.2748 27.8236 14.3768 26.9256L5.80566 18.3545Z" fill="currentColor" fill-opacity="0.25"/><path fill-rule="evenodd" clip-rule="evenodd" d="M16.4801 13.9619C16.4801 12.9761 16.7467 12.5436 16.9443 12.3296C17.1764 12.078 17.5731 11.8517 18.2275 11.707C18.8821 11.5623 19.638 11.5342 20.4038 11.5582C20.7804 11.57 21.1341 11.5932 21.4719 11.6156L21.5263 11.6193C21.8195 11.6389 22.1626 11.6618 22.4429 11.6618V7.40825C22.3209 7.40825 22.1219 7.39596 21.7544 7.37149C21.4202 7.34925 20.9976 7.32115 20.5371 7.30672C19.6286 7.27824 18.4672 7.29779 17.3093 7.55377C16.1512 7.8098 14.8404 8.33724 13.8181 9.4452C12.7612 10.5907 12.2266 12.1236 12.2266 13.9619V15.0127H10.6836V19.2662H12.2266V26.6332H16.4801V19.2662H20.3394V15.0127H16.4801V13.9619Z" fill="currentColor"/></svg>from_file</span></h4><!----> <a id="diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexImageReference.from_file" class="header-link invisible with-hover:group-hover:visible pr-2" href="#diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexImageReference.from_file"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></a> <!--[0--><a class="!ml-auto !text-gray-400 !no-underline text-sm flex items-center" href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/modular_pipelines/pika_h3_flex/references.py#L99" target="_blank"><span><</span> <span class="hidden md:block mx-0.5 hover:!underline">source</span> <span>></span></a><!--]--></span> <!--[0--><p class="font-mono text-xs md:text-sm !leading-relaxed !my-6"><span>(</span> <!--[--><span class="comma cursor-pointer"><span class="rounded hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black">media<span class="opacity-60"></span></span></span><!--]--> <span>)</span> <!--[-1--><!--]--></p><!--]--> <div class="!mb-10 relative docstring-details "><!--[-1--><!--]--> <!--[0--><p class="flex items-center font-semibold !mt-2 !mb-2 text-gray-800">Parâmetros <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>) — Caminho ou URL da imagem.<!----></span></span></li><!--]--></ul><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--></div></div><!----> <p>Carregue um arquivo de imagem em um <code>PikaH3FlexImageReference</code>, por meio de <a href="/docs/diffusers/main/pt/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><</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">Parâmetros <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>) — | |
| Os frames de referência: uma lista de imagens, um array <code>(num_frames, height, width, 3)</code> ou um tensor <code>(num_frames, 3, height, width)</code>, <code>uint8</code> ou ponto flutuante em <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>opcional</em>, padrão 24.0) — | |
| A taxa de quadros que <code>frames</code> carrega, que é o que posiciona os blocos de visão da referência na grade de 2 | |
| fps do conditioner. O próprio relógio do MiniMax-H3 é de 24 fps, portanto qualquer outra taxa é reamostrada para ele | |
| por meio de exclusão e duplicação de quadros inteiros — o que torna este o campo a ser definido corretamente quando os | |
| quadros vieram de um arquivo.<!----></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 forma <code>(channels, num_samples)</code>, <em>opcional</em>) — | |
| A trilha sonora deste vídeo, mono ou estéreo, condicionada como a própria do referencial, em vez de como um referencial próprio. Se omitida, o referencial é condicionado apenas pelo movimento.<!----></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>opcional</em>) — | |
| A taxa na qual o <code>audio</code> carrega suas amostras. Se omitida, será a taxa própria do VAE de áudio, o que mantém as amostras inalteradas; qualquer outra taxa resultará em uma reamostragem para ela.<!----></span></span></li><!--]--></ul><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--></div></div><!----> <p>Uma referência de movimento e câmera: no máximo 3 por solicitação, condicionada em conjunto com sua própria trilha sonora.</p> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><div><span class="group flex space-x-1.5 items-center text-gray-800 bg-gradient-to-r rounded-tr-lg -mt-4 -ml-4 pt-3 px-2.5" id="diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexVideoReference.from_file"><!----><h4 class="!m-0"><span class="flex-1 rounded-xl py-0.5 break-all bg-gradient-to-r from-blue-50/60 to-white dark:from-gray-900 dark:to-gray-950 text-blue-700 dark:text-blue-300 font-medium px-2"><svg width="1em" height="1em" viewBox="0 0 32 33" class="mr-1 inline-block -mt-0.5" xmlns="http://www.w3.org/2000/svg"><path d="M5.80566 18.3545C4.90766 17.4565 4.90766 16.0005 5.80566 15.1025L14.3768 6.53142C15.2748 5.63342 16.7307 5.63342 17.6287 6.53142L26.1999 15.1025C27.0979 16.0005 27.0979 17.4565 26.1999 18.3545L17.6287 26.9256C16.7307 27.8236 15.2748 27.8236 14.3768 26.9256L5.80566 18.3545Z" fill="currentColor" fill-opacity="0.25"/><path fill-rule="evenodd" clip-rule="evenodd" d="M16.4801 13.9619C16.4801 12.9761 16.7467 12.5436 16.9443 12.3296C17.1764 12.078 17.5731 11.8517 18.2275 11.707C18.8821 11.5623 19.638 11.5342 20.4038 11.5582C20.7804 11.57 21.1341 11.5932 21.4719 11.6156L21.5263 11.6193C21.8195 11.6389 22.1626 11.6618 22.4429 11.6618V7.40825C22.3209 7.40825 22.1219 7.39596 21.7544 7.37149C21.4202 7.34925 20.9976 7.32115 20.5371 7.30672C19.6286 7.27824 18.4672 7.29779 17.3093 7.55377C16.1512 7.8098 14.8404 8.33724 13.8181 9.4452C12.7612 10.5907 12.2266 12.1236 12.2266 13.9619V15.0127H10.6836V19.2662H12.2266V26.6332H16.4801V19.2662H20.3394V15.0127H16.4801V13.9619Z" fill="currentColor"/></svg>from_file</span></h4><!----> <a id="diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexVideoReference.from_file" class="header-link invisible with-hover:group-hover:visible pr-2" href="#diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexVideoReference.from_file"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></a> <!--[0--><a class="!ml-auto !text-gray-400 !no-underline text-sm flex items-center" href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/modular_pipelines/pika_h3_flex/references.py#L147" target="_blank"><span><</span> <span class="hidden md:block mx-0.5 hover:!underline">source</span> <span>></span></a><!--]--></span> <!--[0--><p class="font-mono text-xs md:text-sm !leading-relaxed !my-6"><span>(</span> <!--[--><span class="comma cursor-pointer"><span class="rounded hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black">media<span class="opacity-60"></span></span></span><!--]--> <span>)</span> <!--[0--><span class="font-bold">→</span> <span class="rounded hover:bg-gray-400 cursor-pointer"><!----><span><code>PikaH3FlexVideoReference</code></span><!----></span><!--]--></p><!--]--> <div class="!mb-10 relative docstring-details "><!--[-1--><!--]--> <!--[0--><p class="flex items-center font-semibold !mt-2 !mb-2 text-gray-800">Parâmetros <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>) — Caminho ou URL do vídeo.<!----></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"><!---->Retorna<!----></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>os quadros <code>(num_frames, height, width, 3)</code> <code>uint8</code> na taxa de quadros informada pelo | |
| contêiner, incluindo sua trilha sonora e a própria taxa de amostragem dessa trilha quando há um fluxo de áudio.</p> | |
| <!----></div><!--]--> <!--[-1--><!--]--></div></div><!----> <p>Decodifique um arquivo de vídeo em um <code>PikaH3FlexVideoReference</code>, na resolução, na taxa de quadros e na trilha sonora que ele carrega.</p> <p>As taxas são definidas na referência, que é o ponto de decodificar dessa forma em vez de usar <a href="/docs/diffusers/main/pt/api/utilities#diffusers.utils.load_video">load_video()</a>: o MiniMax-H3 reamostra uma referência para seus próprios 24 fps, portanto, uma taxa de quadros perdida na entrada é uma solicitação condicionada na velocidade errada, sem nada para alertar sobre isso. Um contêiner cujos metadados estão incorretos é corrigido sobrescrevendo <code>fps</code> ou <code>sample_rate</code> na referência retornada.</p> <p>Requer <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><</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">Parâmetros <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 forma <code>(channels, num_samples)</code>) — | |
| A forma de onda de referência, mono ou estéreo.<!----></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>opcional</em>) — | |
| A taxa na qual o <code>audio</code> carrega suas amostras. Se omitida, será a taxa própria do VAE de áudio, o que mantém as amostras inalteradas; qualquer outra taxa resultará em uma reamostragem para ela.<!----></span></span></li><!--]--></ul><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--></div></div><!----> <p>Uma referência de voz ou música: no máximo 3 por solicitação e nunca isolada — uma referência de áudio deve ser pareada com pelo menos uma referência de imagem ou vídeo. Ela nunca chega ao conditioner e é codificada apenas pelo VAE de áudio.</p> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><div><span class="group flex space-x-1.5 items-center text-gray-800 bg-gradient-to-r rounded-tr-lg -mt-4 -ml-4 pt-3 px-2.5" id="diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexAudioReference.from_file"><!----><h4 class="!m-0"><span class="flex-1 rounded-xl py-0.5 break-all bg-gradient-to-r from-blue-50/60 to-white dark:from-gray-900 dark:to-gray-950 text-blue-700 dark:text-blue-300 font-medium px-2"><svg width="1em" height="1em" viewBox="0 0 32 33" class="mr-1 inline-block -mt-0.5" xmlns="http://www.w3.org/2000/svg"><path d="M5.80566 18.3545C4.90766 17.4565 4.90766 16.0005 5.80566 15.1025L14.3768 6.53142C15.2748 5.63342 16.7307 5.63342 17.6287 6.53142L26.1999 15.1025C27.0979 16.0005 27.0979 17.4565 26.1999 18.3545L17.6287 26.9256C16.7307 27.8236 15.2748 27.8236 14.3768 26.9256L5.80566 18.3545Z" fill="currentColor" fill-opacity="0.25"/><path fill-rule="evenodd" clip-rule="evenodd" d="M16.4801 13.9619C16.4801 12.9761 16.7467 12.5436 16.9443 12.3296C17.1764 12.078 17.5731 11.8517 18.2275 11.707C18.8821 11.5623 19.638 11.5342 20.4038 11.5582C20.7804 11.57 21.1341 11.5932 21.4719 11.6156L21.5263 11.6193C21.8195 11.6389 22.1626 11.6618 22.4429 11.6618V7.40825C22.3209 7.40825 22.1219 7.39596 21.7544 7.37149C21.4202 7.34925 20.9976 7.32115 20.5371 7.30672C19.6286 7.27824 18.4672 7.29779 17.3093 7.55377C16.1512 7.8098 14.8404 8.33724 13.8181 9.4452C12.7612 10.5907 12.2266 12.1236 12.2266 13.9619V15.0127H10.6836V19.2662H12.2266V26.6332H16.4801V19.2662H20.3394V15.0127H16.4801V13.9619Z" fill="currentColor"/></svg>from_file</span></h4><!----> <a id="diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexAudioReference.from_file" class="header-link invisible with-hover:group-hover:visible pr-2" href="#diffusers.modular_pipelines.pika_h3_flex.PikaH3FlexAudioReference.from_file"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></a> <!--[0--><a class="!ml-auto !text-gray-400 !no-underline text-sm flex items-center" href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/modular_pipelines/pika_h3_flex/references.py#L193" target="_blank"><span><</span> <span class="hidden md:block mx-0.5 hover:!underline">source</span> <span>></span></a><!--]--></span> <!--[0--><p class="font-mono text-xs md:text-sm !leading-relaxed !my-6"><span>(</span> <!--[--><span class="comma cursor-pointer"><span class="rounded hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black">media<span class="opacity-60"></span></span></span><!--]--> <span>)</span> <!--[0--><span class="font-bold">→</span> <span class="rounded hover:bg-gray-400 cursor-pointer"><!----><span><code>PikaH3FlexAudioReference</code></span><!----></span><!--]--></p><!--]--> <div class="!mb-10 relative docstring-details "><!--[-1--><!--]--> <!--[0--><p class="flex items-center font-semibold !mt-2 !mb-2 text-gray-800">Parâmetros <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>) — Caminho ou URL do áudio, ou de um vídeo cuja trilha sonora será extraída.<!----></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"><!---->Retorna<!----></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>o <code>(channels, num_samples)</code> waveform float32 na taxa de amostragem que o | |
| container relata.</p> | |
| <!----></div><!--]--> <!--[-1--><!--]--></div></div><!----> <p>Decodifique um arquivo de áudio em um <code>PikaH3FlexAudioReference</code>, na taxa de amostragem que ele carrega.</p> <p>Requer <a href="https://github.com/PyAV-Org/PyAV" rel="nofollow">PyAV</a>.</p></div></div> <a class="!text-gray-400 !no-underline text-sm flex items-center not-prose mt-4" href="https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/pika_h3_flex.md" target="_blank"><svg class="mr-1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M31,16l-7,7l-1.41-1.41L28.17,16l-5.58-5.59L24,9l7,7z"></path><path d="M1,16l7-7l1.41,1.41L3.83,16l5.58,5.59L8,23l-7-7z"></path><path d="M12.419,25.484L17.639,6.552l1.932,0.518L14.351,26.002z"></path></svg><!----> <span><span class="underline">Update</span> on GitHub</span></a><!----> <p></p><!--]--><!----><!--]--><!--]--><!--]--> <!--[-1--><!--]--><!--]--> | |
| <script> | |
| { | |
| __sveltekit_g37pnb = { | |
| base: "/docs/diffusers/main/en", | |
| assets: "/docs/diffusers/main/en" | |
| }; | |
| const element = document.currentScript.parentElement; | |
| Promise.all([ | |
| import("/docs/diffusers/main/en/_app/immutable/entry/start.D3LnKZ4R.js"), | |
| import("/docs/diffusers/main/en/_app/immutable/entry/app.C0rBoMxR.js") | |
| ]).then(([kit, app]) => { | |
| kit.start(app, element, { | |
| node_ids: [0, 225], | |
| data: [null,null], | |
| form: null, | |
| error: null | |
| }); | |
| }); | |
| } | |
| </script> | |
Xet Storage Details
- Size:
- 108 kB
- Xet hash:
- 12dc9a2f01e71d3725446a6131a56b5c2436b7378f15de75da92e1cd5d07f81e
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.