Buckets:

download
raw
7.52 kB
import"../chunks/DsnmJJEf.js";import{i as J,h as N,C as Z,H as t,a as d,D as s,E as j,s as A}from"../chunks/BtE7mKSK.js";import{p as C,o as H,s as e,f as D,a as T,b as E,c as a,d as w,n as i,r as o}from"../chunks/jDjavuwI.js";const G='{"title":"Outputs","local":"outputs","sections":[{"title":"BaseOutput","local":"diffusers.utils.BaseOutput","sections":[],"depth":2},{"title":"ImagePipelineOutput","local":"diffusers.ImagePipelineOutput","sections":[],"depth":2},{"title":"AudioPipelineOutput","local":"diffusers.AudioPipelineOutput","sections":[],"depth":2},{"title":"ImageTextPipelineOutput","local":"diffusers.ImageTextPipelineOutput","sections":[],"depth":2}],"depth":1}';var q=w('<meta name="hf:doc:metadata"/>'),R=w(`<p></p> <!> <!> <p>All model outputs are subclasses of <a href="/docs/diffusers/pr_13881/en/api/outputs#diffusers.utils.BaseOutput">BaseOutput</a>, data structures containing all the information returned by the model. The outputs can also be used as tuples or dictionaries.</p> <p>For example:</p> <!> <p>The <code>outputs</code> object is a <a href="/docs/diffusers/pr_13881/en/api/pipelines/ddim#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> which means it has an image attribute.</p> <p>You can access each attribute as you normally would or with a keyword lookup, and if that attribute is not returned by the model, you will get <code>None</code>:</p> <!> <p>When considering the <code>outputs</code> object as a tuple, it only considers the attributes that don’t have <code>None</code> values.
For instance, retrieving an image by indexing into it returns the tuple <code>(outputs.images)</code>:</p> <!> <blockquote class="tip"><p>To check a specific pipeline or model output, refer to its corresponding API documentation.</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>Base class for all model outputs as dataclass. Has a <code>__getitem__</code> that allows indexing by integer or slice (like a
tuple) or strings (like a dictionary) that will ignore the <code>None</code> attributes. Otherwise behaves like a regular
Python dictionary.</p> <blockquote class="warning"><p>> You can’t unpack a <code>BaseOutput</code> directly. Use the <a href="/docs/diffusers/pr_13881/en/api/outputs#diffusers.utils.BaseOutput.to_tuple">to_tuple()</a> method to convert
it to a tuple > first.</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>Convert self to a tuple containing all the attributes/keys that are not <code>None</code>.</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>Output class for image pipelines.</p></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>Output class for audio pipelines.</p></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>Output class for joint image-text pipelines.</p></div> <!> <p></p>`,1);function F(B,L){C(L,!1),H(()=>{new URLSearchParams(window.location.search).get("fw")}),J();var l=R();N("7dwt02",P=>{var x=q();A(x,"content",G),T(P,x)});var c=e(D(l),2);Z(c,{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"});var g=e(c,2);t(g,{title:"Outputs",local:"outputs",headingTag:"h1"});var f=e(g,6);d(f,{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERESU1QaXBlbGluZSUwQSUwQXBpcGVsaW5lJTIwJTNEJTIwRERJTVBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZkZHBtLWNpZmFyMTAtMzIlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMHBpcGVsaW5lKCk=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DDIMPipeline
pipeline = DDIMPipeline.from_pretrained(<span class="hljs-string">&quot;google/ddpm-cifar10-32&quot;</span>)
outputs = pipeline()`,lang:"python",wrap:!1});var m=e(f,6);d(m,{code:"b3V0cHV0cy5pbWFnZXMlMEFvdXRwdXRzJTVCJTIyaW1hZ2VzJTIyJTVE",highlighted:`outputs.images
outputs[<span class="hljs-string">&quot;images&quot;</span>]`,lang:"python",wrap:!1});var h=e(m,4);d(h,{code:"b3V0cHV0cyU1QiUzQTElNUQ=",highlighted:'outputs[:<span class="hljs-number">1</span>]',lang:"python",wrap:!1});var b=e(h,4);t(b,{title:"BaseOutput",local:"diffusers.utils.BaseOutput",headingTag:"h2"});var r=e(b,2),y=a(r);s(y,{name:"class diffusers.utils.BaseOutput",anchor:"diffusers.utils.BaseOutput",source:"https://github.com/huggingface/diffusers/blob/vr_13881/src/diffusers/utils/outputs.py#L40",parameters:""});var v=e(y,6),k=a(v);s(k,{name:"to_tuple",anchor:"diffusers.utils.BaseOutput.to_tuple",source:"https://github.com/huggingface/diffusers/blob/vr_13881/src/diffusers/utils/outputs.py#L130",parameters:[]}),i(2),o(v),o(r);var _=e(r,2);t(_,{title:"ImagePipelineOutput",local:"diffusers.ImagePipelineOutput",headingTag:"h2"});var n=e(_,2),M=a(n);s(M,{name:"class diffusers.ImagePipelineOutput",anchor:"diffusers.ImagePipelineOutput",source:"https://github.com/huggingface/diffusers/blob/vr_13881/src/diffusers/pipelines/pipeline_utils.py#L122",parameters:[{name:"images",val:": list[PIL.Image.Image] | numpy.ndarray"}],parametersDescription:[{anchor:"diffusers.ImagePipelineOutput.images",description:`<strong>images</strong> (<code>List[PIL.Image.Image]</code> or <code>np.ndarray</code>) &#x2014;
List of denoised PIL images of length <code>batch_size</code> or NumPy array of shape <code>(batch_size, height, width, num_channels)</code>.`,name:"images"}]}),i(2),o(n);var O=e(n,2);t(O,{title:"AudioPipelineOutput",local:"diffusers.AudioPipelineOutput",headingTag:"h2"});var u=e(O,2),U=a(u);s(U,{name:"class diffusers.AudioPipelineOutput",anchor:"diffusers.AudioPipelineOutput",source:"https://github.com/huggingface/diffusers/blob/vr_13881/src/diffusers/pipelines/pipeline_utils.py#L136",parameters:[{name:"audios",val:": ndarray"}],parametersDescription:[{anchor:"diffusers.AudioPipelineOutput.audios",description:`<strong>audios</strong> (<code>np.ndarray</code>) &#x2014;
List of denoised audio samples of a NumPy array of shape <code>(batch_size, num_channels, sample_rate)</code>.`,name:"audios"}]}),i(2),o(u);var I=e(u,2);t(I,{title:"ImageTextPipelineOutput",local:"diffusers.ImageTextPipelineOutput",headingTag:"h2"});var p=e(I,2),V=a(p);s(V,{name:"class diffusers.ImageTextPipelineOutput",anchor:"diffusers.ImageTextPipelineOutput",source:"https://github.com/huggingface/diffusers/blob/vr_13881/src/diffusers/pipelines/deprecated/unidiffuser/pipeline_unidiffuser.py#L48",parameters:[{name:"images",val:": list[PIL.Image.Image] | numpy.ndarray | None"},{name:"text",val:": list[str] | list[list[str]] | None"}],parametersDescription:[{anchor:"diffusers.ImageTextPipelineOutput.images",description:`<strong>images</strong> (<code>list[PIL.Image.Image]</code> or <code>np.ndarray</code>) &#x2014;
list of denoised PIL images of length <code>batch_size</code> or NumPy array of shape <code>(batch_size, height, width, num_channels)</code>.`,name:"images"},{anchor:"diffusers.ImageTextPipelineOutput.text",description:`<strong>text</strong> (<code>list[str]</code> or <code>list[list[str]]</code>) &#x2014;
list of generated text strings of length <code>batch_size</code> or a list of list of strings whose outer list has
length <code>batch_size</code>.`,name:"text"}]}),i(2),o(p);var z=e(p,2);j(z,{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/outputs.md"}),i(2),T(B,l),E()}export{F as component};

Xet Storage Details

Size:
7.52 kB
·
Xet hash:
fa61d43bf304b269833259ed5f916530beecfd8dc5dc242e3c6fffa794b2955d

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