Buckets:

mishig's picture
download
raw
66.6 kB
<meta charset="utf-8" /><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;コマンドラインインターフェース&quot;,&quot;local&quot;:&quot;command-line-interface&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;利用可能なコマンド&quot;,&quot;local&quot;:&quot;available-commands&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env&quot;,&quot;local&quot;:&quot;env&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;スキーマ&quot;,&quot;local&quot;:&quot;schema&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;run&quot;,&quot;local&quot;:&quot;run&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;パイプライン引数の渡し方&quot;,&quot;local&quot;:&quot;passing-pipeline-arguments&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;読み込み中&quot;,&quot;local&quot;:&quot;loading&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;最適化&quot;,&quot;local&quot;:&quot;optimizations&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;モジュール化されたパイプライン&quot;,&quot;local&quot;:&quot;modular-pipelines&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;出力&quot;,&quot;local&quot;:&quot;outputs&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;リモート実行(--remote)&quot;,&quot;local&quot;:&quot;remote-execution----remote-&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;custom_blocks&quot;,&quot;local&quot;:&quot;customblocks&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;fp16_safetensors&quot;,&quot;local&quot;:&quot;fp16safetensors&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;スキル&quot;,&quot;local&quot;:&quot;skills&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;: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="{&quot;title&quot;:&quot;Command line interface&quot;,&quot;local&quot;:&quot;command-line-interface&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Available commands&quot;,&quot;local&quot;:&quot;available-commands&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env&quot;,&quot;local&quot;:&quot;env&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;schema&quot;,&quot;local&quot;:&quot;schema&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;run&quot;,&quot;local&quot;:&quot;run&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Passing pipeline arguments&quot;,&quot;local&quot;:&quot;passing-pipeline-arguments&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Loading&quot;,&quot;local&quot;:&quot;loading&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Optimizations&quot;,&quot;local&quot;:&quot;optimizations&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Modular pipelines&quot;,&quot;local&quot;:&quot;modular-pipelines&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Outputs&quot;,&quot;local&quot;:&quot;outputs&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Remote execution ( --remote )&quot;,&quot;local&quot;:&quot;remote-execution----remote-&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;custom_blocks&quot;,&quot;local&quot;:&quot;customblocks&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;fp16_safetensors&quot;,&quot;local&quot;:&quot;fp16safetensors&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;skills&quot;,&quot;local&quot;:&quot;skills&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}"/><!---->
<link href="/docs/diffusers/main/en/_app/immutable/assets/0.tn0RQdqM.css" rel="modulepreload"> <!--[--><!--[0--><!--[--><!--[0--><!--[--><p></p> <div class="items-center shrink-0 min-w-[100px] max-sm:min-w-[50px] justify-end ml-auto flex" style="float: inline-end; margin-inline-start: 10px; display: inline-flex; position: relative; z-index: 10;"><div dir="ltr" class="inline-flex rounded-md max-sm:rounded-sm"><button class="inline-flex items-center gap-1 h-7 max-sm:h-7 px-2 max-sm:px-1.5 text-sm font-medium text-gray-800 border border-r-0 rounded-l-md max-sm:rounded-l-sm border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-live="polite"><span class="inline-flex items-center justify-center rounded-md p-0.5 max-sm:p-0 hover:text-gray-800 dark:hover:text-gray-200"><svg class="sm:size-3.5 size-3" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----></span> <span dir="auto">Copy page</span></button> <button class="inline-flex items-center justify-center w-6 max-sm:w-5 h-7 max-sm:h-7 disabled:pointer-events-none text-sm text-gray-500 hover:text-gray-700 dark:hover:text-white rounded-r-md max-sm:rounded-r-sm border border-l transition border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-haspopup="menu" aria-expanded="false" aria-label="Open copy menu"><svg class="transition-transform text-gray-400 overflow-visible sm:size-3.5 size-3 rotate-0" width="1em" height="1em" viewBox="0 0 12 7" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L6 6L11 1" stroke="currentColor"></path></svg><!----></button></div> <!--[-1--><!--]--></div><!----> <!--[0--><h1 class="relative group"><a id="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><!---->コマンドラインインターフェース<!----></span></h1><!--]--><!----> <p><code>diffusers-cli</code> は、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><!---->利用可能なコマンド<!----></span></h2><!--]--><!----> <table><thead><tr><th>コマンド</th><th>目的</th></tr></thead><tbody><tr><td><a href="#env"><code>env</code></a></td><td>バグレポート用に環境情報を出力します。</td></tr><tr><td><a href="#schema"><code>schema</code></a></td><td>重みをダウンロードせずに、パイプラインの<code>__call__</code>シグネチャを確認します。</td></tr><tr><td><a href="#run"><code>run</code></a></td><td>パイプラインをローカルまたは Hugging Face Sandbox で実行します。</td></tr><tr><td><a href="#customblocks"><code>custom_blocks</code></a></td><td>ローカルの<code>ModularPipelineBlocks</code>サブクラスをパッケージして、Hubに公開します。</td></tr><tr><td><a href="#fp16safetensors"><code>fp16_safetensors</code></a></td><td>チェックポイントを<code>.safetensors</code>形式のfp16に変換します。</td></tr><tr><td><a href="#skills"><code>skills</code></a></td><td>AIコーディングエージェントに、事前作成済みのスキルバンドルをインストールします。</td></tr></tbody></table> <blockquote class="tip"><p>このページでは、各サブコマンドのすべてのオプションの詳細を記載していません。任意のサブコマンドの最新かつ完全なオプション一覧を確認するには、<code>diffusers-cli &lt;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>Python、PyTorch、Diffusers のバージョン、CUDA の情報、およびインストールされている任意の依存関係を出力します。Issue を投稿する際に使用し、メンテナーがあなたの環境を再現できるようにしてください。</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> コピーしました</div><!----></button><!----></div> <pre class="language-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><!---->スキーマ<!----></span></h2><!--]--><!----> <p>重みをダウンロードせずに、パイプラインが受け入れる入力値を返します。<a href="#run"><code>run</code></a> 用の <code>--pipeline-kwargs</code> を構築する際に使用します。</p> <p>インデックスファイルのみが取得されます。標準のパイプラインは<code>model_index.json</code>を読み込みます。モジュラーパイプラインは<code>modular_model_index.json</code>を読み込みます。カスタムブロックのリポジトリは<code>modular_config.json</code>を読み込み、Hub上のコードが実行されるため、<code>--trust-remote-code</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> コピーしました</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>パイプラインをエンドツーエンドで実行します。CLIは、標準リポジトリとモジュラーリポジトリを自動検出します。URLまたはローカルパスからメディア入力を自動読み込み、パイプラインの戻り値の型に基づいて出力を保存し、<code>--remote</code>を指定することでHugging Face Sandbox上でリモート実行することもできます。</p> <p>最小限の例:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> コピーしました</div><!----></button><!----></div> <pre class="language-bash "><!---->diffusers-cli run \
--model black-forest-labs/FLUX.1-dev \
--dtype bf16 \
--pipeline-kwargs <span class="hljs-string">&#x27;{&quot;prompt&quot;: &quot;an astronaut riding a horse&quot;}&#x27;</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><!---->パイプライン引数の渡し方<!----></span></h3><!--]--><!----> <p><code>--pipeline-kwargs</code> は、<code>pipeline(**kwargs)</code> に転送される JSON オブジェクトを受け取ります。既知のメディア入力キーにある文字列値は自動的に読み込まれます:</p> <ul><li>画像(<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>load_image</code> を通じて <code>PIL.Image</code> として扱われます。</li> <li>動画(<code>video</code>、<code>control_video</code>)→ <code>load_video</code> 経由で <code>list[PIL.Image]</code></li> <li>オーディオ(<code>initial_audio_waveforms</code>、<code>reference_audio</code>、<code>src_audio</code>) → <code>torchaudio.load</code> 経由で <code>torch.Tensor</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> コピーしました</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">&#x27;{&quot;prompt&quot;: &quot;make the fur grey&quot;, &quot;image&quot;: &quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png&quot;, &quot;strength&quot;: 0.6}&#x27;</span><!----></pre></div><!----> <p>メディアキーとテキストキーの両方で、JSON配列を受け取り、単一のパイプライン呼び出しでバッチ処理を実行できます。メディアリストの各エントリは個別に読み込まれます(URL、ローカルパス、またはバケットマウントパス)。DiffusersはGPU上で1回のフォワードパスでリスト全体を処理します。</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> コピーしました</div><!----></button><!----></div> <pre class="language-bash "><!---->diffusers-cli run \
--model black-forest-labs/FLUX.1-Kontext-dev --dtype bf16 \
--pipeline-kwargs <span class="hljs-string">&#x27;{
&quot;prompt&quot;: [&quot;make it grey&quot;, &quot;make it pink&quot;, &quot;make it blue&quot;],
&quot;image&quot;: [
&quot;https://.../cat1.png&quot;,
&quot;https://.../cat2.png&quot;,
&quot;https://.../cat3.png&quot;
]
}&#x27;</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><!---->読み込み中<!----></span></h3><!--]--><!----> <p>CLIがモデルの重みとカスタムパイプラインコードを読み込む方法を設定します。</p> <ul><li><p><code>--dtype {auto, bfloat16, bf16, float16, fp16, float32, fp32}</code> — 重みの dtype。</p></li> <li><p><code>--device-map &lt;value></code> — コンポーネントの配置。torch のデバイス文字列(<code>cuda</code>、<code>cuda:0</code>、<code>cpu</code>、<code>mps</code>)、<code>balanced</code>(表示可能な GPU にコンポーネントを自動分割して配置)、またはコンポーネントごとの明示的な配置を指定する JSON 辞書を受け取ります。省略した場合、自動検出されます。詳細は <a href="../optimization/device_map">device_map</a> を参照してください。</p></li> <li><p><code>--variant fp16</code> — 重みのバリアントを選択します。</p></li> <li><p><code>--revision &lt;sha></code> — 特定のモデルのリビジョンを固定します。</p></li> <li><p><code>--trust-remote-code</code> — Hub からのカスタムコードを許可します(カスタムパイプラインクラスやモジュラーブロックを同梱するリポジトリには必要です)。標準的なカスタムパイプラインについては <a href="../using-diffusers/custom_pipeline_overview">コミュニティパイプライン</a>、<a href="../modular_diffusers/overview">Modular Diffusers</a> についてはそちらを参照してください。</p></li> <li><p><code>--lora &lt;spec></code> — 読み込み後に LoRA アダプターをアタッチします。各値は JSON 辞書です。複数のアダプターをスタックするには、このフラグを繰り返し指定します。各エントリには <code>lora_id</code> が必須で、<code>lora_scale</code> のデフォルト値は <code>1.0</code> です。<code>adapter_name</code> は任意で、スタックする場合は <code>lora_&lt;i></code> として自動生成されます。</p> <ul><li>単一: <code>--lora '{"lora_id": "alvdansen/flux-koda", "lora_scale": 0.8}'</code></li> <li>複数: <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>すべての仕様は<code>pipeline.load_lora_weights(...)</code>によって読み込まれ、その後、単一の<code>pipeline.set_adapters(names, adapter_weights=scales)</code>呼び出しで同時に有効化されます。アダプタのスタッキング、スケールスケジューリング、ホットスワップの詳細については、<a href="../tutorials/using_peft_for_inference">LoRA</a>を参照してください。</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><!---->最適化<!----></span></h3><!--]--><!----> <ul><li><code>--cpu-offload {model, group, auto}</code> — オフロード先は <code>--device-map</code> (オフロードにはプレーンなデバイス文字列が必要です)。 <ul><li><code>model</code> — 標準パイプライン用の<code>enable_model_cpu_offload</code>。<a href="../optimization/memory#model-offloading">モデルのオフロード</a>を参照してください。</li> <li><code>group</code> — 標準的なパイプラインには <code>enable_group_offload(offload_type="leaf_level", use_stream=True)</code> を使用します。<a href="../optimization/memory#group-offloading">グループオフロード</a>を参照してください。</li> <li><code>auto</code> — <a href="../modular_diffusers/components_manager"><code>ComponentsManager</code></a>でのみモジュラーに対応します。標準モードではモジュラーパイプラインで例外を発生させます。<code>auto</code>は標準パイプラインで例外を発生させます。</li></ul></li> <li><code>--offload-margin &lt;size></code> — <code>--cpu-offload auto</code> の下でアクティベーション用に確保しておくデバイスメモリ量。<code>enable_auto_cpu_offload</code> に <code>memory_reserve_margin</code> として渡されます(デフォルトは <code>3GB</code>)。大きなキャンバスでフォワードの途中でメモリ不足が発生する場合は、この値を上げてください。オフローダーはコンポーネントが収まる限りレジデントに保つため、VRAM の大きいカードでは、デフォルトのマージンでは長い動画のアクティベーションに十分な領域を確保できない場合があります。</li> <li><code>--attention-backend</code> — Hub にホストされているアテンションカーネルで、初回使用時に自動ダウンロードされます。選択肢は <code>default</code> と、Diffusers に登録されている Hub バックエンド(例: <code>flash_hub</code>、<code>flash_varlen_hub</code>、<code>flash_4_hub</code>、<code>sage_hub</code>、<code>sage_blackwell_hub</code>)です。現在のリストを確認するには <code>diffusers-cli run --help</code> を実行してください。Transformer ベースのパイプラインのみサポートしており、レガシーな UNet パイプラインでは警告とともに無視されます。<a href="../optimization/attention_backends">アテンションバックエンド</a>を参照してください。</li> <li><code>--vae-tiling</code> / <code>--vae-slicing</code> — VAE デコード時の VRAM 使用量を削減します。<a href="../optimization/memory#vae-tiling">VAE tiling</a> と <a href="../optimization/memory#vae-slicing">VAE slicing</a> を参照してください。</li> <li><code>--compile [JSON]</code> — <a href="../optimization/fp16#torchcompile">torch.compile</a>でデノイザーモジュールをコンパイルします。CLIは、繰り返しブロックを持つモジュールに対して<a href="../optimization/fp16#regional-compilation">地域的コンパイル</a>を優先します。単に<code>--compile</code>を指定すると<code>fullgraph=true</code>が使用されます。JSONオブジェクトは<code>torch.compile</code>に転送されます。<code>--context-parallel</code>との併用はサポートされていません。</li> <li><code>--context-parallel</code> — DiT ベースのパイプラインにおける Ulysses スタイルのコンテキスト並列化。ローカルでは torchrun が必要ですが、<code>--remote</code> を使用すると、CLI が <code>torchrun --nproc-per-node=gpu</code> を自動的にラップします。<a href="../optimization/context_parallelism">コンテキスト並列化</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><!---->モジュール化されたパイプライン<!----></span></h3><!--]--><!----> <p><code>run</code> は、<code>modular_model_index.json</code> が同梱されているか、<code>model_index.json</code> が <code>ModularPipeline</code> のサブクラスを指定しているかのいずれかの場合に、<a href="../modular_diffusers/overview">モジュラーリポジトリ</a> を自動的に検出します。そのため、オプトイン用のフラグは不要です。</p> <p>一部のモジュラーリポジトリでは、コンポーネントを共有しながら、実行されるブロックや受け取る入力が異なる、名前付きタスクのような複数の<em>ワークフロー</em>が定義されています。例えば、<a href="../api/pipelines/minimax_h3">MiniMax-H3</a>では、<code>t2va</code>(テキストから動画と音声への変換)、<code>fl2va</code>(最初のキーフレームと/または最後のキーフレーム)、<code>ref2va</code>(画像、動画、音声の参照の順序付きミックス)が提供されています。<code>--workflow</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> コピーしました</div><!----></button><!----></div> <pre class="language-bash "><!---->diffusers-cli run \
--model MiniMaxAI/MiniMax-H3 --workflow fl2va \
--pipeline-kwargs <span class="hljs-string">&#x27;{
&quot;prompt&quot;: &quot;the camera pushes in slowly as rain falls&quot;,
&quot;image&quot;: &quot;opening-frame.png&quot;,
&quot;last_image&quot;: &quot;closing-frame.png&quot;,
&quot;num_frames&quot;: 124
}&#x27;</span> \
--output-key videos --output-key audio \
--fps 24 --sampling-rate 32000 \
--cpu-offload auto --dtype bf16<!----></pre></div><!----> <p>ワークフローを選択すると、そのタスクのブロックのみが保持されるため、パイプラインは必要なコンポーネントのみを宣言し、<code>load_components</code> はそれらのサブフォルダのみを取得します。<code>--workflow</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> コピーしました</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> はモジュラーパイプラインにのみ適用されます。標準パイプラインでは、警告とともに無視されます。</p> <p>モジュール型パイプラインは単一の出力オブジェクトではなく、<a href="../modular_diffusers/modular_pipeline"><code>PipelineState</code></a> を返すため、<code>--output-key</code> は保存する中間結果を指定します。</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><!---->出力<!----></span></h3><!--]--><!----> <p><code>run</code> はパイプラインの出力タイプを検出します:</p> <ul><li><code>PIL.Image</code>/list → <code>&lt;NNNN>.png</code>(ゼロパディングされたインデックス、例: <code>0000.png</code>)</li> <li>画像シーケンス → <code>0000.mp4</code>(<code>--fps</code> でフレームレートを制御します。デフォルトは 8 です)</li> <li>オーディオ配列 → <code>0000.wav</code>(<code>--sampling-rate</code> でレートが制御されます)</li> <li>それ以外 → JSON ダンプ</li></ul> <p>デフォルトの出力ディレクトリ形式は <code>~/.diffusers/cli/run/outputs/diffusers-run-&lt;YYYYMMDDTHHMMSS>-&lt;uuid>/</code> です。各実行には独自のサブディレクトリが割り当てられるため、連続した呼び出しによって上書きされることはありません。</p> <p><code>--output &lt;path></code> で上書きできます。パスの展開方法は、パスの形式とバッチサイズによって異なります。</p> <table><thead><tr><th><code>--output</code></th><th>1つの出力</th><th>N 個の出力</th></tr></thead><tbody><tr><td><em>省略</em></td><td>デフォルトのディレクトリ → <code>0000.png</code></td><td>デフォルトのディレクトリ → <code>0000.png</code>、<code>0001.png</code>、<code>0002.png</code>、…</td></tr><tr><td><code>./results/</code>(末尾に<code>/</code>を付けるか、既存のディレクトリを指定)</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>(ファイルパス)</td><td><code>my-cat.png</code>(そのまま使用)</td><td><code>my-cat-0000.png</code>, <code>my-cat-0001.png</code>, …</td></tr></tbody></table> <p>ディレクトリ出力では、常にパディングされた名前(<code>0000</code>、<code>0001</code>、…)が使用されます。明示的なファイルパスでは、選択したステムが保持され、バッチが複数の出力を生成する場合に、パディングされたインデックスが追加されます。</p> <p><code>--push-to</code> を使用して、出力を<a href="https://huggingface.co/docs/hub/en/storage-buckets" rel="nofollow">Hugging Face ストレージバケット</a>にアップロードします。以下を受け取ります:</p> <ul><li>HF バケット ID(<code>&lt;namespace>/&lt;name></code>)</li> <li><code>hf://buckets/&lt;namespace>/&lt;name>[/&lt;subpath>]</code> <a href="https://huggingface.co/docs/huggingface_hub/main/en/package_reference/hf_uris" rel="nofollow">HF URI</a></li> <li>ブラウザのURL</li></ul> <p>サブパスはフォルダのプレフィックスとして使用されます。バケットが存在しない場合は作成され、オブジェクトは<code>[&lt;subpath>/]&lt;run_id>/&lt;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> コピーしました</div><!----></button><!----></div> <pre class="language-bash "><!----><span class="hljs-comment"># HF bucket id — files at hf://buckets/alice/edit-outputs/&lt;run_id&gt;/&lt;file&gt;</span>
--push-to alice/edit-outputs
<span class="hljs-comment"># URI with subpath — files at hf://buckets/alice/edit-outputs/greyscale/2026-07/&lt;run_id&gt;/&lt;file&gt;</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>以下の表はリモート実行について説明しています。ローカル実行の場合、<code>--push-to</code> はローカルに保存された出力をアップロードします。ローカルファイルの作成を抑制することはありません。</p> <table><thead><tr><th><code>--push-to</code> が設定されていますか?</th><th><code>--output</code> は設定されていますか?</th><th>結果</th></tr></thead><tbody><tr><td>いいえ</td><td>いいえ</td><td>デフォルトのローカルディレクトリにダウンロード</td></tr><tr><td>いいえ</td><td>はい</td><td><code>--output</code> にダウンロード</td></tr><tr><td>はい</td><td>いいえ</td><td>バケットのみ、ローカルへのダウンロードなし</td></tr><tr><td>はい</td><td>はい</td><td>bucket および <code>--output</code></td></tr></tbody></table> <p><code>--format</code> は、stdout に出力されるメタデータ(パス、タイミング、サンドボックス情報)の形式を指定します。メディアファイル自体の形式は変更されません。書き出される画像は常に PNG、動画は MP4、音声は 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><!---->リモート実行(--remote)<!----></span></h3><!--]--><!----> <p><a href="https://huggingface.co/docs/huggingface_hub/en/guides/sandbox" rel="nofollow">Hugging Face Sandbox</a>内で同じ呼び出しを実行します。これはCLIがHTTP経由で操作する隔離されたクラウドVMであり、入力をアップロードしてパイプラインを実行し、出力をダウンロードした後にサンドボックスを終了します。<code>huggingface_hub>=1.23</code>が必要です。</p> <p>サンドボックスは、torch、CUDA、および CLI の依存関係がすでに同梱された事前構築済みイメージである <a href="https://hub.docker.com/r/diffusers/diffusers-cli-cuda" rel="nofollow"><code>diffusers/diffusers-cli-cuda</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> コピーしました</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">&#x27;{&quot;prompt&quot;: &quot;an astronaut riding a horse&quot;}&#x27;</span> \
--remote --flavor a100-large<!----></pre></div><!----> <p>リモートフラグ:</p> <ul><li><code>--flavor &lt;name></code> — サンドボックスのハードウェア(例: <code>a10g-small</code>、<code>h200</code>、<code>rtx-pro-6000</code>)。</li> <li><code>--timeout &lt;duration></code> — サンドボックス内で実行コマンドを実行する際の最大の実時間(デフォルトは <code>10m</code>)。</li> <li><code>--dependencies &lt;pkg></code> — 追加の pip 依存関係(繰り返し指定可能)。イメージ上にインストールされます。diffusers のブランチの tarball を固定したり、パイプライン固有の追加要素を追加したりするのに便利です。</li> <li><code>--namespace &lt;name></code> — 別の HF 組織/アカウントの下にサンドボックスを作成します。</li> <li><code>--image &lt;ref></code> — サンドボックスイメージをオーバーライドします。<code>--flavor</code> のドライバーと互換性のある torch + CUDA を同梱している必要があります。CLI は、デフォルトのイメージでは回避される処理として、すべてのコールドサンドボックスに対して独自の依存関係をインストールします。</li> <li><code>--volume &lt;bucket-id>[:&lt;mount-path>]</code> — <a href="https://huggingface.co/docs/hub/en/storage-buckets" rel="nofollow">HF storage bucket</a>をサンドボックスに読み書き可能なディレクトリとしてマウントします(繰り返し指定可能)。デフォルトのマウントパスは<code>/mnt/buckets/&lt;bucket-id></code>です。マウントされたファイルは、他のローカルパスと同様に<code>--pipeline-kwargs</code>から参照できます。
新しいサンドボックスの作成時のみ適用され、<code>--sandbox-id</code>を介して再接続する場合は無視されます。</li></ul> <p>デフォルトでは、各 <code>--remote</code> 実行はエフェメラル(作成 → 実行 → ダウンロード → 終了)です。実行間でウォームなサンドボックスを再利用し、依存関係、モデル重みのキャッシュ、および <code>torch.compile</code> キャッシュをディスク上に保持するには、サンドボックスを存続させ、再接続してください。</p> <ul><li><code>--keep-alive</code> — 実行後にサンドボックスを終了しません。その ID が出力されます。</li> <li><code>--sandbox-id &lt;id></code> — 新規作成せずに、キープアライブ状態のサンドボックスに再接続します。</li> <li><code>--idle-timeout &lt;duration></code> — この時間だけ無操作が続いた後に自動シャットダウンします(デフォルトは<code>10m</code>)。新しいサンドボックスの作成時のみ適用され、<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> コピーしました</div><!----></button><!----></div> <pre class="language-bash "><!----><span class="hljs-comment"># First run keeps the sandbox alive and prints sandbox_id=&lt;id&gt;.</span>
diffusers-cli run -m black-forest-labs/FLUX.1-dev --dtype bf16 \
--pipeline-kwargs <span class="hljs-string">&#x27;{&quot;prompt&quot;: &quot;a cat&quot;}&#x27;</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">&#x27;{&quot;prompt&quot;: &quot;a dog&quot;}&#x27;</span> --remote --flavor a100-large --sandbox-id &lt;<span class="hljs-built_in">id</span>&gt;
<span class="hljs-comment"># Stop it when done (or let it timeout).</span>
hf sandbox <span class="hljs-built_in">kill</span> &lt;<span class="hljs-built_in">id</span>&gt;<!----></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>ローカルの<code>ModularPipelineBlocks</code>サブクラスを、Hubへのアップロード用にパッケージ化します。Pythonファイルを読み取り、ASTスキャンによって<code>ModularPipelineBlocks</code>またはその複合サブクラス(<code>SequentialPipelineBlocks</code>、<code>AutoPipelineBlocks</code>、<code>ConditionalPipelineBlocks</code>、<code>LoopSequentialPipelineBlocks</code>)を継承するクラスを検索し、選択されたクラスをインスタンス化して、現在の作業ディレクトリで<code>save_pretrained</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> コピーしました</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>ブロッククラスは、引数なしでインスタンス化可能である必要があります。デフォルト値は<code>__init__</code>内でハードコードするか、呼び出し時にパイプラインの<code>state</code>から設定を読み取ります。</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>このコマンドは非推奨となり、将来のバージョンで削除されます。</p></blockquote> <p>Hub上のチェックポイントを<code>.safetensors</code>形式のfp16に変換し、結果をプッシュします。リポジトリの重みのサイズを縮小して読み込みを高速化するために有用です。正確な引数については<code>diffusers-cli fp16_safetensors --help</code>を参照してください。</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><!---->スキル<!----></span></h2><!--]--><!----> <p>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> コピーしました</div><!----></button><!----></div> <pre class="language-bash "><!----><span class="hljs-comment"># Install a single skill</span>
diffusers-cli skills add <span class="hljs-string">&quot;&lt;skill name&gt;&quot;</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&#x27;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>ターゲットフラグを指定しない場合、CLIは起動元のエージェントに対して、または特定できない場合はすべてのエージェントに対してインストールを行います。Claude Codeには<code>.claude/skills/diffusers/</code>の下にプラグインバンドルが配置され(<code>/diffusers:&lt;skill name></code>として名前空間化されます)、CodexとCursorには<code>.agents/skills/&lt;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:
66.6 kB
·
Xet hash:
3c074c7e8f5cadb9e4c056c9142a0e16ec07c50c787c52af1bb832f487ba4b48

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