Buckets:

HuggingFaceDocBuilder's picture
download
raw
51.3 kB
<meta charset="utf-8" /><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;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/entry/start.Bqlzoo7k.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/nplVfhAp.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/wvPyzM3A.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/entry/app.D3UEgfuk.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/T1rQByR4.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/C1r7BcyV.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/DsnmJJEf.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/BeYo49jn.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/nodes/0.Cg4Qo2QW.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/nodes/2.qVXZGRsu.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/BNXJmYHe.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;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: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"><div 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>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>Command line interface</span></h1><!--]--><!----> <p><code>diffusers-cli</code> is a command line client for running, inspecting, and packaging Diffusers pipelines.</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>Available commands</span></h2><!--]--><!----> <table><thead><tr><th>Command</th><th>Purpose</th></tr></thead><tbody><tr><td><a href="#env"><code>env</code></a></td><td>Print environment info for bug reports.</td></tr><tr><td><a href="#schema"><code>schema</code></a></td><td>Inspect a pipeline’s <code>__call__</code> signature without downloading weights.</td></tr><tr><td><a href="#run"><code>run</code></a></td><td>Run a pipeline locally or in a Hugging Face Sandbox.</td></tr><tr><td><a href="#custom_blocks"><code>custom_blocks</code></a></td><td>Package a local <code>ModularPipelineBlocks</code> subclass for the Hub.</td></tr><tr><td><a href="#fp16_safetensors"><code>fp16_safetensors</code></a></td><td>Convert a checkpoint to fp16 <code>.safetensors</code>.</td></tr><tr><td><a href="#skills"><code>skills</code></a></td><td>Install pre-authored skill bundles into your AI coding agent.</td></tr></tbody></table> <blockquote class="tip"><p>This page does not provide details for all options under each subcommand. For the full, always-current list of options for any subcommand, run <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>Prints Python/PyTorch/Diffusers versions, CUDA info, and installed optional deps. Use it when opening an
issue so maintainers can reproduce your setup.</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> Copied</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>Returns the pipeline’s accepted inputs without downloading weights. This is useful when building <code>--pipeline-kwargs</code></p> <p>Only the index file is fetched. Standard pipelines read <code>model_index.json</code>; modular pipelines read <code>modular_model_index.json</code>; custom-block repos read <code>modular_config.json</code> and need <code>--trust-remote-code</code> since
loading them runs code from the 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> Copied</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>Run a pipeline end-to-end. Auto-detects standard vs modular repos, auto-loads media inputs from URLs or local
paths, saves outputs by detecting the pipeline’s return type, and can run remotely on a Hugging Face
Sandbox via <code>--remote</code>.</p> <p>Minimal example:</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> Copied</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>Passing pipeline arguments</span></h3><!--]--><!----> <p><code>--pipeline-kwargs</code> takes a JSON object that’s forwarded to <code>pipeline(**kwargs)</code>. String values at known
media-input keys are auto-loaded:</p> <ul><li>Images (<code>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>Videos (<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> Copied</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>Both media keys and text keys accept a JSON array to run a batch through a single pipeline call. Each entry
in a media list is loaded individually (URL, local path, or bucket-mount path), and diffusers processes the
whole list in one forward pass on the 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> Copied</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>Loading</span></h3><!--]--><!----> <p>Configure how the CLI loads model weights and custom pipeline code.</p> <ul><li><p><code>--dtype {auto, bfloat16, bf16, float16, fp16, float32, fp32}</code> — weight dtype.</p></li> <li><p><code>--device-map &lt;value></code> — component placement. Accepts a torch device string (<code>cuda</code>, <code>cuda:0</code>, <code>cpu</code>, <code>mps</code>), <code>balanced</code> (auto-splits components across visible GPUs), or a JSON dict for explicit per-component placement.
Auto-detected if omitted. See <a href="../training/distributed_inference#device_map">device_map</a> for more details</p></li> <li><p><code>--variant fp16</code> — pick a weight variant.</p></li> <li><p><code>--revision &lt;sha></code> — pin a specific model revision.</p></li> <li><p><code>--trust-remote-code</code> — allow custom code from the Hub (required for repos that ship custom pipeline classes
or modular blocks). See <a href="../using-diffusers/custom_pipeline_overview">Community pipelines</a> for standard custom
pipelines and <a href="../modular_diffusers/overview">Modular Diffusers</a>.</p></li> <li><p><code>--lora &lt;spec></code> — attach a LoRA adapter after loading. Each value is a JSON dict; repeat the flag to
stack multiple adapters. <code>lora_id</code> is required per entry; <code>lora_scale</code> defaults to <code>1.0</code>; <code>adapter_name</code> is optional (auto-generated as <code>lora_&lt;i></code> when stacking).</p> <ul><li>Single: <code>--lora '{"lora_id": "alvdansen/flux-koda", "lora_scale": 0.8}'</code></li> <li>Multiple: <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>All specs are loaded by <code>pipeline.load_lora_weights(...)</code>, then activated together with a single <code>pipeline.set_adapters(names, adapter_weights=scales)</code> call. See <a href="../tutorials/using_peft_for_inference">LoRA</a> for a deeper walkthrough of adapter stacking, scale scheduling, and hotswapping.</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>Optimizations</span></h3><!--]--><!----> <ul><li><code>--cpu-offload {model, group}</code><code>model</code> calls <code>enable_model_cpu_offload</code>; <code>group</code> calls <code>enable_group_offload(offload_type="leaf_level", use_stream=True)</code>. Onload target comes from <code>--device-map</code> (which must be a plain device string for offload). See <a href="../optimization/memory#model-offloading">Model offloading</a> and <a href="../optimization/memory#group-offloading">Group offloading</a>.</li> <li><code>--attention-backend {default, flash_hub, flash_varlen_hub, flash_4_hub, sage_hub}</code> — Hub-hosted attention
kernels, auto-downloaded on first use. Transformer-based pipelines only; ignored with a warning on legacy UNet
pipelines. See <a href="../optimization/attention_backends">Attention backends</a>.</li> <li><code>--vae-tiling</code> / <code>--vae-slicing</code> — lower VAE decode VRAM. See <a href="../optimization/memory#vae-tiling">VAE tiling</a> and <a href="../optimization/memory#vae-slicing">VAE slicing</a>.</li> <li><code>--compile [JSON]</code> — compile denoiser modules with <a href="../optimization/fp16#torchcompile">torch.compile</a>. The
CLI prefers <a href="../optimization/fp16#regional-compilation">regional compilation</a> for modules with repeated
blocks. Bare <code>--compile</code> uses <code>fullgraph=true</code>. A JSON object is forwarded to <code>torch.compile</code>. Not supported
with <code>--context-parallel</code>.</li> <li><code>--context-parallel</code> — Ulysses-style context parallelism on a DiT-based pipeline. Locally requires torchrun;
under <code>--remote</code> the CLI wraps <code>torchrun --nproc-per-node=gpu</code> for you. See <a href="../training/distributed_inference#context-parallelism">Context parallelism</a>.</li></ul> <!--[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>Outputs</span></h3><!--]--><!----> <p><code>run</code> detects the pipeline output type:</p> <ul><li><code>PIL.Image</code>/list → <code>&lt;NNNN>.png</code> (zero-padded index, e.g. <code>0000.png</code>)</li> <li>Image sequence → <code>0000.mp4</code> (<code>--fps</code> controls framerate, default 8)</li> <li>Audio array → <code>0000.wav</code> (<code>--sampling-rate</code> controls rate)</li> <li>Anything else → JSON dump</li></ul> <p>The default output directory format is <code>~/.diffusers/cli/run/outputs/diffusers-run-&lt;YYYYMMDDTHHMMSS>-&lt;uuid>/</code>. Each
run gets its own subdirectory so consecutive invocations don’t overwrite.</p> <p>Override with <code>--output &lt;path></code>. How the path expands depends on its shape and the batch size:</p> <table><thead><tr><th><code>--output</code></th><th>1 output</th><th>N outputs</th></tr></thead><tbody><tr><td><em>omitted</em></td><td>default dir → <code>0000.png</code></td><td>default dir → <code>0000.png</code>, <code>0001.png</code>, <code>0002.png</code>, …</td></tr><tr><td><code>./results/</code> (trailing <code>/</code> or an existing directory)</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> (file path)</td><td><code>my-cat.png</code> (used verbatim)</td><td><code>my-cat-0000.png</code>, <code>my-cat-0001.png</code>, …</td></tr></tbody></table> <p>Directory outputs always use bare padded names (<code>0000</code>, <code>0001</code>, …). Explicit file paths preserve your chosen
stem and get the padded index appended when the batch produces multiple outputs.</p> <p>Use <code>--push-to</code> to upload outputs to a <a href="https://huggingface.co/docs/hub/en/storage-buckets" rel="nofollow">Hugging Face storage bucket</a>. Accepts an HF bucket
id (<code>&lt;namespace>/&lt;name></code>), an <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>, or a browser URL
for the same — a subpath is used as a folder prefix. The bucket is created if missing; objects land under <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> Copied</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>The table below describes remote runs. For local runs, <code>--push-to</code> uploads the locally saved output. It does
not suppress local file creation.</p> <table><thead><tr><th><code>--push-to</code> set?</th><th><code>--output</code> set?</th><th>Result</th></tr></thead><tbody><tr><td>no</td><td>no</td><td>download to default local dir</td></tr><tr><td>no</td><td>yes</td><td>download to <code>--output</code></td></tr><tr><td>yes</td><td>no</td><td>bucket only, no local download</td></tr><tr><td>yes</td><td>yes</td><td>bucket AND <code>--output</code></td></tr></tbody></table> <p><code>--format</code> shapes the stdout metadata (paths, timing, sandbox info) — it does not change the file format of
the media itself. Written images are always PNG, videos MP4, audio 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 execution ( --remote )</span></h3><!--]--><!----> <p>Run the same call inside a <a href="https://huggingface.co/docs/huggingface_hub/en/guides/sandbox" rel="nofollow">Hugging Face Sandbox</a> — an isolated cloud VM the CLI drives over HTTP: it uploads inputs, installs deps, runs the pipeline, downloads
outputs, then terminates the sandbox. Requires <code>huggingface_hub>=1.23</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> Copied</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>Remote flags:</p> <ul><li><code>--flavor &lt;name></code> — sandbox hardware (e.g. <code>a10g-small</code>, <code>h200</code>, <code>rtx-pro-6000</code>).</li> <li><code>--timeout &lt;duration></code> — max wallclock for the run command inside the sandbox (default <code>10m</code>).</li> <li><code>--dependencies &lt;pkg></code> — extra pip deps (repeatable). Useful for pinning a diffusers branch tarball or
adding pipeline-specific extras.</li> <li><code>--namespace &lt;name></code> — create the sandbox under a different HF org/account.</li> <li><code>--image &lt;ref></code> — override the sandbox image. Must ship torch + CUDA compatible with your <code>--flavor</code>’s
driver.</li> <li><code>--volume &lt;bucket-id>[:&lt;mount-path>]</code> — mount an <a href="https://huggingface.co/docs/hub/en/storage-buckets" rel="nofollow">HF storage bucket</a> into the sandbox as a read-write directory. Repeatable. Default mount path is <code>/mnt/buckets/&lt;bucket-id></code>. Reference mounted files from <code>--pipeline-kwargs</code> like any other local path.
Applied only on new sandbox creation — ignored when reconnecting via <code>--sandbox-id</code>.</li></ul> <p>By default each <code>--remote</code> run is ephemeral (create → run → download → kill). To reuse a warm sandbox across
runs — keeping deps, the model weight cache, and the <code>torch.compile</code> cache on its disk — keep it alive and
reconnect:</p> <ul><li><code>--keep-alive</code> — don’t terminate the sandbox after the run; its id is printed.</li> <li><code>--sandbox-id &lt;id></code> — reconnect to a kept-alive sandbox instead of creating a new one.</li> <li><code>--idle-timeout &lt;duration></code> — auto-shutdown after this much inactivity (default <code>10m</code>). Applied only on new sandbox creation — ignored when reconnecting 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> Copied</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>Package a local <code>ModularPipelineBlocks</code> subclass for upload to the Hub. Reads a Python file, AST-scans it for
subclasses of <code>ModularPipelineBlocks</code>, instantiates the chosen one, and calls <code>save_pretrained</code> in the current
working directory.</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> Copied</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 — hardcode 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><!--]--><!----> <p>Convert a checkpoint on the Hub to fp16 <code>.safetensors</code> and push the result. Useful for shrinking a repo’s
weight size for faster loading. See <code>diffusers-cli fp16_safetensors --help</code> for the exact args.</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>skills</span></h2><!--]--><!----> <p>Install skills from the diffusers repo (<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> Copied</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</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<!----></pre></div><!----> <a class="!text-gray-400 !no-underline text-sm flex items-center not-prose mt-4" href="https://github.com/huggingface/diffusers/blob/main/docs/source/en/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_1q81s3f = {
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.Bqlzoo7k.js"),
import("/docs/diffusers/main/en/_app/immutable/entry/app.D3UEgfuk.js")
]).then(([kit, app]) => {
kit.start(app, element, {
node_ids: [0, 2],
data: [null,null],
form: null,
error: null
});
});
}
</script>

Xet Storage Details

Size:
51.3 kB
·
Xet hash:
7d68dd3662f1c69bad1e665b4873c20a0b0523a439ff67c82c6f6cdb71b66775

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