import{S as Qt,i as Xt,s as Zt,e as r,k as c,w as C,t as d,M as en,c as o,d as n,m as p,a as i,x,h as l,b as s,G as t,g as u,y as b,q as y,o as U,B as w,v as tn}from"../../../chunks/vendor-hf-doc-builder.js";import{T as nn}from"../../../chunks/Tip-hf-doc-builder.js";import{D as Ce}from"../../../chunks/Docstring-hf-doc-builder.js";import{I as We}from"../../../chunks/IconCopyLink-hf-doc-builder.js";function rn(xe){let f,S,m,v,$,h,H,T;return{c(){f=r("p"),S=d("Make sure to check out the Schedulers "),m=r("a"),v=d("guide"),$=d(" to learn how to explore the tradeoff between scheduler speed and quality, and see the "),h=r("a"),H=d("reuse components across pipelines"),T=d(" section to learn how to efficiently load the same components into multiple pipelines."),this.h()},l(k){f=o(k,"P",{});var g=i(f);S=l(g,"Make sure to check out the Schedulers "),m=o(g,"A",{href:!0});var I=i(m);v=l(I,"guide"),I.forEach(n),$=l(g," to learn how to explore the tradeoff between scheduler speed and quality, and see the "),h=o(g,"A",{href:!0});var L=i(h);H=l(L,"reuse components across pipelines"),L.forEach(n),T=l(g," section to learn how to efficiently load the same components into multiple pipelines."),g.forEach(n),this.h()},h(){s(m,"href","/using-diffusers/schedulers"),s(h,"href","/using-diffusers/loading#reuse-components-across-pipelines")},m(k,g){u(k,f,g),t(f,S),t(f,m),t(m,v),t(f,$),t(f,h),t(h,H),t(f,T)},d(k){k&&n(f)}}}function on(xe){let f,S,m,v,$,h,H,T,k,g,I,L,He,Re,oe,Ye,Be,be,ie,Je,ye,se,le,Ke,Ue,O,Qe,R,Xe,Ze,we,V,$e,D,A,ce,Y,et,pe,tt,Te,_,B,nt,ue,rt,ot,J,it,ae,st,at,dt,z,K,lt,fe,ct,ke,M,j,me,Q,pt,he,ut,De,P,X,ft,ge,mt,ht,Z,gt,de,_t,Pt,vt,q,ee,It,_e,Lt,Me,N,G,Pe,te,Ct,ve,xt,Ne,E,ne,bt,Ie,yt,Ee;return h=new We({}),V=new nn({props:{$$slots:{default:[rn]},$$scope:{ctx:xe}}}),Y=new We({}),B=new Ce({props:{name:"class diffusers.UnCLIPPipeline",anchor:"diffusers.UnCLIPPipeline",parameters:[{name:"prior",val:": PriorTransformer"},{name:"decoder",val:": UNet2DConditionModel"},{name:"text_encoder",val:": CLIPTextModelWithProjection"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"text_proj",val:": UnCLIPTextProjModel"},{name:"super_res_first",val:": UNet2DModel"},{name:"super_res_last",val:": UNet2DModel"},{name:"prior_scheduler",val:": UnCLIPScheduler"},{name:"decoder_scheduler",val:": UnCLIPScheduler"},{name:"super_res_scheduler",val:": UnCLIPScheduler"}],parametersDescription:[{anchor:"diffusers.UnCLIPPipeline.text_encoder",description:`<strong>text_encoder</strong> (<a href="https://huggingface.co/docs/transformers/v4.31.0/en/model_doc/clip#transformers.CLIPTextModelWithProjection" rel="nofollow">CLIPTextModelWithProjection</a>) &#x2014;
Frozen text-encoder.`,name:"text_encoder"},{anchor:"diffusers.UnCLIPPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="https://huggingface.co/docs/transformers/v4.31.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.UnCLIPPipeline.prior",description:`<strong>prior</strong> (<a href="/docs/diffusers/v0.20.0/en/api/models/prior_transformer#diffusers.PriorTransformer">PriorTransformer</a>) &#x2014;
The canonical unCLIP prior to approximate the image embedding from the text embedding.`,name:"prior"},{anchor:"diffusers.UnCLIPPipeline.text_proj",description:`<strong>text_proj</strong> (<code>UnCLIPTextProjModel</code>) &#x2014;
Utility class to prepare and combine the embeddings before they are passed to the decoder.`,name:"text_proj"},{anchor:"diffusers.UnCLIPPipeline.decoder",description:`<strong>decoder</strong> (<a href="/docs/diffusers/v0.20.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
The decoder to invert the image embedding into an image.`,name:"decoder"},{anchor:"diffusers.UnCLIPPipeline.super_res_first",description:`<strong>super_res_first</strong> (<a href="/docs/diffusers/v0.20.0/en/api/models/unet2d#diffusers.UNet2DModel">UNet2DModel</a>) &#x2014;
Super resolution UNet. Used in all but the last step of the super resolution diffusion process.`,name:"super_res_first"},{anchor:"diffusers.UnCLIPPipeline.super_res_last",description:`<strong>super_res_last</strong> (<a href="/docs/diffusers/v0.20.0/en/api/models/unet2d#diffusers.UNet2DModel">UNet2DModel</a>) &#x2014;
Super resolution UNet. Used in the last step of the super resolution diffusion process.`,name:"super_res_last"},{anchor:"diffusers.UnCLIPPipeline.prior_scheduler",description:`<strong>prior_scheduler</strong> (<code>UnCLIPScheduler</code>) &#x2014;
Scheduler used in the prior denoising process (a modified <a href="/docs/diffusers/v0.20.0/en/api/schedulers/ddpm#diffusers.DDPMScheduler">DDPMScheduler</a>).`,name:"prior_scheduler"},{anchor:"diffusers.UnCLIPPipeline.decoder_scheduler",description:`<strong>decoder_scheduler</strong> (<code>UnCLIPScheduler</code>) &#x2014;
Scheduler used in the decoder denoising process (a modified <a href="/docs/diffusers/v0.20.0/en/api/schedulers/ddpm#diffusers.DDPMScheduler">DDPMScheduler</a>).`,name:"decoder_scheduler"},{anchor:"diffusers.UnCLIPPipeline.super_res_scheduler",description:`<strong>super_res_scheduler</strong> (<code>UnCLIPScheduler</code>) &#x2014;
Scheduler used in the super resolution denoising process (a modified <a href="/docs/diffusers/v0.20.0/en/api/schedulers/ddpm#diffusers.DDPMScheduler">DDPMScheduler</a>).`,name:"super_res_scheduler"}],source:"https://github.com/huggingface/diffusers/blob/v0.20.0/src/diffusers/pipelines/unclip/pipeline_unclip.py#L33"}}),K=new Ce({props:{name:"__call__",anchor:"diffusers.UnCLIPPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": int = 1"},{name:"prior_num_inference_steps",val:": int = 25"},{name:"decoder_num_inference_steps",val:": int = 25"},{name:"super_res_num_inference_steps",val:": int = 7"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"prior_latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"super_res_latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"text_model_output",val:": typing.Union[transformers.models.clip.modeling_clip.CLIPTextModelOutput, typing.Tuple, NoneType] = None"},{name:"text_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"prior_guidance_scale",val:": float = 4.0"},{name:"decoder_guidance_scale",val:": float = 8.0"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.UnCLIPPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
The prompt or prompts to guide image generation. This can only be left undefined if <code>text_model_output</code>
and <code>text_attention_mask</code> is passed.`,name:"prompt"},{anchor:"diffusers.UnCLIPPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.UnCLIPPipeline.__call__.prior_num_inference_steps",description:`<strong>prior_num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 25) &#x2014;
The number of denoising steps for the prior. More denoising steps usually lead to a higher quality
image at the expense of slower inference.`,name:"prior_num_inference_steps"},{anchor:"diffusers.UnCLIPPipeline.__call__.decoder_num_inference_steps",description:`<strong>decoder_num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 25) &#x2014;
The number of denoising steps for the decoder. More denoising steps usually lead to a higher quality
image at the expense of slower inference.`,name:"decoder_num_inference_steps"},{anchor:"diffusers.UnCLIPPipeline.__call__.super_res_num_inference_steps",description:`<strong>super_res_num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 7) &#x2014;
The number of denoising steps for super resolution. More denoising steps usually lead to a higher
quality image at the expense of slower inference.`,name:"super_res_num_inference_steps"},{anchor:"diffusers.UnCLIPPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow"><code>torch.Generator</code></a> to make
generation deterministic.`,name:"generator"},{anchor:"diffusers.UnCLIPPipeline.__call__.prior_latents",description:`<strong>prior_latents</strong> (<code>torch.FloatTensor</code> of shape (batch size, embeddings dimension), <em>optional</em>) &#x2014;
Pre-generated noisy latents to be used as inputs for the prior.`,name:"prior_latents"},{anchor:"diffusers.UnCLIPPipeline.__call__.decoder_latents",description:`<strong>decoder_latents</strong> (<code>torch.FloatTensor</code> of shape (batch size, channels, height, width), <em>optional</em>) &#x2014;
Pre-generated noisy latents to be used as inputs for the decoder.`,name:"decoder_latents"},{anchor:"diffusers.UnCLIPPipeline.__call__.super_res_latents",description:`<strong>super_res_latents</strong> (<code>torch.FloatTensor</code> of shape (batch size, channels, super res height, super res width), <em>optional</em>) &#x2014;
Pre-generated noisy latents to be used as inputs for the decoder.`,name:"super_res_latents"},{anchor:"diffusers.UnCLIPPipeline.__call__.prior_guidance_scale",description:`<strong>prior_guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
A higher guidance scale value encourages the model to generate images closely linked to the text
<code>prompt</code> at the expense of lower image quality. Guidance scale is enabled when <code>guidance_scale &gt; 1</code>.`,name:"prior_guidance_scale"},{anchor:"diffusers.UnCLIPPipeline.__call__.decoder_guidance_scale",description:`<strong>decoder_guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
A higher guidance scale value encourages the model to generate images closely linked to the text
<code>prompt</code> at the expense of lower image quality. Guidance scale is enabled when <code>guidance_scale &gt; 1</code>.`,name:"decoder_guidance_scale"},{anchor:"diffusers.UnCLIPPipeline.__call__.text_model_output",description:`<strong>text_model_output</strong> (<code>CLIPTextModelOutput</code>, <em>optional</em>) &#x2014;
Pre-defined <code>CLIPTextModel</code> outputs that can be derived from the text encoder. Pre-defined text
outputs can be passed for tasks like text embedding interpolations. Make sure to also pass
<code>text_attention_mask</code> in this case. <code>prompt</code> can the be left <code>None</code>.`,name:"text_model_output"},{anchor:"diffusers.UnCLIPPipeline.__call__.text_attention_mask",description:`<strong>text_attention_mask</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-defined CLIP text attention mask that can be derived from the tokenizer. Pre-defined text attention
masks are necessary when passing <code>text_model_output</code>.`,name:"text_attention_mask"},{anchor:"diffusers.UnCLIPPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generated image. Choose between <code>PIL.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.UnCLIPPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.20.0/en/api/pipelines/ddim#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.20.0/src/diffusers/pipelines/unclip/pipeline_unclip.py#L208",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/v0.20.0/en/api/pipelines/ddim#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> is returned, otherwise a <code>tuple</code> is
returned where the first element is a list with the generated images.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.20.0/en/api/pipelines/ddim#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),Q=new We({}),X=new Ce({props:{name:"class diffusers.UnCLIPImageVariationPipeline",anchor:"diffusers.UnCLIPImageVariationPipeline",parameters:[{name:"decoder",val:": UNet2DConditionModel"},{name:"text_encoder",val:": CLIPTextModelWithProjection"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"text_proj",val:": UnCLIPTextProjModel"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"image_encoder",val:": CLIPVisionModelWithProjection"},{name:"super_res_first",val:": UNet2DModel"},{name:"super_res_last",val:": UNet2DModel"},{name:"decoder_scheduler",val:": UnCLIPScheduler"},{name:"super_res_scheduler",val:": UnCLIPScheduler"}],parametersDescription:[{anchor:"diffusers.UnCLIPImageVariationPipeline.text_encoder",description:`<strong>text_encoder</strong> (<a href="https://huggingface.co/docs/transformers/v4.31.0/en/model_doc/clip#transformers.CLIPTextModelWithProjection" rel="nofollow">CLIPTextModelWithProjection</a>) &#x2014;
Frozen text-encoder.`,name:"text_encoder"},{anchor:"diffusers.UnCLIPImageVariationPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="https://huggingface.co/docs/transformers/v4.31.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.UnCLIPImageVariationPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<a href="https://huggingface.co/docs/transformers/v4.31.0/en/model_doc/clip#transformers.CLIPImageProcessor" rel="nofollow">CLIPImageProcessor</a>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>image_encoder</code>.`,name:"feature_extractor"},{anchor:"diffusers.UnCLIPImageVariationPipeline.image_encoder",description:`<strong>image_encoder</strong> (<a href="https://huggingface.co/docs/transformers/v4.31.0/en/model_doc/clip#transformers.CLIPVisionModelWithProjection" rel="nofollow">CLIPVisionModelWithProjection</a>) &#x2014;
Frozen CLIP image-encoder (<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>).`,name:"image_encoder"},{anchor:"diffusers.UnCLIPImageVariationPipeline.text_proj",description:`<strong>text_proj</strong> (<code>UnCLIPTextProjModel</code>) &#x2014;
Utility class to prepare and combine the embeddings before they are passed to the decoder.`,name:"text_proj"},{anchor:"diffusers.UnCLIPImageVariationPipeline.decoder",description:`<strong>decoder</strong> (<a href="/docs/diffusers/v0.20.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
The decoder to invert the image embedding into an image.`,name:"decoder"},{anchor:"diffusers.UnCLIPImageVariationPipeline.super_res_first",description:`<strong>super_res_first</strong> (<a href="/docs/diffusers/v0.20.0/en/api/models/unet2d#diffusers.UNet2DModel">UNet2DModel</a>) &#x2014;
Super resolution UNet. Used in all but the last step of the super resolution diffusion process.`,name:"super_res_first"},{anchor:"diffusers.UnCLIPImageVariationPipeline.super_res_last",description:`<strong>super_res_last</strong> (<a href="/docs/diffusers/v0.20.0/en/api/models/unet2d#diffusers.UNet2DModel">UNet2DModel</a>) &#x2014;
Super resolution UNet. Used in the last step of the super resolution diffusion process.`,name:"super_res_last"},{anchor:"diffusers.UnCLIPImageVariationPipeline.decoder_scheduler",description:`<strong>decoder_scheduler</strong> (<code>UnCLIPScheduler</code>) &#x2014;
Scheduler used in the decoder denoising process (a modified <a href="/docs/diffusers/v0.20.0/en/api/schedulers/ddpm#diffusers.DDPMScheduler">DDPMScheduler</a>).`,name:"decoder_scheduler"},{anchor:"diffusers.UnCLIPImageVariationPipeline.super_res_scheduler",description:`<strong>super_res_scheduler</strong> (<code>UnCLIPScheduler</code>) &#x2014;
Scheduler used in the super resolution denoising process (a modified <a href="/docs/diffusers/v0.20.0/en/api/schedulers/ddpm#diffusers.DDPMScheduler">DDPMScheduler</a>).`,name:"super_res_scheduler"}],source:"https://github.com/huggingface/diffusers/blob/v0.20.0/src/diffusers/pipelines/unclip/pipeline_unclip_image_variation.py#L38"}}),ee=new Ce({props:{name:"__call__",anchor:"diffusers.UnCLIPImageVariationPipeline.__call__",parameters:[{name:"image",val:": typing.Union[PIL.Image.Image, typing.List[PIL.Image.Image], torch.FloatTensor, NoneType] = None"},{name:"num_images_per_prompt",val:": int = 1"},{name:"decoder_num_inference_steps",val:": int = 25"},{name:"super_res_num_inference_steps",val:": int = 7"},{name:"generator",val:": typing.Optional[torch._C.Generator] = None"},{name:"decoder_latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"super_res_latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"image_embeddings",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_guidance_scale",val:": float = 8.0"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.UnCLIPImageVariationPipeline.__call__.image",description:`<strong>image</strong> (<code>PIL.Image.Image</code> or <code>List[PIL.Image.Image]</code> or <code>torch.FloatTensor</code>) &#x2014;
<code>Image</code> or tensor representing an image batch to be used as the starting point. If you provide a
tensor, it needs to be compatible with the <code>CLIPImageProcessor</code>
<a href="https://huggingface.co/fusing/karlo-image-variations-diffusers/blob/main/feature_extractor/preprocessor_config.json" rel="nofollow">configuration</a>.
Can be left as <code>None</code> only when <code>image_embeddings</code> are passed.`,name:"image"},{anchor:"diffusers.UnCLIPImageVariationPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.UnCLIPImageVariationPipeline.__call__.decoder_num_inference_steps",description:`<strong>decoder_num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 25) &#x2014;
The number of denoising steps for the decoder. More denoising steps usually lead to a higher quality
image at the expense of slower inference.`,name:"decoder_num_inference_steps"},{anchor:"diffusers.UnCLIPImageVariationPipeline.__call__.super_res_num_inference_steps",description:`<strong>super_res_num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 7) &#x2014;
The number of denoising steps for super resolution. More denoising steps usually lead to a higher
quality image at the expense of slower inference.`,name:"super_res_num_inference_steps"},{anchor:"diffusers.UnCLIPImageVariationPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) &#x2014;
A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow"><code>torch.Generator</code></a> to make
generation deterministic.`,name:"generator"},{anchor:"diffusers.UnCLIPImageVariationPipeline.__call__.decoder_latents",description:`<strong>decoder_latents</strong> (<code>torch.FloatTensor</code> of shape (batch size, channels, height, width), <em>optional</em>) &#x2014;
Pre-generated noisy latents to be used as inputs for the decoder.`,name:"decoder_latents"},{anchor:"diffusers.UnCLIPImageVariationPipeline.__call__.super_res_latents",description:`<strong>super_res_latents</strong> (<code>torch.FloatTensor</code> of shape (batch size, channels, super res height, super res width), <em>optional</em>) &#x2014;
Pre-generated noisy latents to be used as inputs for the decoder.`,name:"super_res_latents"},{anchor:"diffusers.UnCLIPImageVariationPipeline.__call__.decoder_guidance_scale",description:`<strong>decoder_guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
A higher guidance scale value encourages the model to generate images closely linked to the text
<code>prompt</code> at the expense of lower image quality. Guidance scale is enabled when <code>guidance_scale &gt; 1</code>.`,name:"decoder_guidance_scale"},{anchor:"diffusers.UnCLIPImageVariationPipeline.__call__.image_embeddings",description:`<strong>image_embeddings</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-defined image embeddings that can be derived from the image encoder. Pre-defined image embeddings
can be passed for tasks like image interpolations. <code>image</code> can be left as <code>None</code>.`,name:"image_embeddings"},{anchor:"diffusers.UnCLIPImageVariationPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generated image. Choose between <code>PIL.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.UnCLIPImageVariationPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.20.0/en/api/pipelines/ddim#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.20.0/src/diffusers/pipelines/unclip/pipeline_unclip_image_variation.py#L197",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/v0.20.0/en/api/pipelines/ddim#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> is returned, otherwise a <code>tuple</code> is
returned where the first element is a list with the generated images.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.20.0/en/api/pipelines/ddim#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),te=new We({}),ne=new Ce({props:{name:"class diffusers.ImagePipelineOutput",anchor:"diffusers.ImagePipelineOutput",parameters:[{name:"images",val:": typing.Union[typing.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"}],source:"https://github.com/huggingface/diffusers/blob/v0.20.0/src/diffusers/pipelines/pipeline_utils.py#L112"}}),{c(){f=r("meta"),S=c(),m=r("h1"),v=r("a"),$=r("span"),C(h.$$.fragment),H=c(),T=r("span"),k=d("UnCLIP"),g=c(),I=r("p"),L=r("a"),He=d("Hierarchical Text-Conditional Image Generation with CLIP Latents"),Re=d(" is by Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, Mark Chen. The UnCLIP model in \u{1F917} Diffusers comes from kakaobrain\u2019s "),oe=r("a"),Ye=d("karlo"),Be=d("."),be=c(),ie=r("p"),Je=d("The abstract from the paper is following:"),ye=c(),se=r("p"),le=r("em"),Ke=d("Contrastive models like CLIP have been shown to learn robust representations of images that capture both semantics and style. To leverage these representations for image generation, we propose a two-stage model: a prior that generates a CLIP image embedding given a text caption, and a decoder that generates an image conditioned on the image embedding. We show that explicitly generating image representations improves image diversity with minimal loss in photorealism and caption similarity. Our decoders conditioned on image representations can also produce variations of an image that preserve both its semantics and style, while varying the non-essential details absent from the image representation. Moreover, the joint embedding space of CLIP enables language-guided image manipulations in a zero-shot fashion. We use diffusion models for the decoder and experiment with both autoregressive and diffusion models for the prior, finding that the latter are computationally more efficient and produce higher-quality samples."),Ue=c(),O=r("p"),Qe=d("You can find lucidrains DALL-E 2 recreation at "),R=r("a"),Xe=d("lucidrains/DALLE2-pytorch"),Ze=d("."),we=c(),C(V.$$.fragment),$e=c(),D=r("h2"),A=r("a"),ce=r("span"),C(Y.$$.fragment),et=c(),pe=r("span"),tt=d("UnCLIPPipeline"),Te=c(),_=r("div"),C(B.$$.fragment),nt=c(),ue=r("p"),rt=d("Pipeline for text-to-image generation using unCLIP."),ot=c(),J=r("p"),it=d("This model inherits from "),ae=r("a"),st=d("DiffusionPipeline"),at=d(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),dt=c(),z=r("div"),C(K.$$.fragment),lt=c(),fe=r("p"),ct=d("The call function to the pipeline for generation."),ke=c(),M=r("h2"),j=r("a"),me=r("span"),C(Q.$$.fragment),pt=c(),he=r("span"),ut=d("UnCLIPImageVariationPipeline"),De=c(),P=r("div"),C(X.$$.fragment),ft=c(),ge=r("p"),mt=d("Pipeline to generate image variations from an input image using UnCLIP."),ht=c(),Z=r("p"),gt=d("This model inherits from "),de=r("a"),_t=d("DiffusionPipeline"),Pt=d(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),vt=c(),q=r("div"),C(ee.$$.fragment),It=c(),_e=r("p"),Lt=d("The call function to the pipeline for generation."),Me=c(),N=r("h2"),G=r("a"),Pe=r("span"),C(te.$$.fragment),Ct=c(),ve=r("span"),xt=d("ImagePipelineOutput"),Ne=c(),E=r("div"),C(ne.$$.fragment),bt=c(),Ie=r("p"),yt=d("Output class for image pipelines."),this.h()},l(e){const a=en('[data-svelte="svelte-1phssyn"]',document.head);f=o(a,"META",{name:!0,content:!0}),a.forEach(n),S=p(e),m=o(e,"H1",{class:!0});var re=i(m);v=o(re,"A",{id:!0,class:!0,href:!0});var Ut=i(v);$=o(Ut,"SPAN",{});var wt=i($);x(h.$$.fragment,wt),wt.forEach(n),Ut.forEach(n),H=p(re),T=o(re,"SPAN",{});var $t=i(T);k=l($t,"UnCLIP"),$t.forEach(n),re.forEach(n),g=p(e),I=o(e,"P",{});var Le=i(I);L=o(Le,"A",{href:!0,rel:!0});var Tt=i(L);He=l(Tt,"Hierarchical Text-Conditional Image Generation with CLIP Latents"),Tt.forEach(n),Re=l(Le," is by Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, Mark Chen. The UnCLIP model in \u{1F917} Diffusers comes from kakaobrain\u2019s "),oe=o(Le,"A",{href:!0});var kt=i(oe);Ye=l(kt,"karlo"),kt.forEach(n),Be=l(Le,"."),Le.forEach(n),be=p(e),ie=o(e,"P",{});var Dt=i(ie);Je=l(Dt,"The abstract from the paper is following:"),Dt.forEach(n),ye=p(e),se=o(e,"P",{});var Mt=i(se);le=o(Mt,"EM",{});var Nt=i(le);Ke=l(Nt,"Contrastive models like CLIP have been shown to learn robust representations of images that capture both semantics and style. To leverage these representations for image generation, we propose a two-stage model: a prior that generates a CLIP image embedding given a text caption, and a decoder that generates an image conditioned on the image embedding. We show that explicitly generating image representations improves image diversity with minimal loss in photorealism and caption similarity. Our decoders conditioned on image representations can also produce variations of an image that preserve both its semantics and style, while varying the non-essential details absent from the image representation. Moreover, the joint embedding space of CLIP enables language-guided image manipulations in a zero-shot fashion. We use diffusion models for the decoder and experiment with both autoregressive and diffusion models for the prior, finding that the latter are computationally more efficient and produce higher-quality samples."),Nt.forEach(n),Mt.forEach(n),Ue=p(e),O=o(e,"P",{});var Se=i(O);Qe=l(Se,"You can find lucidrains DALL-E 2 recreation at "),R=o(Se,"A",{href:!0,rel:!0});var Et=i(R);Xe=l(Et,"lucidrains/DALLE2-pytorch"),Et.forEach(n),Ze=l(Se,"."),Se.forEach(n),we=p(e),x(V.$$.fragment,e),$e=p(e),D=o(e,"H2",{class:!0});var Oe=i(D);A=o(Oe,"A",{id:!0,class:!0,href:!0});var St=i(A);ce=o(St,"SPAN",{});var Ot=i(ce);x(Y.$$.fragment,Ot),Ot.forEach(n),St.forEach(n),et=p(Oe),pe=o(Oe,"SPAN",{});var Vt=i(pe);tt=l(Vt,"UnCLIPPipeline"),Vt.forEach(n),Oe.forEach(n),Te=p(e),_=o(e,"DIV",{class:!0});var F=i(_);x(B.$$.fragment,F),nt=p(F),ue=o(F,"P",{});var At=i(ue);rt=l(At,"Pipeline for text-to-image generation using unCLIP."),At.forEach(n),ot=p(F),J=o(F,"P",{});var Ve=i(J);it=l(Ve,"This model inherits from "),ae=o(Ve,"A",{href:!0});var zt=i(ae);st=l(zt,"DiffusionPipeline"),zt.forEach(n),at=l(Ve,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Ve.forEach(n),dt=p(F),z=o(F,"DIV",{class:!0});var Ae=i(z);x(K.$$.fragment,Ae),lt=p(Ae),fe=o(Ae,"P",{});var jt=i(fe);ct=l(jt,"The call function to the pipeline for generation."),jt.forEach(n),Ae.forEach(n),F.forEach(n),ke=p(e),M=o(e,"H2",{class:!0});var ze=i(M);j=o(ze,"A",{id:!0,class:!0,href:!0});var qt=i(j);me=o(qt,"SPAN",{});var Gt=i(me);x(Q.$$.fragment,Gt),Gt.forEach(n),qt.forEach(n),pt=p(ze),he=o(ze,"SPAN",{});var Ft=i(he);ut=l(Ft,"UnCLIPImageVariationPipeline"),Ft.forEach(n),ze.forEach(n),De=p(e),P=o(e,"DIV",{class:!0});var W=i(P);x(X.$$.fragment,W),ft=p(W),ge=o(W,"P",{});var Wt=i(ge);mt=l(Wt,"Pipeline to generate image variations from an input image using UnCLIP."),Wt.forEach(n),ht=p(W),Z=o(W,"P",{});var je=i(Z);gt=l(je,"This model inherits from "),de=o(je,"A",{href:!0});var Ht=i(de);_t=l(Ht,"DiffusionPipeline"),Ht.forEach(n),Pt=l(je,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),je.forEach(n),vt=p(W),q=o(W,"DIV",{class:!0});var qe=i(q);x(ee.$$.fragment,qe),It=p(qe),_e=o(qe,"P",{});var Rt=i(_e);Lt=l(Rt,"The call function to the pipeline for generation."),Rt.forEach(n),qe.forEach(n),W.forEach(n),Me=p(e),N=o(e,"H2",{class:!0});var Ge=i(N);G=o(Ge,"A",{id:!0,class:!0,href:!0});var Yt=i(G);Pe=o(Yt,"SPAN",{});var Bt=i(Pe);x(te.$$.fragment,Bt),Bt.forEach(n),Yt.forEach(n),Ct=p(Ge),ve=o(Ge,"SPAN",{});var Jt=i(ve);xt=l(Jt,"ImagePipelineOutput"),Jt.forEach(n),Ge.forEach(n),Ne=p(e),E=o(e,"DIV",{class:!0});var Fe=i(E);x(ne.$$.fragment,Fe),bt=p(Fe),Ie=o(Fe,"P",{});var Kt=i(Ie);yt=l(Kt,"Output class for image pipelines."),Kt.forEach(n),Fe.forEach(n),this.h()},h(){s(f,"name","hf:doc:metadata"),s(f,"content",JSON.stringify(sn)),s(v,"id","unclip"),s(v,"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"),s(v,"href","#unclip"),s(m,"class","relative group"),s(L,"href","https://huggingface.co/papers/2204.06125"),s(L,"rel","nofollow"),s(oe,"href","(https://github.com/kakaobrain/karlo)"),s(R,"href","https://github.com/lucidrains/DALLE2-pytorch"),s(R,"rel","nofollow"),s(A,"id","diffusers.UnCLIPPipeline"),s(A,"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"),s(A,"href","#diffusers.UnCLIPPipeline"),s(D,"class","relative group"),s(ae,"href","/docs/diffusers/v0.20.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),s(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(_,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(j,"id","diffusers.UnCLIPImageVariationPipeline"),s(j,"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"),s(j,"href","#diffusers.UnCLIPImageVariationPipeline"),s(M,"class","relative group"),s(de,"href","/docs/diffusers/v0.20.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),s(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(G,"id","diffusers.ImagePipelineOutput"),s(G,"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"),s(G,"href","#diffusers.ImagePipelineOutput"),s(N,"class","relative group"),s(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,a){t(document.head,f),u(e,S,a),u(e,m,a),t(m,v),t(v,$),b(h,$,null),t(m,H),t(m,T),t(T,k),u(e,g,a),u(e,I,a),t(I,L),t(L,He),t(I,Re),t(I,oe),t(oe,Ye),t(I,Be),u(e,be,a),u(e,ie,a),t(ie,Je),u(e,ye,a),u(e,se,a),t(se,le),t(le,Ke),u(e,Ue,a),u(e,O,a),t(O,Qe),t(O,R),t(R,Xe),t(O,Ze),u(e,we,a),b(V,e,a),u(e,$e,a),u(e,D,a),t(D,A),t(A,ce),b(Y,ce,null),t(D,et),t(D,pe),t(pe,tt),u(e,Te,a),u(e,_,a),b(B,_,null),t(_,nt),t(_,ue),t(ue,rt),t(_,ot),t(_,J),t(J,it),t(J,ae),t(ae,st),t(J,at),t(_,dt),t(_,z),b(K,z,null),t(z,lt),t(z,fe),t(fe,ct),u(e,ke,a),u(e,M,a),t(M,j),t(j,me),b(Q,me,null),t(M,pt),t(M,he),t(he,ut),u(e,De,a),u(e,P,a),b(X,P,null),t(P,ft),t(P,ge),t(ge,mt),t(P,ht),t(P,Z),t(Z,gt),t(Z,de),t(de,_t),t(Z,Pt),t(P,vt),t(P,q),b(ee,q,null),t(q,It),t(q,_e),t(_e,Lt),u(e,Me,a),u(e,N,a),t(N,G),t(G,Pe),b(te,Pe,null),t(N,Ct),t(N,ve),t(ve,xt),u(e,Ne,a),u(e,E,a),b(ne,E,null),t(E,bt),t(E,Ie),t(Ie,yt),Ee=!0},p(e,[a]){const re={};a&2&&(re.$$scope={dirty:a,ctx:e}),V.$set(re)},i(e){Ee||(y(h.$$.fragment,e),y(V.$$.fragment,e),y(Y.$$.fragment,e),y(B.$$.fragment,e),y(K.$$.fragment,e),y(Q.$$.fragment,e),y(X.$$.fragment,e),y(ee.$$.fragment,e),y(te.$$.fragment,e),y(ne.$$.fragment,e),Ee=!0)},o(e){U(h.$$.fragment,e),U(V.$$.fragment,e),U(Y.$$.fragment,e),U(B.$$.fragment,e),U(K.$$.fragment,e),U(Q.$$.fragment,e),U(X.$$.fragment,e),U(ee.$$.fragment,e),U(te.$$.fragment,e),U(ne.$$.fragment,e),Ee=!1},d(e){n(f),e&&n(S),e&&n(m),w(h),e&&n(g),e&&n(I),e&&n(be),e&&n(ie),e&&n(ye),e&&n(se),e&&n(Ue),e&&n(O),e&&n(we),w(V,e),e&&n($e),e&&n(D),w(Y),e&&n(Te),e&&n(_),w(B),w(K),e&&n(ke),e&&n(M),w(Q),e&&n(De),e&&n(P),w(X),w(ee),e&&n(Me),e&&n(N),w(te),e&&n(Ne),e&&n(E),w(ne)}}}const sn={local:"unclip",sections:[{local:"diffusers.UnCLIPPipeline",title:"UnCLIPPipeline"},{local:"diffusers.UnCLIPImageVariationPipeline",title:"UnCLIPImageVariationPipeline"},{local:"diffusers.ImagePipelineOutput",title:"ImagePipelineOutput"}],title:"UnCLIP"};function an(xe){return tn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class un extends Qt{constructor(f){super();Xt(this,f,an,on,Zt,{})}}export{un as default,sn as metadata};
