import{s as Yt,o as Vt,n as xe}from"../chunks/scheduler.94020406.js";import{S as Et,i as St,g as $,s as p,r as w,E as Qt,h as d,f as s,c as r,j as Bt,u as b,x as M,k as Ht,y as qt,a,v as h,d as _,t as g,w as T}from"../chunks/index.a08c8d92.js";import{T as $t}from"../chunks/Tip.3b0aeee8.js";import{C as Z}from"../chunks/CodeBlock.f1fae7de.js";import{D as zt}from"../chunks/DocNotebookDropdown.a1753374.js";import{F as Ft,M as dt}from"../chunks/Markdown.23159a98.js";import{H as Je,E as At}from"../chunks/index.b61e04a5.js";function Dt(J){let t,u='<a href="https://huggingface.co/sd-concepts-library" rel="nofollow">Stable Diffusion Textual Inversion Concepts Library</a>에는 커뮤니티에서 제작한 학습된 textual-inversion 모델들이 있습니다. 시간이 지남에 따라 더 많은 콘셉트들이 추가되어 유용한 리소스로 성장할 것입니다!';return{c(){t=$("p"),t.innerHTML=u},l(n){t=d(n,"P",{"data-svelte-h":!0}),M(t)!=="svelte-tvrtva"&&(t.innerHTML=u)},m(n,o){a(n,t,o)},p:xe,d(n){n&&s(t)}}}function Pt(J){let t,u='💡V100 GPU 1개를 기준으로 전체 학습에는 최대 1시간이 걸립니다. 학습이 완료되기를 기다리는 동안 궁금한 점이 있으면 아래 섹션에서 <a href="https://huggingface.co/docs/diffusers/training/text_inversion#how-it-works" rel="nofollow">textual-inversion이 어떻게 작동하는지</a> 자유롭게 확인하세요 !';return{c(){t=$("p"),t.innerHTML=u},l(n){t=d(n,"P",{"data-svelte-h":!0}),M(t)!=="svelte-1hsqtvl"&&(t.innerHTML=u)},m(n,o){a(n,t,o)},p:xe,d(n){n&&s(t)}}}function Kt(J){let t,u="💡학습 성능을 올리기 위해, 플레이스홀더 토큰(<code>&lt;cat-toy&gt;</code>)을 (단일한 임베딩 벡터가 아닌) 복수의 임베딩 벡터로 표현하는 것 역시 고려할 있습니다.  이러한 트릭이 모델이 보다 복잡한 이미지의 스타일(앞서 말한 콘셉트)을 더 잘 캡처하는 데 도움이 될 수 있습니다. 복수의 임베딩 벡터 학습을 활성화하려면 다음 옵션을 전달하십시오.",n,o,f;return o=new Z({props:{code:"LS1udW1fdmVjdG9ycyUzRDU=",highlighted:"--num_vectors=5",wrap:!1}}),{c(){t=$("p"),t.innerHTML=u,n=p(),w(o.$$.fragment)},l(m){t=d(m,"P",{"data-svelte-h":!0}),M(t)!=="svelte-scq1d8"&&(t.innerHTML=u),n=r(m),b(o.$$.fragment,m)},m(m,y){a(m,t,y),a(m,n,y),h(o,m,y),f=!0},p:xe,i(m){f||(_(o.$$.fragment,m),f=!0)},o(m){g(o.$$.fragment,m),f=!1},d(m){m&&(s(t),s(n)),T(o,m)}}}function Ot(J){let t,u,n,o;return t=new Z({props:{code:"ZXhwb3J0JTIwTU9ERUxfTkFNRSUzRCUyMnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyMiUwQWV4cG9ydCUyMERBVEFfRElSJTNEJTIyLiUyRmNhdCUyMiUwQSUwQWFjY2VsZXJhdGUlMjBsYXVuY2glMjB0ZXh0dWFsX2ludmVyc2lvbi5weSUyMCU1QyUwQSUyMCUyMC0tcHJldHJhaW5lZF9tb2RlbF9uYW1lX29yX3BhdGglM0QlMjRNT0RFTF9OQU1FJTIwJTVDJTBBJTIwJTIwLS10cmFpbl9kYXRhX2RpciUzRCUyNERBVEFfRElSJTIwJTVDJTBBJTIwJTIwLS1sZWFybmFibGVfcHJvcGVydHklM0QlMjJvYmplY3QlMjIlMjAlNUMlMEElMjAlMjAtLXBsYWNlaG9sZGVyX3Rva2VuJTNEJTIyJTNDY2F0LXRveSUzRSUyMiUyMC0taW5pdGlhbGl6ZXJfdG9rZW4lM0QlMjJ0b3klMjIlMjAlNUMlMEElMjAlMjAtLXJlc29sdXRpb24lM0Q1MTIlMjAlNUMlMEElMjAlMjAtLXRyYWluX2JhdGNoX3NpemUlM0QxJTIwJTVDJTBBJTIwJTIwLS1ncmFkaWVudF9hY2N1bXVsYXRpb25fc3RlcHMlM0Q0JTIwJTVDJTBBJTIwJTIwLS1tYXhfdHJhaW5fc3RlcHMlM0QzMDAwJTIwJTVDJTBBJTIwJTIwLS1sZWFybmluZ19yYXRlJTNENS4wZS0wNCUyMC0tc2NhbGVfbHIlMjAlNUMlMEElMjAlMjAtLWxyX3NjaGVkdWxlciUzRCUyMmNvbnN0YW50JTIyJTIwJTVDJTBBJTIwJTIwLS1scl93YXJtdXBfc3RlcHMlM0QwJTIwJTVDJTBBJTIwJTIwLS1vdXRwdXRfZGlyJTNEJTIydGV4dHVhbF9pbnZlcnNpb25fY2F0JTIyJTIwJTVDJTBBJTIwJTIwLS1wdXNoX3RvX2h1Yg==",highlighted:`<span class="hljs-built_in">export</span> MODEL_NAME=<span class="hljs-string">&quot;stable-diffusion-v1-5/stable-diffusion-v1-5&quot;</span>
<span class="hljs-built_in">export</span> DATA_DIR=<span class="hljs-string">&quot;./cat&quot;</span>

accelerate launch textual_inversion.py \\
  --pretrained_model_name_or_path=<span class="hljs-variable">$MODEL_NAME</span> \\
  --train_data_dir=<span class="hljs-variable">$DATA_DIR</span> \\
  --learnable_property=<span class="hljs-string">&quot;object&quot;</span> \\
  --placeholder_token=<span class="hljs-string">&quot;&lt;cat-toy&gt;&quot;</span> --initializer_token=<span class="hljs-string">&quot;toy&quot;</span> \\
  --resolution=512 \\
  --train_batch_size=1 \\
  --gradient_accumulation_steps=4 \\
  --max_train_steps=3000 \\
  --learning_rate=5.0e-04 --scale_lr \\
  --lr_scheduler=<span class="hljs-string">&quot;constant&quot;</span> \\
  --lr_warmup_steps=0 \\
  --output_dir=<span class="hljs-string">&quot;textual_inversion_cat&quot;</span> \\
  --push_to_hub`,wrap:!1}}),n=new $t({props:{$$slots:{default:[Kt]},$$scope:{ctx:J}}}),{c(){w(t.$$.fragment),u=p(),w(n.$$.fragment)},l(f){b(t.$$.fragment,f),u=r(f),b(n.$$.fragment,f)},m(f,m){h(t,f,m),a(f,u,m),h(n,f,m),o=!0},p(f,m){const y={};m&2&&(y.$$scope={dirty:m,ctx:f}),n.$set(y)},i(f){o||(_(t.$$.fragment,f),_(n.$$.fragment,f),o=!0)},o(f){g(t.$$.fragment,f),g(n.$$.fragment,f),o=!1},d(f){f&&s(u),T(t,f),T(n,f)}}}function el(J){let t,u;return t=new dt({props:{$$slots:{default:[Ot]},$$scope:{ctx:J}}}),{c(){w(t.$$.fragment)},l(n){b(t.$$.fragment,n)},m(n,o){h(t,n,o),u=!0},p(n,o){const f={};o&2&&(f.$$scope={dirty:o,ctx:n}),t.$set(f)},i(n){u||(_(t.$$.fragment,n),u=!0)},o(n){g(t.$$.fragment,n),u=!1},d(n){T(t,n)}}}function tl(J){let t,u='TPU에 액세스할 수 있는 경우, <a href="https://github.com/huggingface/diffusers/blob/main/examples/textual_inversion/textual_inversion_flax.py" rel="nofollow">Flax 학습 스크립트</a>를 사용하여 더 빠르게 모델을 학습시켜보세요. (물론 GPU에서도 작동합니다.) 동일한 설정에서 Flax 학습 스크립트는 PyTorch 학습 스크립트보다 최소 70% 더 빨라야 합니다! ⚡️',n,o,f="시작하기 앞서 Flax에 대한 의존성 라이브러리들을 설치해야 합니다.",m,y,X,k,R='모델의 리포지토리 ID(또는 모델 가중치가 포함된 디렉터리 경로)를 <code>MODEL_NAME</code> 환경 변수에 할당하고, 해당 값을 <a href="https://huggingface.co/docs/diffusers/en/api/diffusion_pipeline#diffusers.DiffusionPipeline.from_pretrained.pretrained_model_name_or_path" rel="nofollow"><code>pretrained_model_name_or_path</code></a> 인자에 전달합니다.',W,U,N='그런 다음 <a href="https://github.com/huggingface/diffusers/blob/main/examples/textual_inversion/textual_inversion_flax.py" rel="nofollow">학습 스크립트</a>를 시작할 수 있습니다.',L,j,I;return y=new Z({props:{code:"cGlwJTIwaW5zdGFsbCUyMC1VJTIwLXIlMjByZXF1aXJlbWVudHNfZmxheC50eHQ=",highlighted:"pip install -U -r requirements_flax.txt",wrap:!1}}),j=new Z({props:{code:"ZXhwb3J0JTIwTU9ERUxfTkFNRSUzRCUyMmR1b25nbmElMkZzdGFibGUtZGlmZnVzaW9uLXYxLTQtZmxheCUyMiUwQWV4cG9ydCUyMERBVEFfRElSJTNEJTIyLiUyRmNhdCUyMiUwQSUwQXB5dGhvbiUyMHRleHR1YWxfaW52ZXJzaW9uX2ZsYXgucHklMjAlNUMlMEElMjAlMjAtLXByZXRyYWluZWRfbW9kZWxfbmFtZV9vcl9wYXRoJTNEJTI0TU9ERUxfTkFNRSUyMCU1QyUwQSUyMCUyMC0tdHJhaW5fZGF0YV9kaXIlM0QlMjREQVRBX0RJUiUyMCU1QyUwQSUyMCUyMC0tbGVhcm5hYmxlX3Byb3BlcnR5JTNEJTIyb2JqZWN0JTIyJTIwJTVDJTBBJTIwJTIwLS1wbGFjZWhvbGRlcl90b2tlbiUzRCUyMiUzQ2NhdC10b3klM0UlMjIlMjAtLWluaXRpYWxpemVyX3Rva2VuJTNEJTIydG95JTIyJTIwJTVDJTBBJTIwJTIwLS1yZXNvbHV0aW9uJTNENTEyJTIwJTVDJTBBJTIwJTIwLS10cmFpbl9iYXRjaF9zaXplJTNEMSUyMCU1QyUwQSUyMCUyMC0tbWF4X3RyYWluX3N0ZXBzJTNEMzAwMCUyMCU1QyUwQSUyMCUyMC0tbGVhcm5pbmdfcmF0ZSUzRDUuMGUtMDQlMjAtLXNjYWxlX2xyJTIwJTVDJTBBJTIwJTIwLS1vdXRwdXRfZGlyJTNEJTIydGV4dHVhbF9pbnZlcnNpb25fY2F0JTIyJTIwJTVDJTBBJTIwJTIwLS1wdXNoX3RvX2h1Yg==",highlighted:`<span class="hljs-built_in">export</span> MODEL_NAME=<span class="hljs-string">&quot;duongna/stable-diffusion-v1-4-flax&quot;</span>
<span class="hljs-built_in">export</span> DATA_DIR=<span class="hljs-string">&quot;./cat&quot;</span>

python textual_inversion_flax.py \\
  --pretrained_model_name_or_path=<span class="hljs-variable">$MODEL_NAME</span> \\
  --train_data_dir=<span class="hljs-variable">$DATA_DIR</span> \\
  --learnable_property=<span class="hljs-string">&quot;object&quot;</span> \\
  --placeholder_token=<span class="hljs-string">&quot;&lt;cat-toy&gt;&quot;</span> --initializer_token=<span class="hljs-string">&quot;toy&quot;</span> \\
  --resolution=512 \\
  --train_batch_size=1 \\
  --max_train_steps=3000 \\
  --learning_rate=5.0e-04 --scale_lr \\
  --output_dir=<span class="hljs-string">&quot;textual_inversion_cat&quot;</span> \\
  --push_to_hub`,wrap:!1}}),{c(){t=$("p"),t.innerHTML=u,n=p(),o=$("p"),o.textContent=f,m=p(),w(y.$$.fragment),X=p(),k=$("p"),k.innerHTML=R,W=p(),U=$("p"),U.innerHTML=N,L=p(),w(j.$$.fragment)},l(c){t=d(c,"P",{"data-svelte-h":!0}),M(t)!=="svelte-1ug88y6"&&(t.innerHTML=u),n=r(c),o=d(c,"P",{"data-svelte-h":!0}),M(o)!=="svelte-36790u"&&(o.textContent=f),m=r(c),b(y.$$.fragment,c),X=r(c),k=d(c,"P",{"data-svelte-h":!0}),M(k)!=="svelte-1xqwqhs"&&(k.innerHTML=R),W=r(c),U=d(c,"P",{"data-svelte-h":!0}),M(U)!=="svelte-12y9yev"&&(U.innerHTML=N),L=r(c),b(j.$$.fragment,c)},m(c,v){a(c,t,v),a(c,n,v),a(c,o,v),a(c,m,v),h(y,c,v),a(c,X,v),a(c,k,v),a(c,W,v),a(c,U,v),a(c,L,v),h(j,c,v),I=!0},p:xe,i(c){I||(_(y.$$.fragment,c),_(j.$$.fragment,c),I=!0)},o(c){g(y.$$.fragment,c),g(j.$$.fragment,c),I=!1},d(c){c&&(s(t),s(n),s(o),s(m),s(X),s(k),s(W),s(U),s(L)),T(y,c),T(j,c)}}}function ll(J){let t,u;return t=new dt({props:{$$slots:{default:[tl]},$$scope:{ctx:J}}}),{c(){w(t.$$.fragment)},l(n){b(t.$$.fragment,n)},m(n,o){h(t,n,o),u=!0},p(n,o){const f={};o&2&&(f.$$scope={dirty:o,ctx:n}),t.$set(f)},i(n){u||(_(t.$$.fragment,n),u=!0)},o(n){g(t.$$.fragment,n),u=!1},d(n){T(t,n)}}}function sl(J){let t,u='💡 커뮤니티는 <a href="https://huggingface.co/sd-concepts-library" rel="nofollow">sd-concepts-library</a> 라는 대규모의 textual-inversion 임베딩 벡터 라이브러리를 만들었습니다. textual-inversion 임베딩을 밑바닥부터 학습하는 대신, 해당 라이브러리에 본인이 찾는 textual-inversion 임베딩이 이미 추가되어 있지 않은지를 확인하는 것도 좋은 방법이 될 것 같습니다.';return{c(){t=$("p"),t.innerHTML=u},l(n){t=d(n,"P",{"data-svelte-h":!0}),M(t)!=="svelte-1dx5v1s"&&(t.innerHTML=u)},m(n,o){a(n,t,o)},p:xe,d(n){n&&s(t)}}}function nl(J){let t,u,n,o='textual-inversion 임베딩 벡터을 불러오기 위해서는, 먼저 해당 임베딩 벡터를 학습할 때 사용한 모델을 불러와야 합니다. 여기서는  <a href="https://huggingface.co/docs/diffusers/training/stable-diffusion-v1-5/stable-diffusion-v1-5" rel="nofollow"><code>stable-diffusion-v1-5/stable-diffusion-v1-5</code></a> 모델이 사용되었다고 가정하고 불러오겠습니다.',f,m,y,X,k="다음으로 <code>TextualInversionLoaderMixin.load_textual_inversion</code> 함수를 통해, textual-inversion 임베딩 벡터를 불러와야 합니다. 여기서 우리는 이전의 <code>&lt;cat-toy&gt;</code> 예제의 임베딩을 불러올 것입니다.",R,W,U,N,L="이제 플레이스홀더 토큰(<code>&lt;cat-toy&gt;</code>)이 잘 동작하는지를 확인하는 파이프라인을 실행할 수 있습니다.",j,I,c,v,Ue='<code>TextualInversionLoaderMixin.load_textual_inversion</code>은 Diffusers 형식으로 저장된 텍스트 임베딩 벡터를 로드할 수 있을 뿐만 아니라, <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui" rel="nofollow">Automatic1111</a> 형식으로 저장된 임베딩 벡터도 로드할 수 있습니다. 이렇게 하려면, 먼저 <a href="https://civitai.com/models/3036?modelVersionId=8387" rel="nofollow">civitAI</a>에서 임베딩 벡터를 다운로드한 다음 로컬에서 불러와야 합니다.',G,C,B;return t=new $t({props:{$$slots:{default:[sl]},$$scope:{ctx:J}}}),m=new Z({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFtb2RlbF9pZCUyMCUzRCUyMCUyMnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyMiUwQXBpcGUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQobW9kZWxfaWQlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpLnRvKCUyMmN1ZGElMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline
<span class="hljs-keyword">import</span> torch

model_id = <span class="hljs-string">&quot;stable-diffusion-v1-5/stable-diffusion-v1-5&quot;</span>
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to(<span class="hljs-string">&quot;cuda&quot;</span>)`,wrap:!1}}),W=new Z({props:{code:"cGlwZS5sb2FkX3RleHR1YWxfaW52ZXJzaW9uKCUyMnNkLWNvbmNlcHRzLWxpYnJhcnklMkZjYXQtdG95JTIyKQ==",highlighted:'pipe.load_textual_inversion(<span class="hljs-string">&quot;sd-concepts-library/cat-toy&quot;</span>)',wrap:!1}}),I=new Z({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyQSUyMCUzQ2NhdC10b3klM0UlMjBiYWNrcGFjayUyMiUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENTApLmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMmNhdC1iYWNrcGFjay5wbmclMjIp",highlighted:`prompt = <span class="hljs-string">&quot;A &lt;cat-toy&gt; backpack&quot;</span>

image = pipe(prompt, num_inference_steps=<span class="hljs-number">50</span>).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;cat-backpack.png&quot;</span>)`,wrap:!1}}),C=new Z({props:{code:"cGlwZS5sb2FkX3RleHR1YWxfaW52ZXJzaW9uKCUyMi4lMkZjaGFydHVybmVydjIucHQlMjIp",highlighted:'pipe.load_textual_inversion(<span class="hljs-string">&quot;./charturnerv2.pt&quot;</span>)',wrap:!1}}),{c(){w(t.$$.fragment),u=p(),n=$("p"),n.innerHTML=o,f=p(),w(m.$$.fragment),y=p(),X=$("p"),X.innerHTML=k,R=p(),w(W.$$.fragment),U=p(),N=$("p"),N.innerHTML=L,j=p(),w(I.$$.fragment),c=p(),v=$("p"),v.innerHTML=Ue,G=p(),w(C.$$.fragment)},l(i){b(t.$$.fragment,i),u=r(i),n=d(i,"P",{"data-svelte-h":!0}),M(n)!=="svelte-rs52ie"&&(n.innerHTML=o),f=r(i),b(m.$$.fragment,i),y=r(i),X=d(i,"P",{"data-svelte-h":!0}),M(X)!=="svelte-f7udvy"&&(X.innerHTML=k),R=r(i),b(W.$$.fragment,i),U=r(i),N=d(i,"P",{"data-svelte-h":!0}),M(N)!=="svelte-1qomt85"&&(N.innerHTML=L),j=r(i),b(I.$$.fragment,i),c=r(i),v=d(i,"P",{"data-svelte-h":!0}),M(v)!=="svelte-6cdkr9"&&(v.innerHTML=Ue),G=r(i),b(C.$$.fragment,i)},m(i,x){h(t,i,x),a(i,u,x),a(i,n,x),a(i,f,x),h(m,i,x),a(i,y,x),a(i,X,x),a(i,R,x),h(W,i,x),a(i,U,x),a(i,N,x),a(i,j,x),h(I,i,x),a(i,c,x),a(i,v,x),a(i,G,x),h(C,i,x),B=!0},p(i,x){const V={};x&2&&(V.$$scope={dirty:x,ctx:i}),t.$set(V)},i(i){B||(_(t.$$.fragment,i),_(m.$$.fragment,i),_(W.$$.fragment,i),_(I.$$.fragment,i),_(C.$$.fragment,i),B=!0)},o(i){g(t.$$.fragment,i),g(m.$$.fragment,i),g(W.$$.fragment,i),g(I.$$.fragment,i),g(C.$$.fragment,i),B=!1},d(i){i&&(s(u),s(n),s(f),s(y),s(X),s(R),s(U),s(N),s(j),s(c),s(v),s(G)),T(t,i),T(m,i),T(W,i),T(I,i),T(C,i)}}}function al(J){let t,u;return t=new dt({props:{$$slots:{default:[nl]},$$scope:{ctx:J}}}),{c(){w(t.$$.fragment)},l(n){b(t.$$.fragment,n)},m(n,o){h(t,n,o),u=!0},p(n,o){const f={};o&2&&(f.$$scope={dirty:o,ctx:n}),t.$set(f)},i(n){u||(_(t.$$.fragment,n),u=!0)},o(n){g(t.$$.fragment,n),u=!1},d(n){T(t,n)}}}function il(J){let t,u="현재 Flax에 대한 <code>load_textual_inversion</code> 함수는 없습니다. 따라서 학습 후 textual-inversion 임베딩 벡터가 모델의 일부로서 저장되었는지를 확인해야 합니다. 그런 다음은 다른 Flax 모델과 마찬가지로 실행할 수 있습니다.",n,o,f;return o=new Z({props:{code:"aW1wb3J0JTIwamF4JTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBZnJvbSUyMGZsYXguamF4X3V0aWxzJTIwaW1wb3J0JTIwcmVwbGljYXRlJTBBZnJvbSUyMGZsYXgudHJhaW5pbmcuY29tbW9uX3V0aWxzJTIwaW1wb3J0JTIwc2hhcmQlMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRmxheFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBJTBBbW9kZWxfcGF0aCUyMCUzRCUyMCUyMnBhdGgtdG8teW91ci10cmFpbmVkLW1vZGVsJTIyJTBBcGlwZWxpbmUlMkMlMjBwYXJhbXMlMjAlM0QlMjBGbGF4U3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKG1vZGVsX3BhdGglMkMlMjBkdHlwZSUzRGpheC5udW1weS5iZmxvYXQxNiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJBJTIwJTNDY2F0LXRveSUzRSUyMGJhY2twYWNrJTIyJTBBcHJuZ19zZWVkJTIwJTNEJTIwamF4LnJhbmRvbS5QUk5HS2V5KDApJTBBbnVtX2luZmVyZW5jZV9zdGVwcyUyMCUzRCUyMDUwJTBBJTBBbnVtX3NhbXBsZXMlMjAlM0QlMjBqYXguZGV2aWNlX2NvdW50KCklMEFwcm9tcHQlMjAlM0QlMjBudW1fc2FtcGxlcyUyMColMjAlNUJwcm9tcHQlNUQlMEFwcm9tcHRfaWRzJTIwJTNEJTIwcGlwZWxpbmUucHJlcGFyZV9pbnB1dHMocHJvbXB0KSUwQSUwQSUyMyUyMHNoYXJkJTIwaW5wdXRzJTIwYW5kJTIwcm5nJTBBcGFyYW1zJTIwJTNEJTIwcmVwbGljYXRlKHBhcmFtcyklMEFwcm5nX3NlZWQlMjAlM0QlMjBqYXgucmFuZG9tLnNwbGl0KHBybmdfc2VlZCUyQyUyMGpheC5kZXZpY2VfY291bnQoKSklMEFwcm9tcHRfaWRzJTIwJTNEJTIwc2hhcmQocHJvbXB0X2lkcyklMEElMEFpbWFnZXMlMjAlM0QlMjBwaXBlbGluZShwcm9tcHRfaWRzJTJDJTIwcGFyYW1zJTJDJTIwcHJuZ19zZWVkJTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUyQyUyMGppdCUzRFRydWUpLmltYWdlcyUwQWltYWdlcyUyMCUzRCUyMHBpcGVsaW5lLm51bXB5X3RvX3BpbChucC5hc2FycmF5KGltYWdlcy5yZXNoYXBlKChudW1fc2FtcGxlcyUyQyklMjAlMkIlMjBpbWFnZXMuc2hhcGUlNUItMyUzQSU1RCkpKSUwQWltYWdlLnNhdmUoJTIyY2F0LWJhY2twYWNrLnBuZyUyMik=",highlighted:`<span class="hljs-keyword">import</span> jax
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-keyword">from</span> flax.jax_utils <span class="hljs-keyword">import</span> replicate
<span class="hljs-keyword">from</span> flax.training.common_utils <span class="hljs-keyword">import</span> shard
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> FlaxStableDiffusionPipeline

model_path = <span class="hljs-string">&quot;path-to-your-trained-model&quot;</span>
pipeline, params = FlaxStableDiffusionPipeline.from_pretrained(model_path, dtype=jax.numpy.bfloat16)

prompt = <span class="hljs-string">&quot;A &lt;cat-toy&gt; backpack&quot;</span>
prng_seed = jax.random.PRNGKey(<span class="hljs-number">0</span>)
num_inference_steps = <span class="hljs-number">50</span>

num_samples = jax.device_count()
prompt = num_samples * [prompt]
prompt_ids = pipeline.prepare_inputs(prompt)

<span class="hljs-comment"># shard inputs and rng</span>
params = replicate(params)
prng_seed = jax.random.split(prng_seed, jax.device_count())
prompt_ids = shard(prompt_ids)

images = pipeline(prompt_ids, params, prng_seed, num_inference_steps, jit=<span class="hljs-literal">True</span>).images
images = pipeline.numpy_to_pil(np.asarray(images.reshape((num_samples,) + images.shape[-<span class="hljs-number">3</span>:])))
image.save(<span class="hljs-string">&quot;cat-backpack.png&quot;</span>)`,wrap:!1}}),{c(){t=$("p"),t.innerHTML=u,n=p(),w(o.$$.fragment)},l(m){t=d(m,"P",{"data-svelte-h":!0}),M(t)!=="svelte-1caeprs"&&(t.innerHTML=u),n=r(m),b(o.$$.fragment,m)},m(m,y){a(m,t,y),a(m,n,y),h(o,m,y),f=!0},p:xe,i(m){f||(_(o.$$.fragment,m),f=!0)},o(m){g(o.$$.fragment,m),f=!1},d(m){m&&(s(t),s(n)),T(o,m)}}}function pl(J){let t,u;return t=new dt({props:{$$slots:{default:[il]},$$scope:{ctx:J}}}),{c(){w(t.$$.fragment)},l(n){b(t.$$.fragment,n)},m(n,o){h(t,n,o),u=!0},p(n,o){const f={};o&2&&(f.$$scope={dirty:o,ctx:n}),t.$set(f)},i(n){u||(_(t.$$.fragment,n),u=!0)},o(n){g(t.$$.fragment,n),u=!1},d(n){T(t,n)}}}function rl(J){let t,u,n,o,f,m,y,X,k,R='<a href="https://huggingface.co/papers/2208.01618" rel="nofollow">textual-inversion</a>은 소수의 예시 이미지에서 새로운 콘셉트를 포착하는 기법입니다. 이 기술은 원래 <a href="https://github.com/CompVis/latent-diffusion" rel="nofollow">Latent Diffusion</a>에서 시연되었지만, 이후 <a href="https://huggingface.co/docs/diffusers/main/en/conceptual/stable_diffusion" rel="nofollow">Stable Diffusion</a>과 같은 유사한 다른 모델에도 적용되었습니다. 학습된 콘셉트는 text-to-image 파이프라인에서 생성된 이미지를 더 잘 제어하는 데 사용할 수 있습니다. 이 모델은 텍스트 인코더의 임베딩 공간에서 새로운 ‘단어’를 학습하여 개인화된 이미지 생성을 위한 텍스트 프롬프트 내에서 사용됩니다.',W,U,N='<img src="https://textual-inversion.github.io/static/images/editing/colorful_teapot.JPG" alt="Textual Inversion example"/>',L,j,I='By using just 3-5 images you can teach new concepts to a model such as Stable Diffusion for personalized image generation <a href="https://github.com/rinongal/textual_inversion">(image source)</a>.',c,v,Ue='이 가이드에서는 textual-inversion으로 <a href="https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5" rel="nofollow"><code>stable-diffusion-v1-5/stable-diffusion-v1-5</code></a> 모델을 학습하는 방법을 설명합니다. 이 가이드에서 사용된 모든 textual-inversion 학습 스크립트는 <a href="https://github.com/huggingface/diffusers/tree/main/examples/textual_inversion" rel="nofollow">여기</a>에서 확인할 수 있습니다. 내부적으로 어떻게 작동하는지 자세히 살펴보고 싶으시다면 해당 링크를 참조해주시기 바랍니다.',G,C,B,i,x="시작하기 전에 학습을 위한 의존성 라이브러리들을 설치해야 합니다:",V,E,ke,S,Mt='의존성 라이브러리들의 설치가 완료되면, <a href="https://github.com/huggingface/accelerate/" rel="nofollow">🤗Accelerate</a> 환경을 초기화시킵니다.',Ze,Q,Xe,q,wt="별도의 설정없이, 기본 🤗Accelerate 환경을 설정하려면 다음과 같이 하세요:",We,z,Ce,A,bt="또는 사용 중인 환경이 노트북과 같은 대화형 셸을 지원하지 않는다면, 다음과 같이 사용할 수 있습니다:",Ie,D,Ne,P,ht='마지막으로, Memory-Efficient Attention을 통해 메모리 사용량을 줄이기 위해 <a href="https://huggingface.co/docs/diffusers/main/en/training/optimization/xformers" rel="nofollow">xFormers</a>를 설치합니다. xFormers를 설치한 후, 학습 스크립트에 <code>--enable_xformers_memory_efficient_attention</code> 인자를 추가합니다. xFormers는 Flax에서 지원되지 않습니다.',Le,K,Re,O,_t="모델을 허브에 저장하려면, 학습 스크립트에 다음 인자를 추가해야 합니다.",Ge,ee,Be,te,He,le,gt="학습중에 모델의 체크포인트를 정기적으로 저장하는 것이 좋습니다. 이렇게 하면 어떤 이유로든 학습이 중단된 경우 저장된 체크포인트에서 학습을 다시 시작할 수 있습니다. 학습 스크립트에 다음 인자를 전달하면 500단계마다 전체 학습 상태가 <code>output_dir</code>의 하위 폴더에 체크포인트로서 저장됩니다.",Fe,se,Ye,ne,Tt="저장된 체크포인트에서 학습을 재개하려면, 학습 스크립트와 재개할 특정 체크포인트에 다음 인자를 전달하세요.",Ve,ae,Ee,ie,Se,pe,yt='학습용 데이터셋으로 <a href="https://huggingface.co/datasets/diffusers/cat_toy_example" rel="nofollow">고양이 장난감 데이터셋</a>을 다운로드하여 디렉토리에 저장하세요. 여러분만의 고유한 데이터셋을 사용하고자 한다면, <a href="https://huggingface.co/docs/diffusers/training/create_dataset" rel="nofollow">학습용 데이터셋 만들기</a> 가이드를 살펴보시기 바랍니다.',Qe,re,qe,oe,vt='모델의 리포지토리 ID(또는 모델 가중치가 포함된 디렉터리 경로)를 <code>MODEL_NAME</code> 환경 변수에 할당하고, 해당 값을 <a href="https://huggingface.co/docs/diffusers/en/api/diffusion_pipeline#diffusers.DiffusionPipeline.from_pretrained.pretrained_model_name_or_path" rel="nofollow"><code>pretrained_model_name_or_path</code></a> 인자에 전달합니다. 그리고 이미지가 포함된 디렉터리 경로를 <code>DATA_DIR</code> 환경 변수에 할당합니다.',ze,fe,Jt='이제 <a href="https://github.com/huggingface/diffusers/blob/main/examples/textual_inversion/textual_inversion.py" rel="nofollow">학습 스크립트</a>를 실행할 수 있습니다. 스크립트는 다음 파일을 생성하고 리포지토리에 저장합니다.',Ae,me,xt="<li><code>learned_embeds.bin</code></li> <li><code>token_identifier.txt</code></li> <li><code>type_of_concept.txt</code>.</li>",De,H,Pe,F,Ke,ue,Oe,ce,Ut="모델의 학습 진행 상황을 추적하는 데 관심이 있는 경우, 학습 과정에서 생성된 이미지를 저장할 수 있습니다. 학습 스크립트에 다음 인수를 추가하여 중간 로깅을 활성화합니다.",et,$e,jt="<li><code>validation_prompt</code> : 샘플을 생성하는 데 사용되는 프롬프트(기본값은 <code>None</code>으로 설정되며, 이 때 중간 로깅은 비활성화됨)</li> <li><code>num_validation_images</code> : 생성할 샘플 이미지 수</li> <li><code>validation_steps</code> : <code>validation_prompt</code>로부터 샘플 이미지를 생성하기 전 스텝의 수</li>",tt,de,lt,Me,st,we,kt="모델을 학습한 후에는, 해당 모델을 <code>StableDiffusionPipeline</code>을 사용하여 추론에 사용할 수 있습니다.",nt,be,Zt="textual-inversion 스크립트는 기본적으로 textual-inversion을 통해 얻어진 임베딩 벡터만을 저장합니다. 해당 임베딩 벡터들은 텍스트 인코더의 임베딩 행렬에 추가되어 있습습니다.",at,Y,it,he,pt,_e,Xt='<img src="https://textual-inversion.github.io/static/images/training/training.JPG" alt="Diagram from the paper showing overview"/>',rt,ge,Wt='Architecture overview from the Textual Inversion <a href="https://textual-inversion.github.io/">blog post.</a>',ot,Te,Ct="일반적으로 텍스트 프롬프트는 모델에 전달되기 전에 임베딩으로 토큰화됩니다. textual-inversion은 비슷한 작업을 수행하지만, 위 다이어그램의 특수 토큰 <code>S*</code>로부터 새로운 토큰 임베딩 <code>v*</code>를 학습합니다. 모델의 아웃풋은 디퓨전 모델을 조정하는 데 사용되며, 디퓨전 모델이 단 몇 개의 예제 이미지에서 신속하고 새로운 콘셉트를 이해하는 데 도움을 줍니다.",ft,ye,It="이를 위해 textual-inversion은 제너레이터 모델과 학습용 이미지의 노이즈 버전을 사용합니다. 제너레이터는 노이즈가 적은 버전의 이미지를 예측하려고 시도하며 토큰 임베딩 <code>v*</code>은 제너레이터의 성능에 따라 최적화됩니다. 토큰 임베딩이 새로운 콘셉트를 성공적으로 포착하면 디퓨전 모델에 더 유용한 정보를 제공하고 노이즈가 적은 더 선명한 이미지를 생성하는 데 도움이 됩니다. 이러한 최적화 프로세스는 일반적으로 다양한 프롬프트와 이미지에 수천 번에 노출됨으로써 이루어집니다.",mt,ve,ut,je,ct;return f=new Je({props:{title:"Textual-Inversion",local:"textual-inversion",headingTag:"h1"}}),y=new zt({props:{classNames:"absolute z-10 right-0 top-0",options:[{label:"Mixed",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/ko/text_inversion.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/ko/pytorch/text_inversion.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/ko/tensorflow/text_inversion.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/ko/text_inversion.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/ko/pytorch/text_inversion.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/ko/tensorflow/text_inversion.ipynb"}]}}),C=new $t({props:{$$slots:{default:[Dt]},$$scope:{ctx:J}}}),E=new Z({props:{code:"cGlwJTIwaW5zdGFsbCUyMGRpZmZ1c2VycyUyMGFjY2VsZXJhdGUlMjB0cmFuc2Zvcm1lcnM=",highlighted:"pip install diffusers accelerate transformers",wrap:!1}}),Q=new Z({props:{code:"YWNjZWxlcmF0ZSUyMGNvbmZpZw==",highlighted:"accelerate config",wrap:!1}}),z=new Z({props:{code:"YWNjZWxlcmF0ZSUyMGNvbmZpZyUyMGRlZmF1bHQ=",highlighted:"accelerate config default",wrap:!1}}),D=new Z({props:{code:"ZnJvbSUyMGFjY2VsZXJhdGUudXRpbHMlMjBpbXBvcnQlMjB3cml0ZV9iYXNpY19jb25maWclMEElMEF3cml0ZV9iYXNpY19jb25maWcoKQ==",highlighted:`<span class="hljs-keyword">from</span> accelerate.utils <span class="hljs-keyword">import</span> write_basic_config

write_basic_config()`,wrap:!1}}),K=new Je({props:{title:"허브에 모델 업로드하기",local:"허브에-모델-업로드하기",headingTag:"h2"}}),ee=new Z({props:{code:"LS1wdXNoX3RvX2h1Yg==",highlighted:"--push_to_hub",wrap:!1}}),te=new Je({props:{title:"체크포인트 저장 및 불러오기",local:"체크포인트-저장-및-불러오기",headingTag:"h2"}}),se=new Z({props:{code:"LS1jaGVja3BvaW50aW5nX3N0ZXBzJTNENTAw",highlighted:"--checkpointing_steps=500",wrap:!1}}),ae=new Z({props:{code:"LS1yZXN1bWVfZnJvbV9jaGVja3BvaW50JTNEJTIyY2hlY2twb2ludC0xNTAwJTIy",highlighted:'--resume_from_checkpoint=<span class="hljs-string">&quot;checkpoint-1500&quot;</span>',wrap:!1}}),ie=new Je({props:{title:"파인 튜닝",local:"파인-튜닝",headingTag:"h2"}}),re=new Z({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMHNuYXBzaG90X2Rvd25sb2FkJTBBJTBBbG9jYWxfZGlyJTIwJTNEJTIwJTIyLiUyRmNhdCUyMiUwQXNuYXBzaG90X2Rvd25sb2FkKCUwQSUyMCUyMCUyMCUyMCUyMmRpZmZ1c2VycyUyRmNhdF90b3lfZXhhbXBsZSUyMiUyQyUyMGxvY2FsX2RpciUzRGxvY2FsX2RpciUyQyUyMHJlcG9fdHlwZSUzRCUyMmRhdGFzZXQlMjIlMkMlMjBpZ25vcmVfcGF0dGVybnMlM0QlMjIuZ2l0YXR0cmlidXRlcyUyMiUwQSk=",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> snapshot_download

local_dir = <span class="hljs-string">&quot;./cat&quot;</span>
snapshot_download(
    <span class="hljs-string">&quot;diffusers/cat_toy_example&quot;</span>, local_dir=local_dir, repo_type=<span class="hljs-string">&quot;dataset&quot;</span>, ignore_patterns=<span class="hljs-string">&quot;.gitattributes&quot;</span>
)`,wrap:!1}}),H=new $t({props:{$$slots:{default:[Pt]},$$scope:{ctx:J}}}),F=new Ft({props:{pytorch:!0,tensorflow:!1,jax:!0,$$slots:{jax:[ll],pytorch:[el]},$$scope:{ctx:J}}}),ue=new Je({props:{title:"중간 로깅",local:"중간-로깅",headingTag:"h3"}}),de=new Z({props:{code:"LS12YWxpZGF0aW9uX3Byb21wdCUzRCUyMkElMjAlM0NjYXQtdG95JTNFJTIwYmFja3BhY2slMjIlMEEtLW51bV92YWxpZGF0aW9uX2ltYWdlcyUzRDQlMEEtLXZhbGlkYXRpb25fc3RlcHMlM0QxMDA=",highlighted:`--validation_prompt=<span class="hljs-string">&quot;A &lt;cat-toy&gt; backpack&quot;</span>
--num_validation_images=4
--validation_steps=100`,wrap:!1}}),Me=new Je({props:{title:"추론",local:"추론",headingTag:"h2"}}),Y=new Ft({props:{pytorch:!0,tensorflow:!1,jax:!0,$$slots:{jax:[pl],pytorch:[al]},$$scope:{ctx:J}}}),he=new Je({props:{title:"작동 방식",local:"작동-방식",headingTag:"h2"}}),ve=new At({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/ko/training/text_inversion.md"}}),{c(){t=$("meta"),u=p(),n=$("p"),o=p(),w(f.$$.fragment),m=p(),w(y.$$.fragment),X=p(),k=$("p"),k.innerHTML=R,W=p(),U=$("p"),U.innerHTML=N,L=p(),j=$("small"),j.innerHTML=I,c=p(),v=$("p"),v.innerHTML=Ue,G=p(),w(C.$$.fragment),B=p(),i=$("p"),i.textContent=x,V=p(),w(E.$$.fragment),ke=p(),S=$("p"),S.innerHTML=Mt,Ze=p(),w(Q.$$.fragment),Xe=p(),q=$("p"),q.textContent=wt,We=p(),w(z.$$.fragment),Ce=p(),A=$("p"),A.textContent=bt,Ie=p(),w(D.$$.fragment),Ne=p(),P=$("p"),P.innerHTML=ht,Le=p(),w(K.$$.fragment),Re=p(),O=$("p"),O.textContent=_t,Ge=p(),w(ee.$$.fragment),Be=p(),w(te.$$.fragment),He=p(),le=$("p"),le.innerHTML=gt,Fe=p(),w(se.$$.fragment),Ye=p(),ne=$("p"),ne.textContent=Tt,Ve=p(),w(ae.$$.fragment),Ee=p(),w(ie.$$.fragment),Se=p(),pe=$("p"),pe.innerHTML=yt,Qe=p(),w(re.$$.fragment),qe=p(),oe=$("p"),oe.innerHTML=vt,ze=p(),fe=$("p"),fe.innerHTML=Jt,Ae=p(),me=$("ul"),me.innerHTML=xt,De=p(),w(H.$$.fragment),Pe=p(),w(F.$$.fragment),Ke=p(),w(ue.$$.fragment),Oe=p(),ce=$("p"),ce.textContent=Ut,et=p(),$e=$("ul"),$e.innerHTML=jt,tt=p(),w(de.$$.fragment),lt=p(),w(Me.$$.fragment),st=p(),we=$("p"),we.innerHTML=kt,nt=p(),be=$("p"),be.textContent=Zt,at=p(),w(Y.$$.fragment),it=p(),w(he.$$.fragment),pt=p(),_e=$("p"),_e.innerHTML=Xt,rt=p(),ge=$("small"),ge.innerHTML=Wt,ot=p(),Te=$("p"),Te.innerHTML=Ct,ft=p(),ye=$("p"),ye.innerHTML=It,mt=p(),w(ve.$$.fragment),ut=p(),je=$("p"),this.h()},l(e){const l=Qt("svelte-u9bgzb",document.head);t=d(l,"META",{name:!0,content:!0}),l.forEach(s),u=r(e),n=d(e,"P",{}),Bt(n).forEach(s),o=r(e),b(f.$$.fragment,e),m=r(e),b(y.$$.fragment,e),X=r(e),k=d(e,"P",{"data-svelte-h":!0}),M(k)!=="svelte-nzyg9i"&&(k.innerHTML=R),W=r(e),U=d(e,"P",{"data-svelte-h":!0}),M(U)!=="svelte-1vgmpoc"&&(U.innerHTML=N),L=r(e),j=d(e,"SMALL",{"data-svelte-h":!0}),M(j)!=="svelte-20gkrh"&&(j.innerHTML=I),c=r(e),v=d(e,"P",{"data-svelte-h":!0}),M(v)!=="svelte-b6ij9f"&&(v.innerHTML=Ue),G=r(e),b(C.$$.fragment,e),B=r(e),i=d(e,"P",{"data-svelte-h":!0}),M(i)!=="svelte-1gixux3"&&(i.textContent=x),V=r(e),b(E.$$.fragment,e),ke=r(e),S=d(e,"P",{"data-svelte-h":!0}),M(S)!=="svelte-1pnlkh"&&(S.innerHTML=Mt),Ze=r(e),b(Q.$$.fragment,e),Xe=r(e),q=d(e,"P",{"data-svelte-h":!0}),M(q)!=="svelte-1apzpmc"&&(q.textContent=wt),We=r(e),b(z.$$.fragment,e),Ce=r(e),A=d(e,"P",{"data-svelte-h":!0}),M(A)!=="svelte-e9ddhp"&&(A.textContent=bt),Ie=r(e),b(D.$$.fragment,e),Ne=r(e),P=d(e,"P",{"data-svelte-h":!0}),M(P)!=="svelte-1djpdsa"&&(P.innerHTML=ht),Le=r(e),b(K.$$.fragment,e),Re=r(e),O=d(e,"P",{"data-svelte-h":!0}),M(O)!=="svelte-fr8nft"&&(O.textContent=_t),Ge=r(e),b(ee.$$.fragment,e),Be=r(e),b(te.$$.fragment,e),He=r(e),le=d(e,"P",{"data-svelte-h":!0}),M(le)!=="svelte-1ntxetc"&&(le.innerHTML=gt),Fe=r(e),b(se.$$.fragment,e),Ye=r(e),ne=d(e,"P",{"data-svelte-h":!0}),M(ne)!=="svelte-169qicm"&&(ne.textContent=Tt),Ve=r(e),b(ae.$$.fragment,e),Ee=r(e),b(ie.$$.fragment,e),Se=r(e),pe=d(e,"P",{"data-svelte-h":!0}),M(pe)!=="svelte-1hkoxwu"&&(pe.innerHTML=yt),Qe=r(e),b(re.$$.fragment,e),qe=r(e),oe=d(e,"P",{"data-svelte-h":!0}),M(oe)!=="svelte-1x1kakg"&&(oe.innerHTML=vt),ze=r(e),fe=d(e,"P",{"data-svelte-h":!0}),M(fe)!=="svelte-1q9sy4o"&&(fe.innerHTML=Jt),Ae=r(e),me=d(e,"UL",{"data-svelte-h":!0}),M(me)!=="svelte-49yler"&&(me.innerHTML=xt),De=r(e),b(H.$$.fragment,e),Pe=r(e),b(F.$$.fragment,e),Ke=r(e),b(ue.$$.fragment,e),Oe=r(e),ce=d(e,"P",{"data-svelte-h":!0}),M(ce)!=="svelte-1i6qamb"&&(ce.textContent=Ut),et=r(e),$e=d(e,"UL",{"data-svelte-h":!0}),M($e)!=="svelte-jpu1w7"&&($e.innerHTML=jt),tt=r(e),b(de.$$.fragment,e),lt=r(e),b(Me.$$.fragment,e),st=r(e),we=d(e,"P",{"data-svelte-h":!0}),M(we)!=="svelte-1k5zyxz"&&(we.innerHTML=kt),nt=r(e),be=d(e,"P",{"data-svelte-h":!0}),M(be)!=="svelte-xlgr7u"&&(be.textContent=Zt),at=r(e),b(Y.$$.fragment,e),it=r(e),b(he.$$.fragment,e),pt=r(e),_e=d(e,"P",{"data-svelte-h":!0}),M(_e)!=="svelte-4oyjpc"&&(_e.innerHTML=Xt),rt=r(e),ge=d(e,"SMALL",{"data-svelte-h":!0}),M(ge)!=="svelte-1t7e7o6"&&(ge.innerHTML=Wt),ot=r(e),Te=d(e,"P",{"data-svelte-h":!0}),M(Te)!=="svelte-699n2d"&&(Te.innerHTML=Ct),ft=r(e),ye=d(e,"P",{"data-svelte-h":!0}),M(ye)!=="svelte-12bb61m"&&(ye.innerHTML=It),mt=r(e),b(ve.$$.fragment,e),ut=r(e),je=d(e,"P",{}),Bt(je).forEach(s),this.h()},h(){Ht(t,"name","hf:doc:metadata"),Ht(t,"content",ol)},m(e,l){qt(document.head,t),a(e,u,l),a(e,n,l),a(e,o,l),h(f,e,l),a(e,m,l),h(y,e,l),a(e,X,l),a(e,k,l),a(e,W,l),a(e,U,l),a(e,L,l),a(e,j,l),a(e,c,l),a(e,v,l),a(e,G,l),h(C,e,l),a(e,B,l),a(e,i,l),a(e,V,l),h(E,e,l),a(e,ke,l),a(e,S,l),a(e,Ze,l),h(Q,e,l),a(e,Xe,l),a(e,q,l),a(e,We,l),h(z,e,l),a(e,Ce,l),a(e,A,l),a(e,Ie,l),h(D,e,l),a(e,Ne,l),a(e,P,l),a(e,Le,l),h(K,e,l),a(e,Re,l),a(e,O,l),a(e,Ge,l),h(ee,e,l),a(e,Be,l),h(te,e,l),a(e,He,l),a(e,le,l),a(e,Fe,l),h(se,e,l),a(e,Ye,l),a(e,ne,l),a(e,Ve,l),h(ae,e,l),a(e,Ee,l),h(ie,e,l),a(e,Se,l),a(e,pe,l),a(e,Qe,l),h(re,e,l),a(e,qe,l),a(e,oe,l),a(e,ze,l),a(e,fe,l),a(e,Ae,l),a(e,me,l),a(e,De,l),h(H,e,l),a(e,Pe,l),h(F,e,l),a(e,Ke,l),h(ue,e,l),a(e,Oe,l),a(e,ce,l),a(e,et,l),a(e,$e,l),a(e,tt,l),h(de,e,l),a(e,lt,l),h(Me,e,l),a(e,st,l),a(e,we,l),a(e,nt,l),a(e,be,l),a(e,at,l),h(Y,e,l),a(e,it,l),h(he,e,l),a(e,pt,l),a(e,_e,l),a(e,rt,l),a(e,ge,l),a(e,ot,l),a(e,Te,l),a(e,ft,l),a(e,ye,l),a(e,mt,l),h(ve,e,l),a(e,ut,l),a(e,je,l),ct=!0},p(e,[l]){const Nt={};l&2&&(Nt.$$scope={dirty:l,ctx:e}),C.$set(Nt);const Lt={};l&2&&(Lt.$$scope={dirty:l,ctx:e}),H.$set(Lt);const Rt={};l&2&&(Rt.$$scope={dirty:l,ctx:e}),F.$set(Rt);const Gt={};l&2&&(Gt.$$scope={dirty:l,ctx:e}),Y.$set(Gt)},i(e){ct||(_(f.$$.fragment,e),_(y.$$.fragment,e),_(C.$$.fragment,e),_(E.$$.fragment,e),_(Q.$$.fragment,e),_(z.$$.fragment,e),_(D.$$.fragment,e),_(K.$$.fragment,e),_(ee.$$.fragment,e),_(te.$$.fragment,e),_(se.$$.fragment,e),_(ae.$$.fragment,e),_(ie.$$.fragment,e),_(re.$$.fragment,e),_(H.$$.fragment,e),_(F.$$.fragment,e),_(ue.$$.fragment,e),_(de.$$.fragment,e),_(Me.$$.fragment,e),_(Y.$$.fragment,e),_(he.$$.fragment,e),_(ve.$$.fragment,e),ct=!0)},o(e){g(f.$$.fragment,e),g(y.$$.fragment,e),g(C.$$.fragment,e),g(E.$$.fragment,e),g(Q.$$.fragment,e),g(z.$$.fragment,e),g(D.$$.fragment,e),g(K.$$.fragment,e),g(ee.$$.fragment,e),g(te.$$.fragment,e),g(se.$$.fragment,e),g(ae.$$.fragment,e),g(ie.$$.fragment,e),g(re.$$.fragment,e),g(H.$$.fragment,e),g(F.$$.fragment,e),g(ue.$$.fragment,e),g(de.$$.fragment,e),g(Me.$$.fragment,e),g(Y.$$.fragment,e),g(he.$$.fragment,e),g(ve.$$.fragment,e),ct=!1},d(e){e&&(s(u),s(n),s(o),s(m),s(X),s(k),s(W),s(U),s(L),s(j),s(c),s(v),s(G),s(B),s(i),s(V),s(ke),s(S),s(Ze),s(Xe),s(q),s(We),s(Ce),s(A),s(Ie),s(Ne),s(P),s(Le),s(Re),s(O),s(Ge),s(Be),s(He),s(le),s(Fe),s(Ye),s(ne),s(Ve),s(Ee),s(Se),s(pe),s(Qe),s(qe),s(oe),s(ze),s(fe),s(Ae),s(me),s(De),s(Pe),s(Ke),s(Oe),s(ce),s(et),s($e),s(tt),s(lt),s(st),s(we),s(nt),s(be),s(at),s(it),s(pt),s(_e),s(rt),s(ge),s(ot),s(Te),s(ft),s(ye),s(mt),s(ut),s(je)),s(t),T(f,e),T(y,e),T(C,e),T(E,e),T(Q,e),T(z,e),T(D,e),T(K,e),T(ee,e),T(te,e),T(se,e),T(ae,e),T(ie,e),T(re,e),T(H,e),T(F,e),T(ue,e),T(de,e),T(Me,e),T(Y,e),T(he,e),T(ve,e)}}}const ol='{"title":"Textual-Inversion","local":"textual-inversion","sections":[{"title":"허브에 모델 업로드하기","local":"허브에-모델-업로드하기","sections":[],"depth":2},{"title":"체크포인트 저장 및 불러오기","local":"체크포인트-저장-및-불러오기","sections":[],"depth":2},{"title":"파인 튜닝","local":"파인-튜닝","sections":[{"title":"중간 로깅","local":"중간-로깅","sections":[],"depth":3}],"depth":2},{"title":"추론","local":"추론","sections":[],"depth":2},{"title":"작동 방식","local":"작동-방식","sections":[],"depth":2}],"depth":1}';function fl(J){return Vt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class bl extends Et{constructor(t){super(),St(this,t,fl,rl,Yt,{})}}export{bl as component};
