import{s as ae,o as ie,n as pe}from"../chunks/scheduler.e3739aa0.js";import{S as re,i as oe,g as r,s as a,r as v,E as ce,h as o,f as s,c as i,j as ne,u as J,x as u,k as z,y as me,a as l,v as x,d as G,t as Z,w as H}from"../chunks/index.13f5b837.js";import{T as ue}from"../chunks/Tip.51dedfeb.js";import{C as F}from"../chunks/CodeBlock.de02009a.js";import{H as fe,E as de}from"../chunks/EditOnGithub.72bac8d8.js";function ge(S){let n,f="💡 제안된 솔루션에 대한 자세한 내용은 위에 링크된 논문을 참고하세요!";return{c(){n=r("p"),n.textContent=f},l(p){n=o(p,"P",{"data-svelte-h":!0}),u(n)!=="svelte-94zn0j"&&(n.textContent=f)},m(p,U){l(p,n,U)},p:pe,d(p){p&&s(n)}}}function Me(S){let n,f,p,U,d,k,g,Y='Stable Diffusion 파이프라인은 <a href="https://huggingface.co/papers/2305.08891" rel="nofollow">일반적인 디퓨전 노이즈 스케줄과 샘플 단계에 결함이 있음</a> 논문에서 설명한 것처럼 매우 밝거나 어두운 이미지를 생성하는 데는 성능이 평범합니다. 이 논문에서 제안한 솔루션은 현재 <code>DDIMScheduler</code>에 구현되어 있으며 이미지의 밝기를 개선하는 데 사용할 수 있습니다.',W,c,C,M,A='해결책 중 하나는 <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>을 활성화합니다:',E,h,B,y,K='예를 들어, <code>v_prediction</code>으로 미세 조정된 <a href="https://huggingface.co/ptx0/pseudo-journey-v2" rel="nofollow"><code>ptx0/pseudo-journey-v2</code></a> 체크포인트를 사용해 보겠습니다.',D,_,O="다음으로 <code>DDIMScheduler</code>에서 다음 파라미터를 설정합니다:",I,$,ee="<li>rescale_betas_zero_snr=True`, 노이즈 스케줄을 제로 터미널 신호 대 잡음비(SNR)로 재조정합니다.</li> <li><code>timestep_spacing=&quot;trailing&quot;</code>, 마지막 타임스텝부터 샘플링 시작</li>",L,b,q,j,te="마지막으로 파이프라인에 대한 호출에서 <code>guidance_rescale</code>을 설정하여 과다 노출을 방지합니다:",Q,w,N,m,se='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/zero_snr.png"/>',R,T,X,V,P;return d=new fe({props:{title:"이미지 밝기 조절하기",local:"이미지-밝기-조절하기",headingTag:"h1"}}),c=new ue({props:{$$slots:{default:[ge]},$$scope:{ctx:S}}}),h=new F({props:{code:"LS1wcmVkaWN0aW9uX3R5cGUlM0QlMjJ2X3ByZWRpY3Rpb24lMjI=",highlighted:'--prediction_type=<span class="hljs-string">&quot;v_prediction&quot;</span>',wrap:!1}}),b=new F({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 F({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}}),T=new de({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/ko/using-diffusers/control_brightness.md"}}),{c(){n=r("meta"),f=a(),p=r("p"),U=a(),v(d.$$.fragment),k=a(),g=r("p"),g.innerHTML=Y,W=a(),v(c.$$.fragment),C=a(),M=r("p"),M.innerHTML=A,E=a(),v(h.$$.fragment),B=a(),y=r("p"),y.innerHTML=K,D=a(),_=r("p"),_.innerHTML=O,I=a(),$=r("ol"),$.innerHTML=ee,L=a(),v(b.$$.fragment),q=a(),j=r("p"),j.innerHTML=te,Q=a(),v(w.$$.fragment),N=a(),m=r("div"),m.innerHTML=se,R=a(),v(T.$$.fragment),X=a(),V=r("p"),this.h()},l(e){const t=ce("svelte-u9bgzb",document.head);n=o(t,"META",{name:!0,content:!0}),t.forEach(s),f=i(e),p=o(e,"P",{}),ne(p).forEach(s),U=i(e),J(d.$$.fragment,e),k=i(e),g=o(e,"P",{"data-svelte-h":!0}),u(g)!=="svelte-41kvy4"&&(g.innerHTML=Y),W=i(e),J(c.$$.fragment,e),C=i(e),M=o(e,"P",{"data-svelte-h":!0}),u(M)!=="svelte-l6uezj"&&(M.innerHTML=A),E=i(e),J(h.$$.fragment,e),B=i(e),y=o(e,"P",{"data-svelte-h":!0}),u(y)!=="svelte-1rdr8q8"&&(y.innerHTML=K),D=i(e),_=o(e,"P",{"data-svelte-h":!0}),u(_)!=="svelte-19qmk1q"&&(_.innerHTML=O),I=i(e),$=o(e,"OL",{"data-svelte-h":!0}),u($)!=="svelte-rour8r"&&($.innerHTML=ee),L=i(e),J(b.$$.fragment,e),q=i(e),j=o(e,"P",{"data-svelte-h":!0}),u(j)!=="svelte-1chsr97"&&(j.innerHTML=te),Q=i(e),J(w.$$.fragment,e),N=i(e),m=o(e,"DIV",{class:!0,"data-svelte-h":!0}),u(m)!=="svelte-1fieqb3"&&(m.innerHTML=se),R=i(e),J(T.$$.fragment,e),X=i(e),V=o(e,"P",{}),ne(V).forEach(s),this.h()},h(){z(n,"name","hf:doc:metadata"),z(n,"content",he),z(m,"class","flex justify-center")},m(e,t){me(document.head,n),l(e,f,t),l(e,p,t),l(e,U,t),x(d,e,t),l(e,k,t),l(e,g,t),l(e,W,t),x(c,e,t),l(e,C,t),l(e,M,t),l(e,E,t),x(h,e,t),l(e,B,t),l(e,y,t),l(e,D,t),l(e,_,t),l(e,I,t),l(e,$,t),l(e,L,t),x(b,e,t),l(e,q,t),l(e,j,t),l(e,Q,t),x(w,e,t),l(e,N,t),l(e,m,t),l(e,R,t),x(T,e,t),l(e,X,t),l(e,V,t),P=!0},p(e,[t]){const le={};t&2&&(le.$$scope={dirty:t,ctx:e}),c.$set(le)},i(e){P||(G(d.$$.fragment,e),G(c.$$.fragment,e),G(h.$$.fragment,e),G(b.$$.fragment,e),G(w.$$.fragment,e),G(T.$$.fragment,e),P=!0)},o(e){Z(d.$$.fragment,e),Z(c.$$.fragment,e),Z(h.$$.fragment,e),Z(b.$$.fragment,e),Z(w.$$.fragment,e),Z(T.$$.fragment,e),P=!1},d(e){e&&(s(f),s(p),s(U),s(k),s(g),s(W),s(C),s(M),s(E),s(B),s(y),s(D),s(_),s(I),s($),s(L),s(q),s(j),s(Q),s(N),s(m),s(R),s(X),s(V)),s(n),H(d,e),H(c,e),H(h,e),H(b,e),H(w,e),H(T,e)}}}const he='{"title":"이미지 밝기 조절하기","local":"이미지-밝기-조절하기","sections":[],"depth":1}';function ye(S){return ie(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Te extends re{constructor(n){super(),oe(this,n,ye,Me,ae,{})}}export{Te as component};
