import{s as Yt,o as Et,n as Ue}from"../chunks/scheduler.e3739aa0.js";import{S as Vt,i as Qt,g as $,s as p,r as h,E as St,h as d,f as n,c as r,j as Bt,u as w,x as M,k as Ft,y as At,a,v as y,d as _,t as b,w as g}from"../chunks/index.13f5b837.js";import{T as $t}from"../chunks/Tip.51dedfeb.js";import{C as k}from"../chunks/CodeBlock.de02009a.js";import{D as zt}from"../chunks/DocNotebookDropdown.5cbf7847.js";import{F as Nt,M as dt}from"../chunks/Markdown.a820be0b.js";import{H as xe,E as qt}from"../chunks/EditOnGithub.72bac8d8.js";function Dt(x){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(s){t=d(s,"P",{"data-svelte-h":!0}),M(t)!=="svelte-tvrtva"&&(t.innerHTML=u)},m(s,o){a(s,t,o)},p:Ue,d(s){s&&n(t)}}}function Pt(x){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(s){t=d(s,"P",{"data-svelte-h":!0}),M(t)!=="svelte-1ncwfw5"&&(t.innerHTML=u)},m(s,o){a(s,t,o)},p:Ue,d(s){s&&n(t)}}}function Kt(x){let t,u="💡학습 성능을 올리기 위해, 플레이스홀더 토큰(<code>&lt;cat-toy&gt;</code>)을 (단일한 임베딩 벡터가 아닌) 복수의 임베딩 벡터로 표현하는 것 역시 고려할 있습니다.  이러한 트릭이 모델이 보다 복잡한 이미지의 스타일(앞서 말한 콘셉트)을 더 잘 캡처하는 데 도움이 될 수 있습니다. 복수의 임베딩 벡터 학습을 활성화하려면 다음 옵션을 전달하십시오.",s,o,f;return o=new k({props:{code:"LS1udW1fdmVjdG9ycyUzRDU=",highlighted:"--num_vectors=5",wrap:!1}}),{c(){t=$("p"),t.innerHTML=u,s=p(),h(o.$$.fragment)},l(m){t=d(m,"P",{"data-svelte-h":!0}),M(t)!=="svelte-scq1d8"&&(t.innerHTML=u),s=r(m),w(o.$$.fragment,m)},m(m,T){a(m,t,T),a(m,s,T),y(o,m,T),f=!0},p:Ue,i(m){f||(_(o.$$.fragment,m),f=!0)},o(m){b(o.$$.fragment,m),f=!1},d(m){m&&(n(t),n(s)),g(o,m)}}}function Ot(x){let t,u,s,o;return t=new k({props:{code:"ZXhwb3J0JTIwTU9ERUxfTkFNRSUzRCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTBBZXhwb3J0JTIwREFUQV9ESVIlM0QlMjIuJTJGY2F0JTIyJTBBJTBBYWNjZWxlcmF0ZSUyMGxhdW5jaCUyMHRleHR1YWxfaW52ZXJzaW9uLnB5JTIwJTVDJTBBJTIwJTIwLS1wcmV0cmFpbmVkX21vZGVsX25hbWVfb3JfcGF0aCUzRCUyNE1PREVMX05BTUUlMjAlNUMlMEElMjAlMjAtLXRyYWluX2RhdGFfZGlyJTNEJTI0REFUQV9ESVIlMjAlNUMlMEElMjAlMjAtLWxlYXJuYWJsZV9wcm9wZXJ0eSUzRCUyMm9iamVjdCUyMiUyMCU1QyUwQSUyMCUyMC0tcGxhY2Vob2xkZXJfdG9rZW4lM0QlMjIlM0NjYXQtdG95JTNFJTIyJTIwLS1pbml0aWFsaXplcl90b2tlbiUzRCUyMnRveSUyMiUyMCU1QyUwQSUyMCUyMC0tcmVzb2x1dGlvbiUzRDUxMiUyMCU1QyUwQSUyMCUyMC0tdHJhaW5fYmF0Y2hfc2l6ZSUzRDElMjAlNUMlMEElMjAlMjAtLWdyYWRpZW50X2FjY3VtdWxhdGlvbl9zdGVwcyUzRDQlMjAlNUMlMEElMjAlMjAtLW1heF90cmFpbl9zdGVwcyUzRDMwMDAlMjAlNUMlMEElMjAlMjAtLWxlYXJuaW5nX3JhdGUlM0Q1LjBlLTA0JTIwLS1zY2FsZV9sciUyMCU1QyUwQSUyMCUyMC0tbHJfc2NoZWR1bGVyJTNEJTIyY29uc3RhbnQlMjIlMjAlNUMlMEElMjAlMjAtLWxyX3dhcm11cF9zdGVwcyUzRDAlMjAlNUMlMEElMjAlMjAtLW91dHB1dF9kaXIlM0QlMjJ0ZXh0dWFsX2ludmVyc2lvbl9jYXQlMjIlMjAlNUMlMEElMjAlMjAtLXB1c2hfdG9faHVi",highlighted:`<span class="hljs-built_in">export</span> MODEL_NAME=<span class="hljs-string">&quot;runwayml/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}}),s=new $t({props:{$$slots:{default:[Kt]},$$scope:{ctx:x}}}),{c(){h(t.$$.fragment),u=p(),h(s.$$.fragment)},l(f){w(t.$$.fragment,f),u=r(f),w(s.$$.fragment,f)},m(f,m){y(t,f,m),a(f,u,m),y(s,f,m),o=!0},p(f,m){const T={};m&2&&(T.$$scope={dirty:m,ctx:f}),s.$set(T)},i(f){o||(_(t.$$.fragment,f),_(s.$$.fragment,f),o=!0)},o(f){b(t.$$.fragment,f),b(s.$$.fragment,f),o=!1},d(f){f&&n(u),g(t,f),g(s,f)}}}function el(x){let t,u;return t=new dt({props:{$$slots:{default:[Ot]},$$scope:{ctx:x}}}),{c(){h(t.$$.fragment)},l(s){w(t.$$.fragment,s)},m(s,o){y(t,s,o),u=!0},p(s,o){const f={};o&2&&(f.$$scope={dirty:o,ctx:s}),t.$set(f)},i(s){u||(_(t.$$.fragment,s),u=!0)},o(s){b(t.$$.fragment,s),u=!1},d(s){g(t,s)}}}function tl(x){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% 더 빨라야 합니다! ⚡️',s,o,f="시작하기 앞서 Flax에 대한 의존성 라이브러리들을 설치해야 합니다.",m,T,Z,C,I='모델의 리포지토리 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,J,L='그런 다음 <a href="https://github.com/huggingface/diffusers/blob/main/examples/textual_inversion/textual_inversion_flax.py" rel="nofollow">학습 스크립트</a>를 시작할 수 있습니다.',R,j,G;return T=new k({props:{code:"cGlwJTIwaW5zdGFsbCUyMC1VJTIwLXIlMjByZXF1aXJlbWVudHNfZmxheC50eHQ=",highlighted:"pip install -U -r requirements_flax.txt",wrap:!1}}),j=new k({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,s=p(),o=$("p"),o.textContent=f,m=p(),h(T.$$.fragment),Z=p(),C=$("p"),C.innerHTML=I,W=p(),J=$("p"),J.innerHTML=L,R=p(),h(j.$$.fragment)},l(c){t=d(c,"P",{"data-svelte-h":!0}),M(t)!=="svelte-1ug88y6"&&(t.innerHTML=u),s=r(c),o=d(c,"P",{"data-svelte-h":!0}),M(o)!=="svelte-36790u"&&(o.textContent=f),m=r(c),w(T.$$.fragment,c),Z=r(c),C=d(c,"P",{"data-svelte-h":!0}),M(C)!=="svelte-1xqwqhs"&&(C.innerHTML=I),W=r(c),J=d(c,"P",{"data-svelte-h":!0}),M(J)!=="svelte-12y9yev"&&(J.innerHTML=L),R=r(c),w(j.$$.fragment,c)},m(c,v){a(c,t,v),a(c,s,v),a(c,o,v),a(c,m,v),y(T,c,v),a(c,Z,v),a(c,C,v),a(c,W,v),a(c,J,v),a(c,R,v),y(j,c,v),G=!0},p:Ue,i(c){G||(_(T.$$.fragment,c),_(j.$$.fragment,c),G=!0)},o(c){b(T.$$.fragment,c),b(j.$$.fragment,c),G=!1},d(c){c&&(n(t),n(s),n(o),n(m),n(Z),n(C),n(W),n(J),n(R)),g(T,c),g(j,c)}}}function ll(x){let t,u;return t=new dt({props:{$$slots:{default:[tl]},$$scope:{ctx:x}}}),{c(){h(t.$$.fragment)},l(s){w(t.$$.fragment,s)},m(s,o){y(t,s,o),u=!0},p(s,o){const f={};o&2&&(f.$$scope={dirty:o,ctx:s}),t.$set(f)},i(s){u||(_(t.$$.fragment,s),u=!0)},o(s){b(t.$$.fragment,s),u=!1},d(s){g(t,s)}}}function nl(x){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(s){t=d(s,"P",{"data-svelte-h":!0}),M(t)!=="svelte-1dx5v1s"&&(t.innerHTML=u)},m(s,o){a(s,t,o)},p:Ue,d(s){s&&n(t)}}}function sl(x){let t,u,s,o='textual-inversion 임베딩 벡터을 불러오기 위해서는, 먼저 해당 임베딩 벡터를 학습할 때 사용한 모델을 불러와야 합니다. 여기서는  <a href="https://huggingface.co/docs/diffusers/training/runwayml/stable-diffusion-v1-5" rel="nofollow"><code>runwayml/stable-diffusion-v1-5</code></a> 모델이 사용되었다고 가정하고 불러오겠습니다.',f,m,T,Z,C="다음으로 <code>TextualInversionLoaderMixin.load_textual_inversion</code> 함수를 통해, textual-inversion 임베딩 벡터를 불러와야 합니다. 여기서 우리는 이전의 <code>&lt;cat-toy&gt;</code> 예제의 임베딩을 불러올 것입니다.",I,W,J,L,R="이제 플레이스홀더 토큰(<code>&lt;cat-toy&gt;</code>)이 잘 동작하는지를 확인하는 파이프라인을 실행할 수 있습니다.",j,G,c,v,Je='<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>에서 임베딩 벡터를 다운로드한 다음 로컬에서 불러와야 합니다.',H,X,B;return t=new $t({props:{$$slots:{default:[nl]},$$scope:{ctx:x}}}),m=new k({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFtb2RlbF9pZCUyMCUzRCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTBBcGlwZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNikudG8oJTIyY3VkYSUyMik=",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;runwayml/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 k({props:{code:"cGlwZS5sb2FkX3RleHR1YWxfaW52ZXJzaW9uKCUyMnNkLWNvbmNlcHRzLWxpYnJhcnklMkZjYXQtdG95JTIyKQ==",highlighted:'pipe.load_textual_inversion(<span class="hljs-string">&quot;sd-concepts-library/cat-toy&quot;</span>)',wrap:!1}}),G=new k({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}}),X=new k({props:{code:"cGlwZS5sb2FkX3RleHR1YWxfaW52ZXJzaW9uKCUyMi4lMkZjaGFydHVybmVydjIucHQlMjIp",highlighted:'pipe.load_textual_inversion(<span class="hljs-string">&quot;./charturnerv2.pt&quot;</span>)',wrap:!1}}),{c(){h(t.$$.fragment),u=p(),s=$("p"),s.innerHTML=o,f=p(),h(m.$$.fragment),T=p(),Z=$("p"),Z.innerHTML=C,I=p(),h(W.$$.fragment),J=p(),L=$("p"),L.innerHTML=R,j=p(),h(G.$$.fragment),c=p(),v=$("p"),v.innerHTML=Je,H=p(),h(X.$$.fragment)},l(i){w(t.$$.fragment,i),u=r(i),s=d(i,"P",{"data-svelte-h":!0}),M(s)!=="svelte-ijli0i"&&(s.innerHTML=o),f=r(i),w(m.$$.fragment,i),T=r(i),Z=d(i,"P",{"data-svelte-h":!0}),M(Z)!=="svelte-f7udvy"&&(Z.innerHTML=C),I=r(i),w(W.$$.fragment,i),J=r(i),L=d(i,"P",{"data-svelte-h":!0}),M(L)!=="svelte-1qomt85"&&(L.innerHTML=R),j=r(i),w(G.$$.fragment,i),c=r(i),v=d(i,"P",{"data-svelte-h":!0}),M(v)!=="svelte-6cdkr9"&&(v.innerHTML=Je),H=r(i),w(X.$$.fragment,i)},m(i,U){y(t,i,U),a(i,u,U),a(i,s,U),a(i,f,U),y(m,i,U),a(i,T,U),a(i,Z,U),a(i,I,U),y(W,i,U),a(i,J,U),a(i,L,U),a(i,j,U),y(G,i,U),a(i,c,U),a(i,v,U),a(i,H,U),y(X,i,U),B=!0},p(i,U){const E={};U&2&&(E.$$scope={dirty:U,ctx:i}),t.$set(E)},i(i){B||(_(t.$$.fragment,i),_(m.$$.fragment,i),_(W.$$.fragment,i),_(G.$$.fragment,i),_(X.$$.fragment,i),B=!0)},o(i){b(t.$$.fragment,i),b(m.$$.fragment,i),b(W.$$.fragment,i),b(G.$$.fragment,i),b(X.$$.fragment,i),B=!1},d(i){i&&(n(u),n(s),n(f),n(T),n(Z),n(I),n(J),n(L),n(j),n(c),n(v),n(H)),g(t,i),g(m,i),g(W,i),g(G,i),g(X,i)}}}function al(x){let t,u;return t=new dt({props:{$$slots:{default:[sl]},$$scope:{ctx:x}}}),{c(){h(t.$$.fragment)},l(s){w(t.$$.fragment,s)},m(s,o){y(t,s,o),u=!0},p(s,o){const f={};o&2&&(f.$$scope={dirty:o,ctx:s}),t.$set(f)},i(s){u||(_(t.$$.fragment,s),u=!0)},o(s){b(t.$$.fragment,s),u=!1},d(s){g(t,s)}}}function il(x){let t,u="현재 Flax에 대한 <code>load_textual_inversion</code> 함수는 없습니다. 따라서 학습 후 textual-inversion 임베딩 벡터가 모델의 일부로서 저장되었는지를 확인해야 합니다. 그런 다음은 다른 Flax 모델과 마찬가지로 실행할 수 있습니다.",s,o,f;return o=new k({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,s=p(),h(o.$$.fragment)},l(m){t=d(m,"P",{"data-svelte-h":!0}),M(t)!=="svelte-1caeprs"&&(t.innerHTML=u),s=r(m),w(o.$$.fragment,m)},m(m,T){a(m,t,T),a(m,s,T),y(o,m,T),f=!0},p:Ue,i(m){f||(_(o.$$.fragment,m),f=!0)},o(m){b(o.$$.fragment,m),f=!1},d(m){m&&(n(t),n(s)),g(o,m)}}}function pl(x){let t,u;return t=new dt({props:{$$slots:{default:[il]},$$scope:{ctx:x}}}),{c(){h(t.$$.fragment)},l(s){w(t.$$.fragment,s)},m(s,o){y(t,s,o),u=!0},p(s,o){const f={};o&2&&(f.$$scope={dirty:o,ctx:s}),t.$set(f)},i(s){u||(_(t.$$.fragment,s),u=!0)},o(s){b(t.$$.fragment,s),u=!1},d(s){g(t,s)}}}function rl(x){let t,u,s,o,f,m,T,Z,C,I='<a href="https://arxiv.org/abs/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,J,L='<img src="https://textual-inversion.github.io/static/images/editing/colorful_teapot.JPG" alt="Textual Inversion example"/>',R,j,G='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,Je='이 가이드에서는 textual-inversion으로 <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow"><code>runwayml/stable-diffusion-v1-5</code></a> 모델을 학습하는 방법을 설명합니다. 이 가이드에서 사용된 모든 textual-inversion 학습 스크립트는 <a href="https://github.com/huggingface/diffusers/tree/main/examples/textual_inversion" rel="nofollow">여기</a>에서 확인할 수 있습니다. 내부적으로 어떻게 작동하는지 자세히 살펴보고 싶으시다면 해당 링크를 참조해주시기 바랍니다.',H,X,B,i,U="시작하기 전에 학습을 위한 의존성 라이브러리들을 설치해야 합니다:",E,V,Ce,Q,Mt='의존성 라이브러리들의 설치가 완료되면, <a href="https://github.com/huggingface/accelerate/" rel="nofollow">🤗Accelerate</a> 환경을 초기화시킵니다.',ke,S,Ze,A,ht="별도의 설정없이, 기본 🤗Accelerate 환경을 설정하려면 다음과 같이 하세요:",We,z,Xe,q,wt="또는 사용 중인 환경이 노트북과 같은 대화형 셸을 지원하지 않는다면, 다음과 같이 사용할 수 있습니다:",Ge,D,Le,P,yt='마지막으로, 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에서 지원되지 않습니다.',Re,K,Ie,O,_t="모델을 허브에 저장하려면, 학습 스크립트에 다음 인자를 추가해야 합니다.",He,ee,Be,te,Fe,le,bt="학습중에 모델의 체크포인트를 정기적으로 저장하는 것이 좋습니다. 이렇게 하면 어떤 이유로든 학습이 중단된 경우 저장된 체크포인트에서 학습을 다시 시작할 수 있습니다. 학습 스크립트에 다음 인자를 전달하면 500단계마다 전체 학습 상태가 <code>output_dir</code>의 하위 폴더에 체크포인트로서 저장됩니다.",Ne,ne,Ye,se,gt="저장된 체크포인트에서 학습을 재개하려면, 학습 스크립트와 재개할 특정 체크포인트에 다음 인자를 전달하세요.",Ee,ae,Ve,ie,Qe,pe,Tt='학습용 데이터셋으로 <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> 가이드를 살펴보시기 바랍니다.',Se,re,Ae,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,xt='이제 <a href="https://github.com/huggingface/diffusers/blob/main/examples/textual_inversion/textual_inversion.py" rel="nofollow">학습 스크립트</a>를 실행할 수 있습니다. 스크립트는 다음 파일을 생성하고 리포지토리에 저장합니다.',qe,me,Ut="<li><code>learned_embeds.bin</code></li> <li><code>token_identifier.txt</code></li> <li><code>type_of_concept.txt</code>.</li>",De,F,Pe,N,Ke,ue,Oe,ce,Jt="모델의 학습 진행 상황을 추적하는 데 관심이 있는 경우, 학습 과정에서 생성된 이미지를 저장할 수 있습니다. 학습 스크립트에 다음 인수를 추가하여 중간 로깅을 활성화합니다.",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,nt,he,Ct="모델을 학습한 후에는, 해당 모델을 <code>StableDiffusionPipeline</code>을 사용하여 추론에 사용할 수 있습니다.",st,we,kt="textual-inversion 스크립트는 기본적으로 textual-inversion을 통해 얻어진 임베딩 벡터만을 저장합니다. 해당 임베딩 벡터들은 텍스트 인코더의 임베딩 행렬에 추가되어 있습습니다.",at,Y,it,ye,pt,_e,Zt='<img src="https://textual-inversion.github.io/static/images/training/training.JPG" alt="Diagram from the paper showing overview"/>',rt,be,Wt='Architecture overview from the Textual Inversion <a href="https://textual-inversion.github.io/">blog post.</a>',ot,ge,Xt="일반적으로 텍스트 프롬프트는 모델에 전달되기 전에 임베딩으로 토큰화됩니다. textual-inversion은 비슷한 작업을 수행하지만, 위 다이어그램의 특수 토큰 <code>S*</code>로부터 새로운 토큰 임베딩 <code>v*</code>를 학습합니다. 모델의 아웃풋은 디퓨전 모델을 조정하는 데 사용되며, 디퓨전 모델이 단 몇 개의 예제 이미지에서 신속하고 새로운 콘셉트를 이해하는 데 도움을 줍니다.",ft,Te,Gt="이를 위해 textual-inversion은 제너레이터 모델과 학습용 이미지의 노이즈 버전을 사용합니다. 제너레이터는 노이즈가 적은 버전의 이미지를 예측하려고 시도하며 토큰 임베딩 <code>v*</code>은 제너레이터의 성능에 따라 최적화됩니다. 토큰 임베딩이 새로운 콘셉트를 성공적으로 포착하면 디퓨전 모델에 더 유용한 정보를 제공하고 노이즈가 적은 더 선명한 이미지를 생성하는 데 도움이 됩니다. 이러한 최적화 프로세스는 일반적으로 다양한 프롬프트와 이미지에 수천 번에 노출됨으로써 이루어집니다.",mt,ve,ut,je,ct;return f=new xe({props:{title:"Textual-Inversion",local:"textual-inversion",headingTag:"h1"}}),T=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"}]}}),X=new $t({props:{$$slots:{default:[Dt]},$$scope:{ctx:x}}}),V=new k({props:{code:"cGlwJTIwaW5zdGFsbCUyMGRpZmZ1c2VycyUyMGFjY2VsZXJhdGUlMjB0cmFuc2Zvcm1lcnM=",highlighted:"pip install diffusers accelerate transformers",wrap:!1}}),S=new k({props:{code:"YWNjZWxlcmF0ZSUyMGNvbmZpZw==",highlighted:"accelerate config",wrap:!1}}),z=new k({props:{code:"YWNjZWxlcmF0ZSUyMGNvbmZpZyUyMGRlZmF1bHQ=",highlighted:"accelerate config default",wrap:!1}}),D=new k({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 xe({props:{title:"허브에 모델 업로드하기",local:"허브에-모델-업로드하기",headingTag:"h2"}}),ee=new k({props:{code:"LS1wdXNoX3RvX2h1Yg==",highlighted:"--push_to_hub",wrap:!1}}),te=new xe({props:{title:"체크포인트 저장 및 불러오기",local:"체크포인트-저장-및-불러오기",headingTag:"h2"}}),ne=new k({props:{code:"LS1jaGVja3BvaW50aW5nX3N0ZXBzJTNENTAw",highlighted:"--checkpointing_steps=500",wrap:!1}}),ae=new k({props:{code:"LS1yZXN1bWVfZnJvbV9jaGVja3BvaW50JTNEJTIyY2hlY2twb2ludC0xNTAwJTIy",highlighted:'--resume_from_checkpoint=<span class="hljs-string">&quot;checkpoint-1500&quot;</span>',wrap:!1}}),ie=new xe({props:{title:"파인 튜닝",local:"파인-튜닝",headingTag:"h2"}}),re=new k({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}}),F=new $t({props:{$$slots:{default:[Pt]},$$scope:{ctx:x}}}),N=new Nt({props:{pytorch:!0,tensorflow:!1,jax:!0,$$slots:{jax:[ll],pytorch:[el]},$$scope:{ctx:x}}}),ue=new xe({props:{title:"중간 로깅",local:"중간-로깅",headingTag:"h3"}}),de=new k({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 xe({props:{title:"추론",local:"추론",headingTag:"h2"}}),Y=new Nt({props:{pytorch:!0,tensorflow:!1,jax:!0,$$slots:{jax:[pl],pytorch:[al]},$$scope:{ctx:x}}}),ye=new xe({props:{title:"작동 방식",local:"작동-방식",headingTag:"h2"}}),ve=new qt({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/ko/training/text_inversion.md"}}),{c(){t=$("meta"),u=p(),s=$("p"),o=p(),h(f.$$.fragment),m=p(),h(T.$$.fragment),Z=p(),C=$("p"),C.innerHTML=I,W=p(),J=$("p"),J.innerHTML=L,R=p(),j=$("small"),j.innerHTML=G,c=p(),v=$("p"),v.innerHTML=Je,H=p(),h(X.$$.fragment),B=p(),i=$("p"),i.textContent=U,E=p(),h(V.$$.fragment),Ce=p(),Q=$("p"),Q.innerHTML=Mt,ke=p(),h(S.$$.fragment),Ze=p(),A=$("p"),A.textContent=ht,We=p(),h(z.$$.fragment),Xe=p(),q=$("p"),q.textContent=wt,Ge=p(),h(D.$$.fragment),Le=p(),P=$("p"),P.innerHTML=yt,Re=p(),h(K.$$.fragment),Ie=p(),O=$("p"),O.textContent=_t,He=p(),h(ee.$$.fragment),Be=p(),h(te.$$.fragment),Fe=p(),le=$("p"),le.innerHTML=bt,Ne=p(),h(ne.$$.fragment),Ye=p(),se=$("p"),se.textContent=gt,Ee=p(),h(ae.$$.fragment),Ve=p(),h(ie.$$.fragment),Qe=p(),pe=$("p"),pe.innerHTML=Tt,Se=p(),h(re.$$.fragment),Ae=p(),oe=$("p"),oe.innerHTML=vt,ze=p(),fe=$("p"),fe.innerHTML=xt,qe=p(),me=$("ul"),me.innerHTML=Ut,De=p(),h(F.$$.fragment),Pe=p(),h(N.$$.fragment),Ke=p(),h(ue.$$.fragment),Oe=p(),ce=$("p"),ce.textContent=Jt,et=p(),$e=$("ul"),$e.innerHTML=jt,tt=p(),h(de.$$.fragment),lt=p(),h(Me.$$.fragment),nt=p(),he=$("p"),he.innerHTML=Ct,st=p(),we=$("p"),we.textContent=kt,at=p(),h(Y.$$.fragment),it=p(),h(ye.$$.fragment),pt=p(),_e=$("p"),_e.innerHTML=Zt,rt=p(),be=$("small"),be.innerHTML=Wt,ot=p(),ge=$("p"),ge.innerHTML=Xt,ft=p(),Te=$("p"),Te.innerHTML=Gt,mt=p(),h(ve.$$.fragment),ut=p(),je=$("p"),this.h()},l(e){const l=St("svelte-u9bgzb",document.head);t=d(l,"META",{name:!0,content:!0}),l.forEach(n),u=r(e),s=d(e,"P",{}),Bt(s).forEach(n),o=r(e),w(f.$$.fragment,e),m=r(e),w(T.$$.fragment,e),Z=r(e),C=d(e,"P",{"data-svelte-h":!0}),M(C)!=="svelte-1undymd"&&(C.innerHTML=I),W=r(e),J=d(e,"P",{"data-svelte-h":!0}),M(J)!=="svelte-1vgmpoc"&&(J.innerHTML=L),R=r(e),j=d(e,"SMALL",{"data-svelte-h":!0}),M(j)!=="svelte-20gkrh"&&(j.innerHTML=G),c=r(e),v=d(e,"P",{"data-svelte-h":!0}),M(v)!=="svelte-1uunqjn"&&(v.innerHTML=Je),H=r(e),w(X.$$.fragment,e),B=r(e),i=d(e,"P",{"data-svelte-h":!0}),M(i)!=="svelte-1gixux3"&&(i.textContent=U),E=r(e),w(V.$$.fragment,e),Ce=r(e),Q=d(e,"P",{"data-svelte-h":!0}),M(Q)!=="svelte-1pnlkh"&&(Q.innerHTML=Mt),ke=r(e),w(S.$$.fragment,e),Ze=r(e),A=d(e,"P",{"data-svelte-h":!0}),M(A)!=="svelte-1apzpmc"&&(A.textContent=ht),We=r(e),w(z.$$.fragment,e),Xe=r(e),q=d(e,"P",{"data-svelte-h":!0}),M(q)!=="svelte-e9ddhp"&&(q.textContent=wt),Ge=r(e),w(D.$$.fragment,e),Le=r(e),P=d(e,"P",{"data-svelte-h":!0}),M(P)!=="svelte-1djpdsa"&&(P.innerHTML=yt),Re=r(e),w(K.$$.fragment,e),Ie=r(e),O=d(e,"P",{"data-svelte-h":!0}),M(O)!=="svelte-fr8nft"&&(O.textContent=_t),He=r(e),w(ee.$$.fragment,e),Be=r(e),w(te.$$.fragment,e),Fe=r(e),le=d(e,"P",{"data-svelte-h":!0}),M(le)!=="svelte-1ntxetc"&&(le.innerHTML=bt),Ne=r(e),w(ne.$$.fragment,e),Ye=r(e),se=d(e,"P",{"data-svelte-h":!0}),M(se)!=="svelte-169qicm"&&(se.textContent=gt),Ee=r(e),w(ae.$$.fragment,e),Ve=r(e),w(ie.$$.fragment,e),Qe=r(e),pe=d(e,"P",{"data-svelte-h":!0}),M(pe)!=="svelte-1hkoxwu"&&(pe.innerHTML=Tt),Se=r(e),w(re.$$.fragment,e),Ae=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=xt),qe=r(e),me=d(e,"UL",{"data-svelte-h":!0}),M(me)!=="svelte-4dabp"&&(me.innerHTML=Ut),De=r(e),w(F.$$.fragment,e),Pe=r(e),w(N.$$.fragment,e),Ke=r(e),w(ue.$$.fragment,e),Oe=r(e),ce=d(e,"P",{"data-svelte-h":!0}),M(ce)!=="svelte-1i6qamb"&&(ce.textContent=Jt),et=r(e),$e=d(e,"UL",{"data-svelte-h":!0}),M($e)!=="svelte-jpu1w7"&&($e.innerHTML=jt),tt=r(e),w(de.$$.fragment,e),lt=r(e),w(Me.$$.fragment,e),nt=r(e),he=d(e,"P",{"data-svelte-h":!0}),M(he)!=="svelte-1k5zyxz"&&(he.innerHTML=Ct),st=r(e),we=d(e,"P",{"data-svelte-h":!0}),M(we)!=="svelte-xlgr7u"&&(we.textContent=kt),at=r(e),w(Y.$$.fragment,e),it=r(e),w(ye.$$.fragment,e),pt=r(e),_e=d(e,"P",{"data-svelte-h":!0}),M(_e)!=="svelte-4oyjpc"&&(_e.innerHTML=Zt),rt=r(e),be=d(e,"SMALL",{"data-svelte-h":!0}),M(be)!=="svelte-1t7e7o6"&&(be.innerHTML=Wt),ot=r(e),ge=d(e,"P",{"data-svelte-h":!0}),M(ge)!=="svelte-699n2d"&&(ge.innerHTML=Xt),ft=r(e),Te=d(e,"P",{"data-svelte-h":!0}),M(Te)!=="svelte-12bb61m"&&(Te.innerHTML=Gt),mt=r(e),w(ve.$$.fragment,e),ut=r(e),je=d(e,"P",{}),Bt(je).forEach(n),this.h()},h(){Ft(t,"name","hf:doc:metadata"),Ft(t,"content",ol)},m(e,l){At(document.head,t),a(e,u,l),a(e,s,l),a(e,o,l),y(f,e,l),a(e,m,l),y(T,e,l),a(e,Z,l),a(e,C,l),a(e,W,l),a(e,J,l),a(e,R,l),a(e,j,l),a(e,c,l),a(e,v,l),a(e,H,l),y(X,e,l),a(e,B,l),a(e,i,l),a(e,E,l),y(V,e,l),a(e,Ce,l),a(e,Q,l),a(e,ke,l),y(S,e,l),a(e,Ze,l),a(e,A,l),a(e,We,l),y(z,e,l),a(e,Xe,l),a(e,q,l),a(e,Ge,l),y(D,e,l),a(e,Le,l),a(e,P,l),a(e,Re,l),y(K,e,l),a(e,Ie,l),a(e,O,l),a(e,He,l),y(ee,e,l),a(e,Be,l),y(te,e,l),a(e,Fe,l),a(e,le,l),a(e,Ne,l),y(ne,e,l),a(e,Ye,l),a(e,se,l),a(e,Ee,l),y(ae,e,l),a(e,Ve,l),y(ie,e,l),a(e,Qe,l),a(e,pe,l),a(e,Se,l),y(re,e,l),a(e,Ae,l),a(e,oe,l),a(e,ze,l),a(e,fe,l),a(e,qe,l),a(e,me,l),a(e,De,l),y(F,e,l),a(e,Pe,l),y(N,e,l),a(e,Ke,l),y(ue,e,l),a(e,Oe,l),a(e,ce,l),a(e,et,l),a(e,$e,l),a(e,tt,l),y(de,e,l),a(e,lt,l),y(Me,e,l),a(e,nt,l),a(e,he,l),a(e,st,l),a(e,we,l),a(e,at,l),y(Y,e,l),a(e,it,l),y(ye,e,l),a(e,pt,l),a(e,_e,l),a(e,rt,l),a(e,be,l),a(e,ot,l),a(e,ge,l),a(e,ft,l),a(e,Te,l),a(e,mt,l),y(ve,e,l),a(e,ut,l),a(e,je,l),ct=!0},p(e,[l]){const Lt={};l&2&&(Lt.$$scope={dirty:l,ctx:e}),X.$set(Lt);const Rt={};l&2&&(Rt.$$scope={dirty:l,ctx:e}),F.$set(Rt);const It={};l&2&&(It.$$scope={dirty:l,ctx:e}),N.$set(It);const Ht={};l&2&&(Ht.$$scope={dirty:l,ctx:e}),Y.$set(Ht)},i(e){ct||(_(f.$$.fragment,e),_(T.$$.fragment,e),_(X.$$.fragment,e),_(V.$$.fragment,e),_(S.$$.fragment,e),_(z.$$.fragment,e),_(D.$$.fragment,e),_(K.$$.fragment,e),_(ee.$$.fragment,e),_(te.$$.fragment,e),_(ne.$$.fragment,e),_(ae.$$.fragment,e),_(ie.$$.fragment,e),_(re.$$.fragment,e),_(F.$$.fragment,e),_(N.$$.fragment,e),_(ue.$$.fragment,e),_(de.$$.fragment,e),_(Me.$$.fragment,e),_(Y.$$.fragment,e),_(ye.$$.fragment,e),_(ve.$$.fragment,e),ct=!0)},o(e){b(f.$$.fragment,e),b(T.$$.fragment,e),b(X.$$.fragment,e),b(V.$$.fragment,e),b(S.$$.fragment,e),b(z.$$.fragment,e),b(D.$$.fragment,e),b(K.$$.fragment,e),b(ee.$$.fragment,e),b(te.$$.fragment,e),b(ne.$$.fragment,e),b(ae.$$.fragment,e),b(ie.$$.fragment,e),b(re.$$.fragment,e),b(F.$$.fragment,e),b(N.$$.fragment,e),b(ue.$$.fragment,e),b(de.$$.fragment,e),b(Me.$$.fragment,e),b(Y.$$.fragment,e),b(ye.$$.fragment,e),b(ve.$$.fragment,e),ct=!1},d(e){e&&(n(u),n(s),n(o),n(m),n(Z),n(C),n(W),n(J),n(R),n(j),n(c),n(v),n(H),n(B),n(i),n(E),n(Ce),n(Q),n(ke),n(Ze),n(A),n(We),n(Xe),n(q),n(Ge),n(Le),n(P),n(Re),n(Ie),n(O),n(He),n(Be),n(Fe),n(le),n(Ne),n(Ye),n(se),n(Ee),n(Ve),n(Qe),n(pe),n(Se),n(Ae),n(oe),n(ze),n(fe),n(qe),n(me),n(De),n(Pe),n(Ke),n(Oe),n(ce),n(et),n($e),n(tt),n(lt),n(nt),n(he),n(st),n(we),n(at),n(it),n(pt),n(_e),n(rt),n(be),n(ot),n(ge),n(ft),n(Te),n(mt),n(ut),n(je)),n(t),g(f,e),g(T,e),g(X,e),g(V,e),g(S,e),g(z,e),g(D,e),g(K,e),g(ee,e),g(te,e),g(ne,e),g(ae,e),g(ie,e),g(re,e),g(F,e),g(N,e),g(ue,e),g(de,e),g(Me,e),g(Y,e),g(ye,e),g(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(x){return Et(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class wl extends Vt{constructor(t){super(),Qt(this,t,fl,rl,Yt,{})}}export{wl as component};
