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