import{s as $t,o as wt,n as $e}from"../chunks/scheduler.182ea377.js";import{S as vt,i as It,g as c,s as o,r as b,A as yt,h as p,f as s,c as r,j as V,u as _,x as y,k,y as a,a as m,v as $,d as w,t as v,w as I}from"../chunks/index.abf12888.js";import{T as tt}from"../chunks/Tip.230e2334.js";import{D as Z}from"../chunks/Docstring.93f6f462.js";import{C as it}from"../chunks/CodeBlock.57fe6e13.js";import{E as nt}from"../chunks/ExampleCodeBlock.658f5cd6.js";import{H as at}from"../chunks/Heading.16916d63.js";function xt(T){let t,g='Make sure to check out the Stable Diffusion <a href="./overview#tips">Tips</a> section to learn how to explore the tradeoff between scheduler speed and quality, and how to reuse pipeline components efficiently!';return{c(){t=c("p"),t.innerHTML=g},l(i){t=p(i,"P",{"data-svelte-h":!0}),y(t)!=="svelte-py3d2y"&&(t.innerHTML=g)},m(i,f){m(i,t,f)},p:$e,d(i){i&&s(t)}}}function Tt(T){let t,g="Examples:",i,f,h;return f=new it({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvbkltYWdlVmFyaWF0aW9uUGlwZWxpbmUlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFmcm9tJTIwaW8lMjBpbXBvcnQlMjBCeXRlc0lPJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uSW1hZ2VWYXJpYXRpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIybGFtYmRhbGFicyUyRnNkLWltYWdlLXZhcmlhdGlvbnMtZGlmZnVzZXJzJTIyJTJDJTIwcmV2aXNpb24lM0QlMjJ2Mi4wJTIyJTBBKSUwQXBpcGUlMjAlM0QlMjBwaXBlLnRvKCUyMmN1ZGElMjIpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cHMlM0ElMkYlMkZsaDMuZ29vZ2xldXNlcmNvbnRlbnQuY29tJTJGeS1pRk9IZkxUd2t1UVNVZWdwd0RkZ0ttT2pSU1R2UHhhdDYzZFFMQjI1eGtUczRsaEliUlVGZU5CV1p6WWYzNzBnJTNEczEyMDAlMjIlMEElMEFyZXNwb25zZSUyMCUzRCUyMHJlcXVlc3RzLmdldCh1cmwpJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKEJ5dGVzSU8ocmVzcG9uc2UuY29udGVudCkpLmNvbnZlcnQoJTIyUkdCJTIyKSUwQSUwQW91dCUyMCUzRCUyMHBpcGUoaW1hZ2UlMkMlMjBudW1faW1hZ2VzX3Blcl9wcm9tcHQlM0QzJTJDJTIwZ3VpZGFuY2Vfc2NhbGUlM0QxNSklMEFvdXQlNUIlMjJpbWFnZXMlMjIlNUQlNUIwJTVELnNhdmUoJTIycmVzdWx0LmpwZyUyMik=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionImageVariationPipeline
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO
<span class="hljs-keyword">import</span> requests

pipe = StableDiffusionImageVariationPipeline.from_pretrained(
    <span class="hljs-string">&quot;lambdalabs/sd-image-variations-diffusers&quot;</span>, revision=<span class="hljs-string">&quot;v2.0&quot;</span>
)
pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

url = <span class="hljs-string">&quot;https://lh3.googleusercontent.com/y-iFOHfLTwkuQSUegpwDdgKmOjRSTvPxat63dQLB25xkTs4lhIbRUFeNBWZzYf370g=s1200&quot;</span>

response = requests.get(url)
image = Image.<span class="hljs-built_in">open</span>(BytesIO(response.content)).convert(<span class="hljs-string">&quot;RGB&quot;</span>)

out = pipe(image, num_images_per_prompt=<span class="hljs-number">3</span>, guidance_scale=<span class="hljs-number">15</span>)
out[<span class="hljs-string">&quot;images&quot;</span>][<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;result.jpg&quot;</span>)`,wrap:!1}}),{c(){t=c("p"),t.textContent=g,i=o(),b(f.$$.fragment)},l(n){t=p(n,"P",{"data-svelte-h":!0}),y(t)!=="svelte-kvfsh7"&&(t.textContent=g),i=r(n),_(f.$$.fragment,n)},m(n,x){m(n,t,x),m(n,i,x),$(f,n,x),h=!0},p:$e,i(n){h||(w(f.$$.fragment,n),h=!0)},o(n){v(f.$$.fragment,n),h=!1},d(n){n&&(s(t),s(i)),I(f,n)}}}function Mt(T){let t,g=`⚠️ Don’t enable attention slicing if you’re already using <code>scaled_dot_product_attention</code> (SDPA) from PyTorch
2.0 or xFormers. These attention computations are already very memory efficient so you won’t need to enable
this function. If you enable attention slicing with SDPA or xFormers, it can lead to serious slow downs!`;return{c(){t=c("p"),t.innerHTML=g},l(i){t=p(i,"P",{"data-svelte-h":!0}),y(t)!=="svelte-ackzsn"&&(t.innerHTML=g)},m(i,f){m(i,t,f)},p:$e,d(i){i&&s(t)}}}function Pt(T){let t,g="Examples:",i,f,h;return f=new it({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUlMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBJTIwJTIwJTIwJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSUyQyUwQSklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGFuJTIwYXN0cm9uYXV0JTIwcmlkaW5nJTIwYSUyMGhvcnNlJTIwb24lMjBtYXJzJTIyJTBBcGlwZS5lbmFibGVfYXR0ZW50aW9uX3NsaWNpbmcoKSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQpLmltYWdlcyU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>,
<span class="hljs-meta">... </span>    torch_dtype=torch.float16,
<span class="hljs-meta">... </span>    use_safetensors=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;a photo of an astronaut riding a horse on mars&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_attention_slicing()
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt).images[<span class="hljs-number">0</span>]`,wrap:!1}}),{c(){t=c("p"),t.textContent=g,i=o(),b(f.$$.fragment)},l(n){t=p(n,"P",{"data-svelte-h":!0}),y(t)!=="svelte-kvfsh7"&&(t.textContent=g),i=r(n),_(f.$$.fragment,n)},m(n,x){m(n,t,x),m(n,i,x),$(f,n,x),h=!0},p:$e,i(n){h||(w(f.$$.fragment,n),h=!0)},o(n){v(f.$$.fragment,n),h=!1},d(n){n&&(s(t),s(i)),I(f,n)}}}function Dt(T){let t,g=`⚠️ When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`;return{c(){t=c("p"),t.textContent=g},l(i){t=p(i,"P",{"data-svelte-h":!0}),y(t)!=="svelte-17p1lpg"&&(t.textContent=g)},m(i,f){m(i,t,f)},p:$e,d(i){i&&s(t)}}}function St(T){let t,g="Examples:",i,f,h;return f=new it({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEFmcm9tJTIweGZvcm1lcnMub3BzJTIwaW1wb3J0JTIwTWVtb3J5RWZmaWNpZW50QXR0ZW50aW9uRmxhc2hBdHRlbnRpb25PcCUwQSUwQXBpcGUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlJTIwJTNEJTIwcGlwZS50byglMjJjdWRhJTIyKSUwQXBpcGUuZW5hYmxlX3hmb3JtZXJzX21lbW9yeV9lZmZpY2llbnRfYXR0ZW50aW9uKGF0dGVudGlvbl9vcCUzRE1lbW9yeUVmZmljaWVudEF0dGVudGlvbkZsYXNoQXR0ZW50aW9uT3ApJTBBJTIzJTIwV29ya2Fyb3VuZCUyMGZvciUyMG5vdCUyMGFjY2VwdGluZyUyMGF0dGVudGlvbiUyMHNoYXBlJTIwdXNpbmclMjBWQUUlMjBmb3IlMjBGbGFzaCUyMEF0dGVudGlvbiUwQXBpcGUudmFlLmVuYWJsZV94Zm9ybWVyc19tZW1vcnlfZWZmaWNpZW50X2F0dGVudGlvbihhdHRlbnRpb25fb3AlM0ROb25lKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> xformers.ops <span class="hljs-keyword">import</span> MemoryEfficientAttentionFlashAttentionOp

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_xformers_memory_efficient_attention(attention_op=MemoryEfficientAttentionFlashAttentionOp)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Workaround for not accepting attention shape using VAE for Flash Attention</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.vae.enable_xformers_memory_efficient_attention(attention_op=<span class="hljs-literal">None</span>)`,wrap:!1}}),{c(){t=c("p"),t.textContent=g,i=o(),b(f.$$.fragment)},l(n){t=p(n,"P",{"data-svelte-h":!0}),y(t)!=="svelte-kvfsh7"&&(t.textContent=g),i=r(n),_(f.$$.fragment,n)},m(n,x){m(n,t,x),m(n,i,x),$(f,n,x),h=!0},p:$e,i(n){h||(w(f.$$.fragment,n),h=!0)},o(n){v(f.$$.fragment,n),h=!1},d(n){n&&(s(t),s(i)),I(f,n)}}}function Jt(T){let t,g,i,f,h,n,x,st='The Stable Diffusion model can also generate variations from an input image. It uses a fine-tuned version of a Stable Diffusion model by <a href="https://www.justinpinkney.com/" rel="nofollow">Justin Pinkney</a> from <a href="https://lambdalabs.com/" rel="nofollow">Lambda</a>.',ve,q,ot='The original codebase can be found at <a href="https://github.com/LambdaLabsML/lambda-diffusers#stable-diffusion-image-variations" rel="nofollow">LambdaLabsML/lambda-diffusers</a> and additional official checkpoints for image variation can be found at <a href="https://huggingface.co/lambdalabs/sd-image-variations-diffusers" rel="nofollow">lambdalabs/sd-image-variations-diffusers</a>.',Ie,W,ye,Q,xe,d,Y,Ve,re,rt="Pipeline to generate image variations from an input image using Stable Diffusion.",ke,le,lt=`This model inherits from <a href="/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a>. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`,Ce,C,H,Ue,fe,ft="The call function to the pipeline for generation.",je,L,Ze,M,O,We,ce,ct=`Enable sliced attention computation. When this option is enabled, the attention module splits the input tensor
in slices to compute attention in several steps. For more than one attention head, the computation is performed
sequentially over each head. This is useful to save some memory in exchange for a small speed decrease.`,Le,G,Ge,E,Ee,B,A,Be,pe,pt=`Disable sliced attention computation. If <code>enable_attention_slicing</code> was previously called, attention is
computed in one step.`,ze,P,K,Ne,de,dt=`Enable memory efficient attention from <a href="https://facebookresearch.github.io/xformers/" rel="nofollow">xFormers</a>. When this
option is enabled, you should observe lower GPU memory usage and a potential speed up during inference. Speed
up during training is not guaranteed.`,Fe,z,Xe,N,Re,F,ee,qe,me,mt='Disable memory efficient attention from <a href="https://facebookresearch.github.io/xformers/" rel="nofollow">xFormers</a>.',Qe,X,te,Ye,ue,ut="Disables the FreeU mechanism if enabled.",He,D,ne,Oe,ge,gt='Enables the FreeU mechanism as in <a href="https://arxiv.org/abs/2309.11497" rel="nofollow">https://arxiv.org/abs/2309.11497</a>.',Ae,he,ht="The suffixes after the scaling factors represent the stages where they are being applied.",Ke,be,bt=`Please refer to the <a href="https://github.com/ChenyangSi/FreeU" rel="nofollow">official repository</a> for combinations of the values
that are known to work well for different pipelines such as Stable Diffusion v1, v2, and Stable Diffusion XL.`,Te,ae,Me,U,ie,et,_e,_t="Output class for Stable Diffusion pipelines.",Pe,we,De;return h=new at({props:{title:"Image variation",local:"image-variation",headingTag:"h1"}}),W=new tt({props:{$$slots:{default:[xt]},$$scope:{ctx:T}}}),Q=new at({props:{title:"StableDiffusionImageVariationPipeline",local:"diffusers.StableDiffusionImageVariationPipeline",headingTag:"h2"}}),Y=new Z({props:{name:"class diffusers.StableDiffusionImageVariationPipeline",anchor:"diffusers.StableDiffusionImageVariationPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"image_encoder",val:": CLIPVisionModelWithProjection"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionImageVariationPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionImageVariationPipeline.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.StableDiffusionImageVariationPipeline.text_encoder",description:`<strong>text_encoder</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIPTextModel</a>) &#x2014;
Frozen text-encoder (<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>).`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionImageVariationPipeline.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.StableDiffusionImageVariationPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
A <code>UNet2DConditionModel</code> to denoise the encoded image latents.`,name:"unet"},{anchor:"diffusers.StableDiffusionImageVariationPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionImageVariationPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for more details
about a model&#x2019;s potential harms.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionImageVariationPipeline.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;
A <code>CLIPImageProcessor</code> to extract features from generated images; used as inputs to the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_image_variation.py#L37"}}),H=new Z({props:{name:"__call__",anchor:"diffusers.StableDiffusionImageVariationPipeline.__call__",parameters:[{name:"image",val:": Union"},{name:"height",val:": Optional = None"},{name:"width",val:": Optional = None"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"num_images_per_prompt",val:": Optional = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": Union = None"},{name:"latents",val:": Optional = None"},{name:"output_type",val:": Optional = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": Optional = None"},{name:"callback_steps",val:": int = 1"}],parametersDescription:[{anchor:"diffusers.StableDiffusionImageVariationPipeline.__call__.image",description:`<strong>image</strong> (<code>PIL.Image.Image</code> or <code>List[PIL.Image.Image]</code> or <code>torch.FloatTensor</code>) &#x2014;
Image or images to guide image generation. If you provide a tensor, it needs to be compatible with
<a href="https://huggingface.co/lambdalabs/sd-image-variations-diffusers/blob/main/feature_extractor/preprocessor_config.json" rel="nofollow"><code>CLIPImageProcessor</code></a>.`,name:"image"},{anchor:"diffusers.StableDiffusionImageVariationPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.unet.config.sample_size * self.vae_scale_factor</code>) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.StableDiffusionImageVariationPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.unet.config.sample_size * self.vae_scale_factor</code>) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.StableDiffusionImageVariationPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference. This parameter is modulated by <code>strength</code>.`,name:"num_inference_steps"},{anchor:"diffusers.StableDiffusionImageVariationPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#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:"guidance_scale"},{anchor:"diffusers.StableDiffusionImageVariationPipeline.__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.StableDiffusionImageVariationPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) from the <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">DDIM</a> paper. Only applies
to the <a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, and is ignored in other schedulers.`,name:"eta"},{anchor:"diffusers.StableDiffusionImageVariationPipeline.__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.StableDiffusionImageVariationPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor is generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.StableDiffusionImageVariationPipeline.__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.StableDiffusionImageVariationPipeline.__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/stable_diffusion/upscale#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionImageVariationPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that calls every <code>callback_steps</code> steps during inference. The function is called with the
following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.StableDiffusionImageVariationPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function is called. If not specified, the callback is called at
every step.`,name:"callback_steps"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_image_variation.py#L271",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/upscale#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> is returned,
otherwise a <code>tuple</code> is returned where the first element is a list with the generated images and the
second element is a list of <code>bool</code>s indicating whether the corresponding generated image contains
“not-safe-for-work” (nsfw) content.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/upscale#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),L=new nt({props:{anchor:"diffusers.StableDiffusionImageVariationPipeline.__call__.example",$$slots:{default:[Tt]},$$scope:{ctx:T}}}),O=new Z({props:{name:"enable_attention_slicing",anchor:"diffusers.StableDiffusionImageVariationPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": Union = 'auto'"}],parametersDescription:[{anchor:"diffusers.StableDiffusionImageVariationPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
When <code>&quot;auto&quot;</code>, halves the input to the attention heads, so attention will be computed in two steps. If
<code>&quot;max&quot;</code>, maximum amount of memory will be saved by running only one slice at a time. If a number is
provided, uses as many slices as <code>attention_head_dim // slice_size</code>. In this case, <code>attention_head_dim</code>
must be a multiple of <code>slice_size</code>.`,name:"slice_size"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L2052"}}),G=new tt({props:{warning:!0,$$slots:{default:[Mt]},$$scope:{ctx:T}}}),E=new nt({props:{anchor:"diffusers.StableDiffusionImageVariationPipeline.enable_attention_slicing.example",$$slots:{default:[Pt]},$$scope:{ctx:T}}}),A=new Z({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionImageVariationPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L2092"}}),K=new Z({props:{name:"enable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionImageVariationPipeline.enable_xformers_memory_efficient_attention",parameters:[{name:"attention_op",val:": Optional = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionImageVariationPipeline.enable_xformers_memory_efficient_attention.attention_op",description:`<strong>attention_op</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
Override the default <code>None</code> operator for use as <code>op</code> argument to the
<a href="https://facebookresearch.github.io/xformers/components/ops.html#xformers.ops.memory_efficient_attention" rel="nofollow"><code>memory_efficient_attention()</code></a>
function of xFormers.`,name:"attention_op"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1991"}}),z=new tt({props:{warning:!0,$$slots:{default:[Dt]},$$scope:{ctx:T}}}),N=new nt({props:{anchor:"diffusers.StableDiffusionImageVariationPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[St]},$$scope:{ctx:T}}}),ee=new Z({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionImageVariationPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L2026"}}),te=new Z({props:{name:"disable_freeu",anchor:"diffusers.StableDiffusionImageVariationPipeline.disable_freeu",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_image_variation.py#L267"}}),ne=new Z({props:{name:"enable_freeu",anchor:"diffusers.StableDiffusionImageVariationPipeline.enable_freeu",parameters:[{name:"s1",val:": float"},{name:"s2",val:": float"},{name:"b1",val:": float"},{name:"b2",val:": float"}],parametersDescription:[{anchor:"diffusers.StableDiffusionImageVariationPipeline.enable_freeu.s1",description:`<strong>s1</strong> (<code>float</code>) &#x2014;
Scaling factor for stage 1 to attenuate the contributions of the skip features. This is done to
mitigate &#x201C;oversmoothing effect&#x201D; in the enhanced denoising process.`,name:"s1"},{anchor:"diffusers.StableDiffusionImageVariationPipeline.enable_freeu.s2",description:`<strong>s2</strong> (<code>float</code>) &#x2014;
Scaling factor for stage 2 to attenuate the contributions of the skip features. This is done to
mitigate &#x201C;oversmoothing effect&#x201D; in the enhanced denoising process.`,name:"s2"},{anchor:"diffusers.StableDiffusionImageVariationPipeline.enable_freeu.b1",description:"<strong>b1</strong> (<code>float</code>) &#x2014; Scaling factor for stage 1 to amplify the contributions of backbone features.",name:"b1"},{anchor:"diffusers.StableDiffusionImageVariationPipeline.enable_freeu.b2",description:"<strong>b2</strong> (<code>float</code>) &#x2014; Scaling factor for stage 2 to amplify the contributions of backbone features.",name:"b2"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_image_variation.py#L244"}}),ae=new at({props:{title:"StableDiffusionPipelineOutput",local:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",headingTag:"h2"}}),ie=new Z({props:{name:"class diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",parameters:[{name:"images",val:": Union"},{name:"nsfw_content_detected",val:": Optional"}],parametersDescription:[{anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput.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.pipelines.stable_diffusion.StableDiffusionPipelineOutput.nsfw_content_detected",description:`<strong>nsfw_content_detected</strong> (<code>List[bool]</code>) &#x2014;
List indicating whether the corresponding generated image contains &#x201C;not-safe-for-work&#x201D; (nsfw) content or
<code>None</code> if safety checking could not be performed.`,name:"nsfw_content_detected"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_output.py#L10"}}),{c(){t=c("meta"),g=o(),i=c("p"),f=o(),b(h.$$.fragment),n=o(),x=c("p"),x.innerHTML=st,ve=o(),q=c("p"),q.innerHTML=ot,Ie=o(),b(W.$$.fragment),ye=o(),b(Q.$$.fragment),xe=o(),d=c("div"),b(Y.$$.fragment),Ve=o(),re=c("p"),re.textContent=rt,ke=o(),le=c("p"),le.innerHTML=lt,Ce=o(),C=c("div"),b(H.$$.fragment),Ue=o(),fe=c("p"),fe.textContent=ft,je=o(),b(L.$$.fragment),Ze=o(),M=c("div"),b(O.$$.fragment),We=o(),ce=c("p"),ce.textContent=ct,Le=o(),b(G.$$.fragment),Ge=o(),b(E.$$.fragment),Ee=o(),B=c("div"),b(A.$$.fragment),Be=o(),pe=c("p"),pe.innerHTML=pt,ze=o(),P=c("div"),b(K.$$.fragment),Ne=o(),de=c("p"),de.innerHTML=dt,Fe=o(),b(z.$$.fragment),Xe=o(),b(N.$$.fragment),Re=o(),F=c("div"),b(ee.$$.fragment),qe=o(),me=c("p"),me.innerHTML=mt,Qe=o(),X=c("div"),b(te.$$.fragment),Ye=o(),ue=c("p"),ue.textContent=ut,He=o(),D=c("div"),b(ne.$$.fragment),Oe=o(),ge=c("p"),ge.innerHTML=gt,Ae=o(),he=c("p"),he.textContent=ht,Ke=o(),be=c("p"),be.innerHTML=bt,Te=o(),b(ae.$$.fragment),Me=o(),U=c("div"),b(ie.$$.fragment),et=o(),_e=c("p"),_e.textContent=_t,Pe=o(),we=c("p"),this.h()},l(e){const l=yt("svelte-u9bgzb",document.head);t=p(l,"META",{name:!0,content:!0}),l.forEach(s),g=r(e),i=p(e,"P",{}),V(i).forEach(s),f=r(e),_(h.$$.fragment,e),n=r(e),x=p(e,"P",{"data-svelte-h":!0}),y(x)!=="svelte-136oux4"&&(x.innerHTML=st),ve=r(e),q=p(e,"P",{"data-svelte-h":!0}),y(q)!=="svelte-vto4t0"&&(q.innerHTML=ot),Ie=r(e),_(W.$$.fragment,e),ye=r(e),_(Q.$$.fragment,e),xe=r(e),d=p(e,"DIV",{class:!0});var u=V(d);_(Y.$$.fragment,u),Ve=r(u),re=p(u,"P",{"data-svelte-h":!0}),y(re)!=="svelte-1dj22j7"&&(re.textContent=rt),ke=r(u),le=p(u,"P",{"data-svelte-h":!0}),y(le)!=="svelte-496sm0"&&(le.innerHTML=lt),Ce=r(u),C=p(u,"DIV",{class:!0});var j=V(C);_(H.$$.fragment,j),Ue=r(j),fe=p(j,"P",{"data-svelte-h":!0}),y(fe)!=="svelte-50j04k"&&(fe.textContent=ft),je=r(j),_(L.$$.fragment,j),j.forEach(s),Ze=r(u),M=p(u,"DIV",{class:!0});var S=V(M);_(O.$$.fragment,S),We=r(S),ce=p(S,"P",{"data-svelte-h":!0}),y(ce)!=="svelte-10jaql7"&&(ce.textContent=ct),Le=r(S),_(G.$$.fragment,S),Ge=r(S),_(E.$$.fragment,S),S.forEach(s),Ee=r(u),B=p(u,"DIV",{class:!0});var se=V(B);_(A.$$.fragment,se),Be=r(se),pe=p(se,"P",{"data-svelte-h":!0}),y(pe)!=="svelte-1lh0nh5"&&(pe.innerHTML=pt),se.forEach(s),ze=r(u),P=p(u,"DIV",{class:!0});var J=V(P);_(K.$$.fragment,J),Ne=r(J),de=p(J,"P",{"data-svelte-h":!0}),y(de)!=="svelte-e03q3e"&&(de.innerHTML=dt),Fe=r(J),_(z.$$.fragment,J),Xe=r(J),_(N.$$.fragment,J),J.forEach(s),Re=r(u),F=p(u,"DIV",{class:!0});var oe=V(F);_(ee.$$.fragment,oe),qe=r(oe),me=p(oe,"P",{"data-svelte-h":!0}),y(me)!=="svelte-1vfte1e"&&(me.innerHTML=mt),oe.forEach(s),Qe=r(u),X=p(u,"DIV",{class:!0});var Se=V(X);_(te.$$.fragment,Se),Ye=r(Se),ue=p(Se,"P",{"data-svelte-h":!0}),y(ue)!=="svelte-psupw6"&&(ue.textContent=ut),Se.forEach(s),He=r(u),D=p(u,"DIV",{class:!0});var R=V(D);_(ne.$$.fragment,R),Oe=r(R),ge=p(R,"P",{"data-svelte-h":!0}),y(ge)!=="svelte-1f3tmq1"&&(ge.innerHTML=gt),Ae=r(R),he=p(R,"P",{"data-svelte-h":!0}),y(he)!=="svelte-xjijlp"&&(he.textContent=ht),Ke=r(R),be=p(R,"P",{"data-svelte-h":!0}),y(be)!=="svelte-hy0nzs"&&(be.innerHTML=bt),R.forEach(s),u.forEach(s),Te=r(e),_(ae.$$.fragment,e),Me=r(e),U=p(e,"DIV",{class:!0});var Je=V(U);_(ie.$$.fragment,Je),et=r(Je),_e=p(Je,"P",{"data-svelte-h":!0}),y(_e)!=="svelte-1qpjiuf"&&(_e.textContent=_t),Je.forEach(s),Pe=r(e),we=p(e,"P",{}),V(we).forEach(s),this.h()},h(){k(t,"name","hf:doc:metadata"),k(t,"content",Vt),k(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(d,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(U,"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,l){a(document.head,t),m(e,g,l),m(e,i,l),m(e,f,l),$(h,e,l),m(e,n,l),m(e,x,l),m(e,ve,l),m(e,q,l),m(e,Ie,l),$(W,e,l),m(e,ye,l),$(Q,e,l),m(e,xe,l),m(e,d,l),$(Y,d,null),a(d,Ve),a(d,re),a(d,ke),a(d,le),a(d,Ce),a(d,C),$(H,C,null),a(C,Ue),a(C,fe),a(C,je),$(L,C,null),a(d,Ze),a(d,M),$(O,M,null),a(M,We),a(M,ce),a(M,Le),$(G,M,null),a(M,Ge),$(E,M,null),a(d,Ee),a(d,B),$(A,B,null),a(B,Be),a(B,pe),a(d,ze),a(d,P),$(K,P,null),a(P,Ne),a(P,de),a(P,Fe),$(z,P,null),a(P,Xe),$(N,P,null),a(d,Re),a(d,F),$(ee,F,null),a(F,qe),a(F,me),a(d,Qe),a(d,X),$(te,X,null),a(X,Ye),a(X,ue),a(d,He),a(d,D),$(ne,D,null),a(D,Oe),a(D,ge),a(D,Ae),a(D,he),a(D,Ke),a(D,be),m(e,Te,l),$(ae,e,l),m(e,Me,l),m(e,U,l),$(ie,U,null),a(U,et),a(U,_e),m(e,Pe,l),m(e,we,l),De=!0},p(e,[l]){const u={};l&2&&(u.$$scope={dirty:l,ctx:e}),W.$set(u);const j={};l&2&&(j.$$scope={dirty:l,ctx:e}),L.$set(j);const S={};l&2&&(S.$$scope={dirty:l,ctx:e}),G.$set(S);const se={};l&2&&(se.$$scope={dirty:l,ctx:e}),E.$set(se);const J={};l&2&&(J.$$scope={dirty:l,ctx:e}),z.$set(J);const oe={};l&2&&(oe.$$scope={dirty:l,ctx:e}),N.$set(oe)},i(e){De||(w(h.$$.fragment,e),w(W.$$.fragment,e),w(Q.$$.fragment,e),w(Y.$$.fragment,e),w(H.$$.fragment,e),w(L.$$.fragment,e),w(O.$$.fragment,e),w(G.$$.fragment,e),w(E.$$.fragment,e),w(A.$$.fragment,e),w(K.$$.fragment,e),w(z.$$.fragment,e),w(N.$$.fragment,e),w(ee.$$.fragment,e),w(te.$$.fragment,e),w(ne.$$.fragment,e),w(ae.$$.fragment,e),w(ie.$$.fragment,e),De=!0)},o(e){v(h.$$.fragment,e),v(W.$$.fragment,e),v(Q.$$.fragment,e),v(Y.$$.fragment,e),v(H.$$.fragment,e),v(L.$$.fragment,e),v(O.$$.fragment,e),v(G.$$.fragment,e),v(E.$$.fragment,e),v(A.$$.fragment,e),v(K.$$.fragment,e),v(z.$$.fragment,e),v(N.$$.fragment,e),v(ee.$$.fragment,e),v(te.$$.fragment,e),v(ne.$$.fragment,e),v(ae.$$.fragment,e),v(ie.$$.fragment,e),De=!1},d(e){e&&(s(g),s(i),s(f),s(n),s(x),s(ve),s(q),s(Ie),s(ye),s(xe),s(d),s(Te),s(Me),s(U),s(Pe),s(we)),s(t),I(h,e),I(W,e),I(Q,e),I(Y),I(H),I(L),I(O),I(G),I(E),I(A),I(K),I(z),I(N),I(ee),I(te),I(ne),I(ae,e),I(ie)}}}const Vt='{"title":"Image variation","local":"image-variation","sections":[{"title":"StableDiffusionImageVariationPipeline","local":"diffusers.StableDiffusionImageVariationPipeline","sections":[],"depth":2},{"title":"StableDiffusionPipelineOutput","local":"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput","sections":[],"depth":2}],"depth":1}';function kt(T){return wt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Et extends vt{constructor(t){super(),It(this,t,kt,Jt,$t,{})}}export{Et as component};
