import{s as se,o as ae,n as ne}from"../chunks/scheduler.6e0d5ff7.js";import{S as ie,i as pe,g as o,s as n,r as v,E as oe,h as r,f as l,c as i,j as le,u as J,x as u,k as X,y as re,a as s,v as x,d as G,t as Z,w as H}from"../chunks/index.d7c1b260.js";import{H as ce,g as me}from"../chunks/Heading.2be73954.js";import{T as ue}from"../chunks/Tip.c000e27b.js";import{C as P}from"../chunks/CodeBlock.09a08494.js";function fe(V){let a,f="💡 제안된 솔루션에 대한 자세한 내용은 위에 링크된 논문을 참고하세요!";return{c(){a=o("p"),a.textContent=f},l(p){a=r(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 de(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,c,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,D,y,Y='예를 들어, <code>v_prediction</code>으로 미세 조정된 <a href="https://huggingface.co/ptx0/pseudo-journey-v2" rel="nofollow"><code>ptx0/pseudo-journey-v2</code></a> 체크포인트를 사용해 보겠습니다.',B,_,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,w,O="마지막으로 파이프라인에 대한 호출에서 <code>guidance_rescale</code>을 설정하여 과다 노출을 방지합니다:",q,b,Q,m,ee='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/zero_snr.png"/>',N,U,R;return d=new ce({props:{title:"이미지 밝기 조절하기",local:"이미지-밝기-조절하기",headingTag:"h1"}}),c=new ue({props:{$$slots:{default:[fe]},$$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}}),b=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=o("meta"),f=n(),p=o("p"),T=n(),v(d.$$.fragment),S=n(),M=o("p"),M.innerHTML=z,W=n(),v(c.$$.fragment),k=n(),g=o("p"),g.innerHTML=F,C=n(),v(h.$$.fragment),D=n(),y=o("p"),y.innerHTML=Y,B=n(),_=o("p"),_.innerHTML=A,I=n(),$=o("ol"),$.innerHTML=K,L=n(),v(j.$$.fragment),E=n(),w=o("p"),w.innerHTML=O,q=n(),v(b.$$.fragment),Q=n(),m=o("div"),m.innerHTML=ee,N=n(),U=o("p"),this.h()},l(e){const t=oe("svelte-u9bgzb",document.head);a=r(t,"META",{name:!0,content:!0}),t.forEach(l),f=i(e),p=r(e,"P",{}),le(p).forEach(l),T=i(e),J(d.$$.fragment,e),S=i(e),M=r(e,"P",{"data-svelte-h":!0}),u(M)!=="svelte-41kvy4"&&(M.innerHTML=z),W=i(e),J(c.$$.fragment,e),k=i(e),g=r(e,"P",{"data-svelte-h":!0}),u(g)!=="svelte-l6uezj"&&(g.innerHTML=F),C=i(e),J(h.$$.fragment,e),D=i(e),y=r(e,"P",{"data-svelte-h":!0}),u(y)!=="svelte-1rdr8q8"&&(y.innerHTML=Y),B=i(e),_=r(e,"P",{"data-svelte-h":!0}),u(_)!=="svelte-19qmk1q"&&(_.innerHTML=A),I=i(e),$=r(e,"OL",{"data-svelte-h":!0}),u($)!=="svelte-rour8r"&&($.innerHTML=K),L=i(e),J(j.$$.fragment,e),E=i(e),w=r(e,"P",{"data-svelte-h":!0}),u(w)!=="svelte-1chsr97"&&(w.innerHTML=O),q=i(e),J(b.$$.fragment,e),Q=i(e),m=r(e,"DIV",{class:!0,"data-svelte-h":!0}),u(m)!=="svelte-1fieqb3"&&(m.innerHTML=ee),N=i(e),U=r(e,"P",{}),le(U).forEach(l),this.h()},h(){X(a,"name","hf:doc:metadata"),X(a,"content",Me),X(m,"class","flex justify-center")},m(e,t){re(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(c,e,t),s(e,k,t),s(e,g,t),s(e,C,t),x(h,e,t),s(e,D,t),s(e,y,t),s(e,B,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,w,t),s(e,q,t),x(b,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}),c.$set(te)},i(e){R||(G(d.$$.fragment,e),G(c.$$.fragment,e),G(h.$$.fragment,e),G(j.$$.fragment,e),G(b.$$.fragment,e),R=!0)},o(e){Z(d.$$.fragment,e),Z(c.$$.fragment,e),Z(h.$$.fragment,e),Z(j.$$.fragment,e),Z(b.$$.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(D),l(y),l(B),l(_),l(I),l($),l(L),l(E),l(w),l(q),l(Q),l(m),l(N),l(U)),l(a),H(d,e),H(c,e),H(h,e),H(j,e),H(b,e)}}}const Me='{"title":"이미지 밝기 조절하기","local":"이미지-밝기-조절하기","sections":[],"depth":1}';function ge(V){return ae(()=>{new URLSearchParams(window.location.search).get("fw"),window.hfDocGoto=me}),[]}class we extends ie{constructor(a){super(),pe(this,a,ge,de,se,{})}}export{we as component};
