Buckets:
| import"../chunks/DsnmJJEf.js";import{i as re,h as le,C as de,H as f,D as t,E as pe,s as ce,a as l}from"../chunks/BtE7mKSK.js";import{p as me,o as fe,s as e,f as c,a as d,b as ue,c as s,d as u,r,n as he}from"../chunks/jDjavuwI.js";import{E as p}from"../chunks/SrSJA0zO.js";const ge='{"title":"AutoPipeline","local":"autopipeline","sections":[{"title":"AutoPipelineForText2Image","local":"diffusers.AutoPipelineForText2Image","sections":[],"depth":2},{"title":"AutoPipelineForImage2Image","local":"diffusers.AutoPipelineForImage2Image","sections":[],"depth":2},{"title":"AutoPipelineForInpainting","local":"diffusers.AutoPipelineForInpainting","sections":[],"depth":2},{"title":"AutoPipelineForText2Audio","local":"diffusers.AutoPipelineForText2Audio","sections":[],"depth":2}],"depth":1}';var _e=u('<meta name="hf:doc:metadata"/>'),T=u("<p>If you get the error message below, you need to finetune the weights for your downstream task:</p> <!>",1),m=u("<p>Examples:</p> <!>",1),ye=u(`<p></p> <!> <!> <p>The <code>AutoPipeline</code> is designed to make it easy to load a checkpoint for a task without needing to know the specific pipeline class. Based on the task, the <code>AutoPipeline</code> automatically retrieves the correct pipeline class from the checkpoint <code>model_index.json</code> file.</p> <blockquote class="tip"><p>Check out the <a href="../../tutorials/autopipeline">AutoPipeline</a> tutorial to learn how to use this API!</p></blockquote> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p><a href="/docs/diffusers/pr_14192/en/api/pipelines/auto_pipeline#diffusers.AutoPipelineForText2Image">AutoPipelineForText2Image</a> is a generic pipeline class that instantiates a text-to-image pipeline class. The | |
| specific underlying pipeline class is automatically selected from either the <a href="/docs/diffusers/pr_14192/en/api/pipelines/auto_pipeline#diffusers.AutoPipelineForText2Image.from_pretrained">from_pretrained()</a> or <a href="/docs/diffusers/pr_14192/en/api/pipelines/auto_pipeline#diffusers.AutoPipelineForText2Image.from_pipe">from_pipe()</a> methods.</p> <p>This class cannot be instantiated using <code>__init__()</code> (throws an error).</p> <p>Class attributes:</p> <ul><li><strong>config_name</strong> (<code>str</code>) — The configuration filename that stores the class and module names of all the | |
| diffusion pipeline’s components.</li></ul> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Instantiates a text-to-image Pytorch diffusion pipeline from pretrained pipeline weight.</p> <p>The from_pretrained() method takes care of returning the correct pipeline class instance by:</p> <ol><li>Detect the pipeline class of the pretrained_model_or_path based on the _class_name property of its | |
| config object</li> <li>Find the text-to-image pipeline linked to the pipeline class using pattern matching on pipeline class | |
| name.</li></ol> <p>If a <code>controlnet</code> argument is passed, it will instantiate a <a href="/docs/diffusers/pr_14192/en/api/pipelines/controlnet#diffusers.StableDiffusionControlNetPipeline">StableDiffusionControlNetPipeline</a> object.</p> <p>The pipeline is set in evaluation mode (<code>model.eval()</code>) by default.</p> <!> <blockquote class="tip"><p>> To use private or <a href="https://huggingface.co/docs/hub/models-gated#gated-models" rel="nofollow">gated</a> models, log-in | |
| with <code>hf > auth login</code>.</p></blockquote> <!></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Instantiates a text-to-image Pytorch diffusion pipeline from another instantiated diffusion pipeline class.</p> <p>The from_pipe() method takes care of returning the correct pipeline class instance by finding the text-to-image | |
| pipeline linked to the pipeline class using pattern matching on pipeline class name.</p> <p>All the modules the pipeline contains will be used to initialize the new pipeline without reallocating | |
| additional memory.</p> <p>The pipeline is set in evaluation mode (<code>model.eval()</code>) by default.</p> <!></div></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p><a href="/docs/diffusers/pr_14192/en/api/pipelines/auto_pipeline#diffusers.AutoPipelineForImage2Image">AutoPipelineForImage2Image</a> is a generic pipeline class that instantiates an image-to-image pipeline class. The | |
| specific underlying pipeline class is automatically selected from either the <a href="/docs/diffusers/pr_14192/en/api/pipelines/auto_pipeline#diffusers.AutoPipelineForImage2Image.from_pretrained">from_pretrained()</a> or <a href="/docs/diffusers/pr_14192/en/api/pipelines/auto_pipeline#diffusers.AutoPipelineForImage2Image.from_pipe">from_pipe()</a> methods.</p> <p>This class cannot be instantiated using <code>__init__()</code> (throws an error).</p> <p>Class attributes:</p> <ul><li><strong>config_name</strong> (<code>str</code>) — The configuration filename that stores the class and module names of all the | |
| diffusion pipeline’s components.</li></ul> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Instantiates a image-to-image Pytorch diffusion pipeline from pretrained pipeline weight.</p> <p>The from_pretrained() method takes care of returning the correct pipeline class instance by:</p> <ol><li>Detect the pipeline class of the pretrained_model_or_path based on the _class_name property of its | |
| config object</li> <li>Find the image-to-image pipeline linked to the pipeline class using pattern matching on pipeline class | |
| name.</li></ol> <p>If a <code>controlnet</code> argument is passed, it will instantiate a <a href="/docs/diffusers/pr_14192/en/api/pipelines/controlnet#diffusers.StableDiffusionControlNetImg2ImgPipeline">StableDiffusionControlNetImg2ImgPipeline</a> object.</p> <p>The pipeline is set in evaluation mode (<code>model.eval()</code>) by default.</p> <!> <blockquote class="tip"><p>> To use private or <a href="https://huggingface.co/docs/hub/models-gated#gated-models" rel="nofollow">gated</a> models, log-in | |
| with <code>hf > auth login</code>.</p></blockquote> <!></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Instantiates a image-to-image Pytorch diffusion pipeline from another instantiated diffusion pipeline class.</p> <p>The from_pipe() method takes care of returning the correct pipeline class instance by finding the | |
| image-to-image pipeline linked to the pipeline class using pattern matching on pipeline class name.</p> <p>All the modules the pipeline contains will be used to initialize the new pipeline without reallocating | |
| additional memory.</p> <p>The pipeline is set in evaluation mode (<code>model.eval()</code>) by default.</p> <!></div></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p><a href="/docs/diffusers/pr_14192/en/api/pipelines/auto_pipeline#diffusers.AutoPipelineForInpainting">AutoPipelineForInpainting</a> is a generic pipeline class that instantiates an inpainting pipeline class. The | |
| specific underlying pipeline class is automatically selected from either the <a href="/docs/diffusers/pr_14192/en/api/pipelines/auto_pipeline#diffusers.AutoPipelineForInpainting.from_pretrained">from_pretrained()</a> or <a href="/docs/diffusers/pr_14192/en/api/pipelines/auto_pipeline#diffusers.AutoPipelineForInpainting.from_pipe">from_pipe()</a> methods.</p> <p>This class cannot be instantiated using <code>__init__()</code> (throws an error).</p> <p>Class attributes:</p> <ul><li><strong>config_name</strong> (<code>str</code>) — The configuration filename that stores the class and module names of all the | |
| diffusion pipeline’s components.</li></ul> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Instantiates a inpainting Pytorch diffusion pipeline from pretrained pipeline weight.</p> <p>The from_pretrained() method takes care of returning the correct pipeline class instance by:</p> <ol><li>Detect the pipeline class of the pretrained_model_or_path based on the _class_name property of its | |
| config object</li> <li>Find the inpainting pipeline linked to the pipeline class using pattern matching on pipeline class name.</li></ol> <p>If a <code>controlnet</code> argument is passed, it will instantiate a <a href="/docs/diffusers/pr_14192/en/api/pipelines/controlnet#diffusers.StableDiffusionControlNetInpaintPipeline">StableDiffusionControlNetInpaintPipeline</a> object.</p> <p>The pipeline is set in evaluation mode (<code>model.eval()</code>) by default.</p> <!> <blockquote class="tip"><p>> To use private or <a href="https://huggingface.co/docs/hub/models-gated#gated-models" rel="nofollow">gated</a> models, log-in | |
| with <code>hf > auth login</code>.</p></blockquote> <!></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Instantiates a inpainting Pytorch diffusion pipeline from another instantiated diffusion pipeline class.</p> <p>The from_pipe() method takes care of returning the correct pipeline class instance by finding the inpainting | |
| pipeline linked to the pipeline class using pattern matching on pipeline class name.</p> <p>All the modules the pipeline class contain will be used to initialize the new pipeline without reallocating | |
| additional memory.</p> <p>The pipeline is set in evaluation mode (<code>model.eval()</code>) by default.</p> <!></div></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p><a href="/docs/diffusers/pr_14192/en/api/pipelines/auto_pipeline#diffusers.AutoPipelineForText2Audio">AutoPipelineForText2Audio</a> is a generic pipeline class that instantiates a text-to-audio pipeline class. The | |
| specific underlying pipeline class is automatically selected from either the <a href="/docs/diffusers/pr_14192/en/api/pipelines/auto_pipeline#diffusers.AutoPipelineForText2Audio.from_pretrained">from_pretrained()</a> or <a href="/docs/diffusers/pr_14192/en/api/pipelines/auto_pipeline#diffusers.AutoPipelineForText2Audio.from_pipe">from_pipe()</a> methods.</p> <p>This class cannot be instantiated using <code>__init__()</code> (throws an error).</p> <p>Class attributes:</p> <ul><li><strong>config_name</strong> (<code>str</code>) — The configuration filename that stores the class and module names of all the | |
| diffusion pipeline’s components.</li></ul> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Instantiates a text-to-audio Pytorch diffusion pipeline from pretrained pipeline weight.</p> <p>The from_pretrained() method takes care of returning the correct pipeline class instance by:</p> <ol><li>Detect the pipeline class of the pretrained_model_or_path based on the _class_name property of its | |
| config object</li> <li>Find the text-to-audio pipeline linked to the pipeline class using pattern matching on pipeline class | |
| name.</li></ol> <p>The pipeline is set in evaluation mode (<code>model.eval()</code>) by default.</p> <blockquote class="tip"><p>> To use private or <a href="https://huggingface.co/docs/hub/models-gated#gated-models" rel="nofollow">gated</a> models, log-in | |
| with <code>hf > auth login</code>.</p></blockquote> <!></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Instantiates a text-to-audio Pytorch diffusion pipeline from another instantiated diffusion pipeline class.</p> <p>The from_pipe() method takes care of returning the correct pipeline class instance by finding the text-to-audio | |
| pipeline linked to the pipeline class using pattern matching on pipeline class name.</p> <p>All the modules the pipeline contains will be used to initialize the new pipeline without reallocating | |
| additional memory.</p> <p>The pipeline is set in evaluation mode (<code>model.eval()</code>) by default.</p> <!></div></div> <!> <p></p>`,1);function Te(L,$){me($,!1),fe(()=>{new URLSearchParams(window.location.search).get("fw")}),re();var x=ye();le("ne1bpu",i=>{var n=_e();ce(n,"content",ge),d(i,n)});var I=e(c(x),2);de(I,{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"});var U=e(I,2);f(U,{title:"AutoPipeline",local:"autopipeline",headingTag:"h1"});var j=e(U,6);f(j,{title:"AutoPipelineForText2Image",local:"diffusers.AutoPipelineForText2Image",headingTag:"h2"});var h=e(j,2),F=s(h);t(F,{name:"class diffusers.AutoPipelineForText2Image",anchor:"diffusers.AutoPipelineForText2Image",source:"https://github.com/huggingface/diffusers/blob/vr_14192/src/diffusers/pipelines/auto_pipeline.py#L371",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}]});var g=e(F,10),k=s(g);t(k,{name:"from_pretrained",anchor:"diffusers.AutoPipelineForText2Image.from_pretrained",source:"https://github.com/huggingface/diffusers/blob/vr_14192/src/diffusers/pipelines/auto_pipeline.py#L396",parameters:[{name:"pretrained_model_or_path",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.AutoPipelineForText2Image.from_pretrained.pretrained_model_or_path",description:`<strong>pretrained_model_or_path</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) — | |
| Can be either:</p> | |
| <ul> | |
| <li>A string, the <em>repo id</em> (for example <code>CompVis/ldm-text2im-large-256</code>) of a pretrained pipeline | |
| hosted on the Hub.</li> | |
| <li>A path to a <em>directory</em> (for example <code>./my_pipeline_directory/</code>) containing pipeline weights | |
| saved using | |
| <a href="/docs/diffusers/pr_14192/en/api/pipelines/overview#diffusers.DiffusionPipeline.save_pretrained">save_pretrained()</a>.</li> | |
| </ul>`,name:"pretrained_model_or_path"},{anchor:"diffusers.AutoPipelineForText2Image.from_pretrained.dtype",description:`<strong>dtype</strong> (<code>torch.dtype</code>, <em>optional</em>) — | |
| Override the default <code>torch.dtype</code> and load the model with another dtype.`,name:"dtype"},{anchor:"diffusers.AutoPipelineForText2Image.from_pretrained.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether or not to force the (re-)download of the model weights and configuration files, overriding the | |
| cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.AutoPipelineForText2Image.from_pretrained.cache_dir",description:`<strong>cache_dir</strong> (<code>str | os.PathLike</code>, <em>optional</em>) — | |
| Path to a directory where a downloaded pretrained model configuration is cached if the standard cache | |
| is not used.`,name:"cache_dir"},{anchor:"diffusers.AutoPipelineForText2Image.from_pretrained.proxies",description:`<strong>proxies</strong> (<code>dict[str, str]</code>, <em>optional</em>) — | |
| A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{'http': 'foo.bar:3128', 'http://hostname': 'foo.bar:4012'}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.AutoPipelineForText2Image.from_pretrained.output_loading_info(bool,",description:`<strong>output_loading_info(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) — | |
| Whether or not to also return a dictionary containing missing keys, unexpected keys and error messages.`,name:"output_loading_info(bool,"},{anchor:"diffusers.AutoPipelineForText2Image.from_pretrained.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model | |
| won’t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.AutoPipelineForText2Image.from_pretrained.token",description:`<strong>token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) — | |
| The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from | |
| <code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"token"},{anchor:"diffusers.AutoPipelineForText2Image.from_pretrained.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"main"</code>) — | |
| The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier | |
| allowed by Git.`,name:"revision"},{anchor:"diffusers.AutoPipelineForText2Image.from_pretrained.custom_revision",description:`<strong>custom_revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"main"</code>) — | |
| The specific model version to use. It can be a branch name, a tag name, or a commit id similar to | |
| <code>revision</code> when loading a custom pipeline from the Hub. It can be a 🤗 Diffusers version when loading a | |
| custom pipeline from GitHub, otherwise it defaults to <code>"main"</code> when loading from the Hub.`,name:"custom_revision"},{anchor:"diffusers.AutoPipelineForText2Image.from_pretrained.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) — | |
| Mirror source to resolve accessibility issues if you’re downloading a model in China. We do not | |
| guarantee the timeliness or safety of the source, and you should refer to the mirror site for more | |
| information.`,name:"mirror"},{anchor:"diffusers.AutoPipelineForText2Image.from_pretrained.device_map",description:`<strong>device_map</strong> (<code>str</code> or <code>dict[str, int | str | torch.device]</code>, <em>optional</em>) — | |
| A map that specifies where each submodule should go. It doesn’t need to be defined for each | |
| parameter/buffer name; once a given module name is inside, every submodule of it will be sent to the | |
| same device.</p> | |
| <p>Set <code>device_map="auto"</code> to have 🤗 Accelerate automatically compute the most optimized <code>device_map</code>. For | |
| more information about each option see <a href="https://hf.co/docs/accelerate/main/en/usage_guides/big_modeling#designing-a-device-map" rel="nofollow">designing a device | |
| map</a>.`,name:"device_map"},{anchor:"diffusers.AutoPipelineForText2Image.from_pretrained.max_memory",description:`<strong>max_memory</strong> (<code>Dict</code>, <em>optional</em>) — | |
| A dictionary device identifier for the maximum memory. Will default to the maximum memory available for | |
| each GPU and the available CPU RAM if unset.`,name:"max_memory"},{anchor:"diffusers.AutoPipelineForText2Image.from_pretrained.offload_folder",description:`<strong>offload_folder</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) — | |
| The path to offload weights if device_map contains the value <code>"disk"</code>.`,name:"offload_folder"},{anchor:"diffusers.AutoPipelineForText2Image.from_pretrained.offload_state_dict",description:`<strong>offload_state_dict</strong> (<code>bool</code>, <em>optional</em>) — | |
| If <code>True</code>, temporarily offloads the CPU state dict to the hard drive to avoid running out of CPU RAM if | |
| the weight of the CPU state dict + the biggest shard of the checkpoint does not fit. Defaults to <code>True</code> | |
| when there is some disk offload.`,name:"offload_state_dict"},{anchor:"diffusers.AutoPipelineForText2Image.from_pretrained.low_cpu_mem_usage",description:`<strong>low_cpu_mem_usage</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code> if torch version >= 1.9.0 else <code>False</code>) — | |
| Speed up model loading only loading the pretrained weights and not initializing the weights. This also | |
| tries to not use more than 1x model size in CPU memory (including peak memory) while loading the model. | |
| Only supported for PyTorch >= 1.9.0. If you are using an older version of PyTorch, setting this | |
| argument to <code>True</code> will raise an error.`,name:"low_cpu_mem_usage"},{anchor:"diffusers.AutoPipelineForText2Image.from_pretrained.use_safetensors",description:`<strong>use_safetensors</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) — | |
| If set to <code>None</code>, the safetensors weights are downloaded if they’re available <strong>and</strong> if the | |
| safetensors library is installed. If set to <code>True</code>, the model is forcibly loaded from safetensors | |
| weights. If set to <code>False</code>, safetensors weights are not loaded.`,name:"use_safetensors"},{anchor:"diffusers.AutoPipelineForText2Image.from_pretrained.kwargs",description:`<strong>kwargs</strong> (remaining dictionary of keyword arguments, <em>optional</em>) — | |
| Can be used to overwrite load and saveable variables (the pipeline components of the specific pipeline | |
| class). The overwritten components are passed directly to the pipelines <code>__init__</code> method. See example | |
| below for more information.`,name:"kwargs"},{anchor:"diffusers.AutoPipelineForText2Image.from_pretrained.variant",description:`<strong>variant</strong> (<code>str</code>, <em>optional</em>) — | |
| Load weights from a specified variant filename such as <code>"fp16"</code> or <code>"ema"</code>. This is ignored when | |
| loading <code>from_flax</code>.`,name:"variant"}]});var A=e(k,12);p(A,{anchor:"diffusers.AutoPipelineForText2Image.from_pretrained.example",children:(i,n)=>{var o=T(),a=e(c(o),2);l(a,{code:"U29tZSUyMHdlaWdodHMlMjBvZiUyMFVOZXQyRENvbmRpdGlvbk1vZGVsJTIwd2VyZSUyMG5vdCUyMGluaXRpYWxpemVkJTIwZnJvbSUyMHRoZSUyMG1vZGVsJTIwY2hlY2twb2ludCUyMGF0JTIwc3RhYmxlLWRpZmZ1c2lvbi12MS01JTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIwYW5kJTIwYXJlJTIwbmV3bHklMjBpbml0aWFsaXplZCUyMGJlY2F1c2UlMjB0aGUlMjBzaGFwZXMlMjBkaWQlMjBub3QlMjBtYXRjaCUzQSUwQS0lMjBjb252X2luLndlaWdodCUzQSUyMGZvdW5kJTIwc2hhcGUlMjB0b3JjaC5TaXplKCU1QjMyMCUyQyUyMDQlMkMlMjAzJTJDJTIwMyU1RCklMjBpbiUyMHRoZSUyMGNoZWNrcG9pbnQlMjBhbmQlMjB0b3JjaC5TaXplKCU1QjMyMCUyQyUyMDklMkMlMjAzJTJDJTIwMyU1RCklMjBpbiUyMHRoZSUyMG1vZGVsJTIwaW5zdGFudGlhdGVkJTBBWW91JTIwc2hvdWxkJTIwcHJvYmFibHklMjBUUkFJTiUyMHRoaXMlMjBtb2RlbCUyMG9uJTIwYSUyMGRvd24tc3RyZWFtJTIwdGFzayUyMHRvJTIwYmUlMjBhYmxlJTIwdG8lMjB1c2UlMjBpdCUyMGZvciUyMHByZWRpY3Rpb25zJTIwYW5kJTIwaW5mZXJlbmNlLg==",highlighted:`Some weights of UNet2DConditionModel were not initialized from the model checkpoint <span class="hljs-built_in">at</span> stable-<span class="hljs-keyword">diffusion-v1-5/stable-diffusion-v1-5 </span><span class="hljs-keyword">and </span>are newly initialized <span class="hljs-keyword">because </span>the <span class="hljs-keyword">shapes </span><span class="hljs-keyword">did </span>not match: | |
| - conv_in.weight: found <span class="hljs-keyword">shape </span>torch.Size([<span class="hljs-number">320</span>, <span class="hljs-number">4</span>, <span class="hljs-number">3</span>, <span class="hljs-number">3</span>]) in the checkpoint <span class="hljs-keyword">and </span>torch.Size([<span class="hljs-number">320</span>, <span class="hljs-number">9</span>, <span class="hljs-number">3</span>, <span class="hljs-number">3</span>]) in the model <span class="hljs-keyword">instantiated | |
| </span>You <span class="hljs-keyword">should </span>probably TRAIN this model on a down-stream task to <span class="hljs-keyword">be </span>able to use it for predictions <span class="hljs-keyword">and </span>inference.`,lang:"",wrap:!1}),d(i,o)},$$slots:{default:!0}});var K=e(A,4);p(K,{anchor:"diffusers.AutoPipelineForText2Image.from_pretrained.example-2",children:(i,n)=>{var o=m(),a=e(c(o),2);l(a,{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9QaXBlbGluZUZvclRleHQySW1hZ2UlMEElMEFwaXBlbGluZSUyMCUzRCUyMEF1dG9QaXBlbGluZUZvclRleHQySW1hZ2UuZnJvbV9wcmV0cmFpbmVkKCUyMnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyMiklMEFpbWFnZSUyMCUzRCUyMHBpcGVsaW5lKHByb21wdCkuaW1hZ2VzJTVCMCU1RA==",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoPipelineForText2Image | |
| <span class="hljs-meta">>>> </span>pipeline = AutoPipelineForText2Image.from_pretrained(<span class="hljs-string">"stable-diffusion-v1-5/stable-diffusion-v1-5"</span>) | |
| <span class="hljs-meta">>>> </span>image = pipeline(prompt).images[<span class="hljs-number">0</span>]`,lang:"py",wrap:!1}),d(i,o)},$$slots:{default:!0}}),r(g);var J=e(g,2),P=s(J);t(P,{name:"from_pipe",anchor:"diffusers.AutoPipelineForText2Image.from_pipe",source:"https://github.com/huggingface/diffusers/blob/vr_14192/src/diffusers/pipelines/auto_pipeline.py#L544",parameters:[{name:"pipeline",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.AutoPipelineForText2Image.from_pipe.pipeline",description:`<strong>pipeline</strong> (<code>DiffusionPipeline</code>) — | |
| an instantiated <code>DiffusionPipeline</code> object`,name:"pipeline"}]});var O=e(P,10);p(O,{anchor:"diffusers.AutoPipelineForText2Image.from_pipe.example",children:(i,n)=>{l(i,{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9QaXBlbGluZUZvclRleHQySW1hZ2UlMkMlMjBBdXRvUGlwZWxpbmVGb3JJbWFnZTJJbWFnZSUwQSUwQXBpcGVfaTJpJTIwJTNEJTIwQXV0b1BpcGVsaW5lRm9ySW1hZ2UySW1hZ2UuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyMiUyQyUyMHJlcXVpcmVzX3NhZmV0eV9jaGVja2VyJTNERmFsc2UlMEEpJTBBJTBBcGlwZV90MmklMjAlM0QlMjBBdXRvUGlwZWxpbmVGb3JUZXh0MkltYWdlLmZyb21fcGlwZShwaXBlX2kyaSklMEFpbWFnZSUyMCUzRCUyMHBpcGVfdDJpKHByb21wdCkuaW1hZ2VzJTVCMCU1RA==",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoPipelineForText2Image, AutoPipelineForImage2Image | |
| <span class="hljs-meta">>>> </span>pipe_i2i = AutoPipelineForImage2Image.from_pretrained( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"stable-diffusion-v1-5/stable-diffusion-v1-5"</span>, requires_safety_checker=<span class="hljs-literal">False</span> | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>pipe_t2i = AutoPipelineForText2Image.from_pipe(pipe_i2i) | |
| <span class="hljs-meta">>>> </span>image = pipe_t2i(prompt).images[<span class="hljs-number">0</span>]`,lang:"py",wrap:!1})},$$slots:{default:!0}}),r(J),r(h);var Z=e(h,2);f(Z,{title:"AutoPipelineForImage2Image",local:"diffusers.AutoPipelineForImage2Image",headingTag:"h2"});var _=e(Z,2),G=s(_);t(G,{name:"class diffusers.AutoPipelineForImage2Image",anchor:"diffusers.AutoPipelineForImage2Image",source:"https://github.com/huggingface/diffusers/blob/vr_14192/src/diffusers/pipelines/auto_pipeline.py#L661",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}]});var y=e(G,10),W=s(y);t(W,{name:"from_pretrained",anchor:"diffusers.AutoPipelineForImage2Image.from_pretrained",source:"https://github.com/huggingface/diffusers/blob/vr_14192/src/diffusers/pipelines/auto_pipeline.py#L686",parameters:[{name:"pretrained_model_or_path",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.AutoPipelineForImage2Image.from_pretrained.pretrained_model_or_path",description:`<strong>pretrained_model_or_path</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) — | |
| Can be either:</p> | |
| <ul> | |
| <li>A string, the <em>repo id</em> (for example <code>CompVis/ldm-text2im-large-256</code>) of a pretrained pipeline | |
| hosted on the Hub.</li> | |
| <li>A path to a <em>directory</em> (for example <code>./my_pipeline_directory/</code>) containing pipeline weights | |
| saved using | |
| <a href="/docs/diffusers/pr_14192/en/api/pipelines/overview#diffusers.DiffusionPipeline.save_pretrained">save_pretrained()</a>.</li> | |
| </ul>`,name:"pretrained_model_or_path"},{anchor:"diffusers.AutoPipelineForImage2Image.from_pretrained.dtype",description:`<strong>dtype</strong> (<code>str</code> or <code>torch.dtype</code>, <em>optional</em>) — | |
| Override the default <code>torch.dtype</code> and load the model with another dtype.`,name:"dtype"},{anchor:"diffusers.AutoPipelineForImage2Image.from_pretrained.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether or not to force the (re-)download of the model weights and configuration files, overriding the | |
| cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.AutoPipelineForImage2Image.from_pretrained.cache_dir",description:`<strong>cache_dir</strong> (<code>str | os.PathLike</code>, <em>optional</em>) — | |
| Path to a directory where a downloaded pretrained model configuration is cached if the standard cache | |
| is not used.`,name:"cache_dir"},{anchor:"diffusers.AutoPipelineForImage2Image.from_pretrained.proxies",description:`<strong>proxies</strong> (<code>dict[str, str]</code>, <em>optional</em>) — | |
| A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{'http': 'foo.bar:3128', 'http://hostname': 'foo.bar:4012'}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.AutoPipelineForImage2Image.from_pretrained.output_loading_info(bool,",description:`<strong>output_loading_info(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) — | |
| Whether or not to also return a dictionary containing missing keys, unexpected keys and error messages.`,name:"output_loading_info(bool,"},{anchor:"diffusers.AutoPipelineForImage2Image.from_pretrained.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model | |
| won’t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.AutoPipelineForImage2Image.from_pretrained.token",description:`<strong>token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) — | |
| The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from | |
| <code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"token"},{anchor:"diffusers.AutoPipelineForImage2Image.from_pretrained.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"main"</code>) — | |
| The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier | |
| allowed by Git.`,name:"revision"},{anchor:"diffusers.AutoPipelineForImage2Image.from_pretrained.custom_revision",description:`<strong>custom_revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"main"</code>) — | |
| The specific model version to use. It can be a branch name, a tag name, or a commit id similar to | |
| <code>revision</code> when loading a custom pipeline from the Hub. It can be a 🤗 Diffusers version when loading a | |
| custom pipeline from GitHub, otherwise it defaults to <code>"main"</code> when loading from the Hub.`,name:"custom_revision"},{anchor:"diffusers.AutoPipelineForImage2Image.from_pretrained.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) — | |
| Mirror source to resolve accessibility issues if you’re downloading a model in China. We do not | |
| guarantee the timeliness or safety of the source, and you should refer to the mirror site for more | |
| information.`,name:"mirror"},{anchor:"diffusers.AutoPipelineForImage2Image.from_pretrained.device_map",description:`<strong>device_map</strong> (<code>str</code> or <code>dict[str, int | str | torch.device]</code>, <em>optional</em>) — | |
| A map that specifies where each submodule should go. It doesn’t need to be defined for each | |
| parameter/buffer name; once a given module name is inside, every submodule of it will be sent to the | |
| same device.</p> | |
| <p>Set <code>device_map="auto"</code> to have 🤗 Accelerate automatically compute the most optimized <code>device_map</code>. For | |
| more information about each option see <a href="https://hf.co/docs/accelerate/main/en/usage_guides/big_modeling#designing-a-device-map" rel="nofollow">designing a device | |
| map</a>.`,name:"device_map"},{anchor:"diffusers.AutoPipelineForImage2Image.from_pretrained.max_memory",description:`<strong>max_memory</strong> (<code>Dict</code>, <em>optional</em>) — | |
| A dictionary device identifier for the maximum memory. Will default to the maximum memory available for | |
| each GPU and the available CPU RAM if unset.`,name:"max_memory"},{anchor:"diffusers.AutoPipelineForImage2Image.from_pretrained.offload_folder",description:`<strong>offload_folder</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) — | |
| The path to offload weights if device_map contains the value <code>"disk"</code>.`,name:"offload_folder"},{anchor:"diffusers.AutoPipelineForImage2Image.from_pretrained.offload_state_dict",description:`<strong>offload_state_dict</strong> (<code>bool</code>, <em>optional</em>) — | |
| If <code>True</code>, temporarily offloads the CPU state dict to the hard drive to avoid running out of CPU RAM if | |
| the weight of the CPU state dict + the biggest shard of the checkpoint does not fit. Defaults to <code>True</code> | |
| when there is some disk offload.`,name:"offload_state_dict"},{anchor:"diffusers.AutoPipelineForImage2Image.from_pretrained.low_cpu_mem_usage",description:`<strong>low_cpu_mem_usage</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code> if torch version >= 1.9.0 else <code>False</code>) — | |
| Speed up model loading only loading the pretrained weights and not initializing the weights. This also | |
| tries to not use more than 1x model size in CPU memory (including peak memory) while loading the model. | |
| Only supported for PyTorch >= 1.9.0. If you are using an older version of PyTorch, setting this | |
| argument to <code>True</code> will raise an error.`,name:"low_cpu_mem_usage"},{anchor:"diffusers.AutoPipelineForImage2Image.from_pretrained.use_safetensors",description:`<strong>use_safetensors</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) — | |
| If set to <code>None</code>, the safetensors weights are downloaded if they’re available <strong>and</strong> if the | |
| safetensors library is installed. If set to <code>True</code>, the model is forcibly loaded from safetensors | |
| weights. If set to <code>False</code>, safetensors weights are not loaded.`,name:"use_safetensors"},{anchor:"diffusers.AutoPipelineForImage2Image.from_pretrained.kwargs",description:`<strong>kwargs</strong> (remaining dictionary of keyword arguments, <em>optional</em>) — | |
| Can be used to overwrite load and saveable variables (the pipeline components of the specific pipeline | |
| class). The overwritten components are passed directly to the pipelines <code>__init__</code> method. See example | |
| below for more information.`,name:"kwargs"},{anchor:"diffusers.AutoPipelineForImage2Image.from_pretrained.variant",description:`<strong>variant</strong> (<code>str</code>, <em>optional</em>) — | |
| Load weights from a specified variant filename such as <code>"fp16"</code> or <code>"ema"</code>. This is ignored when | |
| loading <code>from_flax</code>.`,name:"variant"}]});var B=e(W,12);p(B,{anchor:"diffusers.AutoPipelineForImage2Image.from_pretrained.example",children:(i,n)=>{var o=T(),a=e(c(o),2);l(a,{code:"U29tZSUyMHdlaWdodHMlMjBvZiUyMFVOZXQyRENvbmRpdGlvbk1vZGVsJTIwd2VyZSUyMG5vdCUyMGluaXRpYWxpemVkJTIwZnJvbSUyMHRoZSUyMG1vZGVsJTIwY2hlY2twb2ludCUyMGF0JTIwc3RhYmxlLWRpZmZ1c2lvbi12MS01JTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIwYW5kJTIwYXJlJTIwbmV3bHklMjBpbml0aWFsaXplZCUyMGJlY2F1c2UlMjB0aGUlMjBzaGFwZXMlMjBkaWQlMjBub3QlMjBtYXRjaCUzQSUwQS0lMjBjb252X2luLndlaWdodCUzQSUyMGZvdW5kJTIwc2hhcGUlMjB0b3JjaC5TaXplKCU1QjMyMCUyQyUyMDQlMkMlMjAzJTJDJTIwMyU1RCklMjBpbiUyMHRoZSUyMGNoZWNrcG9pbnQlMjBhbmQlMjB0b3JjaC5TaXplKCU1QjMyMCUyQyUyMDklMkMlMjAzJTJDJTIwMyU1RCklMjBpbiUyMHRoZSUyMG1vZGVsJTIwaW5zdGFudGlhdGVkJTBBWW91JTIwc2hvdWxkJTIwcHJvYmFibHklMjBUUkFJTiUyMHRoaXMlMjBtb2RlbCUyMG9uJTIwYSUyMGRvd24tc3RyZWFtJTIwdGFzayUyMHRvJTIwYmUlMjBhYmxlJTIwdG8lMjB1c2UlMjBpdCUyMGZvciUyMHByZWRpY3Rpb25zJTIwYW5kJTIwaW5mZXJlbmNlLg==",highlighted:`Some weights of UNet2DConditionModel were not initialized from the model checkpoint <span class="hljs-built_in">at</span> stable-<span class="hljs-keyword">diffusion-v1-5/stable-diffusion-v1-5 </span><span class="hljs-keyword">and </span>are newly initialized <span class="hljs-keyword">because </span>the <span class="hljs-keyword">shapes </span><span class="hljs-keyword">did </span>not match: | |
| - conv_in.weight: found <span class="hljs-keyword">shape </span>torch.Size([<span class="hljs-number">320</span>, <span class="hljs-number">4</span>, <span class="hljs-number">3</span>, <span class="hljs-number">3</span>]) in the checkpoint <span class="hljs-keyword">and </span>torch.Size([<span class="hljs-number">320</span>, <span class="hljs-number">9</span>, <span class="hljs-number">3</span>, <span class="hljs-number">3</span>]) in the model <span class="hljs-keyword">instantiated | |
| </span>You <span class="hljs-keyword">should </span>probably TRAIN this model on a down-stream task to <span class="hljs-keyword">be </span>able to use it for predictions <span class="hljs-keyword">and </span>inference.`,lang:"",wrap:!1}),d(i,o)},$$slots:{default:!0}});var ee=e(B,4);p(ee,{anchor:"diffusers.AutoPipelineForImage2Image.from_pretrained.example-2",children:(i,n)=>{var o=m(),a=e(c(o),2);l(a,{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9QaXBlbGluZUZvckltYWdlMkltYWdlJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBBdXRvUGlwZWxpbmVGb3JJbWFnZTJJbWFnZS5mcm9tX3ByZXRyYWluZWQoJTIyc3RhYmxlLWRpZmZ1c2lvbi12MS01JTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyKSUwQWltYWdlJTIwJTNEJTIwcGlwZWxpbmUocHJvbXB0JTJDJTIwaW1hZ2UpLmltYWdlcyU1QjAlNUQ=",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoPipelineForImage2Image | |
| <span class="hljs-meta">>>> </span>pipeline = AutoPipelineForImage2Image.from_pretrained(<span class="hljs-string">"stable-diffusion-v1-5/stable-diffusion-v1-5"</span>) | |
| <span class="hljs-meta">>>> </span>image = pipeline(prompt, image).images[<span class="hljs-number">0</span>]`,lang:"py",wrap:!1}),d(i,o)},$$slots:{default:!0}}),r(y);var C=e(y,2),R=s(C);t(R,{name:"from_pipe",anchor:"diffusers.AutoPipelineForImage2Image.from_pipe",source:"https://github.com/huggingface/diffusers/blob/vr_14192/src/diffusers/pipelines/auto_pipeline.py#L845",parameters:[{name:"pipeline",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.AutoPipelineForImage2Image.from_pipe.pipeline",description:`<strong>pipeline</strong> (<code>DiffusionPipeline</code>) — | |
| an instantiated <code>DiffusionPipeline</code> object`,name:"pipeline"}]});var oe=e(R,10);p(oe,{anchor:"diffusers.AutoPipelineForImage2Image.from_pipe.example",children:(i,n)=>{var o=m(),a=e(c(o),2);l(a,{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9QaXBlbGluZUZvclRleHQySW1hZ2UlMkMlMjBBdXRvUGlwZWxpbmVGb3JJbWFnZTJJbWFnZSUwQSUwQXBpcGVfdDJpJTIwJTNEJTIwQXV0b1BpcGVsaW5lRm9yVGV4dDJJbWFnZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyc3RhYmxlLWRpZmZ1c2lvbi12MS01JTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTIwcmVxdWlyZXNfc2FmZXR5X2NoZWNrZXIlM0RGYWxzZSUwQSklMEElMEFwaXBlX2kyaSUyMCUzRCUyMEF1dG9QaXBlbGluZUZvckltYWdlMkltYWdlLmZyb21fcGlwZShwaXBlX3QyaSklMEFpbWFnZSUyMCUzRCUyMHBpcGVfaTJpKHByb21wdCUyQyUyMGltYWdlKS5pbWFnZXMlNUIwJTVE",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoPipelineForText2Image, AutoPipelineForImage2Image | |
| <span class="hljs-meta">>>> </span>pipe_t2i = AutoPipelineForText2Image.from_pretrained( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"stable-diffusion-v1-5/stable-diffusion-v1-5"</span>, requires_safety_checker=<span class="hljs-literal">False</span> | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>pipe_i2i = AutoPipelineForImage2Image.from_pipe(pipe_t2i) | |
| <span class="hljs-meta">>>> </span>image = pipe_i2i(prompt, image).images[<span class="hljs-number">0</span>]`,lang:"py",wrap:!1}),d(i,o)},$$slots:{default:!0}}),r(C),r(_);var S=e(_,2);f(S,{title:"AutoPipelineForInpainting",local:"diffusers.AutoPipelineForInpainting",headingTag:"h2"});var b=e(S,2),X=s(b);t(X,{name:"class diffusers.AutoPipelineForInpainting",anchor:"diffusers.AutoPipelineForInpainting",source:"https://github.com/huggingface/diffusers/blob/vr_14192/src/diffusers/pipelines/auto_pipeline.py#L967",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}]});var w=e(X,10),V=s(w);t(V,{name:"from_pretrained",anchor:"diffusers.AutoPipelineForInpainting.from_pretrained",source:"https://github.com/huggingface/diffusers/blob/vr_14192/src/diffusers/pipelines/auto_pipeline.py#L992",parameters:[{name:"pretrained_model_or_path",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.AutoPipelineForInpainting.from_pretrained.pretrained_model_or_path",description:`<strong>pretrained_model_or_path</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) — | |
| Can be either:</p> | |
| <ul> | |
| <li>A string, the <em>repo id</em> (for example <code>CompVis/ldm-text2im-large-256</code>) of a pretrained pipeline | |
| hosted on the Hub.</li> | |
| <li>A path to a <em>directory</em> (for example <code>./my_pipeline_directory/</code>) containing pipeline weights | |
| saved using | |
| <a href="/docs/diffusers/pr_14192/en/api/pipelines/overview#diffusers.DiffusionPipeline.save_pretrained">save_pretrained()</a>.</li> | |
| </ul>`,name:"pretrained_model_or_path"},{anchor:"diffusers.AutoPipelineForInpainting.from_pretrained.dtype",description:`<strong>dtype</strong> (<code>str</code> or <code>torch.dtype</code>, <em>optional</em>) — | |
| Override the default <code>torch.dtype</code> and load the model with another dtype.`,name:"dtype"},{anchor:"diffusers.AutoPipelineForInpainting.from_pretrained.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether or not to force the (re-)download of the model weights and configuration files, overriding the | |
| cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.AutoPipelineForInpainting.from_pretrained.cache_dir",description:`<strong>cache_dir</strong> (<code>str | os.PathLike</code>, <em>optional</em>) — | |
| Path to a directory where a downloaded pretrained model configuration is cached if the standard cache | |
| is not used.`,name:"cache_dir"},{anchor:"diffusers.AutoPipelineForInpainting.from_pretrained.proxies",description:`<strong>proxies</strong> (<code>dict[str, str]</code>, <em>optional</em>) — | |
| A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{'http': 'foo.bar:3128', 'http://hostname': 'foo.bar:4012'}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.AutoPipelineForInpainting.from_pretrained.output_loading_info(bool,",description:`<strong>output_loading_info(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) — | |
| Whether or not to also return a dictionary containing missing keys, unexpected keys and error messages.`,name:"output_loading_info(bool,"},{anchor:"diffusers.AutoPipelineForInpainting.from_pretrained.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model | |
| won’t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.AutoPipelineForInpainting.from_pretrained.token",description:`<strong>token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) — | |
| The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from | |
| <code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"token"},{anchor:"diffusers.AutoPipelineForInpainting.from_pretrained.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"main"</code>) — | |
| The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier | |
| allowed by Git.`,name:"revision"},{anchor:"diffusers.AutoPipelineForInpainting.from_pretrained.custom_revision",description:`<strong>custom_revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"main"</code>) — | |
| The specific model version to use. It can be a branch name, a tag name, or a commit id similar to | |
| <code>revision</code> when loading a custom pipeline from the Hub. It can be a 🤗 Diffusers version when loading a | |
| custom pipeline from GitHub, otherwise it defaults to <code>"main"</code> when loading from the Hub.`,name:"custom_revision"},{anchor:"diffusers.AutoPipelineForInpainting.from_pretrained.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) — | |
| Mirror source to resolve accessibility issues if you’re downloading a model in China. We do not | |
| guarantee the timeliness or safety of the source, and you should refer to the mirror site for more | |
| information.`,name:"mirror"},{anchor:"diffusers.AutoPipelineForInpainting.from_pretrained.device_map",description:`<strong>device_map</strong> (<code>str</code> or <code>dict[str, int | str | torch.device]</code>, <em>optional</em>) — | |
| A map that specifies where each submodule should go. It doesn’t need to be defined for each | |
| parameter/buffer name; once a given module name is inside, every submodule of it will be sent to the | |
| same device.</p> | |
| <p>Set <code>device_map="auto"</code> to have 🤗 Accelerate automatically compute the most optimized <code>device_map</code>. For | |
| more information about each option see <a href="https://hf.co/docs/accelerate/main/en/usage_guides/big_modeling#designing-a-device-map" rel="nofollow">designing a device | |
| map</a>.`,name:"device_map"},{anchor:"diffusers.AutoPipelineForInpainting.from_pretrained.max_memory",description:`<strong>max_memory</strong> (<code>Dict</code>, <em>optional</em>) — | |
| A dictionary device identifier for the maximum memory. Will default to the maximum memory available for | |
| each GPU and the available CPU RAM if unset.`,name:"max_memory"},{anchor:"diffusers.AutoPipelineForInpainting.from_pretrained.offload_folder",description:`<strong>offload_folder</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) — | |
| The path to offload weights if device_map contains the value <code>"disk"</code>.`,name:"offload_folder"},{anchor:"diffusers.AutoPipelineForInpainting.from_pretrained.offload_state_dict",description:`<strong>offload_state_dict</strong> (<code>bool</code>, <em>optional</em>) — | |
| If <code>True</code>, temporarily offloads the CPU state dict to the hard drive to avoid running out of CPU RAM if | |
| the weight of the CPU state dict + the biggest shard of the checkpoint does not fit. Defaults to <code>True</code> | |
| when there is some disk offload.`,name:"offload_state_dict"},{anchor:"diffusers.AutoPipelineForInpainting.from_pretrained.low_cpu_mem_usage",description:`<strong>low_cpu_mem_usage</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code> if torch version >= 1.9.0 else <code>False</code>) — | |
| Speed up model loading only loading the pretrained weights and not initializing the weights. This also | |
| tries to not use more than 1x model size in CPU memory (including peak memory) while loading the model. | |
| Only supported for PyTorch >= 1.9.0. If you are using an older version of PyTorch, setting this | |
| argument to <code>True</code> will raise an error.`,name:"low_cpu_mem_usage"},{anchor:"diffusers.AutoPipelineForInpainting.from_pretrained.use_safetensors",description:`<strong>use_safetensors</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) — | |
| If set to <code>None</code>, the safetensors weights are downloaded if they’re available <strong>and</strong> if the | |
| safetensors library is installed. If set to <code>True</code>, the model is forcibly loaded from safetensors | |
| weights. If set to <code>False</code>, safetensors weights are not loaded.`,name:"use_safetensors"},{anchor:"diffusers.AutoPipelineForInpainting.from_pretrained.kwargs",description:`<strong>kwargs</strong> (remaining dictionary of keyword arguments, <em>optional</em>) — | |
| Can be used to overwrite load and saveable variables (the pipeline components of the specific pipeline | |
| class). The overwritten components are passed directly to the pipelines <code>__init__</code> method. See example | |
| below for more information.`,name:"kwargs"},{anchor:"diffusers.AutoPipelineForInpainting.from_pretrained.variant",description:`<strong>variant</strong> (<code>str</code>, <em>optional</em>) — | |
| Load weights from a specified variant filename such as <code>"fp16"</code> or <code>"ema"</code>. This is ignored when | |
| loading <code>from_flax</code>.`,name:"variant"}]});var Q=e(V,12);p(Q,{anchor:"diffusers.AutoPipelineForInpainting.from_pretrained.example",children:(i,n)=>{var o=T(),a=e(c(o),2);l(a,{code:"U29tZSUyMHdlaWdodHMlMjBvZiUyMFVOZXQyRENvbmRpdGlvbk1vZGVsJTIwd2VyZSUyMG5vdCUyMGluaXRpYWxpemVkJTIwZnJvbSUyMHRoZSUyMG1vZGVsJTIwY2hlY2twb2ludCUyMGF0JTIwc3RhYmxlLWRpZmZ1c2lvbi12MS01JTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIwYW5kJTIwYXJlJTIwbmV3bHklMjBpbml0aWFsaXplZCUyMGJlY2F1c2UlMjB0aGUlMjBzaGFwZXMlMjBkaWQlMjBub3QlMjBtYXRjaCUzQSUwQS0lMjBjb252X2luLndlaWdodCUzQSUyMGZvdW5kJTIwc2hhcGUlMjB0b3JjaC5TaXplKCU1QjMyMCUyQyUyMDQlMkMlMjAzJTJDJTIwMyU1RCklMjBpbiUyMHRoZSUyMGNoZWNrcG9pbnQlMjBhbmQlMjB0b3JjaC5TaXplKCU1QjMyMCUyQyUyMDklMkMlMjAzJTJDJTIwMyU1RCklMjBpbiUyMHRoZSUyMG1vZGVsJTIwaW5zdGFudGlhdGVkJTBBWW91JTIwc2hvdWxkJTIwcHJvYmFibHklMjBUUkFJTiUyMHRoaXMlMjBtb2RlbCUyMG9uJTIwYSUyMGRvd24tc3RyZWFtJTIwdGFzayUyMHRvJTIwYmUlMjBhYmxlJTIwdG8lMjB1c2UlMjBpdCUyMGZvciUyMHByZWRpY3Rpb25zJTIwYW5kJTIwaW5mZXJlbmNlLg==",highlighted:`Some weights of UNet2DConditionModel were not initialized from the model checkpoint <span class="hljs-built_in">at</span> stable-<span class="hljs-keyword">diffusion-v1-5/stable-diffusion-v1-5 </span><span class="hljs-keyword">and </span>are newly initialized <span class="hljs-keyword">because </span>the <span class="hljs-keyword">shapes </span><span class="hljs-keyword">did </span>not match: | |
| - conv_in.weight: found <span class="hljs-keyword">shape </span>torch.Size([<span class="hljs-number">320</span>, <span class="hljs-number">4</span>, <span class="hljs-number">3</span>, <span class="hljs-number">3</span>]) in the checkpoint <span class="hljs-keyword">and </span>torch.Size([<span class="hljs-number">320</span>, <span class="hljs-number">9</span>, <span class="hljs-number">3</span>, <span class="hljs-number">3</span>]) in the model <span class="hljs-keyword">instantiated | |
| </span>You <span class="hljs-keyword">should </span>probably TRAIN this model on a down-stream task to <span class="hljs-keyword">be </span>able to use it for predictions <span class="hljs-keyword">and </span>inference.`,lang:"",wrap:!1}),d(i,o)},$$slots:{default:!0}});var ie=e(Q,4);p(ie,{anchor:"diffusers.AutoPipelineForInpainting.from_pretrained.example-2",children:(i,n)=>{var o=m(),a=e(c(o),2);l(a,{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9QaXBlbGluZUZvcklucGFpbnRpbmclMEElMEFwaXBlbGluZSUyMCUzRCUyMEF1dG9QaXBlbGluZUZvcklucGFpbnRpbmcuZnJvbV9wcmV0cmFpbmVkKCUyMnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyMiklMEFpbWFnZSUyMCUzRCUyMHBpcGVsaW5lKHByb21wdCUyQyUyMGltYWdlJTNEaW5pdF9pbWFnZSUyQyUyMG1hc2tfaW1hZ2UlM0RtYXNrX2ltYWdlKS5pbWFnZXMlNUIwJTVE",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoPipelineForInpainting | |
| <span class="hljs-meta">>>> </span>pipeline = AutoPipelineForInpainting.from_pretrained(<span class="hljs-string">"stable-diffusion-v1-5/stable-diffusion-v1-5"</span>) | |
| <span class="hljs-meta">>>> </span>image = pipeline(prompt, image=init_image, mask_image=mask_image).images[<span class="hljs-number">0</span>]`,lang:"py",wrap:!1}),d(i,o)},$$slots:{default:!0}}),r(w);var Y=e(w,2),q=s(Y);t(q,{name:"from_pipe",anchor:"diffusers.AutoPipelineForInpainting.from_pipe",source:"https://github.com/huggingface/diffusers/blob/vr_14192/src/diffusers/pipelines/auto_pipeline.py#L1148",parameters:[{name:"pipeline",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.AutoPipelineForInpainting.from_pipe.pipeline",description:`<strong>pipeline</strong> (<code>DiffusionPipeline</code>) — | |
| an instantiated <code>DiffusionPipeline</code> object`,name:"pipeline"}]});var ae=e(q,10);p(ae,{anchor:"diffusers.AutoPipelineForInpainting.from_pipe.example",children:(i,n)=>{var o=m(),a=e(c(o),2);l(a,{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9QaXBlbGluZUZvclRleHQySW1hZ2UlMkMlMjBBdXRvUGlwZWxpbmVGb3JJbnBhaW50aW5nJTBBJTBBcGlwZV90MmklMjAlM0QlMjBBdXRvUGlwZWxpbmVGb3JUZXh0MkltYWdlLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJEZWVwRmxveWQlMkZJRi1JLVhMLXYxLjAlMjIlMkMlMjByZXF1aXJlc19zYWZldHlfY2hlY2tlciUzREZhbHNlJTBBKSUwQSUwQXBpcGVfaW5wYWludCUyMCUzRCUyMEF1dG9QaXBlbGluZUZvcklucGFpbnRpbmcuZnJvbV9waXBlKHBpcGVfdDJpKSUwQWltYWdlJTIwJTNEJTIwcGlwZV9pbnBhaW50KHByb21wdCUyQyUyMGltYWdlJTNEaW5pdF9pbWFnZSUyQyUyMG1hc2tfaW1hZ2UlM0RtYXNrX2ltYWdlKS5pbWFnZXMlNUIwJTVE",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoPipelineForText2Image, AutoPipelineForInpainting | |
| <span class="hljs-meta">>>> </span>pipe_t2i = AutoPipelineForText2Image.from_pretrained( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"DeepFloyd/IF-I-XL-v1.0"</span>, requires_safety_checker=<span class="hljs-literal">False</span> | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>pipe_inpaint = AutoPipelineForInpainting.from_pipe(pipe_t2i) | |
| <span class="hljs-meta">>>> </span>image = pipe_inpaint(prompt, image=init_image, mask_image=mask_image).images[<span class="hljs-number">0</span>]`,lang:"py",wrap:!1}),d(i,o)},$$slots:{default:!0}}),r(Y),r(b);var H=e(b,2);f(H,{title:"AutoPipelineForText2Audio",local:"diffusers.AutoPipelineForText2Audio",headingTag:"h2"});var v=e(H,2),N=s(v);t(N,{name:"class diffusers.AutoPipelineForText2Audio",anchor:"diffusers.AutoPipelineForText2Audio",source:"https://github.com/huggingface/diffusers/blob/vr_14192/src/diffusers/pipelines/auto_pipeline.py#L1267",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}]});var M=e(N,10),z=s(M);t(z,{name:"from_pretrained",anchor:"diffusers.AutoPipelineForText2Audio.from_pretrained",source:"https://github.com/huggingface/diffusers/blob/vr_14192/src/diffusers/pipelines/auto_pipeline.py#L1292",parameters:[{name:"pretrained_model_or_path",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.AutoPipelineForText2Audio.from_pretrained.pretrained_model_or_path",description:`<strong>pretrained_model_or_path</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) — | |
| Can be either:</p> | |
| <ul> | |
| <li>A string, the <em>repo id</em> (for example <code>stabilityai/stable-audio-open-1.0</code>) of a pretrained | |
| pipeline hosted on the Hub.</li> | |
| <li>A path to a <em>directory</em> (for example <code>./my_pipeline_directory/</code>) containing pipeline weights | |
| saved using | |
| <a href="/docs/diffusers/pr_14192/en/api/pipelines/overview#diffusers.DiffusionPipeline.save_pretrained">save_pretrained()</a>.</li> | |
| </ul>`,name:"pretrained_model_or_path"},{anchor:"diffusers.AutoPipelineForText2Audio.from_pretrained.dtype",description:`<strong>dtype</strong> (<code>torch.dtype</code>, <em>optional</em>) — | |
| Override the default <code>torch.dtype</code> and load the model with another dtype.`,name:"dtype"},{anchor:"diffusers.AutoPipelineForText2Audio.from_pretrained.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether or not to force the (re-)download of the model weights and configuration files, overriding the | |
| cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.AutoPipelineForText2Audio.from_pretrained.cache_dir",description:`<strong>cache_dir</strong> (<code>str | os.PathLike</code>, <em>optional</em>) — | |
| Path to a directory where a downloaded pretrained model configuration is cached if the standard cache | |
| is not used.`,name:"cache_dir"},{anchor:"diffusers.AutoPipelineForText2Audio.from_pretrained.proxies",description:`<strong>proxies</strong> (<code>dict[str, str]</code>, <em>optional</em>) — | |
| A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{'http': 'foo.bar:3128', 'http://hostname': 'foo.bar:4012'}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.AutoPipelineForText2Audio.from_pretrained.output_loading_info(bool,",description:`<strong>output_loading_info(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) — | |
| Whether or not to also return a dictionary containing missing keys, unexpected keys and error messages.`,name:"output_loading_info(bool,"},{anchor:"diffusers.AutoPipelineForText2Audio.from_pretrained.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model | |
| won’t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.AutoPipelineForText2Audio.from_pretrained.token",description:`<strong>token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) — | |
| The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from | |
| <code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"token"},{anchor:"diffusers.AutoPipelineForText2Audio.from_pretrained.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"main"</code>) — | |
| The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier | |
| allowed by Git.`,name:"revision"},{anchor:"diffusers.AutoPipelineForText2Audio.from_pretrained.custom_revision",description:`<strong>custom_revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"main"</code>) — | |
| The specific model version to use. It can be a branch name, a tag name, or a commit id similar to | |
| <code>revision</code> when loading a custom pipeline from the Hub. It can be a 🤗 Diffusers version when loading a | |
| custom pipeline from GitHub, otherwise it defaults to <code>"main"</code> when loading from the Hub.`,name:"custom_revision"},{anchor:"diffusers.AutoPipelineForText2Audio.from_pretrained.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) — | |
| Mirror source to resolve accessibility issues if you’re downloading a model in China. We do not | |
| guarantee the timeliness or safety of the source, and you should refer to the mirror site for more | |
| information.`,name:"mirror"},{anchor:"diffusers.AutoPipelineForText2Audio.from_pretrained.device_map",description:`<strong>device_map</strong> (<code>str</code> or <code>dict[str, int | str | torch.device]</code>, <em>optional</em>) — | |
| A map that specifies where each submodule should go. It doesn’t need to be defined for each | |
| parameter/buffer name; once a given module name is inside, every submodule of it will be sent to the | |
| same device.</p> | |
| <p>Set <code>device_map="auto"</code> to have 🤗 Accelerate automatically compute the most optimized <code>device_map</code>. For | |
| more information about each option see <a href="https://hf.co/docs/accelerate/main/en/usage_guides/big_modeling#designing-a-device-map" rel="nofollow">designing a device | |
| map</a>.`,name:"device_map"},{anchor:"diffusers.AutoPipelineForText2Audio.from_pretrained.max_memory",description:`<strong>max_memory</strong> (<code>Dict</code>, <em>optional</em>) — | |
| A dictionary device identifier for the maximum memory. Will default to the maximum memory available for | |
| each GPU and the available CPU RAM if unset.`,name:"max_memory"},{anchor:"diffusers.AutoPipelineForText2Audio.from_pretrained.offload_folder",description:`<strong>offload_folder</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) — | |
| The path to offload weights if device_map contains the value <code>"disk"</code>.`,name:"offload_folder"},{anchor:"diffusers.AutoPipelineForText2Audio.from_pretrained.offload_state_dict",description:`<strong>offload_state_dict</strong> (<code>bool</code>, <em>optional</em>) — | |
| If <code>True</code>, temporarily offloads the CPU state dict to the hard drive to avoid running out of CPU RAM if | |
| the weight of the CPU state dict + the biggest shard of the checkpoint does not fit. Defaults to <code>True</code> | |
| when there is some disk offload.`,name:"offload_state_dict"},{anchor:"diffusers.AutoPipelineForText2Audio.from_pretrained.low_cpu_mem_usage",description:`<strong>low_cpu_mem_usage</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code> if torch version >= 1.9.0 else <code>False</code>) — | |
| Speed up model loading only loading the pretrained weights and not initializing the weights. This also | |
| tries to not use more than 1x model size in CPU memory (including peak memory) while loading the model. | |
| Only supported for PyTorch >= 1.9.0. If you are using an older version of PyTorch, setting this | |
| argument to <code>True</code> will raise an error.`,name:"low_cpu_mem_usage"},{anchor:"diffusers.AutoPipelineForText2Audio.from_pretrained.use_safetensors",description:`<strong>use_safetensors</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) — | |
| If set to <code>None</code>, the safetensors weights are downloaded if they’re available <strong>and</strong> if the | |
| safetensors library is installed. If set to <code>True</code>, the model is forcibly loaded from safetensors | |
| weights. If set to <code>False</code>, safetensors weights are not loaded.`,name:"use_safetensors"},{anchor:"diffusers.AutoPipelineForText2Audio.from_pretrained.kwargs",description:`<strong>kwargs</strong> (remaining dictionary of keyword arguments, <em>optional</em>) — | |
| Can be used to overwrite load and saveable variables (the pipeline components of the specific pipeline | |
| class). The overwritten components are passed directly to the pipelines <code>__init__</code> method. See example | |
| below for more information.`,name:"kwargs"},{anchor:"diffusers.AutoPipelineForText2Audio.from_pretrained.variant",description:`<strong>variant</strong> (<code>str</code>, <em>optional</em>) — | |
| Load weights from a specified variant filename such as <code>"fp16"</code> or <code>"ema"</code>. This is ignored when | |
| loading <code>from_flax</code>.`,name:"variant"}]});var ne=e(z,12);p(ne,{anchor:"diffusers.AutoPipelineForText2Audio.from_pretrained.example",children:(i,n)=>{var o=m(),a=e(c(o),2);l(a,{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjBzb3VuZGZpbGUlMjBhcyUyMHNmJTBBZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9QaXBlbGluZUZvclRleHQyQXVkaW8lMEElMEFwaXBlbGluZSUyMCUzRCUyMEF1dG9QaXBlbGluZUZvclRleHQyQXVkaW8uZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnN0YWJpbGl0eWFpJTJGc3RhYmxlLWF1ZGlvLW9wZW4tMS4wJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQXBpcGVsaW5lJTIwJTNEJTIwcGlwZWxpbmUudG8oJTIyY3VkYSUyMiklMEElMEFvdXRwdXQlMjAlM0QlMjBwaXBlbGluZSglMEElMjAlMjAlMjAlMjAlMjJHZW5lcmF0ZSUyMGElMjBtYWxlJTIwdm9pY2UlMjByZWFkaW5nJTIwYSUyMHBhcmFncmFwaCUyMiUyQyUwQSUyMCUyMCUyMCUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0QyMDAlMkMlMEElMjAlMjAlMjAlMjBhdWRpb19lbmRfaW5fcyUzRDEwLjAlMkMlMEEpJTBBYXVkaW8lMjAlM0QlMjBvdXRwdXQuYXVkaW9zJTVCMCU1RC5ULmZsb2F0KCkuY3B1KCkubnVtcHkoKSUwQXNmLndyaXRlKCUyMmF1ZGlvLndhdiUyMiUyQyUyMGF1ZGlvJTJDJTIwcGlwZWxpbmUudmFlLnNhbXBsaW5nX3JhdGUp",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> soundfile <span class="hljs-keyword">as</span> sf | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoPipelineForText2Audio | |
| <span class="hljs-meta">>>> </span>pipeline = AutoPipelineForText2Audio.from_pretrained( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"stabilityai/stable-audio-open-1.0"</span>, torch_dtype=torch.float16 | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>pipeline = pipeline.to(<span class="hljs-string">"cuda"</span>) | |
| <span class="hljs-meta">>>> </span>output = pipeline( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"Generate a male voice reading a paragraph"</span>, | |
| <span class="hljs-meta">... </span> num_inference_steps=<span class="hljs-number">200</span>, | |
| <span class="hljs-meta">... </span> audio_end_in_s=<span class="hljs-number">10.0</span>, | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>audio = output.audios[<span class="hljs-number">0</span>].T.<span class="hljs-built_in">float</span>().cpu().numpy() | |
| <span class="hljs-meta">>>> </span>sf.write(<span class="hljs-string">"audio.wav"</span>, audio, pipeline.vae.sampling_rate)`,lang:"py",wrap:!1}),d(i,o)},$$slots:{default:!0}}),r(M);var E=e(M,2),D=s(E);t(D,{name:"from_pipe",anchor:"diffusers.AutoPipelineForText2Audio.from_pipe",source:"https://github.com/huggingface/diffusers/blob/vr_14192/src/diffusers/pipelines/auto_pipeline.py#L1428",parameters:[{name:"pipeline",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.AutoPipelineForText2Audio.from_pipe.pipeline",description:`<strong>pipeline</strong> (<code>DiffusionPipeline</code>) — | |
| an instantiated <code>DiffusionPipeline</code> object`,name:"pipeline"}]});var te=e(D,10);p(te,{anchor:"diffusers.AutoPipelineForText2Audio.from_pipe.example",children:(i,n)=>{l(i,{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjBzb3VuZGZpbGUlMjBhcyUyMHNmJTBBZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9QaXBlbGluZUZvclRleHQyQXVkaW8lMkMlMjBTdGFibGVBdWRpb1BpcGVsaW5lJTBBJTBBcGlwZSUyMCUzRCUyMFN0YWJsZUF1ZGlvUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMnN0YWJpbGl0eWFpJTJGc3RhYmxlLWF1ZGlvLW9wZW4tMS4wJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KSUwQSUwQXBpcGVfYXVkaW8lMjAlM0QlMjBBdXRvUGlwZWxpbmVGb3JUZXh0MkF1ZGlvLmZyb21fcGlwZShwaXBlKSUwQW91dHB1dCUyMCUzRCUyMHBpcGVfYXVkaW8oJTBBJTIwJTIwJTIwJTIwJTIyR2VuZXJhdGUlMjBhJTIwc291bmQlMjIlMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMjAwJTJDJTBBJTIwJTIwJTIwJTIwYXVkaW9fZW5kX2luX3MlM0QxMC4wJTJDJTBBKSUwQWF1ZGlvJTIwJTNEJTIwb3V0cHV0LmF1ZGlvcyU1QjAlNUQuVC5mbG9hdCgpLmNwdSgpLm51bXB5KCklMEFzZi53cml0ZSglMjJhdWRpby53YXYlMjIlMkMlMjBhdWRpbyUyQyUyMHBpcGVfYXVkaW8udmFlLnNhbXBsaW5nX3JhdGUp",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> soundfile <span class="hljs-keyword">as</span> sf | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoPipelineForText2Audio, StableAudioPipeline | |
| <span class="hljs-meta">>>> </span>pipe = StableAudioPipeline.from_pretrained(<span class="hljs-string">"stabilityai/stable-audio-open-1.0"</span>, torch_dtype=torch.float16) | |
| <span class="hljs-meta">>>> </span>pipe_audio = AutoPipelineForText2Audio.from_pipe(pipe) | |
| <span class="hljs-meta">>>> </span>output = pipe_audio( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"Generate a sound"</span>, | |
| <span class="hljs-meta">... </span> num_inference_steps=<span class="hljs-number">200</span>, | |
| <span class="hljs-meta">... </span> audio_end_in_s=<span class="hljs-number">10.0</span>, | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>audio = output.audios[<span class="hljs-number">0</span>].T.<span class="hljs-built_in">float</span>().cpu().numpy() | |
| <span class="hljs-meta">>>> </span>sf.write(<span class="hljs-string">"audio.wav"</span>, audio, pipe_audio.vae.sampling_rate)`,lang:"py",wrap:!1})},$$slots:{default:!0}}),r(E),r(v);var se=e(v,2);pe(se,{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/auto_pipeline.md"}),he(2),d(L,x),ue()}export{Te as component}; | |
Xet Storage Details
- Size:
- 69.5 kB
- Xet hash:
- d3d28189a60a68a94810f7446ed52d11afbc71fa899413f7da10d886e5d09266
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.