import{s as se,o as ae,n as ne}from"../chunks/scheduler.6e0d5ff7.js";import{S as ie,i as pe,g as r,s as n,r as v,E as re,h as c,f as l,c as i,j as le,u as J,x as u,k as X,y as ce,a as s,v as x,d as G,t as Z,w as H}from"../chunks/index.d7c1b260.js";import{T as oe}from"../chunks/Tip.c000e27b.js";import{C as P}from"../chunks/CodeBlock.09a08494.js";import{H as me}from"../chunks/Heading.30a009b0.js";function ue(V){let a,f="💡 제안된 솔루션에 대한 자세한 내용은 위에 링크된 논문을 참고하세요!";return{c(){a=r("p"),a.textContent=f},l(p){a=c(p,"P",{"data-svelte-h":!0}),u(a)!=="svelte-94zn0j"&&(a.textContent=f)},m(p,T){s(p,a,T)},p:ne,d(p){p&&l(a)}}}function fe(V){let a,f,p,T,d,S,M,z='Stable Diffusion 파이프라인은 <a href="https://huggingface.co/papers/2305.08891" rel="nofollow">일반적인 디퓨전 노이즈 스케줄과 샘플 단계에 결함이 있음</a> 논문에서 설명한 것처럼 매우 밝거나 어두운 이미지를 생성하는 데는 성능이 평범합니다. 이 논문에서 제안한 솔루션은 현재 <code>DDIMScheduler</code>에 구현되어 있으며 이미지의 밝기를 개선하는 데 사용할 수 있습니다.',W,o,k,g,F='해결책 중 하나는 <em>v 예측값</em>과 <em>v 로스</em>로 모델을 훈련하는 것입니다. 다음 flag를 <a href="https://github.com/huggingface/diffusers/blob/main/examples/text_to_image/train_text_to_image.py" rel="nofollow"><code>train_text_to_image.py</code></a> 또는 <a href="https://github.com/huggingface/diffusers/blob/main/examples/text_to_image/train_text_to_image_lora.py" rel="nofollow"><code>train_text_to_image_lora.py</code></a> 스크립트에 추가하여 <code>v_prediction</code>을 활성화합니다:',C,h,B,y,Y='예를 들어, <code>v_prediction</code>으로 미세 조정된 <a href="https://huggingface.co/ptx0/pseudo-journey-v2" rel="nofollow"><code>ptx0/pseudo-journey-v2</code></a> 체크포인트를 사용해 보겠습니다.',D,_,A="다음으로 <code>DDIMScheduler</code>에서 다음 파라미터를 설정합니다:",I,$,K="<li>rescale_betas_zero_snr=True`, 노이즈 스케줄을 제로 터미널 신호 대 잡음비(SNR)로 재조정합니다.</li> <li><code>timestep_spacing=&quot;trailing&quot;</code>, 마지막 타임스텝부터 샘플링 시작</li>",L,j,E,b,O="마지막으로 파이프라인에 대한 호출에서 <code>guidance_rescale</code>을 설정하여 과다 노출을 방지합니다:",q,w,Q,m,ee='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/zero_snr.png"/>',N,U,R;return d=new me({props:{title:"이미지 밝기 조절하기",local:"이미지-밝기-조절하기",headingTag:"h1"}}),o=new oe({props:{$$slots:{default:[ue]},$$scope:{ctx:V}}}),h=new P({props:{code:"LS1wcmVkaWN0aW9uX3R5cGUlM0QlMjJ2X3ByZWRpY3Rpb24lMjI=",highlighted:'--prediction_type=<span class="hljs-string">&quot;v_prediction&quot;</span>',wrap:!1}}),j=new P({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTJDJTIwRERJTVNjaGVkdWxlciUwQSUwQXBpcGVsaW5lJTIwJTNEJTIwRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMnB0eDAlMkZwc2V1ZG8tam91cm5leS12MiUyMiklMEElMEFwaXBlbGluZS5zY2hlZHVsZXIlMjAlM0QlMjBERElNU2NoZWR1bGVyLmZyb21fY29uZmlnKCUwQSUyMCUyMCUyMCUyMHBpcGVsaW5lLnNjaGVkdWxlci5jb25maWclMkMlMjByZXNjYWxlX2JldGFzX3plcm9fc25yJTNEVHJ1ZSUyQyUyMHRpbWVzdGVwX3NwYWNpbmclM0QlMjJ0cmFpbGluZyUyMiUwQSklMEFwaXBlbGluZS50byglMjJjdWRhJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline, DDIMScheduler

<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;ptx0/pseudo-journey-v2&quot;</span>)
<span class="hljs-comment"># switch the scheduler in the pipeline to use the DDIMScheduler</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline.scheduler = DDIMScheduler.from_config(
<span class="hljs-meta">... </span>    pipeline.scheduler.config, rescale_betas_zero_snr=<span class="hljs-literal">True</span>, timestep_spacing=<span class="hljs-string">&quot;trailing&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline.to(<span class="hljs-string">&quot;cuda&quot;</span>)`,wrap:!1}}),w=new P({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyQSUyMGxpb24lMjBpbiUyMGdhbGF4aWVzJTJDJTIwc3BpcmFscyUyQyUyMG5lYnVsYWUlMkMlMjBzdGFycyUyQyUyMHNtb2tlJTJDJTIwaXJpZGVzY2VudCUyQyUyMGludHJpY2F0ZSUyMGRldGFpbCUyQyUyMG9jdGFuZSUyMHJlbmRlciUyQyUyMDhrJTIyJTBBaW1hZ2UlMjAlM0QlMjBwaXBlbGluZShwcm9tcHQlMkMlMjBndWlkYW5jZV9yZXNjYWxlJTNEMC43KS5pbWFnZXMlNUIwJTVE",highlighted:`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>]`,wrap:!1}}),{c(){a=r("meta"),f=n(),p=r("p"),T=n(),v(d.$$.fragment),S=n(),M=r("p"),M.innerHTML=z,W=n(),v(o.$$.fragment),k=n(),g=r("p"),g.innerHTML=F,C=n(),v(h.$$.fragment),B=n(),y=r("p"),y.innerHTML=Y,D=n(),_=r("p"),_.innerHTML=A,I=n(),$=r("ol"),$.innerHTML=K,L=n(),v(j.$$.fragment),E=n(),b=r("p"),b.innerHTML=O,q=n(),v(w.$$.fragment),Q=n(),m=r("div"),m.innerHTML=ee,N=n(),U=r("p"),this.h()},l(e){const t=re("svelte-u9bgzb",document.head);a=c(t,"META",{name:!0,content:!0}),t.forEach(l),f=i(e),p=c(e,"P",{}),le(p).forEach(l),T=i(e),J(d.$$.fragment,e),S=i(e),M=c(e,"P",{"data-svelte-h":!0}),u(M)!=="svelte-41kvy4"&&(M.innerHTML=z),W=i(e),J(o.$$.fragment,e),k=i(e),g=c(e,"P",{"data-svelte-h":!0}),u(g)!=="svelte-l6uezj"&&(g.innerHTML=F),C=i(e),J(h.$$.fragment,e),B=i(e),y=c(e,"P",{"data-svelte-h":!0}),u(y)!=="svelte-1rdr8q8"&&(y.innerHTML=Y),D=i(e),_=c(e,"P",{"data-svelte-h":!0}),u(_)!=="svelte-19qmk1q"&&(_.innerHTML=A),I=i(e),$=c(e,"OL",{"data-svelte-h":!0}),u($)!=="svelte-rour8r"&&($.innerHTML=K),L=i(e),J(j.$$.fragment,e),E=i(e),b=c(e,"P",{"data-svelte-h":!0}),u(b)!=="svelte-1chsr97"&&(b.innerHTML=O),q=i(e),J(w.$$.fragment,e),Q=i(e),m=c(e,"DIV",{class:!0,"data-svelte-h":!0}),u(m)!=="svelte-1fieqb3"&&(m.innerHTML=ee),N=i(e),U=c(e,"P",{}),le(U).forEach(l),this.h()},h(){X(a,"name","hf:doc:metadata"),X(a,"content",de),X(m,"class","flex justify-center")},m(e,t){ce(document.head,a),s(e,f,t),s(e,p,t),s(e,T,t),x(d,e,t),s(e,S,t),s(e,M,t),s(e,W,t),x(o,e,t),s(e,k,t),s(e,g,t),s(e,C,t),x(h,e,t),s(e,B,t),s(e,y,t),s(e,D,t),s(e,_,t),s(e,I,t),s(e,$,t),s(e,L,t),x(j,e,t),s(e,E,t),s(e,b,t),s(e,q,t),x(w,e,t),s(e,Q,t),s(e,m,t),s(e,N,t),s(e,U,t),R=!0},p(e,[t]){const te={};t&2&&(te.$$scope={dirty:t,ctx:e}),o.$set(te)},i(e){R||(G(d.$$.fragment,e),G(o.$$.fragment,e),G(h.$$.fragment,e),G(j.$$.fragment,e),G(w.$$.fragment,e),R=!0)},o(e){Z(d.$$.fragment,e),Z(o.$$.fragment,e),Z(h.$$.fragment,e),Z(j.$$.fragment,e),Z(w.$$.fragment,e),R=!1},d(e){e&&(l(f),l(p),l(T),l(S),l(M),l(W),l(k),l(g),l(C),l(B),l(y),l(D),l(_),l(I),l($),l(L),l(E),l(b),l(q),l(Q),l(m),l(N),l(U)),l(a),H(d,e),H(o,e),H(h,e),H(j,e),H(w,e)}}}const de='{"title":"이미지 밝기 조절하기","local":"이미지-밝기-조절하기","sections":[],"depth":1}';function Me(V){return ae(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class je extends ie{constructor(a){super(),pe(this,a,Me,fe,se,{})}}export{je as component};
