import{S as lc,i as ac,s as ic,e as l,k as d,w as h,t as o,M as oc,c as a,d as s,m as f,a as i,x as m,h as r,b as n,G as e,g as c,y as b,L as rc,q as g,o as y,B as v,v as nc}from"../../../../chunks/vendor-hf-doc-builder.js";import{D as ya}from"../../../../chunks/Docstring-hf-doc-builder.js";import{C as x}from"../../../../chunks/CodeBlock-hf-doc-builder.js";import{I as B}from"../../../../chunks/IconCopyLink-hf-doc-builder.js";function pc(Fr){let N,dl,k,ae,ps,Je,va,cs,_a,fl,E,wa,ds,Ma,Ja,Ee,Ea,Sa,Se,Ta,Za,Te,Ia,Ua,ul,ht,$,ja,Ze,Da,Ga,Ie,Wa,xa,hl,ie,Ba,Ue,Na,ka,ml,V,oe,fs,je,$a,us,Va,bl,X,re,hs,De,Xa,ms,Ra,gl,U,Fa,mt,Aa,Ya,bt,Qa,Ca,yl,S,R,bs,Pa,za,Ge,Ha,La,gt,qa,Ka,F,gs,Oa,ei,We,ti,si,yt,li,ai,A,ys,ii,oi,xe,ri,ni,vt,pi,ci,Y,vs,di,fi,Be,ui,hi,_t,mi,bi,Q,_s,gi,yi,Ne,vi,_i,ws,wi,vl,ne,Mi,wt,Ji,Ei,_l,C,pe,Ms,ke,Si,Js,Ti,wl,Mt,P,Es,Zi,Ii,$e,Ui,ji,Jt,Di,Ml,Ve,Jl,Et,z,Ss,Gi,Wi,Xe,xi,Bi,St,Ni,El,Re,Sl,H,ce,Ts,Fe,ki,Zs,$i,Tl,de,Vi,Is,Ae,Xi,Ri,Zl,Tt,Fi,Il,Zt,Ai,Ul,Z,Us,Yi,Qi,js,Ci,Pi,Ds,zi,Hi,Gs,Li,jl,j,qi,Ws,Ki,Oi,It,eo,to,Dl,Ut,xs,so,Gl,Ye,Wl,fe,I,lo,Qe,Bs,ao,io,Ce,Ns,oo,ro,ks,no,po,co,$s,fo,xl,Pe,Bl,jt,Vs,uo,Nl,ze,kl,D,ho,He,mo,bo,Xs,go,yo,$l,Dt,vo,Vl,Le,Xl,L,ue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jaGVkdWxlci5jb25maWcpJTBBcGlwZSUyMCUzRCUyMHBpcGUudG8oJTIyY3VkYSUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJIaWdoJTIwcXVhbGl0eSUyMHBob3RvJTIwb2YlMjBhbiUyMGFzdHJvbmF1dCUyMHJpZGluZyUyMGElMjBob3JzZSUyMGluJTIwc3BhY2UlMjIlMEFpbWFnZSUyMCUzRCUyMHBpcGUocHJvbXB0JTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDI1KS5pbWFnZXMlNUIwJTVEJTBBaW1hZ2Uuc2F2ZSglMjJhc3Ryb25hdXQucG5nJTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline, DPMSolverMultistepScheduler
<span class="hljs-keyword">import</span> torch

repo_id = <span class="hljs-string">&quot;stabilityai/stable-diffusion-2-base&quot;</span>
pipe = DiffusionPipeline.from_pretrained(repo_id, torch_dtype=torch.float16, revision=<span class="hljs-string">&quot;fp16&quot;</span>)

pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

prompt = <span class="hljs-string">&quot;High quality photo of an astronaut riding a horse in space&quot;</span>
image = pipe(prompt, num_inference_steps=<span class="hljs-number">25</span>).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;astronaut.png&quot;</span>)`}}),Re=new x({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTJDJTIwRFBNU29sdmVyTXVsdGlzdGVwU2NoZWR1bGVyJTBBaW1wb3J0JTIwdG9yY2glMEElMEFyZXBvX2lkJTIwJTNEJTIwJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLTIlMjIlMEFwaXBlJTIwJTNEJTIwRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKHJlcG9faWQlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMjByZXZpc2lvbiUzRCUyMmZwMTYlMjIpJTBBJTBBcGlwZS5zY2hlZHVsZXIlMjAlM0QlMjBEUE1Tb2x2ZXJNdWx0aXN0ZXBTY2hlZHVsZXIuZnJvbV9jb25maWcocGlwZS5zY2hlZHVsZXIuY29uZmlnKSUwQXBpcGUlMjAlM0QlMjBwaXBlLnRvKCUyMmN1ZGElMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIySGlnaCUyMHF1YWxpdHklMjBwaG90byUyMG9mJTIwYW4lMjBhc3Ryb25hdXQlMjByaWRpbmclMjBhJTIwaG9yc2UlMjBpbiUyMHNwYWNlJTIyJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKHByb21wdCUyQyUyMGd1aWRhbmNlX3NjYWxlJTNEOSUyQyUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0QyNSkuaW1hZ2VzJTVCMCU1RCUwQWltYWdlLnNhdmUoJTIyYXN0cm9uYXV0LnBuZyUyMik=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline, DPMSolverMultistepScheduler
<span class="hljs-keyword">import</span> torch

repo_id = <span class="hljs-string">&quot;stabilityai/stable-diffusion-2&quot;</span>
pipe = DiffusionPipeline.from_pretrained(repo_id, torch_dtype=torch.float16, revision=<span class="hljs-string">&quot;fp16&quot;</span>)

pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

prompt = <span class="hljs-string">&quot;High quality photo of an astronaut riding a horse in space&quot;</span>
image = pipe(prompt, guidance_scale=<span class="hljs-number">9</span>, num_inference_steps=<span class="hljs-number">25</span>).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;astronaut.png&quot;</span>)`}}),Fe=new B({}),Ye=new x({props:{code:"cGlwZS5zY2hlZHVsZXIlMjAlM0QlMjBERElNU2NoZWR1bGVyLmZyb21fY29uZmlnKHBpcGUuc2NoZWR1bGVyLmNvbmZpZyUyQyUyMHJlc2NhbGVfYmV0YXNfemVyb19zbnIlM0RUcnVlKQ==",highlighted:'pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config, rescale_betas_zero_snr=<span class="hljs-literal">True</span>)'}}),Pe=new x({props:{code:"cGlwZS5zY2hlZHVsZXIlMjAlM0QlMjBERElNU2NoZWR1bGVyLmZyb21fY29uZmlnKHBpcGUuc2NoZWR1bGVyLmNvbmZpZyUyQyUyMHRpbWVzdGVwX3NjYWxpbmclM0QlMjJ0cmFpbGluZyUyMik=",highlighted:'pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config, timestep_scaling=<span class="hljs-string">&quot;trailing&quot;</span>)'}}),ze=new x({props:{code:"cGlwZSguLi4lMkMlMjBndWlkYW5jZV9yZXNjYWxlJTNEMC43KQ==",highlighted:'pipe(..., guidance_rescale=<span class="hljs-number">0.7</span>)'}}),Le=new x({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTJDJTIwRERJTVNjaGVkdWxlciUwQSUwQXBpcGUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIycHR4MCUyRnBzZXVkby1qb3VybmV5LXYyJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KSUwQXBpcGUuc2NoZWR1bGVyJTIwJTNEJTIwRERJTVNjaGVkdWxlci5mcm9tX2NvbmZpZyglMEElMjAlMjAlMjAlMjBwaXBlLnNjaGVkdWxlci5jb25maWclMkMlMjByZXNjYWxlX2JldGFzX3plcm9fc25yJTNEVHJ1ZSUyQyUyMHRpbWVzdGVwX3NjYWxpbmclM0QlMjJ0cmFpbGluZyUyMiUwQSklMEFwaXBlLnRvKCUyMmN1ZGElMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyQSUyMGxpb24lMjBpbiUyMGdhbGF4aWVzJTJDJTIwc3BpcmFscyUyQyUyMG5lYnVsYWUlMkMlMjBzdGFycyUyQyUyMHNtb2tlJTJDJTIwaXJpZGVzY2VudCUyQyUyMGludHJpY2F0ZSUyMGRldGFpbCUyQyUyMG9jdGFuZSUyMHJlbmRlciUyQyUyMDhrJTIyJTBBaW1hZ2UlMjAlM0QlMjBwaXBlbGluZShwcm9tcHQlMkMlMjBndWlkYW5jZV9yZXNjYWxlJTNEMC43KS5pbWFnZXMlNUIwJTVE",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline, DDIMScheduler

pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;ptx0/pseudo-journey-v2&quot;</span>, torch_dtype=torch.float16)
pipe.scheduler = DDIMScheduler.from_config(
    pipe.scheduler.config, rescale_betas_zero_snr=<span class="hljs-literal">True</span>, timestep_scaling=<span class="hljs-string">&quot;trailing&quot;</span>
)
pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

prompt = <span class="hljs-string">&quot;A lion in galaxies, spirals, nebulae, stars, smoke, iridescent, intricate detail, octane render, 8k&quot;</span>
image = pipeline(prompt, guidance_rescale=<span class="hljs-number">0.7</span>).images[<span class="hljs-number">0</span>]`}}),qe=new B({}),Ke=new ya({props:{name:"class diffusers.DDIMScheduler",anchor:"diffusers.DDIMScheduler",parameters:[{name:"num_train_timesteps",val:": int = 1000"},{name:"beta_start",val:": float = 0.0001"},{name:"beta_end",val:": float = 0.02"},{name:"beta_schedule",val:": str = 'linear'"},{name:"trained_betas",val:": typing.Union[numpy.ndarray, typing.List[float], NoneType] = None"},{name:"clip_sample",val:": bool = True"},{name:"set_alpha_to_one",val:": bool = True"},{name:"steps_offset",val:": int = 0"},{name:"prediction_type",val:": str = 'epsilon'"},{name:"thresholding",val:": bool = False"},{name:"dynamic_thresholding_ratio",val:": float = 0.995"},{name:"clip_sample_range",val:": float = 1.0"},{name:"sample_max_value",val:": float = 1.0"},{name:"timestep_spacing",val:": str = 'leading'"},{name:"rescale_betas_zero_snr",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.DDIMScheduler.num_train_timesteps",description:"<strong>num_train_timesteps</strong> (<code>int</code>) &#x2014; number of diffusion steps used to train the model.",name:"num_train_timesteps"},{anchor:"diffusers.DDIMScheduler.beta_start",description:"<strong>beta_start</strong> (<code>float</code>) &#x2014; the starting <code>beta</code> value of inference.",name:"beta_start"},{anchor:"diffusers.DDIMScheduler.beta_end",description:"<strong>beta_end</strong> (<code>float</code>) &#x2014; the final <code>beta</code> value.",name:"beta_end"},{anchor:"diffusers.DDIMScheduler.beta_schedule",description:`<strong>beta_schedule</strong> (<code>str</code>) &#x2014;
the beta schedule, a mapping from a beta range to a sequence of betas for stepping the model. Choose from
<code>linear</code>, <code>scaled_linear</code>, or <code>squaredcos_cap_v2</code>.`,name:"beta_schedule"},{anchor:"diffusers.DDIMScheduler.trained_betas",description:`<strong>trained_betas</strong> (<code>np.ndarray</code>, optional) &#x2014;
option to pass an array of betas directly to the constructor to bypass <code>beta_start</code>, <code>beta_end</code> etc.`,name:"trained_betas"},{anchor:"diffusers.DDIMScheduler.clip_sample",description:`<strong>clip_sample</strong> (<code>bool</code>, default <code>True</code>) &#x2014;
option to clip predicted sample for numerical stability.`,name:"clip_sample"},{anchor:"diffusers.DDIMScheduler.clip_sample_range",description:`<strong>clip_sample_range</strong> (<code>float</code>, default <code>1.0</code>) &#x2014;
the maximum magnitude for sample clipping. Valid only when <code>clip_sample=True</code>.`,name:"clip_sample_range"},{anchor:"diffusers.DDIMScheduler.set_alpha_to_one",description:`<strong>set_alpha_to_one</strong> (<code>bool</code>, default <code>True</code>) &#x2014;
each diffusion step uses the value of alphas product at that step and at the previous one. For the final
step there is no previous alpha. When this option is <code>True</code> the previous alpha product is fixed to <code>1</code>,
otherwise it uses the value of alpha at step 0.`,name:"set_alpha_to_one"},{anchor:"diffusers.DDIMScheduler.steps_offset",description:`<strong>steps_offset</strong> (<code>int</code>, default <code>0</code>) &#x2014;
an offset added to the inference steps. You can use a combination of <code>offset=1</code> and
<code>set_alpha_to_one=False</code>, to make the last step use step 0 for the previous alpha product, as done in
stable diffusion.`,name:"steps_offset"},{anchor:"diffusers.DDIMScheduler.prediction_type",description:`<strong>prediction_type</strong> (<code>str</code>, default <code>epsilon</code>, optional) &#x2014;
prediction type of the scheduler function, one of <code>epsilon</code> (predicting the noise of the diffusion
process), <code>sample</code> (directly predicting the noisy sample<code>) or </code>v_prediction\` (see section 2.4
<a href="https://imagen.research.google/video/paper.pdf" rel="nofollow">https://imagen.research.google/video/paper.pdf</a>)`,name:"prediction_type"},{anchor:"diffusers.DDIMScheduler.thresholding",description:`<strong>thresholding</strong> (<code>bool</code>, default <code>False</code>) &#x2014;
whether to use the &#x201C;dynamic thresholding&#x201D; method (introduced by Imagen, <a href="https://arxiv.org/abs/2205.11487" rel="nofollow">https://arxiv.org/abs/2205.11487</a>).
Note that the thresholding method is unsuitable for latent-space diffusion models (such as
stable-diffusion).`,name:"thresholding"},{anchor:"diffusers.DDIMScheduler.dynamic_thresholding_ratio",description:`<strong>dynamic_thresholding_ratio</strong> (<code>float</code>, default <code>0.995</code>) &#x2014;
the ratio for the dynamic thresholding method. Default is <code>0.995</code>, the same as Imagen
(<a href="https://arxiv.org/abs/2205.11487" rel="nofollow">https://arxiv.org/abs/2205.11487</a>). Valid only when <code>thresholding=True</code>.`,name:"dynamic_thresholding_ratio"},{anchor:"diffusers.DDIMScheduler.sample_max_value",description:`<strong>sample_max_value</strong> (<code>float</code>, default <code>1.0</code>) &#x2014;
the threshold value for dynamic thresholding. Valid only when <code>thresholding=True</code>.`,name:"sample_max_value"},{anchor:"diffusers.DDIMScheduler.timestep_spacing",description:`<strong>timestep_spacing</strong> (<code>str</code>, default <code>&quot;leading&quot;</code>) &#x2014;
The way the timesteps should be scaled. Refer to Table 2. of <a href="https://arxiv.org/abs/2305.08891" rel="nofollow">Common Diffusion Noise Schedules and Sample
Steps are Flawed</a> for more information.`,name:"timestep_spacing"},{anchor:"diffusers.DDIMScheduler.rescale_betas_zero_snr",description:`<strong>rescale_betas_zero_snr</strong> (<code>bool</code>, default <code>False</code>) &#x2014;
whether to rescale the betas to have zero terminal SNR (proposed by <a href="https://arxiv.org/pdf/2305.08891.pdf" rel="nofollow">https://arxiv.org/pdf/2305.08891.pdf</a>).
This can enable the model to generate very bright and dark samples instead of limiting it to samples with
medium brightness. Loosely related to
<a href="https://github.com/huggingface/diffusers/blob/74fd735eb073eb1d774b1ab4154a0876eb82f055/examples/dreambooth/train_dreambooth.py#L506" rel="nofollow"><code>--offset_noise</code></a>.`,name:"rescale_betas_zero_snr"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.0/src/diffusers/schedulers/scheduling_ddim.py#L115"}}),et=new ya({props:{name:"scale_model_input",anchor:"diffusers.DDIMScheduler.scale_model_input",parameters:[{name:"sample",val:": FloatTensor"},{name:"timestep",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"diffusers.DDIMScheduler.scale_model_input.sample",description:"<strong>sample</strong> (<code>torch.FloatTensor</code>) &#x2014; input sample",name:"sample"},{anchor:"diffusers.DDIMScheduler.scale_model_input.timestep",description:"<strong>timestep</strong> (<code>int</code>, optional) &#x2014; current timestep",name:"timestep"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.0/src/diffusers/schedulers/scheduling_ddim.py#L228",returnDescription:`
<p>scaled input sample</p>
`,returnType:`
<p><code>torch.FloatTensor</code></p>
`}}),tt=new ya({props:{name:"set_timesteps",anchor:"diffusers.DDIMScheduler.set_timesteps",parameters:[{name:"num_inference_steps",val:": int"},{name:"device",val:": typing.Union[str, torch.device] = None"}],parametersDescription:[{anchor:"diffusers.DDIMScheduler.set_timesteps.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>) &#x2014;
the number of diffusion steps used when generating samples with a pre-trained model.`,name:"num_inference_steps"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.0/src/diffusers/schedulers/scheduling_ddim.py#L287"}}),st=new ya({props:{name:"step",anchor:"diffusers.DDIMScheduler.step",parameters:[{name:"model_output",val:": FloatTensor"},{name:"timestep",val:": int"},{name:"sample",val:": FloatTensor"},{name:"eta",val:": float = 0.0"},{name:"use_clipped_model_output",val:": bool = False"},{name:"generator",val:" = None"},{name:"variance_noise",val:": typing.Optional[torch.FloatTensor] = None"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.DDIMScheduler.step.model_output",description:"<strong>model_output</strong> (<code>torch.FloatTensor</code>) &#x2014; direct output from learned diffusion model.",name:"model_output"},{anchor:"diffusers.DDIMScheduler.step.timestep",description:"<strong>timestep</strong> (<code>int</code>) &#x2014; current discrete timestep in the diffusion chain.",name:"timestep"},{anchor:"diffusers.DDIMScheduler.step.sample",description:`<strong>sample</strong> (<code>torch.FloatTensor</code>) &#x2014;
current instance of sample being created by diffusion process.`,name:"sample"},{anchor:"diffusers.DDIMScheduler.step.eta",description:"<strong>eta</strong> (<code>float</code>) &#x2014; weight of noise for added noise in diffusion step.",name:"eta"},{anchor:"diffusers.DDIMScheduler.step.use_clipped_model_output",description:`<strong>use_clipped_model_output</strong> (<code>bool</code>) &#x2014; if <code>True</code>, compute &#x201C;corrected&#x201D; <code>model_output</code> from the clipped
predicted original sample. Necessary because predicted original sample is clipped to [-1, 1] when
<code>self.config.clip_sample</code> is <code>True</code>. If no clipping has happened, &#x201C;corrected&#x201D; <code>model_output</code> would
coincide with the one provided as input and <code>use_clipped_model_output</code> will have not effect.
generator &#x2014; random number generator.`,name:"use_clipped_model_output"},{anchor:"diffusers.DDIMScheduler.step.variance_noise",description:`<strong>variance_noise</strong> (<code>torch.FloatTensor</code>) &#x2014; instead of generating noise for the variance using <code>generator</code>, we
can directly provide the noise for the variance itself. This is useful for methods such as
CycleDiffusion. (<a href="https://arxiv.org/abs/2210.05559" rel="nofollow">https://arxiv.org/abs/2210.05559</a>)`,name:"variance_noise"},{anchor:"diffusers.DDIMScheduler.step.return_dict",description:"<strong>return_dict</strong> (<code>bool</code>) &#x2014; option for returning tuple rather than DDIMSchedulerOutput class",name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.0/src/diffusers/schedulers/scheduling_ddim.py#L325",returnDescription:`
<p><code>~schedulers.scheduling_utils.DDIMSchedulerOutput</code> if <code>return_dict</code> is True, otherwise a <code>tuple</code>. When
returning a tuple, the first element is the sample tensor.</p>
`,returnType:`
<p><code>~schedulers.scheduling_utils.DDIMSchedulerOutput</code> or <code>tuple</code></p>
`}}),lt=new B({}),it=new x({props:{code:"aW1wb3J0JTIwUElMJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBpbyUyMGltcG9ydCUyMEJ5dGVzSU8lMEElMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMkMlMjBEUE1Tb2x2ZXJNdWx0aXN0ZXBTY2hlZHVsZXIlMEElMEElMEFkZWYlMjBkb3dubG9hZF9pbWFnZSh1cmwpJTNBJTBBJTIwJTIwJTIwJTIwcmVzcG9uc2UlMjAlM0QlMjByZXF1ZXN0cy5nZXQodXJsKSUwQSUyMCUyMCUyMCUyMHJldHVybiUyMFBJTC5JbWFnZS5vcGVuKEJ5dGVzSU8ocmVzcG9uc2UuY29udGVudCkpLmNvbnZlcnQoJTIyUkdCJTIyKSUwQSUwQSUwQWltZ191cmwlMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRnJhdy5naXRodWJ1c2VyY29udGVudC5jb20lMkZDb21wVmlzJTJGbGF0ZW50LWRpZmZ1c2lvbiUyRm1haW4lMkZkYXRhJTJGaW5wYWludGluZ19leGFtcGxlcyUyRm92ZXJ0dXJlLWNyZWF0aW9ucy01c0k2ZlFnWUl1by5wbmclMjIlMEFtYXNrX3VybCUyMCUzRCUyMCUyMmh0dH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lJTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDI1KS5pbWFnZXMlNUIwJTVEJTBBJTBBaW1hZ2Uuc2F2ZSglMjJ5ZWxsb3dfY2F0LnBuZyUyMik=",highlighted:`<span class="hljs-keyword">import</span> PIL
<span class="hljs-keyword">import</span> requests
<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO

<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline, DPMSolverMultistepScheduler


<span class="hljs-keyword">def</span> <span class="hljs-title function_">download_image</span>(<span class="hljs-params">url</span>):
    response = requests.get(url)
    <span class="hljs-keyword">return</span> PIL.Image.<span class="hljs-built_in">open</span>(BytesIO(response.content)).convert(<span class="hljs-string">&quot;RGB&quot;</span>)


img_url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png&quot;</span>
mask_url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png&quot;</span>

init_image = download_image(img_url).resize((<span class="hljs-number">512</span>, <span class="hljs-number">512</span>))
mask_image = download_image(mask_url).resize((<span class="hljs-number">512</span>, <span class="hljs-number">512</span>))

repo_id = <span class="hljs-string">&quot;stabilityai/stable-diffusion-2-inpainting&quot;</span>
pipe = DiffusionPipeline.from_pretrained(repo_id, torch_dtype=torch.float16, revision=<span class="hljs-string">&quot;fp16&quot;</span>)

pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

prompt = <span class="hljs-string">&quot;Face of a yellow cat, high resolution, sitting on a park bench&quot;</span>
image = pipe(prompt=prompt, image=init_image, mask_image=mask_image, num_inference_steps=<span class="hljs-number">25</span>).images[<span class="hljs-number">0</span>]

image.save(<span class="hljs-string">&quot;yellow_cat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LnJlc2l6ZSgoMTI4JTJDJTIwMTI4KSklMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwd2hpdGUlMjBjYXQlMjIlMEF1cHNjYWxlZF9pbWFnZSUyMCUzRCUyMHBpcGVsaW5lKHByb21wdCUzRHByb21wdCUyQyUyMGltYWdlJTNEbG93X3Jlc19pbWcpLmltYWdlcyU1QjAlNUQlMEF1cHNjYWxlZF9pbWFnZS5zYXZlKCUyMnVwc2FtcGxlZF9jYXQucG5nJTIyKQ==",highlighted:`<span class="hljs-keyword">import</span> requests
<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">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionUpscalePipeline
<span class="hljs-keyword">import</span> torch

<span class="hljs-comment"># load model and scheduler</span>
model_id = <span class="hljs-string">&quot;stabilityai/stable-diffusion-x4-upscaler&quot;</span>
pipeline = StableDiffusionUpscalePipeline.from_pretrained(model_id, torch_dtype=torch.float16)
pipeline = pipeline.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-comment"># let&#x27;s download an  image</span>
url = <span class="hljs-string">&quot;https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/sd2-upscale/low_res_cat.png&quot;</span>
response = requests.get(url)
low_res_img = Image.<span class="hljs-built_in">open</span>(BytesIO(response.content)).convert(<span class="hljs-string">&quot;RGB&quot;</span>)
low_res_img = low_res_img.resize((<span class="hljs-number">128</span>, <span class="hljs-number">128</span>))
prompt = <span class="hljs-string">&quot;a white cat&quot;</span>
upscaled_image = pipeline(prompt=prompt, image=low_res_img).images[<span class="hljs-number">0</span>]
upscaled_image.save(<span class="hljs-string">&quot;upsampled_cat.png&quot;</span>)`}}),pt=new B({}),dt=new x({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjByZXF1ZXN0cyUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQSUwQWZyb20lMjBkaWZmdXNlcnMlMjBpbXBvcnQlMjBTdGFibGVEaWZmdXNpb25EZXB0aDJJbWdQaXBlbGluZSUwQSUwQXBpcGUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25EZXB0aDJJbWdQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLTItZGVwdGglMjIlMkMlMEElMjAlMjAlMjAlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMEEpLnRvKCUyMmN1ZGElMjIpJTBBJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWluaXRfaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBcHJvbXB0JTIwJTNEJTIwJTIydHdvJTIwdGlnZXJzJTIyJTBBbl9wcm9wbXQlMjAlM0QlMjAlMjJiYWQlMkMlMjBkZWZvcm1lZCUyQyUyMHVnbHklMkMlMjBiYWQlMjBhbm90b215JTIyJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKHByb21wdCUzRHByb21wdCUyQyUyMGltYWdlJTNEaW5pdF9pbWFnZSUyQyUyMG5lZ2F0aXZlX3Byb21wdCUzRG5fcHJvcG10JTJDJTIwc3RyZW5ndGglM0QwLjcpLmltYWdlcyU1QjAlNUQ=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> requests
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image

<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionDepth2ImgPipeline

pipe = StableDiffusionDepth2ImgPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-2-depth&quot;</span>,
    torch_dtype=torch.float16,
).to(<span class="hljs-string">&quot;cuda&quot;</span>)


url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
init_image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
prompt = <span class="hljs-string">&quot;two tigers&quot;</span>
n_propmt = <span class="hljs-string">&quot;bad, deformed, ugly, bad anotomy&quot;</span>
image = pipe(prompt=prompt, image=init_image, negative_prompt=n_propmt, strength=<span class="hljs-number">0.7</span>).images[<span class="hljs-number">0</span>]`}}),ft=new B({}),ut=new x({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTJDJTIwRXVsZXJEaXNjcmV0ZVNjaGVkdWxlciUwQSUwQXBpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMnN0YWJpbGl0eWFpJTJGc3RhYmxlLWRpZmZ1c2lvbi0yJTIyKSUwQXBpcGVsaW5lLnNjaGVkdWxlciUyMCUzRCUyMEV1bGVyRGlzY3JldGVTY2hlZHVsZXIuZnJvbV9jb25maWcocGlwZWxpbmUuc2NoZWR1bGVyLmNvbmZpZyklMEElMEElMjMlMjBvciUwQWV1bGVyX3NjaGVkdWxlciUyMCUzRCUyMEV1bGVyRGlzY3JldGVTY2hlZHVsZXIuZnJvbV9wcmV0cmFpbmVkKCUyMnN0YWJpbGl0eWFpJTJGc3RhYmxlLWRpZmZ1c2lvbi0yJTIyJTJDJTIwc3ViZm9sZGVyJTNEJTIyc2NoZWR1bGVyJTIyKSUwQXBpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMnN0YWJpbGl0eWFpJTJGc3RhYmxlLWRpZmZ1c2lvbi0yJTIyJTJDJTIwc2NoZWR1bGVyJTNEZXVsZXJfc2NoZWR1bGVyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline, EulerDiscreteScheduler

<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline = StableDiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;stabilityai/stable-diffusion-2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline.scheduler = EulerDiscreteScheduler.from_config(pipeline.scheduler.config)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># or</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>euler_scheduler = EulerDiscreteScheduler.from_pretrained(<span class="hljs-string">&quot;stabilityai/stable-diffusion-2&quot;</span>, subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline = StableDiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;stabilityai/stable-diffusion-2&quot;</span>, scheduler=euler_scheduler)`}}),{c(){N=l("meta"),dl=d(),k=l("h1"),ae=l("a"),ps=l("span"),h(Je.$$.fragment),va=d(),cs=l("span"),_a=o("Stable diffusion 2"),fl=d(),E=l("p"),wa=o("Stable Diffusion 2 is a text-to-image "),ds=l("em"),Ma=o("latent diffusion"),Ja=o(" model built upon the work of "),Ee=l("a"),Ea=o("Stable Diffusion 1"),Sa=o(`.
The project to train Stable Diffusion 2 was led by Robin Rombach and Katherine Crowson from `),Se=l("a"),Ta=o("Stability AI"),Za=o(" and "),Te=l("a"),Ia=o("LAION"),Ua=o("."),ul=d(),ht=l("p"),$=l("em"),ja=o(`The Stable Diffusion 2.0 release includes robust text-to-image models trained using a brand new text encoder (OpenCLIP), developed by LAION with support from Stability AI, which greatly improves the quality of the generated images compared to earlier V1 releases. The text-to-image models in this release can generate images with default resolutions of both 512x512 pixels and 768x768 pixels.
These models are trained on an aesthetic subset of the `),Ze=l("a"),Da=o("LAION-5B dataset"),Ga=o(" created by the DeepFloyd team at Stability AI, which is then further filtered to remove adult content using "),Ie=l("a"),Wa=o("LAION\u2019s NSFW filter"),xa=o("."),hl=d(),ie=l("p"),Ba=o("For more details about how Stable Diffusion 2 works and how it differs from Stable Diffusion 1, please refer to the official "),Ue=l("a"),Na=o("launch announcement post"),ka=o("."),ml=d(),V=l("h2"),oe=l("a"),fs=l("span"),h(je.$$.fragment),$a=d(),us=l("span"),Va=o("Tips"),bl=d(),X=l("h3"),re=l("a"),hs=l("span"),h(De.$$.fragment),Xa=d(),ms=l("span"),Ra=o("Available checkpoints:"),gl=d(),U=l("p"),Fa=o("Note that the architecture is more or less identical to "),mt=l("a"),Aa=o("Stable Diffusion 1"),Ya=o(" so please refer to "),bt=l("a"),Qa=o("this page"),Ca=o(" for API documentation."),yl=d(),S=l("ul"),R=l("li"),bs=l("em"),Pa=o("Text-to-Image (512x512 resolution)"),za=o(": "),Ge=l("a"),Ha=o("stabilityai/stable-diffusion-2-base"),La=o(" with "),gt=l("a"),qa=o("StableDiffusionPipeline"),Ka=d(),F=l("li"),gs=l("em"),Oa=o("Text-to-Image (768x768 resolution)"),ei=o(": "),We=l("a"),ti=o("stabilityai/stable-diffusion-2"),si=o(" with "),yt=l("a"),li=o("StableDiffusionPipeline"),ai=d(),A=l("li"),ys=l("em"),ii=o("Image Inpainting (512x512 resolution)"),oi=o(": "),xe=l("a"),ri=o("stabilityai/stable-diffusion-2-inpainting"),ni=o(" with "),vt=l("a"),pi=o("StableDiffusionInpaintPipeline"),ci=d(),Y=l("li"),vs=l("em"),di=o("Super-Resolution (x4 resolution resolution)"),fi=o(": "),Be=l("a"),ui=o("stable-diffusion-x4-upscaler"),hi=d(),_t=l("a"),mi=o("StableDiffusionUpscalePipeline"),bi=d(),Q=l("li"),_s=l("em"),gi=o("Depth-to-Image (512x512 resolution)"),yi=o(": "),Ne=l("a"),vi=o("stabilityai/stable-diffusion-2-depth"),_i=o(" with "),ws=l("code"),wi=o("StableDiffusionDepth2ImagePipeline"),vl=d(),ne=l("p"),Mi=o("We recommend using the "),wt=l("a"),Ji=o("DPMSolverMultistepScheduler"),Ei=o(" as it\u2019s currently the fastest scheduler there is."),_l=d(),C=l("h3"),pe=l("a"),Ms=l("span"),h(ke.$$.fragment),Si=d(),Js=l("span"),Ti=o("Text-to-Image"),wl=d(),Mt=l("ul"),P=l("li"),Es=l("em"),Zi=o("Text-to-Image (512x512 resolution)"),Ii=o(": "),$e=l("a"),Ui=o("stabilityai/stable-diffusion-2-base"),ji=o(" with "),Jt=l("a"),Di=o("StableDiffusionPipeline"),Ml=d(),h(Ve.$$.fragment),Jl=d(),Et=l("ul"),z=l("li"),Ss=l("em"),Gi=o("Text-to-Image (768x768 resolution)"),Wi=o(": "),Xe=l("a"),xi=o("stabilityai/stable-diffusion-2"),Bi=o(" with "),St=l("a"),Ni=o("StableDiffusionPipeline"),El=d(),h(Re.$$.fragment),Sl=d(),H=l("h4"),ce=l("a"),Ts=l("span"),h(Fe.$$.fragment),ki=d(),Zs=l("span"),$i=o('Experimental: "Common Diffusion Noise Schedules and Sample Steps are Flawed":'),Tl=d(),de=l("p"),Vi=o("The paper "),Is=l("strong"),Ae=l("a"),Xi=o("Common Diffusion Noise Schedules and Sample Steps are Flawed"),Ri=o(`
claims that a mismatch between the training and inference settings leads to suboptimal inference generation results for Stable Diffusion.`),Zl=d(),Tt=l("p"),Fi=o("The abstract reads as follows:"),Il=d(),Zt=l("p"),Ai=o(`*We discover that common diffusion noise schedules do not enforce the last timestep to have zero signal-to-noise ratio (SNR),
and some implementations of diffusion samplers do not start from the last timestep.
Such designs are flawed and do not reflect the fact that the model is given pure Gaussian noise at inference, creating a discrepancy between training and inference.
We show that the flawed design causes real problems in existing implementations.
In Stable Diffusion, it severely limits the model to only generate images with medium brightness and
prevents it from generating very bright and dark samples. We propose a few simple fixes:`),Ul=d(),Z=l("ul"),Us=l("li"),Yi=o("(1) rescale the noise schedule to enforce zero terminal SNR;"),Qi=d(),js=l("li"),Ci=o("(2) train the model with v prediction;"),Pi=d(),Ds=l("li"),zi=o("(3) change the sampler to always start from the last timestep;"),Hi=d(),Gs=l("li"),Li=o(`(4) rescale classifier-free guidance to prevent over-exposure.
These simple changes ensure the diffusion process is congruent between training and inference and
allow the model to generate samples more faithful to the original data distribution.*`),jl=d(),j=l("p"),qi=o("You can apply all of these changes in "),Ws=l("code"),Ki=o("diffusers"),Oi=o(" when using "),It=l("a"),eo=o("DDIMScheduler"),to=o(":"),Dl=d(),Ut=l("ul"),xs=l("li"),so=o("(1) rescale the noise schedule to enforce zero terminal SNR;"),Gl=d(),h(Ye.$$.fragment),Wl=d(),fe=l("ul"),I=l("li"),lo=o(`(2) train the model with v prediction;
Continue fine-tuning a checkpoint with `),Qe=l("a"),Bs=l("code"),ao=o("train_text_to_image.py"),io=o(" or "),Ce=l("a"),Ns=l("code"),oo=o("train_text_to_image_lora.py"),ro=o(`
and `),ks=l("code"),no=o('--prediction_type="v_prediction"'),po=o("."),co=d(),$s=l("li"),fo=o("(3) change the sampler to always start from the last timestep;"),xl=d(),h(Pe.$$.fragment),Bl=d(),jt=l("ul"),Vs=l("li"),uo=o("(4) rescale classifier-free guidance to prevent over-exposure."),Nl=d(),h(ze.$$.fragment),kl=d(),D=l("p"),ho=o("An example is to use "),He=l("a"),mo=o("this checkpoint"),bo=o(`
which has been fine-tuned using the `),Xs=l("code"),go=o('"v_prediction"'),yo=o("."),$l=d(),Dt=l("p"),vo=o("The checkpoint can then be run in inference as follows:"),Vl=d(),h(Le.$$.fragment),Xl=d(),L=l("h2"),ue=l("a"),Rs=l("span"),h(qe.$$.fragment),_o=d(),Fs=l("span"),wo=o("DDIMScheduler"),Rl=d(),w=l("div"),h(Ke.$$.fragment),Mo=d(),As=l("p"),Jo=o(`Denoising diffusion implicit models is a scheduler that extends the denoising procedure introduced in denoising
diffusion probabilistic models (DDPMs) with non-Markovian guidance.`),Eo=d(),M=l("p"),Gt=l("a"),So=o("~ConfigMixin"),To=o(" takes care of storing all config attributes that are passed in the scheduler\u2019s "),Ys=l("code"),Zo=o("__init__"),Io=o(`
function, such as `),Qs=l("code"),Uo=o("num_train_timesteps"),jo=o(". They can be accessed via "),Cs=l("code"),Do=o("scheduler.config.num_train_timesteps"),Go=o(`.
`),Wt=l("a"),Wo=o("SchedulerMixin"),xo=o(" provides general loading and saving functionality via the "),xt=l("a"),Bo=o("SchedulerMixin.save_pretrained()"),No=o(` and
`),Bt=l("a"),ko=o("from_pretrained()"),$o=o(" functions."),Vo=d(),Nt=l("p"),Xo=o("For more details, see the original paper: "),Oe=l("a"),Ro=o("https://arxiv.org/abs/2010.02502"),Fo=d(),he=l("div"),h(et.$$.fragment),Ao=d(),Ps=l("p"),Yo=o(`Ensures interchangeability with schedulers that need to scale the denoising model input depending on the
current timestep.`),Qo=d(),me=l("div"),h(tt.$$.fragment),Co=d(),zs=l("p"),Po=o("Sets the discrete timesteps used for the diffusion chain. Supporting function to be run before inference."),zo=d(),be=l("div"),h(st.$$.fragment),Ho=d(),Hs=l("p"),Lo=o(`Predict the sample at the previous timestep by reversing the SDE. Core function to propagate the diffusion
process from the learned model outputs (most often the predicted noise).`),Fl=d(),q=l("h3"),ge=l("a"),Ls=l("span"),h(lt.$$.fragment),qo=d(),qs=l("span"),Ko=o("Image Inpainting"),Al=d(),kt=l("ul"),K=l("li"),Ks=l("em"),Oo=o("Image Inpainting (512x512 resolution)"),er=o(": "),at=l("a"),tr=o("stabilityai/stable-diffusion-2-inpainting"),sr=o(" with "),$t=l("a"),lr=o("StableDiffusionInpaintPipeline"),Yl=d(),h(it.$$.fragment),Ql=d(),O=l("h3"),ye=l("a"),Os=l("span"),h(ot.$$.fragment),ar=d(),el=l("span"),ir=o("Super-Resolution"),Cl=d(),Vt=l("ul"),ee=l("li"),tl=l("em"),or=o("Image Upscaling (x4 resolution resolution)"),rr=o(": "),rt=l("a"),nr=o("stable-diffusion-x4-upscaler"),pr=o(" with "),Xt=l("a"),cr=o("StableDiffusionUpscalePipeline"),Pl=d(),h(nt.$$.fragment),zl=d(),te=l("h3"),ve=l("a"),sl=l("span"),h(pt.$$.fragment),dr=d(),ll=l("span"),fr=o("Depth-to-Image"),Hl=d(),Rt=l("ul"),se=l("li"),al=l("em"),ur=o("Depth-Guided Text-to-Image"),hr=o(": "),ct=l("a"),mr=o("stabilityai/stable-diffusion-2-depth"),br=d(),il=l("code"),gr=o("StableDiffusionDepth2ImagePipeline"),Ll=d(),h(dt.$$.fragment),ql=d(),le=l("h3"),_e=l("a"),ol=l("span"),h(ft.$$.fragment),yr=d(),rl=l("span"),vr=o("How to load and use different schedulers."),Kl=d(),u=l("p"),_r=o("The stable diffusion pipeline uses "),Ft=l("a"),wr=o("DDIMScheduler"),Mr=o(" scheduler by default. But "),nl=l("code"),Jr=o("diffusers"),Er=o(" provides many other schedulers that can be used with the stable diffusion pipeline such as "),At=l("a"),Sr=o("PNDMScheduler"),Tr=o(", "),Yt=l("a"),Zr=o("LMSDiscreteScheduler"),Ir=o(", "),Qt=l("a"),Ur=o("EulerDiscreteScheduler"),jr=o(", "),Ct=l("a"),Dr=o("EulerAncestralDiscreteScheduler"),Gr=o(` etc.
To use a different scheduler, you can either change it via the `),Pt=l("a"),Wr=o("ConfigMixin.from_config()"),xr=o(" method or pass the "),pl=l("code"),Br=o("scheduler"),Nr=o(" argument to the "),cl=l("code"),kr=o("from_pretrained"),$r=o(" method of the pipeline. For example, to use the "),zt=l("a"),Vr=o("EulerDiscreteScheduler"),Xr=o(", you can do the following:"),Ol=d(),h(ut.$$.fragment),this.h()},l(t){const p=oc('[data-svelte="svelte-1phssyn"]',document.head);N=a(p,"META",{name:!0,content:!0}),p.forEach(s),dl=f(t),k=a(t,"H1",{class:!0});var ta=i(k);ae=a(ta,"A",{id:!0,class:!0,href:!0});var Ar=i(ae);ps=a(Ar,"SPAN",{});var Yr=i(ps);m(Je.$$.fragment,Yr),Yr.forEach(s),Ar.forEach(s),va=f(ta),cs=a(ta,"SPAN",{});var Qr=i(cs);_a=r(Qr,"Stable diffusion 2"),Qr.forEach(s),ta.forEach(s),fl=f(t),E=a(t,"P",{});var G=i(E);wa=r(G,"Stable Diffusion 2 is a text-to-image "),ds=a(G,"EM",{});var Cr=i(ds);Ma=r(Cr,"latent diffusion"),Cr.forEach(s),Ja=r(G," model built upon the work of "),Ee=a(G,"A",{href:!0,rel:!0});var Pr=i(Ee);Ea=r(Pr,"Stable Diffusion 1"),Pr.forEach(s),Sa=r(G,`.
The project to train Stable Diffusion 2 was led by Robin Rombach and Katherine Crowson from `),Se=a(G,"A",{href:!0,rel:!0});var zr=i(Se);Ta=r(zr,"Stability AI"),zr.forEach(s),Za=r(G," and "),Te=a(G,"A",{href:!0,rel:!0});var Hr=i(Te);Ia=r(Hr,"LAION"),Hr.forEach(s),Ua=r(G,"."),G.forEach(s),ul=f(t),ht=a(t,"P",{});var Lr=i(ht);$=a(Lr,"EM",{});var Ht=i($);ja=r(Ht,`The Stable Diffusion 2.0 release includes robust text-to-image models trained using a brand new text encoder (OpenCLIP), developed by LAION with support from Stability AI, which greatly improves the quality of the generated images compared to earlier V1 releases. The text-to-image models in this release can generate images with default resolutions of both 512x512 pixels and 768x768 pixels.
These models are trained on an aesthetic subset of the `),Ze=a(Ht,"A",{href:!0,rel:!0});var qr=i(Ze);Da=r(qr,"LAION-5B dataset"),qr.forEach(s),Ga=r(Ht," created by the DeepFloyd team at Stability AI, which is then further filtered to remove adult content using "),Ie=a(Ht,"A",{href:!0,rel:!0});var Kr=i(Ie);Wa=r(Kr,"LAION\u2019s NSFW filter"),Kr.forEach(s),xa=r(Ht,"."),Ht.forEach(s),Lr.forEach(s),hl=f(t),ie=a(t,"P",{});var sa=i(ie);Ba=r(sa,"For more details about how Stable Diffusion 2 works and how it differs from Stable Diffusion 1, please refer to the official "),Ue=a(sa,"A",{href:!0,rel:!0});var Or=i(Ue);Na=r(Or,"launch announcement post"),Or.forEach(s),ka=r(sa,"."),sa.forEach(s),ml=f(t),V=a(t,"H2",{class:!0});var la=i(V);oe=a(la,"A",{id:!0,class:!0,href:!0});var en=i(oe);fs=a(en,"SPAN",{});var tn=i(fs);m(je.$$.fragment,tn),tn.forEach(s),en.forEach(s),$a=f(la),us=a(la,"SPAN",{});var sn=i(us);Va=r(sn,"Tips"),sn.forEach(s),la.forEach(s),bl=f(t),X=a(t,"H3",{class:!0});var aa=i(X);re=a(aa,"A",{id:!0,class:!0,href:!0});var ln=i(re);hs=a(ln,"SPAN",{});var an=i(hs);m(De.$$.fragment,an),an.forEach(s),ln.forEach(s),Xa=f(aa),ms=a(aa,"SPAN",{});var on=i(ms);Ra=r(on,"Available checkpoints:"),on.forEach(s),aa.forEach(s),gl=f(t),U=a(t,"P",{});var Lt=i(U);Fa=r(Lt,"Note that the architecture is more or less identical to "),mt=a(Lt,"A",{href:!0});var rn=i(mt);Aa=r(rn,"Stable Diffusion 1"),rn.forEach(s),Ya=r(Lt," so please refer to "),bt=a(Lt,"A",{href:!0});var nn=i(bt);Qa=r(nn,"this page"),nn.forEach(s),Ca=r(Lt," for API documentation."),Lt.forEach(s),yl=f(t),S=a(t,"UL",{});var W=i(S);R=a(W,"LI",{});var qt=i(R);bs=a(qt,"EM",{});var pn=i(bs);Pa=r(pn,"Text-to-Image (512x512 resolution)"),pn.forEach(s),za=r(qt,": "),Ge=a(qt,"A",{href:!0,rel:!0});var cn=i(Ge);Ha=r(cn,"stabilityai/stable-diffusion-2-base"),cn.forEach(s),La=r(qt," with "),gt=a(qt,"A",{href:!0});var dn=i(gt);qa=r(dn,"StableDiffusionPipeline"),dn.forEach(s),qt.forEach(s),Ka=f(W),F=a(W,"LI",{});var Kt=i(F);gs=a(Kt,"EM",{});var fn=i(gs);Oa=r(fn,"Text-to-Image (768x768 resolution)"),fn.forEach(s),ei=r(Kt,": "),We=a(Kt,"A",{href:!0,rel:!0});var un=i(We);ti=r(un,"stabilityai/stable-diffusion-2"),un.forEach(s),si=r(Kt," with "),yt=a(Kt,"A",{href:!0});var hn=i(yt);li=r(hn,"StableDiffusionPipeline"),hn.forEach(s),Kt.forEach(s),ai=f(W),A=a(W,"LI",{});var Ot=i(A);ys=a(Ot,"EM",{});var mn=i(ys);ii=r(mn,"Image Inpainting (512x512 resolution)"),mn.forEach(s),oi=r(Ot,": "),xe=a(Ot,"A",{href:!0,rel:!0});var bn=i(xe);ri=r(bn,"stabilityai/stable-diffusion-2-inpainting"),bn.forEach(s),ni=r(Ot," with "),vt=a(Ot,"A",{href:!0});var gn=i(vt);pi=r(gn,"StableDiffusionInpaintPipeline"),gn.forEach(s),Ot.forEach(s),ci=f(W),Y=a(W,"LI",{});var es=i(Y);vs=a(es,"EM",{});var yn=i(vs);di=r(yn,"Super-Resolution (x4 resolution resolution)"),yn.forEach(s),fi=r(es,": "),Be=a(es,"A",{href:!0,rel:!0});var vn=i(Be);ui=r(vn,"stable-diffusion-x4-upscaler"),vn.forEach(s),hi=f(es),_t=a(es,"A",{href:!0});var _n=i(_t);mi=r(_n,"StableDiffusionUpscalePipeline"),_n.forEach(s),es.forEach(s),bi=f(W),Q=a(W,"LI",{});var ts=i(Q);_s=a(ts,"EM",{});var wn=i(_s);gi=r(wn,"Depth-to-Image (512x512 resolution)"),wn.forEach(s),yi=r(ts,": "),Ne=a(ts,"A",{href:!0,rel:!0});var Mn=i(Ne);vi=r(Mn,"stabilityai/stable-diffusion-2-depth"),Mn.forEach(s),_i=r(ts," with "),ws=a(ts,"CODE",{});var Jn=i(ws);wi=r(Jn,"StableDiffusionDepth2ImagePipeline"),Jn.forEach(s),ts.forEach(s),W.forEach(s),vl=f(t),ne=a(t,"P",{});var ia=i(ne);Mi=r(ia,"We recommend using the "),wt=a(ia,"A",{href:!0});var En=i(wt);Ji=r(En,"DPMSolverMultistepScheduler"),En.forEach(s),Ei=r(ia," as it\u2019s currently the fastest scheduler there is."),ia.forEach(s),_l=f(t),C=a(t,"H3",{class:!0});var oa=i(C);pe=a(oa,"A",{id:!0,class:!0,href:!0});var Sn=i(pe);Ms=a(Sn,"SPAN",{});var Tn=i(Ms);m(ke.$$.fragment,Tn),Tn.forEach(s),Sn.forEach(s),Si=f(oa),Js=a(oa,"SPAN",{});var Zn=i(Js);Ti=r(Zn,"Text-to-Image"),Zn.forEach(s),oa.forEach(s),wl=f(t),Mt=a(t,"UL",{});var In=i(Mt);P=a(In,"LI",{});var ss=i(P);Es=a(ss,"EM",{});var Un=i(Es);Zi=r(Un,"Text-to-Image (512x512 resolution)"),Un.forEach(s),Ii=r(ss,": "),$e=a(ss,"A",{href:!0,rel:!0});var jn=i($e);Ui=r(jn,"stabilityai/stable-diffusion-2-base"),jn.forEach(s),ji=r(ss," with "),Jt=a(ss,"A",{href:!0});var Dn=i(Jt);Di=r(Dn,"StableDiffusionPipeline"),Dn.forEach(s),ss.forEach(s),In.forEach(s),Ml=f(t),m(Ve.$$.fragment,t),Jl=f(t),Et=a(t,"UL",{});var Gn=i(Et);z=a(Gn,"LI",{});var ls=i(z);Ss=a(ls,"EM",{});var Wn=i(Ss);Gi=r(Wn,"Text-to-Image (768x768 resolution)"),Wn.forEach(s),Wi=r(ls,": "),Xe=a(ls,"A",{href:!0,rel:!0});var xn=i(Xe);xi=r(xn,"stabilityai/stable-diffusion-2"),xn.forEach(s),Bi=r(ls," with "),St=a(ls,"A",{href:!0});var Bn=i(St);Ni=r(Bn,"StableDiffusionPipeline"),Bn.forEach(s),ls.forEach(s),Gn.forEach(s),El=f(t),m(Re.$$.fragment,t),Sl=f(t),H=a(t,"H4",{class:!0});var ra=i(H);ce=a(ra,"A",{id:!0,class:!0,href:!0});var Nn=i(ce);Ts=a(Nn,"SPAN",{});var kn=i(Ts);m(Fe.$$.fragment,kn),kn.forEach(s),Nn.forEach(s),ki=f(ra),Zs=a(ra,"SPAN",{});var $n=i(Zs);$i=r($n,'Experimental: "Common Diffusion Noise Schedules and Sample Steps are Flawed":'),$n.forEach(s),ra.forEach(s),Tl=f(t),de=a(t,"P",{});var na=i(de);Vi=r(na,"The paper "),Is=a(na,"STRONG",{});var Vn=i(Is);Ae=a(Vn,"A",{href:!0,rel:!0});var Xn=i(Ae);Xi=r(Xn,"Common Diffusion Noise Schedules and Sample Steps are Flawed"),Xn.forEach(s),Vn.forEach(s),Ri=r(na,`
claims that a mismatch between the training and inference settings leads to suboptimal inference generation results for Stable Diffusion.`),na.forEach(s),Zl=f(t),Tt=a(t,"P",{});var Rn=i(Tt);Fi=r(Rn,"The abstract reads as follows:"),Rn.forEach(s),Il=f(t),Zt=a(t,"P",{});var Fn=i(Zt);Ai=r(Fn,`*We discover that common diffusion noise schedules do not enforce the last timestep to have zero signal-to-noise ratio (SNR),
and some implementations of diffusion samplers do not start from the last timestep.
Such designs are flawed and do not reflect the fact that the model is given pure Gaussian noise at inference, creating a discrepancy between training and inference.
We show that the flawed design causes real problems in existing implementations.
In Stable Diffusion, it severely limits the model to only generate images with medium brightness and
prevents it from generating very bright and dark samples. We propose a few simple fixes:`),Fn.forEach(s),Ul=f(t),Z=a(t,"UL",{});var we=i(Z);Us=a(we,"LI",{});var An=i(Us);Yi=r(An,"(1) rescale the noise schedule to enforce zero terminal SNR;"),An.forEach(s),Qi=f(we),js=a(we,"LI",{});var Yn=i(js);Ci=r(Yn,"(2) train the model with v prediction;"),Yn.forEach(s),Pi=f(we),Ds=a(we,"LI",{});var Qn=i(Ds);zi=r(Qn,"(3) change the sampler to always start from the last timestep;"),Qn.forEach(s),Hi=f(we),Gs=a(we,"LI",{});var Cn=i(Gs);Li=r(Cn,`(4) rescale classifier-free guidance to prevent over-exposure.
These simple changes ensure the diffusion process is congruent between training and inference and
allow the model to generate samples more faithful to the original data distribution.*`),Cn.forEach(s),we.forEach(s),jl=f(t),j=a(t,"P",{});var as=i(j);qi=r(as,"You can apply all of these changes in "),Ws=a(as,"CODE",{});var Pn=i(Ws);Ki=r(Pn,"diffusers"),Pn.forEach(s),Oi=r(as," when using "),It=a(as,"A",{href:!0});var zn=i(It);eo=r(zn,"DDIMScheduler"),zn.forEach(s),to=r(as,":"),as.forEach(s),Dl=f(t),Ut=a(t,"UL",{});var Hn=i(Ut);xs=a(Hn,"LI",{});var Ln=i(xs);so=r(Ln,"(1) rescale the noise schedule to enforce zero terminal SNR;"),Ln.forEach(s),Hn.forEach(s),Gl=f(t),m(Ye.$$.fragment,t),Wl=f(t),fe=a(t,"UL",{});var pa=i(fe);I=a(pa,"LI",{});var Me=i(I);lo=r(Me,`(2) train the model with v prediction;
Continue fine-tuning a checkpoint with `),Qe=a(Me,"A",{href:!0,rel:!0});var qn=i(Qe);Bs=a(qn,"CODE",{});var Kn=i(Bs);ao=r(Kn,"train_text_to_image.py"),Kn.forEach(s),qn.forEach(s),io=r(Me," or "),Ce=a(Me,"A",{href:!0,rel:!0});var On=i(Ce);Ns=a(On,"CODE",{});var ep=i(Ns);oo=r(ep,"train_text_to_image_lora.py"),ep.forEach(s),On.forEach(s),ro=r(Me,`
and `),ks=a(Me,"CODE",{});var tp=i(ks);no=r(tp,'--prediction_type="v_prediction"'),tp.forEach(s),po=r(Me,"."),Me.forEach(s),co=f(pa),$s=a(pa,"LI",{});var sp=i($s);fo=r(sp,"(3) change the sampler to always start from the last timestep;"),sp.forEach(s),pa.forEach(s),xl=f(t),m(Pe.$$.fragment,t),Bl=f(t),jt=a(t,"UL",{});var lp=i(jt);Vs=a(lp,"LI",{});var ap=i(Vs);uo=r(ap,"(4) rescale classifier-free guidance to prevent over-exposure."),ap.forEach(s),lp.forEach(s),Nl=f(t),m(ze.$$.fragment,t),kl=f(t),D=a(t,"P",{});var is=i(D);ho=r(is,"An example is to use "),He=a(is,"A",{href:!0,rel:!0});var ip=i(He);mo=r(ip,"this checkpoint"),ip.forEach(s),bo=r(is,`
which has been fine-tuned using the `),Xs=a(is,"CODE",{});var op=i(Xs);go=r(op,'"v_prediction"'),op.forEach(s),yo=r(is,"."),is.forEach(s),$l=f(t),Dt=a(t,"P",{});var rp=i(Dt);vo=r(rp,"The checkpoint can then be run in inference as follows:"),rp.forEach(s),Vl=f(t),m(Le.$$.fragment,t),Xl=f(t),L=a(t,"H2",{class:!0});var ca=i(L);ue=a(ca,"A",{id:!0,class:!0,href:!0});var np=i(ue);Rs=a(np,"SPAN",{});var pp=i(Rs);m(qe.$$.fragment,pp),pp.forEach(s),np.forEach(s),_o=f(ca),Fs=a(ca,"SPAN",{});var cp=i(Fs);wo=r(cp,"DDIMScheduler"),cp.forEach(s),ca.forEach(s),Rl=f(t),w=a(t,"DIV",{class:!0});var T=i(w);m(Ke.$$.fragment,T),Mo=f(T),As=a(T,"P",{});var dp=i(As);Jo=r(dp,`Denoising diffusion implicit models is a scheduler that extends the denoising procedure introduced in denoising
diffusion probabilistic models (DDPMs) with non-Markovian guidance.`),dp.forEach(s),Eo=f(T),M=a(T,"P",{});var J=i(M);Gt=a(J,"A",{href:!0});var fp=i(Gt);So=r(fp,"~ConfigMixin"),fp.forEach(s),To=r(J," takes care of storing all config attributes that are passed in the scheduler\u2019s "),Ys=a(J,"CODE",{});var up=i(Ys);Zo=r(up,"__init__"),up.forEach(s),Io=r(J,`
function, such as `),Qs=a(J,"CODE",{});var hp=i(Qs);Uo=r(hp,"num_train_timesteps"),hp.forEach(s),jo=r(J,". They can be accessed via "),Cs=a(J,"CODE",{});var mp=i(Cs);Do=r(mp,"scheduler.config.num_train_timesteps"),mp.forEach(s),Go=r(J,`.
`),Wt=a(J,"A",{href:!0});var bp=i(Wt);Wo=r(bp,"SchedulerMixin"),bp.forEach(s),xo=r(J," provides general loading and saving functionality via the "),xt=a(J,"A",{href:!0});var gp=i(xt);Bo=r(gp,"SchedulerMixin.save_pretrained()"),gp.forEach(s),No=r(J,` and
`),Bt=a(J,"A",{href:!0});var yp=i(Bt);ko=r(yp,"from_pretrained()"),yp.forEach(s),$o=r(J," functions."),J.forEach(s),Vo=f(T),Nt=a(T,"P",{});var Rr=i(Nt);Xo=r(Rr,"For more details, see the original paper: "),Oe=a(Rr,"A",{href:!0,rel:!0});var vp=i(Oe);Ro=r(vp,"https://arxiv.org/abs/2010.02502"),vp.forEach(s),Rr.forEach(s),Fo=f(T),he=a(T,"DIV",{class:!0});var da=i(he);m(et.$$.fragment,da),Ao=f(da),Ps=a(da,"P",{});var _p=i(Ps);Yo=r(_p,`Ensures interchangeability with schedulers that need to scale the denoising model input depending on the
current timestep.`),_p.forEach(s),da.forEach(s),Qo=f(T),me=a(T,"DIV",{class:!0});var fa=i(me);m(tt.$$.fragment,fa),Co=f(fa),zs=a(fa,"P",{});var wp=i(zs);Po=r(wp,"Sets the discrete timesteps used for the diffusion chain. Supporting function to be run before inference."),wp.forEach(s),fa.forEach(s),zo=f(T),be=a(T,"DIV",{class:!0});var ua=i(be);m(st.$$.fragment,ua),Ho=f(ua),Hs=a(ua,"P",{});var Mp=i(Hs);Lo=r(Mp,`Predict the sample at the previous timestep by reversing the SDE. Core function to propagate the diffusion
process from the learned model outputs (most often the predicted noise).`),Mp.forEach(s),ua.forEach(s),T.forEach(s),Fl=f(t),q=a(t,"H3",{class:!0});var ha=i(q);ge=a(ha,"A",{id:!0,class:!0,href:!0});var Jp=i(ge);Ls=a(Jp,"SPAN",{});var Ep=i(Ls);m(lt.$$.fragment,Ep),Ep.forEach(s),Jp.forEach(s),qo=f(ha),qs=a(ha,"SPAN",{});var Sp=i(qs);Ko=r(Sp,"Image Inpainting"),Sp.forEach(s),ha.forEach(s),Al=f(t),kt=a(t,"UL",{});var Tp=i(kt);K=a(Tp,"LI",{});var os=i(K);Ks=a(os,"EM",{});var Zp=i(Ks);Oo=r(Zp,"Image Inpainting (512x512 resolution)"),Zp.forEach(s),er=r(os,": "),at=a(os,"A",{href:!0,rel:!0});var Ip=i(at);tr=r(Ip,"stabilityai/stable-diffusion-2-inpainting"),Ip.forEach(s),sr=r(os," with "),$t=a(os,"A",{href:!0});var Up=i($t);lr=r(Up,"StableDiffusionInpaintPipeline"),Up.forEach(s),os.forEach(s),Tp.forEach(s),Yl=f(t),m(it.$$.fragment,t),Ql=f(t),O=a(t,"H3",{class:!0});var ma=i(O);ye=a(ma,"A",{id:!0,class:!0,href:!0});var jp=i(ye);Os=a(jp,"SPAN",{});var Dp=i(Os);m(ot.$$.fragment,Dp),Dp.forEach(s),jp.forEach(s),ar=f(ma),el=a(ma,"SPAN",{});var Gp=i(el);ir=r(Gp,"Super-Resolution"),Gp.forEach(s),ma.forEach(s),Cl=f(t),Vt=a(t,"UL",{});var Wp=i(Vt);ee=a(Wp,"LI",{});var rs=i(ee);tl=a(rs,"EM",{});var xp=i(tl);or=r(xp,"Image Upscaling (x4 resolution resolution)"),xp.forEach(s),rr=r(rs,": "),rt=a(rs,"A",{href:!0,rel:!0});var Bp=i(rt);nr=r(Bp,"stable-diffusion-x4-upscaler"),Bp.forEach(s),pr=r(rs," with "),Xt=a(rs,"A",{href:!0});var Np=i(Xt);cr=r(Np,"StableDiffusionUpscalePipeline"),Np.forEach(s),rs.forEach(s),Wp.forEach(s),Pl=f(t),m(nt.$$.fragment,t),zl=f(t),te=a(t,"H3",{class:!0});var ba=i(te);ve=a(ba,"A",{id:!0,class:!0,href:!0});var kp=i(ve);sl=a(kp,"SPAN",{});var $p=i(sl);m(pt.$$.fragment,$p),$p.forEach(s),kp.forEach(s),dr=f(ba),ll=a(ba,"SPAN",{});var Vp=i(ll);fr=r(Vp,"Depth-to-Image"),Vp.forEach(s),ba.forEach(s),Hl=f(t),Rt=a(t,"UL",{});var Xp=i(Rt);se=a(Xp,"LI",{});var ns=i(se);al=a(ns,"EM",{});var Rp=i(al);ur=r(Rp,"Depth-Guided Text-to-Image"),Rp.forEach(s),hr=r(ns,": "),ct=a(ns,"A",{href:!0,rel:!0});var Fp=i(ct);mr=r(Fp,"stabilityai/stable-diffusion-2-depth"),Fp.forEach(s),br=f(ns),il=a(ns,"CODE",{});var Ap=i(il);gr=r(Ap,"StableDiffusionDepth2ImagePipeline"),Ap.forEach(s),ns.forEach(s),Xp.forEach(s),Ll=f(t),m(dt.$$.fragment,t),ql=f(t),le=a(t,"H3",{class:!0});var ga=i(le);_e=a(ga,"A",{id:!0,class:!0,href:!0});var Yp=i(_e);ol=a(Yp,"SPAN",{});var Qp=i(ol);m(ft.$$.fragment,Qp),Qp.forEach(s),Yp.forEach(s),yr=f(ga),rl=a(ga,"SPAN",{});var Cp=i(rl);vr=r(Cp,"How to load and use different schedulers."),Cp.forEach(s),ga.forEach(s),Kl=f(t),u=a(t,"P",{});var _=i(u);_r=r(_,"The stable diffusion pipeline uses "),Ft=a(_,"A",{href:!0});var Pp=i(Ft);wr=r(Pp,"DDIMScheduler"),Pp.forEach(s),Mr=r(_," scheduler by default. But "),nl=a(_,"CODE",{});var zp=i(nl);Jr=r(zp,"diffusers"),zp.forEach(s),Er=r(_," provides many other schedulers that can be used with the stable diffusion pipeline such as "),At=a(_,"A",{href:!0});var Hp=i(At);Sr=r(Hp,"PNDMScheduler"),Hp.forEach(s),Tr=r(_,", "),Yt=a(_,"A",{href:!0});var Lp=i(Yt);Zr=r(Lp,"LMSDiscreteScheduler"),Lp.forEach(s),Ir=r(_,", "),Qt=a(_,"A",{href:!0});var qp=i(Qt);Ur=r(qp,"EulerDiscreteScheduler"),qp.forEach(s),jr=r(_,", "),Ct=a(_,"A",{href:!0});var Kp=i(Ct);Dr=r(Kp,"EulerAncestralDiscreteScheduler"),Kp.forEach(s),Gr=r(_,` etc.
To use a different scheduler, you can either change it via the `),Pt=a(_,"A",{href:!0});var Op=i(Pt);Wr=r(Op,"ConfigMixin.from_config()"),Op.forEach(s),xr=r(_," method or pass the "),pl=a(_,"CODE",{});var ec=i(pl);Br=r(ec,"scheduler"),ec.forEach(s),Nr=r(_," argument to the "),cl=a(_,"CODE",{});var tc=i(cl);kr=r(tc,"from_pretrained"),tc.forEach(s),$r=r(_," method of the pipeline. For example, to use the "),zt=a(_,"A",{href:!0});var sc=i(zt);Vr=r(sc,"EulerDiscreteScheduler"),sc.forEach(s),Xr=r(_,", you can do the following:"),_.forEach(s),Ol=f(t),m(ut.$$.fragment,t),this.h()},h(){n(N,"name","hf:doc:metadata"),n(N,"content",JSON.stringify(cc)),n(ae,"id","stable-diffusion-2"),n(ae,"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"),n(ae,"href","#stable-diffusion-2"),n(k,"class","relative group"),n(Ee,"href","https://stability.ai/blog/stable-diffusion-public-release"),n(Ee,"rel","nofollow"),n(Se,"href","https://stability.ai/"),n(Se,"rel","nofollow"),n(Te,"href","https://laion.ai/"),n(Te,"rel","nofollow"),n(Ze,"href","https://laion.ai/blog/laion-5b/"),n(Ze,"rel","nofollow"),n(Ie,"href","https://openreview.net/forum?id=M3Y74vmsMcY"),n(Ie,"rel","nofollow"),n(Ue,"href","https://stability.ai/blog/stable-diffusion-v2-release"),n(Ue,"rel","nofollow"),n(oe,"id","tips"),n(oe,"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"),n(oe,"href","#tips"),n(V,"class","relative group"),n(re,"id","available-checkpoints"),n(re,"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"),n(re,"href","#available-checkpoints"),n(X,"class","relative group"),n(mt,"href","./stable_diffusion/overview"),n(bt,"href","./stable_diffusion/overview"),n(Ge,"href","https://huggingface.co/stabilityai/stable-diffusion-2-base"),n(Ge,"rel","nofollow"),n(gt,"href","/docs/diffusers/v0.17.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),n(We,"href","https://huggingface.co/stabilityai/stable-diffusion-2"),n(We,"rel","nofollow"),n(yt,"href","/docs/diffusers/v0.17.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),n(xe,"href","https://huggingface.co/stabilityai/stable-diffusion-2-inpainting"),n(xe,"rel","nofollow"),n(vt,"href","/docs/diffusers/v0.17.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.StableDiffusionInpaintPipeline"),n(Be,"href","https://huggingface.co/stabilityai/stable-diffusion-x4-upscaler"),n(Be,"rel","nofollow"),n(_t,"href","/docs/diffusers/v0.17.0/en/api/pipelines/stable_diffusion/upscale#diffusers.StableDiffusionUpscalePipeline"),n(Ne,"href","https://huggingface.co/stabilityai/stable-diffusion-2-depth"),n(Ne,"rel","nofollow"),n(wt,"href","/docs/diffusers/v0.17.0/en/api/schedulers/multistep_dpm_solver#diffusers.DPMSolverMultistepScheduler"),n(pe,"id","texttoimage"),n(pe,"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"),n(pe,"href","#texttoimage"),n(C,"class","relative group"),n($e,"href","https://huggingface.co/stabilityai/stable-diffusion-2-base"),n($e,"rel","nofollow"),n(Jt,"href","/docs/diffusers/v0.17.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),n(Xe,"href","https://huggingface.co/stabilityai/stable-diffusion-2"),n(Xe,"rel","nofollow"),n(St,"href","/docs/diffusers/v0.17.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),n(ce,"id","experimental-common-diffusion-noise-schedules-and-sample-steps-are-flawed"),n(ce,"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"),n(ce,"href","#experimental-common-diffusion-noise-schedules-and-sample-steps-are-flawed"),n(H,"class","relative group"),n(Ae,"href","https://arxiv.org/abs/2305.08891"),n(Ae,"rel","nofollow"),n(It,"href","/docs/diffusers/v0.17.0/en/api/schedulers/ddim#diffusers.DDIMScheduler"),n(Qe,"href","https://github.com/huggingface/diffusers/blob/main/examples/text_to_image/train_text_to_image.py"),n(Qe,"rel","nofollow"),n(Ce,"href","https://github.com/huggingface/diffusers/blob/main/examples/text_to_image/train_text_to_image_lora.py"),n(Ce,"rel","nofollow"),n(He,"href","https://huggingface.co/ptx0/pseudo-journey-v2"),n(He,"rel","nofollow"),n(ue,"id","diffusers.DDIMScheduler"),n(ue,"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"),n(ue,"href","#diffusers.DDIMScheduler"),n(L,"class","relative group"),n(Gt,"href","/docs/diffusers/v0.17.0/en/api/configuration#diffusers.ConfigMixin"),n(Wt,"href","/docs/diffusers/v0.17.0/en/api/schedulers/overview#diffusers.SchedulerMixin"),n(xt,"href","/docs/diffusers/v0.17.0/en/api/schedulers/overview#diffusers.SchedulerMixin.save_pretrained"),n(Bt,"href","/docs/diffusers/v0.17.0/en/api/schedulers/overview#diffusers.SchedulerMixin.from_pretrained"),n(Oe,"href","https://arxiv.org/abs/2010.02502"),n(Oe,"rel","nofollow"),n(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),n(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),n(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),n(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),n(ge,"id","image-inpainting"),n(ge,"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"),n(ge,"href","#image-inpainting"),n(q,"class","relative group"),n(at,"href","https://huggingface.co/stabilityai/stable-diffusion-2-inpainting"),n(at,"rel","nofollow"),n($t,"href","/docs/diffusers/v0.17.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.StableDiffusionInpaintPipeline"),n(ye,"id","superresolution"),n(ye,"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"),n(ye,"href","#superresolution"),n(O,"class","relative group"),n(rt,"href","https://huggingface.co/stabilityai/stable-diffusion-x4-upscaler"),n(rt,"rel","nofollow"),n(Xt,"href","/docs/diffusers/v0.17.0/en/api/pipelines/stable_diffusion/upscale#diffusers.StableDiffusionUpscalePipeline"),n(ve,"id","depthtoimage"),n(ve,"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"),n(ve,"href","#depthtoimage"),n(te,"class","relative group"),n(ct,"href","https://huggingface.co/stabilityai/stable-diffusion-2-depth"),n(ct,"rel","nofollow"),n(_e,"id","how-to-load-and-use-different-schedulers"),n(_e,"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"),n(_e,"href","#how-to-load-and-use-different-schedulers"),n(le,"class","relative group"),n(Ft,"href","/docs/diffusers/v0.17.0/en/api/schedulers/ddim#diffusers.DDIMScheduler"),n(At,"href","/docs/diffusers/v0.17.0/en/api/schedulers/pndm#diffusers.PNDMScheduler"),n(Yt,"href","/docs/diffusers/v0.17.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler"),n(Qt,"href","/docs/diffusers/v0.17.0/en/api/schedulers/euler#diffusers.EulerDiscreteScheduler"),n(Ct,"href","/docs/diffusers/v0.17.0/en/api/schedulers/euler_ancestral#diffusers.EulerAncestralDiscreteScheduler"),n(Pt,"href","/docs/diffusers/v0.17.0/en/api/configuration#diffusers.ConfigMixin.from_config"),n(zt,"href","/docs/diffusers/v0.17.0/en/api/schedulers/euler#diffusers.EulerDiscreteScheduler")},m(t,p){e(document.head,N),c(t,dl,p),c(t,k,p),e(k,ae),e(ae,ps),b(Je,ps,null),e(k,va),e(k,cs),e(cs,_a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e(w,Eo),e(w,M),e(M,Gt),e(Gt,So),e(M,To),e(M,Ys),e(Ys,Zo),e(M,Io),e(M,Qs),e(Qs,Uo),e(M,jo),e(M,Cs),e(Cs,Do),e(M,Go),e(M,Wt),e(Wt,Wo),e(M,xo),e(M,xt),e(xt,Bo),e(M,No),e(M,Bt),e(Bt,ko),e(M,$o),e(w,Vo),e(w,Nt),e(Nt,Xo),e(Nt,Oe),e(Oe,Ro),e(w,Fo),e(w,he),b(et,he,null),e(he,Ao),e(he,Ps),e(Ps,Yo),e(w,Qo),e(w,me),b(tt,me,null),e(me,Co),e(me,zs),e(zs,Po),e(w,zo),e(w,be),b(st,be,null),e(be,Ho),e(be,Hs),e(Hs,Lo),c(t,Fl,p),c(t,q,p),e(q,ge),e(ge,Ls),b(lt,Ls,null),e(q,qo),e(q,qs),e(qs,Ko),c(t,Al,p),c(t,kt,p),e(kt,K),e(K,Ks),e(Ks,Oo),e(K,er),e(K,at),e(at,tr),e(K,sr),e(K,$t),e($t,lr),c(t,Yl,p),b(it,t,p),c(t,Ql,p),c(t,O,p),e(O,ye),e(ye,Os),b(ot,Os,null),e(O,ar),e(O,el),e(el,ir),c(t,Cl,p),c(t,Vt,p),e(Vt,ee),e(ee,tl),e(tl,or),e(ee,rr),e(ee,rt),e(rt,nr),e(ee,pr),e(ee,Xt),e(Xt,cr),c(t,Pl,p),b(nt,t,p),c(t,zl,p),c(t,te,p),e(te,ve),e(ve,sl),b(pt,sl,null),e(te,dr),e(te,ll),e(ll,fr),c(t,Hl,p),c(t,Rt,p),e(Rt,se),e(se,al),e(al,ur),e(se,hr),e(se,ct),e(ct,mr),e(se,br),e(se,il),e(il,gr),c(t,Ll,p),b(dt,t,p),c(t,ql,p),c(t,le,p),e(le,_e),e(_e,ol),b(ft,ol,null),e(le,yr),e(le,rl),e(rl,vr),c(t,Kl,p),c(t,u,p),e(u,_r),e(u,Ft),e(Ft,wr),e(u,Mr),e(u,nl),e(nl,Jr),e(u,Er),e(u,At),e(At,Sr),e(u,Tr),e(u,Yt),e(Yt,Zr),e(u,Ir),e(u,Qt),e(Qt,Ur),e(u,jr),e(u,Ct),e(Ct,Dr),e(u,Gr),e(u,Pt),e(Pt,Wr),e(u,xr),e(u,pl),e(pl,Br),e(u,Nr),e(u,cl),e(cl,kr),e(u,$r),e(u,zt),e(zt,Vr),e(u,Xr),c(t,Ol,p),b(ut,t,p),ea=!0},p:rc,i(t){ea||(g(Je.$$.fragment,t),g(je.$$.fragment,t),g(De.$$.fragment,t),g(ke.$$.fragment,t),g(Ve.$$.fragment,t),g(Re.$$.fragment,t),g(Fe.$$.fragment,t),g(Ye.$$.fragment,t),g(Pe.$$.fragment,t),g(ze.$$.fragment,t),g(Le.$$.fragment,t),g(qe.$$.fragment,t),g(Ke.$$.fragment,t),g(et.$$.fragment,t),g(tt.$$.fragment,t),g(st.$$.fragment,t),g(lt.$$.fragment,t),g(it.$$.fragment,t),g(ot.$$.fragment,t),g(nt.$$.fragment,t),g(pt.$$.fragment,t),g(dt.$$.fragment,t),g(ft.$$.fragment,t),g(ut.$$.fragment,t),ea=!0)},o(t){y(Je.$$.fragment,t),y(je.$$.fragment,t),y(De.$$.fragment,t),y(ke.$$.fragment,t),y(Ve.$$.fragment,t),y(Re.$$.fragment,t),y(Fe.$$.fragment,t),y(Ye.$$.fragment,t),y(Pe.$$.fragment,t),y(ze.$$.fragment,t),y(Le.$$.fragment,t),y(qe.$$.fragment,t),y(Ke.$$.fragment,t),y(et.$$.fragment,t),y(tt.$$.fragment,t),y(st.$$.fragment,t),y(lt.$$.fragment,t),y(it.$$.fragment,t),y(ot.$$.fragment,t),y(nt.$$.fragment,t),y(pt.$$.fragment,t),y(dt.$$.fragment,t),y(ft.$$.fragment,t),y(ut.$$.fragment,t),ea=!1},d(t){s(N),t&&s(dl),t&&s(k),v(Je),t&&s(fl),t&&s(E),t&&s(ul),t&&s(ht),t&&s(hl),t&&s(ie),t&&s(ml),t&&s(V),v(je),t&&s(bl),t&&s(X),v(De),t&&s(gl),t&&s(U),t&&s(yl),t&&s(S),t&&s(vl),t&&s(ne),t&&s(_l),t&&s(C),v(ke),t&&s(wl),t&&s(Mt),t&&s(Ml),v(Ve,t),t&&s(Jl),t&&s(Et),t&&s(El),v(Re,t),t&&s(Sl),t&&s(H),v(Fe),t&&s(Tl),t&&s(de),t&&s(Zl),t&&s(Tt),t&&s(Il),t&&s(Zt),t&&s(Ul),t&&s(Z),t&&s(jl),t&&s(j),t&&s(Dl),t&&s(Ut),t&&s(Gl),v(Ye,t),t&&s(Wl),t&&s(fe),t&&s(xl),v(Pe,t),t&&s(Bl),t&&s(jt),t&&s(Nl),v(ze,t),t&&s(kl),t&&s(D),t&&s($l),t&&s(Dt),t&&s(Vl),v(Le,t),t&&s(Xl),t&&s(L),v(qe),t&&s(Rl),t&&s(w),v(Ke),v(et),v(tt),v(st),t&&s(Fl),t&&s(q),v(lt),t&&s(Al),t&&s(kt),t&&s(Yl),v(it,t),t&&s(Ql),t&&s(O),v(ot),t&&s(Cl),t&&s(Vt),t&&s(Pl),v(nt,t),t&&s(zl),t&&s(te),v(pt),t&&s(Hl),t&&s(Rt),t&&s(Ll),v(dt,t),t&&s(ql),t&&s(le),v(ft),t&&s(Kl),t&&s(u),t&&s(Ol),v(ut,t)}}}const cc={local:"stable-diffusion-2",sections:[{local:"tips",sections:[{local:"available-checkpoints",title:"Available checkpoints:"},{local:"texttoimage",sections:[{local:"experimental-common-diffusion-noise-schedules-and-sample-steps-are-flawed",title:'Experimental: "Common Diffusion Noise Schedules and Sample Steps are Flawed": '}],title:"Text-to-Image"}],title:"Tips"},{local:"diffusers.DDIMScheduler",sections:[{local:"image-inpainting",title:"Image Inpainting"},{local:"superresolution",title:"Super-Resolution"},{local:"depthtoimage",title:"Depth-to-Image"},{local:"how-to-load-and-use-different-schedulers",title:"How to load and use different schedulers."}],title:"DDIMScheduler"}],title:"Stable diffusion 2"};function dc(Fr){return nc(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class bc extends lc{constructor(N){super();ac(this,N,dc,pc,ic,{})}}export{bc as default,cc as metadata};
