Buckets:
| <meta charset="utf-8" /><meta name="hf:doc:metadata" content="{"title":"Interface en ligne de commande","local":"command-line-interface","sections":[{"title":"Commandes disponibles","local":"available-commands","sections":[],"depth":2},{"title":"env","local":"env","sections":[],"depth":2},{"title":"schema","local":"schema","sections":[],"depth":2},{"title":"run","local":"run","sections":[{"title":"Passage des arguments du pipeline","local":"passing-pipeline-arguments","sections":[],"depth":3},{"title":"Chargement","local":"loading","sections":[],"depth":3},{"title":"Optimisations","local":"optimizations","sections":[],"depth":3},{"title":"Pipelines modulaires","local":"modular-pipelines","sections":[],"depth":3},{"title":"Sorties","local":"outputs","sections":[],"depth":3},{"title":"Exécution à distance ( --remote )","local":"remote-execution----remote-","sections":[],"depth":3}],"depth":2},{"title":"custom_blocks","local":"customblocks","sections":[],"depth":2},{"title":"fp16_safetensors","local":"fp16safetensors","sections":[],"depth":2},{"title":"compétences","local":"skills","sections":[],"depth":2}],"depth":1}"/> | |
| <link href="/docs/diffusers/main/en/_app/immutable/entry/start.0S0_iEoG.js" rel="modulepreload"> | |
| <link href="/docs/diffusers/main/en/_app/immutable/chunks/I9eooN77.js" rel="modulepreload"> | |
| <link href="/docs/diffusers/main/en/_app/immutable/chunks/Bupkjr9f.js" rel="modulepreload"> | |
| <link href="/docs/diffusers/main/en/_app/immutable/entry/app.CPdOxCbw.js" rel="modulepreload"> | |
| <link href="/docs/diffusers/main/en/_app/immutable/chunks/CyvZ3FS5.js" rel="modulepreload"> | |
| <link href="/docs/diffusers/main/en/_app/immutable/chunks/l0QnnOED.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.DteTvmQZ.js" rel="modulepreload"> | |
| <link href="/docs/diffusers/main/en/_app/immutable/chunks/CoSrdQax.js" rel="modulepreload"> | |
| <link href="/docs/diffusers/main/en/_app/immutable/nodes/388.Cww0re_K.js" rel="modulepreload"> | |
| <link href="/docs/diffusers/main/en/_app/immutable/chunks/DSPDl1gz.js" rel="modulepreload"> | |
| <!--1wkohmy--><meta name="hf:doc:metadata" content="{"title":"Command line interface","local":"command-line-interface","sections":[{"title":"Available commands","local":"available-commands","sections":[],"depth":2},{"title":"env","local":"env","sections":[],"depth":2},{"title":"schema","local":"schema","sections":[],"depth":2},{"title":"run","local":"run","sections":[{"title":"Passing pipeline arguments","local":"passing-pipeline-arguments","sections":[],"depth":3},{"title":"Loading","local":"loading","sections":[],"depth":3},{"title":"Optimizations","local":"optimizations","sections":[],"depth":3},{"title":"Modular pipelines","local":"modular-pipelines","sections":[],"depth":3},{"title":"Outputs","local":"outputs","sections":[],"depth":3},{"title":"Remote execution ( --remote )","local":"remote-execution----remote-","sections":[],"depth":3}],"depth":2},{"title":"custom_blocks","local":"customblocks","sections":[],"depth":2},{"title":"fp16_safetensors","local":"fp16safetensors","sections":[],"depth":2},{"title":"skills","local":"skills","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="command-line-interface" 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="#command-line-interface"><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><!---->Interface en ligne de commande<!----></span></h1><!--]--><!----> <p><code>diffusers-cli</code> est un client en ligne de commande pour exécuter, inspecter et empaqueter les pipelines Diffusers.</p> <!--[1--><h2 class="relative group"><a id="available-commands" 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="#available-commands"><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><!---->Commandes disponibles<!----></span></h2><!--]--><!----> <table><thead><tr><th>Commande</th><th>Objectif</th></tr></thead><tbody><tr><td><a href="#env"><code>env</code></a></td><td>Afficher les informations de l'environnement pour les rapports de bugs.</td></tr><tr><td><a href="#schema"><code>schema</code></a></td><td>Inspecter la signature <code>__call__</code> d’un pipeline sans télécharger les poids.</td></tr><tr><td><a href="#run"><code>run</code></a></td><td>Exécuter un pipeline localement ou dans un Hugging Face Sandbox.</td></tr><tr><td><a href="#customblocks"><code>custom_blocks</code></a></td><td>Emballer une sous-classe locale de <code>ModularPipelineBlocks</code> pour le Hub.</td></tr><tr><td><a href="#fp16safetensors"><code>fp16_safetensors</code></a></td><td>Convertir un point de contrôle en fp16 <code>.safetensors</code>.</td></tr><tr><td><a href="#skills"><code>skills</code></a></td><td>Installez des bundles de compétences pré-écrits dans votre agent de codage IA.</td></tr></tbody></table> <blockquote class="tip"><p>Cette page ne détaille pas toutes les options de chaque sous-commande. Pour obtenir la liste complète et à jour des options de toute sous-commande, exécutez <code>diffusers-cli <command> --help</code> (<code>diffusers-cli run --help</code>).</p></blockquote> <!--[1--><h2 class="relative group"><a id="env" 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="#env"><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><!---->env<!----></span></h2><!--]--><!----> <p>Affiche les versions de Python, PyTorch et Diffusers, les informations CUDA et les dépendances optionnelles installées. Utilisez-le lors de l’ouverture d’un ticket afin que les mainteneurs puissent reproduire votre configuration.</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> Copié</div><!----></button><!----></div> <pre class="language-bash "><!---->diffusers-cli <span class="hljs-built_in">env</span><!----></pre></div><!----> <!--[1--><h2 class="relative group"><a id="schema" 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="#schema"><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><!---->schema<!----></span></h2><!--]--><!----> <p>Retourne les entrées acceptées par le pipeline sans télécharger les poids. Utilisez-le lors de la construction de <code>--pipeline-kwargs</code> pour <a href="#run"><code>run</code></a>.</p> <p>Seul le fichier d’index est récupéré. Les pipelines standard lisent <code>model_index.json</code>. Les pipelines modulaires lisent <code>modular_model_index.json</code>. Les dépôts à blocs personnalisés lisent <code>modular_config.json</code> et nécessitent <code>--trust-remote-code</code>, car leur chargement exécute du code du Hub.</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> Copié</div><!----></button><!----></div> <pre class="language-bash "><!---->diffusers-cli --format json schema --model black-forest-labs/FLUX.1-dev | |
| diffusers-cli schema --model my-org/my-custom-blocks --trust-remote-code<!----></pre></div><!----> <!--[1--><h2 class="relative group"><a id="run" 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="#run"><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><!---->run<!----></span></h2><!--]--><!----> <p>Exécutez un pipeline de bout en bout. L’interface en ligne de commande détecte automatiquement les dépôts standard et modulaires. Elle charge automatiquement les entrées multimédias à partir d’URL ou de chemins locaux, enregistre les sorties selon le type de retour du pipeline et peut s’exécuter à distance sur un Hugging Face Sandbox via <code>--remote</code>.</p> <p>Exemple minimal :</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> Copié</div><!----></button><!----></div> <pre class="language-bash "><!---->diffusers-cli run \ | |
| --model black-forest-labs/FLUX.1-dev \ | |
| --dtype bf16 \ | |
| --pipeline-kwargs <span class="hljs-string">'{"prompt": "an astronaut riding a horse"}'</span><!----></pre></div><!----> <!--[2--><h3 class="relative group"><a id="passing-pipeline-arguments" 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="#passing-pipeline-arguments"><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><!---->Passage des arguments du pipeline<!----></span></h3><!--]--><!----> <p><code>--pipeline-kwargs</code> prend un objet JSON qui est transmis à <code>pipeline(**kwargs)</code>. Les valeurs de chaîne aux clés d’entrée média connues sont chargées automatiquement :</p> <ul><li>Images (<code>image</code>, <code>last_image</code>, <code>mask_image</code>, <code>control_image</code>, <code>ip_adapter_image</code>, <code>image_2</code>) → <code>PIL.Image</code> via <code>load_image</code>.</li> <li>Vidéos (<code>video</code>, <code>control_video</code>) → <code>list[PIL.Image]</code> via <code>load_video</code>.</li> <li>Audio (<code>initial_audio_waveforms</code>, <code>reference_audio</code>, <code>src_audio</code>) → <code>torch.Tensor</code> via <code>torchaudio.load</code>.</li></ul> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> Copié</div><!----></button><!----></div> <pre class="language-bash "><!---->diffusers-cli run \ | |
| --model black-forest-labs/FLUX.2-klein-9B --dtype bf16 \ | |
| --pipeline-kwargs <span class="hljs-string">'{"prompt": "make the fur grey", "image": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png", "strength": 0.6}'</span><!----></pre></div><!----> <p>Les clés média et texte acceptent toutes deux un tableau JSON pour traiter un lot via un seul appel de pipeline. Chaque entrée | |
| d’une liste média est chargée individuellement (URL, chemin local ou chemin de montage de bucket), et Diffusers traite | |
| la liste entière en un seul passage avant sur le GPU :</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> Copié</div><!----></button><!----></div> <pre class="language-bash "><!---->diffusers-cli run \ | |
| --model black-forest-labs/FLUX.1-Kontext-dev --dtype bf16 \ | |
| --pipeline-kwargs <span class="hljs-string">'{ | |
| "prompt": ["make it grey", "make it pink", "make it blue"], | |
| "image": [ | |
| "https://.../cat1.png", | |
| "https://.../cat2.png", | |
| "https://.../cat3.png" | |
| ] | |
| }'</span><!----></pre></div><!----> <!--[2--><h3 class="relative group"><a id="loading" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#loading"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->Chargement<!----></span></h3><!--]--><!----> <p>Configurez la façon dont l’interface en ligne de charge (CLI) charge les poids du modèle et le code de pipeline personnalisé.</p> <ul><li><p><code>--dtype {auto, bfloat16, bf16, float16, fp16, float32, fp32}</code> — dtype des poids.</p></li> <li><p><code>--device-map <value></code> — placement des composants. Accepte une chaîne de device torch (<code>cuda</code>, <code>cuda:0</code>, <code>cpu</code>, <code>mps</code>), <code>balanced</code> (répartit automatiquement les composants entre les GPU visibles) ou un dictionnaire JSON pour un placement explicite par composant. | |
| Détecté automatiquement si omis. Voir <a href="../optimization/device_map">device_map</a> pour plus de détails.</p></li> <li><p><code>--variant fp16</code> — choisir une variante de poids.</p></li> <li><p><code>--revision <sha></code> — épingler une révision spécifique du modèle.</p></li> <li><p><code>--trust-remote-code</code> — autorise le code personnalisé issu du Hub (nécessaire pour les dépôts qui incluent des classes de pipeline personnalisées ou des blocs modulaires). Consultez <a href="../using-diffusers/custom_pipeline_overview">Community pipelines</a> pour les pipelines personnalisés standard et <a href="../modular_diffusers/overview">Modular Diffusers</a>.</p></li> <li><p><code>--lora <spec></code> — attache un adaptateur LoRA après le chargement. Chaque valeur est un dictionnaire JSON. Répétez le drapeau pour empiler plusieurs adaptateurs. <code>lora_id</code> est obligatoire pour chaque entrée, <code>lora_scale</code> est défini par défaut sur <code>1.0</code>, et <code>adapter_name</code> est facultatif (généré automatiquement sous la forme <code>lora_<i></code> lors de l’empilement).</p> <ul><li>Simple : <code>--lora '{"lora_id": "alvdansen/flux-koda", "lora_scale": 0.8}'</code></li> <li>Plusieurs : <code>--lora '{"lora_id": "alvdansen/flux-koda", "lora_scale": 0.6, "adapter_name": "koda"}' --lora '{"lora_id": "Shakker-Labs/FLUX.1-dev-LoRA-AntiBlur", "lora_scale": 0.4}'</code></li></ul> <p>Toutes les spécifications sont chargées par <code>pipeline.load_lora_weights(...)</code>, puis activées ensemble avec un seul appel à <code>pipeline.set_adapters(names, adapter_weights=scales)</code>. Consultez <a href="../tutorials/using_peft_for_inference">LoRA</a> pour un guide détaillé sur le superposition d'adaptateurs, la planification des échelles et le changement à chaud.</p></li></ul> <!--[2--><h3 class="relative group"><a id="optimizations" 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="#optimizations"><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><!---->Optimisations<!----></span></h3><!--]--><!----> <ul><li><code>--cpu-offload {model, group, auto}</code> — la cible de déchargement provient de <code>--device-map</code> (chaîne d'appareil simple requise pour le déchargement). model — enable_model_cpu_offload pour les pipelines standard. Voir Déchargement du modèle. group — enable_group_offload(offload_type="leaf_level", use_stream=True) pour les pipelines standard. Voir Déchargement par groupe. auto — uniquement pour les pipelines modulaires avec ComponentsManager. Les modes standard lèvent une erreur sur les pipelines modulaires. auto lève une erreur sur les pipelines standard. <ul><li><code>model</code> — <code>enable_model_cpu_offload</code> pour les pipelines standard. Voir <a href="../optimization/memory#model-offloading">Déchargement du modèle</a>.</li> <li><code>group</code> — <code>enable_group_offload(offload_type="leaf_level", use_stream=True)</code> pour les pipelines standard. Voir <a href="../optimization/memory#group-offloading">Group offloading</a>.</li> <li><code>auto</code> — uniquement en mode modulaire avec <a href="../modular_diffusers/components_manager"><code>ComponentsManager</code></a>. Les modes standard lèvent une exception sur les pipelines modulaires. <code>auto</code> lève une exception sur les pipelines standard.</li></ul></li> <li><code>--offload-margin <size></code> — mémoire de l’appareil laissée libre pour les activations sous <code>--cpu-offload auto</code>, transmise à <code>enable_auto_cpu_offload</code> en tant que <code>memory_reserve_margin</code> (valeur par défaut <code>3GB</code>). Augmentez cette valeur si une grande toile épuise la mémoire en cours de propagation avant. Le déchargeur conserve les composants en mémoire tant qu’ils y tiennent, de sorte qu’avec une carte à forte VRAM, la marge par défaut peut laisser trop peu de place pour les activations d’une longue vidéo.</li> <li><code>--attention-backend</code> — Noyaux d’attention hébergés sur le Hub, téléchargés automatiquement lors de la première utilisation. Les choix sont <code>default</code> ainsi que les backends du Hub enregistrés dans Diffusers (par exemple <code>flash_hub</code>, <code>flash_varlen_hub</code>, <code>flash_4_hub</code>, <code>sage_hub</code>, <code>sage_blackwell_hub</code>). Exécutez <code>diffusers-cli run --help</code> pour obtenir la liste actuelle. Il ne prend en charge que les pipelines basés sur des Transformers et est ignoré avec un avertissement sur les pipelines UNet legacy. Voir <a href="../optimization/attention_backends">Backends d’attention</a>.</li> <li><code>--vae-tiling</code> / <code>--vae-slicing</code> — réduit la VRAM utilisée par le décodage VAE. Consultez <a href="../optimization/memory#vae-tiling">tiling VAE</a> et <a href="../optimization/memory#vae-slicing">slicing VAE</a>.</li> <li><code>--compile [JSON]</code> — compile les modules du débruiteur avec <a href="../optimization/fp16#torchcompile">torch.compile</a>. L’interface en ligne de commande privilégie la <a href="../optimization/fp16#regional-compilation">compilation régionale</a> pour les modules comportant des blocs répétés. L’option <code>--compile</code> seule utilise <code>fullgraph=true</code>. Un objet JSON est transmis à <code>torch.compile</code>. Non pris en charge avec <code>--context-parallel</code>.</li> <li><code>--context-parallel</code> — parallélisme de contexte de type Ulysses sur un pipeline basé sur DiT. Nécessite localement torchrun, mais | |
| sous <code>--remote</code>, l’interface en ligne de commande encapsule <code>torchrun --nproc-per-node=gpu</code> pour vous. Voir <a href="../optimization/context_parallelism">Parallélisme de contexte</a>.</li></ul> <!--[2--><h3 class="relative group"><a id="modular-pipelines" 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="#modular-pipelines"><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><!---->Pipelines modulaires<!----></span></h3><!--]--><!----> <p><code>run</code> détecte automatiquement un <a href="../modular_diffusers/overview">dépôt modulaire</a> — soit parce qu’il contient un <code>modular_model_index.json</code>, soit parce que son <code>model_index.json</code> référence une sous-classe de <code>ModularPipeline</code> — aucun drapeau n’est donc nécessaire pour l’activer.</p> <p>Certains dépôts modulaires définissent plusieurs <em>workflows</em> semblables à des tâches nommées qui partagent des composants mais diffèrent par les blocs exécutés et les entrées qu’ils acceptent. <a href="../api/pipelines/minimax_h3">MiniMax-H3</a>, par exemple, propose <code>t2va</code> (texte vers vidéo et audio), <code>fl2va</code> (image clé première et/ou dernière) et <code>ref2va</code> (un mélange ordonné de références image, vidéo et audio). Passez <code>--workflow</code> pour en sélectionner un :</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> Copié</div><!----></button><!----></div> <pre class="language-bash "><!---->diffusers-cli run \ | |
| --model MiniMaxAI/MiniMax-H3 --workflow fl2va \ | |
| --pipeline-kwargs <span class="hljs-string">'{ | |
| "prompt": "the camera pushes in slowly as rain falls", | |
| "image": "opening-frame.png", | |
| "last_image": "closing-frame.png", | |
| "num_frames": 124 | |
| }'</span> \ | |
| --output-key videos --output-key audio \ | |
| --fps 24 --sampling-rate 32000 \ | |
| --cpu-offload auto --dtype bf16<!----></pre></div><!----> <p>Sélectionner un workflow ne conserve que les blocs de cette tâche, de sorte que le pipeline ne déclare que les composants dont il a besoin et <code>load_components</code> ne récupère que leurs sous-dossiers. Omettez <code>--workflow</code> pour conserver tous les workflows disponibles et laisser le pipeline choisir à chaque appel en fonction des entrées qui lui sont fournies.</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> Copié</div><!----></button><!----></div> <pre class="language-bash "><!---->diffusers-cli --format json schema --model MiniMaxAI/MiniMax-H3 --trust-remote-code<!----></pre></div><!----> <p><code>--workflow</code> s'applique uniquement aux pipelines modulaires. Il est ignoré avec un avertissement sur les pipelines standard.</p> <p>Un pipeline modulaire renvoie un <a href="../modular_diffusers/modular_pipeline"><code>PipelineState</code></a> plutôt qu'un seul objet de sortie, de sorte que <code>--output-key</code> désigne l'intermédiaire à enregistrer.</p> <!--[2--><h3 class="relative group"><a id="outputs" 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="#outputs"><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><!---->Sorties<!----></span></h3><!--]--><!----> <p><code>run</code> détecte le type de sortie du pipeline :</p> <ul><li><code>PIL.Image</code>/liste → <code><NNNN>.png</code> (index à zéros, par ex. <code>0000.png</code>)</li> <li>Séquence d'images → <code>0000.mp4</code> (<code>--fps</code> contrôle la fréquence d'images, valeur par défaut 8)</li> <li>Tableau audio → <code>0000.wav</code> (<code>--sampling-rate</code> contrôle le taux)</li> <li>Tout le reste → déchargement JSON</li></ul> <p>Le format du répertoire de sortie par défaut est <code>~/.diffusers/cli/run/outputs/diffusers-run-<YYYYMMDDTHHMMSS>-<uuid>/</code>. Chaque | |
| exécution reçoit son propre sous-répertoire afin que les invocations successives ne s'écrasent pas.</p> <p>Utilisez <code>--output <path></code> pour l'écraser. La manière dont le chemin est développé dépend de sa forme et de la taille du lot :</p> <table><thead><tr><th><code>--output</code></th><th>1 sortie</th><th>Sorties N</th></tr></thead><tbody><tr><td><em>omitted</em></td><td>répertoire par défaut → <code>0000.png</code></td><td>répertoire par défaut → <code>0000.png</code>, <code>0001.png</code>, <code>0002.png</code>, …</td></tr><tr><td><code>./results/</code> (avec un <code>/</code> final ou un répertoire existant)</td><td><code>./results/0000.png</code></td><td><code>./results/0000.png</code>, <code>./results/0001.png</code>, …</td></tr><tr><td><code>my-cat.png</code> (chemin du fichier)</td><td><code>my-cat.png</code> (utilisé tel quel)</td><td><code>my-cat-0000.png</code>, <code>my-cat-0001.png</code>, …</td></tr></tbody></table> <p>Les sorties de répertoire utilisent toujours des noms nus avec zéros d’alignement (<code>0000</code>, <code>0001</code>, …). Les chemins de fichiers explicites conservent le préfixe choisi et reçoivent l’index aligné en suffixe lorsque le lot produit plusieurs sorties.</p> <p>Utilisez <code>--push-to</code> pour téléverser les résultats dans un <a href="https://huggingface.co/docs/hub/en/storage-buckets" rel="nofollow">seau de stockage Hugging Face</a>. Il accepte un :</p> <ul><li>ID du bucket HF (<code><namespace>/<name></code>)</li> <li><code>hf://buckets/<namespace>/<name>[/<subpath>]</code> <a href="https://huggingface.co/docs/huggingface_hub/main/en/package_reference/hf_uris" rel="nofollow">URI HF</a></li> <li>URL du navigateur</li></ul> <p>Un sous-chemin est utilisé comme préfixe de dossier. Le bucket est créé s'il est manquant, et les objets sont placés sous <code>[<subpath>/]<run_id>/<filename></code>.</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> Copié</div><!----></button><!----></div> <pre class="language-bash "><!----><span class="hljs-comment"># HF bucket id — files at hf://buckets/alice/edit-outputs/<run_id>/<file></span> | |
| --push-to alice/edit-outputs | |
| <span class="hljs-comment"># URI with subpath — files at hf://buckets/alice/edit-outputs/greyscale/2026-07/<run_id>/<file></span> | |
| --push-to hf://buckets/alice/edit-outputs/greyscale/2026-07 | |
| <span class="hljs-comment"># Browser URL copy-paste from the Hub also works.</span> | |
| --push-to https://huggingface.co/buckets/alice/edit-outputs/tree/greyscale/2026-07<!----></pre></div><!----> <p>Le tableau ci-dessous décrit les exécutions distantes. Pour les exécutions locales, <code>--push-to</code> téléverse la sortie enregistrée localement. Il ne supprime pas la création de fichiers locaux.</p> <table><thead><tr><th><code>--push-to</code> défini ?</th><th><code>--output</code> défini ?</th><th>Résultat</th></tr></thead><tbody><tr><td>non</td><td>non</td><td>télécharger dans le répertoire local par défaut</td></tr><tr><td>non</td><td>oui</td><td>télécharger vers <code>--output</code></td></tr><tr><td>oui</td><td>non</td><td>bucket uniquement, sans téléchargement local</td></tr><tr><td>oui</td><td>oui</td><td>bucket ET <code>--output</code></td></tr></tbody></table> <p><code>--format</code> forme les métadonnées de la sortie standard (chemins, chronométrage, informations sur le bac à sable). Il ne modifie pas le format des fichiers des médias eux-mêmes. Les images écrites sont toujours au format PNG, les vidéos en MP4 et l’audio en WAV.</p> <!--[2--><h3 class="relative group"><a id="remote-execution----remote-" 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="#remote-execution----remote-"><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><!---->Exécution à distance ( --remote )<!----></span></h3><!--]--><!----> <p>Effectuez le même appel dans un <a href="https://huggingface.co/docs/huggingface_hub/en/guides/sandbox" rel="nofollow">Hugging Face Sandbox</a> — une VM cloud isolée que le CLI pilote via HTTP : il téléverse les entrées, exécute le pipeline, télécharge les sorties, puis | |
| met fin au sandbox. Nécessite <code>huggingface_hub>=1.23</code>.</p> <p>Le bac à sable démarre à partir de <a href="https://hub.docker.com/r/diffusers/diffusers-cli-cuda" rel="nofollow"><code>diffusers/diffusers-cli-cuda</code></a>, une image préconstruite qui inclut déjà torch, CUDA et les dépendances du CLI, de sorte qu’une exécution à froid commence à générer au lieu d’installer d’abord.</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> Copié</div><!----></button><!----></div> <pre class="language-bash "><!---->diffusers-cli run \ | |
| --model black-forest-labs/FLUX.1-dev --dtype bf16 \ | |
| --pipeline-kwargs <span class="hljs-string">'{"prompt": "an astronaut riding a horse"}'</span> \ | |
| --remote --flavor a100-large<!----></pre></div><!----> <p>Drapeaux distants :</p> <ul><li><code>--flavor <name></code> — matériel de la sandbox (par exemple, <code>a10g-small</code>, <code>h200</code>, <code>rtx-pro-6000</code>).</li> <li><code>--timeout <duration></code> — durée maximale réelle pour la commande d’exécution dans le bac à sable (par défaut <code>10m</code>).</li> <li><code>--dependencies <pkg></code> — dépendances pip supplémentaires (répétable), installées par-dessus l’image. Utile pour épingler un tarball de branche de diffusers ou ajouter des extras spécifiques à un pipeline.</li> <li><code>--namespace <name></code> — crée le bac à sable sous une autre organisation/compte HF.</li> <li><code>--image <ref></code> — remplace l’image du bac à sable. Elle doit inclure torch + CUDA compatible avec le pilote de votre <code>--flavor</code>. | |
| L’interface en ligne de commande installe alors ses propres dépendances par-dessus dans chaque bac à sable froid, ce que l’image par défaut évite.</li> <li><code>--volume <bucket-id>[:<mount-path>]</code> — monte un <a href="https://huggingface.co/docs/hub/en/storage-buckets" rel="nofollow">bucket de stockage HF</a> dans le bac à sable en tant que répertoire en lecture-écriture (répétable). Le chemin de montage par défaut est <code>/mnt/buckets/<bucket-id></code>. Référencez les fichiers montés depuis <code>--pipeline-kwargs</code> comme n’importe quel autre chemin local. | |
| Appliqué uniquement lors de la création d’un nouveau bac à sable et ignoré lors de la reconnexion via <code>--sandbox-id</code>.</li></ul> <p>Par défaut, chaque exécution <code>--remote</code> est éphémère (création → exécution → téléchargement → arrêt). Pour réutiliser un bac à sable chaud entre les exécutions — en conservant les dépendances, le cache des poids du modèle et le cache <code>torch.compile</code> sur son disque —, maintenez-le en vie et reconnectez-vous :</p> <ul><li><code>--keep-alive</code> — ne pas mettre fin au bac à sable après l’exécution. Son identifiant est affiché.</li> <li><code>--sandbox-id <id></code> — se reconnecter à un sandbox maintenu actif au lieu d’en créer un nouveau.</li> <li><code>--idle-timeout <duration></code> — arrêt automatique après cette durée d’inactivité (par défaut <code>10m</code>). Appliqué uniquement lors de la création d’une nouvelle sandbox et ignoré lors d’une reconnexion via <code>--sandbox-id</code>.</li></ul> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> Copié</div><!----></button><!----></div> <pre class="language-bash "><!----><span class="hljs-comment"># First run keeps the sandbox alive and prints sandbox_id=<id>.</span> | |
| diffusers-cli run -m black-forest-labs/FLUX.1-dev --dtype bf16 \ | |
| --pipeline-kwargs <span class="hljs-string">'{"prompt": "a cat"}'</span> --remote --flavor a100-large --keep-alive | |
| <span class="hljs-comment"># Reconnect for the next run — the model is already cached, so only inference runs.</span> | |
| diffusers-cli run -m black-forest-labs/FLUX.1-dev --dtype bf16 \ | |
| --pipeline-kwargs <span class="hljs-string">'{"prompt": "a dog"}'</span> --remote --flavor a100-large --sandbox-id <<span class="hljs-built_in">id</span>> | |
| <span class="hljs-comment"># Stop it when done (or let it timeout).</span> | |
| hf sandbox <span class="hljs-built_in">kill</span> <<span class="hljs-built_in">id</span>><!----></pre></div><!----> <!--[1--><h2 class="relative group"><a id="customblocks" 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="#customblocks"><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><!---->custom_blocks<!----></span></h2><!--]--><!----> <p>Emballer une sous-classe locale de <code>ModularPipelineBlocks</code> pour son téléversement sur le Hub. Lit un fichier Python, l’analyse via AST pour détecter les classes dérivant de <code>ModularPipelineBlocks</code> ou de l’une de ses sous-classes composites (<code>SequentialPipelineBlocks</code>, <code>AutoPipelineBlocks</code>, <code>ConditionalPipelineBlocks</code>, <code>LoopSequentialPipelineBlocks</code>), instancie celle choisie et | |
| appelle <code>save_pretrained</code> dans le répertoire de travail courant.</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> Copié</div><!----></button><!----></div> <pre class="language-bash "><!----><span class="hljs-comment"># Package the first block found in ./block.py</span> | |
| diffusers-cli custom_blocks | |
| <span class="hljs-comment"># Point at a different file / pick a specific class</span> | |
| diffusers-cli custom_blocks --block_module_name my_block.py --block_class_name MyDenoiseBlock<!----></pre></div><!----> <p>The block class must be instantiable with zero constructor args and hardcodes defaults in <code>__init__</code> or read | |
| config from the pipeline <code>state</code> at call time.</p> <!--[1--><h2 class="relative group"><a id="fp16safetensors" 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="#fp16safetensors"><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><!---->fp16_safetensors<!----></span></h2><!--]--><!----> <blockquote class="caution"><p>Cette commande est désormais obsolète et sera supprimée dans une version future.</p></blockquote> <p>Convertir un point de contrôle sur le Hub en <code>.safetensors</code> fp16 et pousser le résultat. Utile pour réduire la taille des poids d’un dépôt afin d’accélérer le chargement. Consultez <code>diffusers-cli fp16_safetensors --help</code> pour les arguments exacts.</p> <!--[1--><h2 class="relative group"><a id="skills" 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="#skills"><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><!---->compétences<!----></span></h2><!--]--><!----> <p>Installer les compétences depuis le dépôt diffusers (<a href="https://github.com/huggingface/diffusers/tree/main/.ai/skills" rel="nofollow"><code>.ai/skills/</code></a>).</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> Copié</div><!----></button><!----></div> <pre class="language-bash "><!----><span class="hljs-comment"># Install a single skill</span> | |
| diffusers-cli skills add <span class="hljs-string">"<skill name>"</span> | |
| <span class="hljs-comment"># Install every skill in the registry</span> | |
| diffusers-cli skills add --all | |
| <span class="hljs-comment"># List available skills with a one-line summary of each</span> | |
| diffusers-cli skills list | |
| <span class="hljs-comment"># Preview a skill's SKILL.md without installing</span> | |
| diffusers-cli skills preview diffusers-cli | |
| <span class="hljs-comment"># Refetch and reinstall every managed skill</span> | |
| diffusers-cli skills update | |
| <span class="hljs-comment"># Install to the user-level directory instead of the current project</span> | |
| diffusers-cli skills add diffusers-cli --global | |
| <span class="hljs-comment"># Install for one agent instead of detecting it from the environment</span> | |
| diffusers-cli skills add --all --claude <span class="hljs-comment"># or --codex / --cursor</span><!----></pre></div><!----> <p>Sans drapeau cible, le CLI installe pour l’agent qui l’a lancé, ou pour tous les agents s’il ne peut pas le déterminer. Claude Code reçoit un bundle de plugins sous <code>.claude/skills/diffusers/</code> (namespacé en tant que <code>/diffusers:<skill name></code>). Codex et Cursor reçoivent <code>.agents/skills/<skill name>/</code>.</p> <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/using-diffusers/cli.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_1qsdbwf = { | |
| 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.0S0_iEoG.js"), | |
| import("/docs/diffusers/main/en/_app/immutable/entry/app.CPdOxCbw.js") | |
| ]).then(([kit, app]) => { | |
| kit.start(app, element, { | |
| node_ids: [0, 388], | |
| data: [null,null], | |
| form: null, | |
| error: null | |
| }); | |
| }); | |
| } | |
| </script> | |
Xet Storage Details
- Size:
- 63.3 kB
- Xet hash:
- 794018466f74b5edee2dc67163948b1735a2c6b678c7c2567d1ddd14e3db9a81
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.