import{S as Xn,i as Zn,s as et,e as r,k as c,w as C,t as d,M as nt,c as o,d as t,m as p,a as i,x,h as l,b as a,G as n,g as u,y as b,q as y,o as U,B as w,v as tt}from"../../../chunks/vendor-hf-doc-builder.js";import{T as rt}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 ot(xe){let f,S,m,I,$,h,H,T;return{c(){f=r("p"),S=d("Make sure to check out the Schedulers "),m=r("a"),I=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 v=i(m);I=l(v,"guide"),v.forEach(t),$=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(t),T=l(g," section to learn how to efficiently load the same components into multiple pipelines."),g.forEach(t),this.h()},h(){a(m,"href","/using-diffusers/schedulers"),a(h,"href","/using-diffusers/loading#reuse-components-across-pipelines")},m(k,g){u(k,f,g),n(f,S),n(f,m),n(m,I),n(f,$),n(f,h),n(h,H),n(f,T)},d(k){k&&t(f)}}}function it(xe){let f,S,m,I,$,h,H,T,k,g,v,L,He,Re,oe,Ye,Be,be,ie,Je,ye,ae,le,Ke,Ue,O,Qe,R,Xe,Ze,we,V,$e,D,A,ce,Y,en,pe,nn,Te,_,B,tn,ue,rn,on,J,an,se,sn,dn,ln,z,K,cn,fe,pn,ke,M,j,me,Q,un,he,fn,De,P,X,mn,ge,hn,gn,Z,_n,de,Pn,In,vn,q,ee,Ln,_e,Cn,Me,N,G,Pe,ne,xn,Ie,bn,Ne,E,te,yn,ve,Un,Ee;return h=new We({}),V=new rt({props:{$$slots:{default:[ot]},$$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/main/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/main/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/main/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/main/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/main/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/main/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/main/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/main/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/main/en/api/schedulers/ddpm#diffusers.DDPMScheduler">DDPMScheduler</a>).`,name:"super_res_scheduler"}],source:"https://github.com/huggingface/diffusers/blob/main/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/main/en/api/pipelines/latent_diffusion_uncond#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/unclip/pipeline_unclip.py#L208",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/main/en/api/pipelines/latent_diffusion_uncond#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/main/en/api/pipelines/latent_diffusion_uncond#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/main/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/main/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/main/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/main/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/main/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/main/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/main/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/main/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/main/en/api/schedulers/ddpm#diffusers.DDPMScheduler">DDPMScheduler</a>).`,name:"super_res_scheduler"}],source:"https://github.com/huggingface/diffusers/blob/main/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/main/en/api/pipelines/latent_diffusion_uncond#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/main/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/main/en/api/pipelines/latent_diffusion_uncond#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/main/en/api/pipelines/latent_diffusion_uncond#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),ne=new We({}),te=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/main/src/diffusers/pipelines/pipeline_utils.py#L112"}}),{c(){f=r("meta"),S=c(),m=r("h1"),I=r("a"),$=r("span"),C(h.$$.fragment),H=c(),T=r("span"),k=d("UnCLIP"),g=c(),v=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(),ae=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),en=c(),pe=r("span"),nn=d("UnCLIPPipeline"),Te=c(),_=r("div"),C(B.$$.fragment),tn=c(),ue=r("p"),rn=d("Pipeline for text-to-image generation using unCLIP."),on=c(),J=r("p"),an=d("This model inherits from "),se=r("a"),sn=d("DiffusionPipeline"),dn=d(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),ln=c(),z=r("div"),C(K.$$.fragment),cn=c(),fe=r("p"),pn=d("The call function to the pipeline for generation."),ke=c(),M=r("h2"),j=r("a"),me=r("span"),C(Q.$$.fragment),un=c(),he=r("span"),fn=d("UnCLIPImageVariationPipeline"),De=c(),P=r("div"),C(X.$$.fragment),mn=c(),ge=r("p"),hn=d("Pipeline to generate image variations from an input image using UnCLIP."),gn=c(),Z=r("p"),_n=d("This model inherits from "),de=r("a"),Pn=d("DiffusionPipeline"),In=d(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),vn=c(),q=r("div"),C(ee.$$.fragment),Ln=c(),_e=r("p"),Cn=d("The call function to the pipeline for generation."),Me=c(),N=r("h2"),G=r("a"),Pe=r("span"),C(ne.$$.fragment),xn=c(),Ie=r("span"),bn=d("ImagePipelineOutput"),Ne=c(),E=r("div"),C(te.$$.fragment),yn=c(),ve=r("p"),Un=d("Output class for image pipelines."),this.h()},l(e){const s=nt('[data-svelte="svelte-1phssyn"]',document.head);f=o(s,"META",{name:!0,content:!0}),s.forEach(t),S=p(e),m=o(e,"H1",{class:!0});var re=i(m);I=o(re,"A",{id:!0,class:!0,href:!0});var wn=i(I);$=o(wn,"SPAN",{});var $n=i($);x(h.$$.fragment,$n),$n.forEach(t),wn.forEach(t),H=p(re),T=o(re,"SPAN",{});var Tn=i(T);k=l(Tn,"UnCLIP"),Tn.forEach(t),re.forEach(t),g=p(e),v=o(e,"P",{});var Le=i(v);L=o(Le,"A",{href:!0,rel:!0});var kn=i(L);He=l(kn,"Hierarchical Text-Conditional Image Generation with CLIP Latents"),kn.forEach(t),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 Dn=i(oe);Ye=l(Dn,"karlo"),Dn.forEach(t),Be=l(Le,"."),Le.forEach(t),be=p(e),ie=o(e,"P",{});var Mn=i(ie);Je=l(Mn,"The abstract from the paper is following:"),Mn.forEach(t),ye=p(e),ae=o(e,"P",{});var Nn=i(ae);le=o(Nn,"EM",{});var En=i(le);Ke=l(En,"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."),En.forEach(t),Nn.forEach(t),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 Sn=i(R);Xe=l(Sn,"lucidrains/DALLE2-pytorch"),Sn.forEach(t),Ze=l(Se,"."),Se.forEach(t),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 On=i(A);ce=o(On,"SPAN",{});var Vn=i(ce);x(Y.$$.fragment,Vn),Vn.forEach(t),On.forEach(t),en=p(Oe),pe=o(Oe,"SPAN",{});var An=i(pe);nn=l(An,"UnCLIPPipeline"),An.forEach(t),Oe.forEach(t),Te=p(e),_=o(e,"DIV",{class:!0});var F=i(_);x(B.$$.fragment,F),tn=p(F),ue=o(F,"P",{});var zn=i(ue);rn=l(zn,"Pipeline for text-to-image generation using unCLIP."),zn.forEach(t),on=p(F),J=o(F,"P",{});var Ve=i(J);an=l(Ve,"This model inherits from "),se=o(Ve,"A",{href:!0});var jn=i(se);sn=l(jn,"DiffusionPipeline"),jn.forEach(t),dn=l(Ve,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Ve.forEach(t),ln=p(F),z=o(F,"DIV",{class:!0});var Ae=i(z);x(K.$$.fragment,Ae),cn=p(Ae),fe=o(Ae,"P",{});var qn=i(fe);pn=l(qn,"The call function to the pipeline for generation."),qn.forEach(t),Ae.forEach(t),F.forEach(t),ke=p(e),M=o(e,"H2",{class:!0});var ze=i(M);j=o(ze,"A",{id:!0,class:!0,href:!0});var Gn=i(j);me=o(Gn,"SPAN",{});var Fn=i(me);x(Q.$$.fragment,Fn),Fn.forEach(t),Gn.forEach(t),un=p(ze),he=o(ze,"SPAN",{});var Wn=i(he);fn=l(Wn,"UnCLIPImageVariationPipeline"),Wn.forEach(t),ze.forEach(t),De=p(e),P=o(e,"DIV",{class:!0});var W=i(P);x(X.$$.fragment,W),mn=p(W),ge=o(W,"P",{});var Hn=i(ge);hn=l(Hn,"Pipeline to generate image variations from an input image using UnCLIP."),Hn.forEach(t),gn=p(W),Z=o(W,"P",{});var je=i(Z);_n=l(je,"This model inherits from "),de=o(je,"A",{href:!0});var Rn=i(de);Pn=l(Rn,"DiffusionPipeline"),Rn.forEach(t),In=l(je,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),je.forEach(t),vn=p(W),q=o(W,"DIV",{class:!0});var qe=i(q);x(ee.$$.fragment,qe),Ln=p(qe),_e=o(qe,"P",{});var Yn=i(_e);Cn=l(Yn,"The call function to the pipeline for generation."),Yn.forEach(t),qe.forEach(t),W.forEach(t),Me=p(e),N=o(e,"H2",{class:!0});var Ge=i(N);G=o(Ge,"A",{id:!0,class:!0,href:!0});var Bn=i(G);Pe=o(Bn,"SPAN",{});var Jn=i(Pe);x(ne.$$.fragment,Jn),Jn.forEach(t),Bn.forEach(t),xn=p(Ge),Ie=o(Ge,"SPAN",{});var Kn=i(Ie);bn=l(Kn,"ImagePipelineOutput"),Kn.forEach(t),Ge.forEach(t),Ne=p(e),E=o(e,"DIV",{class:!0});var Fe=i(E);x(te.$$.fragment,Fe),yn=p(Fe),ve=o(Fe,"P",{});var Qn=i(ve);Un=l(Qn,"Output class for image pipelines."),Qn.forEach(t),Fe.forEach(t),this.h()},h(){a(f,"name","hf:doc:metadata"),a(f,"content",JSON.stringify(at)),a(I,"id","unclip"),a(I,"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"),a(I,"href","#unclip"),a(m,"class","relative group"),a(L,"href","https://huggingface.co/papers/2204.06125"),a(L,"rel","nofollow"),a(oe,"href","(https://github.com/kakaobrain/karlo)"),a(R,"href","https://github.com/lucidrains/DALLE2-pytorch"),a(R,"rel","nofollow"),a(A,"id","diffusers.UnCLIPPipeline"),a(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"),a(A,"href","#diffusers.UnCLIPPipeline"),a(D,"class","relative group"),a(se,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline"),a(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(_,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(j,"id","diffusers.UnCLIPImageVariationPipeline"),a(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"),a(j,"href","#diffusers.UnCLIPImageVariationPipeline"),a(M,"class","relative group"),a(de,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline"),a(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(G,"id","diffusers.ImagePipelineOutput"),a(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"),a(G,"href","#diffusers.ImagePipelineOutput"),a(N,"class","relative group"),a(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,s){n(document.head,f),u(e,S,s),u(e,m,s),n(m,I),n(I,$),b(h,$,null),n(m,H),n(m,T),n(T,k),u(e,g,s),u(e,v,s),n(v,L),n(L,He),n(v,Re),n(v,oe),n(oe,Ye),n(v,Be),u(e,be,s),u(e,ie,s),n(ie,Je),u(e,ye,s),u(e,ae,s),n(ae,le),n(le,Ke),u(e,Ue,s),u(e,O,s),n(O,Qe),n(O,R),n(R,Xe),n(O,Ze),u(e,we,s),b(V,e,s),u(e,$e,s),u(e,D,s),n(D,A),n(A,ce),b(Y,ce,null),n(D,en),n(D,pe),n(pe,nn),u(e,Te,s),u(e,_,s),b(B,_,null),n(_,tn),n(_,ue),n(ue,rn),n(_,on),n(_,J),n(J,an),n(J,se),n(se,sn),n(J,dn),n(_,ln),n(_,z),b(K,z,null),n(z,cn),n(z,fe),n(fe,pn),u(e,ke,s),u(e,M,s),n(M,j),n(j,me),b(Q,me,null),n(M,un),n(M,he),n(he,fn),u(e,De,s),u(e,P,s),b(X,P,null),n(P,mn),n(P,ge),n(ge,hn),n(P,gn),n(P,Z),n(Z,_n),n(Z,de),n(de,Pn),n(Z,In),n(P,vn),n(P,q),b(ee,q,null),n(q,Ln),n(q,_e),n(_e,Cn),u(e,Me,s),u(e,N,s),n(N,G),n(G,Pe),b(ne,Pe,null),n(N,xn),n(N,Ie),n(Ie,bn),u(e,Ne,s),u(e,E,s),b(te,E,null),n(E,yn),n(E,ve),n(ve,Un),Ee=!0},p(e,[s]){const re={};s&2&&(re.$$scope={dirty:s,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(ne.$$.fragment,e),y(te.$$.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(ne.$$.fragment,e),U(te.$$.fragment,e),Ee=!1},d(e){t(f),e&&t(S),e&&t(m),w(h),e&&t(g),e&&t(v),e&&t(be),e&&t(ie),e&&t(ye),e&&t(ae),e&&t(Ue),e&&t(O),e&&t(we),w(V,e),e&&t($e),e&&t(D),w(Y),e&&t(Te),e&&t(_),w(B),w(K),e&&t(ke),e&&t(M),w(Q),e&&t(De),e&&t(P),w(X),w(ee),e&&t(Me),e&&t(N),w(ne),e&&t(Ne),e&&t(E),w(te)}}}const at={local:"unclip",sections:[{local:"diffusers.UnCLIPPipeline",title:"UnCLIPPipeline"},{local:"diffusers.UnCLIPImageVariationPipeline",title:"UnCLIPImageVariationPipeline"},{local:"diffusers.ImagePipelineOutput",title:"ImagePipelineOutput"}],title:"UnCLIP"};function st(xe){return tt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ut extends Xn{constructor(f){super();Zn(this,f,st,it,et,{})}}export{ut as default,at as metadata};
