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 s,n as w,t as y,o as T,p as _}from"../chunks/index.9b1f405b.js";import{C as At,H as Ue,E as Dt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.ccdc6aab.js";import{C as X}from"../chunks/CodeBlock.cef191d3.js";import{D as Pt}from"../chunks/DocNotebookDropdown.1788fe48.js";import{F as Yt,M as bt}from"../chunks/Markdown.6a72f2f2.js";function Kt(W){let n,d,a,o,g="💡학습 성능을 올리기 위해, 플레이스홀더 토큰(<code>&lt;cat-toy&gt;</code>)을 (단일한 임베딩 벡터가 아닌) 복수의 임베딩 벡터로 표현하는 것 역시 고려할 있습니다.  이러한 트릭이 모델이 보다 복잡한 이미지의 스타일(앞서 말한 콘셉트)을 더 잘 캡처하는 데 도움이 될 수 있습니다. 복수의 임베딩 벡터 학습을 활성화하려면 다음 옵션을 전달하십시오.",J,M,U;return n=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(n.$$.fragment),d=i(),a=m("blockquote"),o=m("p"),o.innerHTML=g,J=i(),b(M.$$.fragment),this.h()},l(c){h(n.$$.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=g),J=p(j),h(M.$$.fragment,j),j.forEach(t),this.h()},h(){ke(a,"class","tip")},m(c,j){w(n,c,j),s(c,d,j),s(c,a,j),wt(a,o),wt(a,J),w(M,a,null),U=!0},p:Mt,i(c){U||(y(n.$$.fragment,c),y(M.$$.fragment,c),U=!0)},o(c){T(n.$$.fragment,c),T(M.$$.fragment,c),U=!1},d(c){c&&(t(d),t(a)),_(n,c),_(M)}}}function Ot(W){let n,d;return n=new bt({props:{$$slots:{default:[Kt]},$$scope:{ctx:W}}}),{c(){b(n.$$.fragment)},l(a){h(n.$$.fragment,a)},m(a,o){w(n,a,o),d=!0},p(a,o){const g={};o&2&&(g.$$scope={dirty:o,ctx:a}),n.$set(g)},i(a){d||(y(n.$$.fragment,a),d=!0)},o(a){T(n.$$.fragment,a),d=!1},d(a){_(n,a)}}}function el(W){let n,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,g="시작하기 앞서 Flax에 대한 의존성 라이브러리들을 설치해야 합니다.",J,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(){n=m("p"),n.innerHTML=d,a=i(),o=m("p"),o.textContent=g,J=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){n=u(f,"P",{"data-svelte-h":!0}),$(n)!=="svelte-1ug88y6"&&(n.innerHTML=d),a=p(f),o=u(f,"P",{"data-svelte-h":!0}),$(o)!=="svelte-36790u"&&(o.textContent=g),J=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){s(f,n,k),s(f,a,k),s(f,o,k),s(f,J,k),w(M,f,k),s(f,U,k),s(f,c,k),s(f,C,k),s(f,Z,k),s(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(n),t(a),t(o),t(J),t(U),t(c),t(C),t(Z),t(x)),_(M,f),_(L,f)}}}function tl(W){let n,d;return n=new bt({props:{$$slots:{default:[el]},$$scope:{ctx:W}}}),{c(){b(n.$$.fragment)},l(a){h(n.$$.fragment,a)},m(a,o){w(n,a,o),d=!0},p(a,o){const g={};o&2&&(g.$$scope={dirty:o,ctx:a}),n.$set(g)},i(a){d||(y(n.$$.fragment,a),d=!0)},o(a){T(n.$$.fragment,a),d=!1},d(a){_(n,a)}}}function ll(W){let n,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,g='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> 모델이 사용되었다고 가정하고 불러오겠습니다.',J,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(){n=m("blockquote"),n.innerHTML=d,a=i(),o=m("p"),o.innerHTML=g,J=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){n=u(r,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),$(n)!=="svelte-1nv7q01"&&(n.innerHTML=d),a=p(r),o=u(r,"P",{"data-svelte-h":!0}),$(o)!=="svelte-rs52ie"&&(o.innerHTML=g),J=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(n,"class","tip")},m(r,v){s(r,n,v),s(r,a,v),s(r,o,v),s(r,J,v),w(M,r,v),s(r,U,v),s(r,c,v),s(r,C,v),w(Z,r,v),s(r,N,v),s(r,x,v),s(r,I,v),w(f,r,v),s(r,k,v),s(r,B,v),s(r,V,v),w(R,r,v),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(n),t(a),t(o),t(J),t(U),t(c),t(C),t(N),t(x),t(I),t(k),t(B),t(V)),_(M,r),_(Z,r),_(f,r),_(R,r)}}}function sl(W){let n,d;return n=new bt({props:{$$slots:{default:[ll]},$$scope:{ctx:W}}}),{c(){b(n.$$.fragment)},l(a){h(n.$$.fragment,a)},m(a,o){w(n,a,o),d=!0},p(a,o){const g={};o&2&&(g.$$scope={dirty:o,ctx:a}),n.$set(g)},i(a){d||(y(n.$$.fragment,a),d=!0)},o(a){T(n.$$.fragment,a),d=!1},d(a){_(n,a)}}}function nl(W){let n,d="현재 Flax에 대한 <code>load_textual_inversion</code> 함수는 없습니다. 따라서 학습 후 textual-inversion 임베딩 벡터가 모델의 일부로서 저장되었는지를 확인해야 합니다. 그런 다음은 다른 Flax 모델과 마찬가지로 실행할 수 있습니다.",a,o,g;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(){n=m("p"),n.innerHTML=d,a=i(),b(o.$$.fragment)},l(J){n=u(J,"P",{"data-svelte-h":!0}),$(n)!=="svelte-1caeprs"&&(n.innerHTML=d),a=p(J),h(o.$$.fragment,J)},m(J,M){s(J,n,M),s(J,a,M),w(o,J,M),g=!0},p:Mt,i(J){g||(y(o.$$.fragment,J),g=!0)},o(J){T(o.$$.fragment,J),g=!1},d(J){J&&(t(n),t(a)),_(o,J)}}}function al(W){let n,d;return n=new bt({props:{$$slots:{default:[nl]},$$scope:{ctx:W}}}),{c(){b(n.$$.fragment)},l(a){h(n.$$.fragment,a)},m(a,o){w(n,a,o),d=!0},p(a,o){const g={};o&2&&(g.$$scope={dirty:o,ctx:a}),n.$set(g)},i(a){d||(y(n.$$.fragment,a),d=!0)},o(a){T(n.$$.fragment,a),d=!1},d(a){_(n,a)}}}function il(W){let n,d,a,o,g,J,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>',v,S,yt="시작하기 전에 학습을 위한 의존성 라이브러리들을 설치해야 합니다:",Ze,Q,Xe,q,Tt='의존성 라이브러리들의 설치가 완료되면, <a href="https://github.com/huggingface/accelerate/" rel="nofollow">🤗Accelerate</a> 환경을 초기화시킵니다.',Ce,z,We,A,_t="별도의 설정없이, 기본 🤗Accelerate 환경을 설정하려면 다음과 같이 하세요:",Ie,D,Le,P,gt="또는 사용 중인 환경이 노트북과 같은 대화형 셸을 지원하지 않는다면, 다음과 같이 사용할 수 있습니다:",Ne,K,Be,O,Jt='마지막으로, 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,vt="모델을 허브에 저장하려면, 학습 스크립트에 다음 인자를 추가해야 합니다.",He,le,Fe,se,Ee,ne,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>",st,be,nt,he,at,we,Lt="모델을 학습한 후에는, 해당 모델을 <code>StableDiffusionPipeline</code>을 사용하여 추론에 사용할 수 있습니다.",it,ye,Nt="textual-inversion 스크립트는 기본적으로 textual-inversion을 통해 얻어진 임베딩 벡터만을 저장합니다. 해당 임베딩 벡터들은 텍스트 인코더의 임베딩 행렬에 추가되어 있습습니다.",pt,Y,ot,Te,rt,_e,Bt='<img src="https://textual-inversion.github.io/static/images/training/training.JPG" alt="Diagram from the paper showing overview"/>',ft,ge,Rt='Architecture overview from the Textual Inversion <a href="https://textual-inversion.github.io/">blog post.</a>',mt,Je,Gt="일반적으로 텍스트 프롬프트는 모델에 전달되기 전에 임베딩으로 토큰화됩니다. textual-inversion은 비슷한 작업을 수행하지만, 위 다이어그램의 특수 토큰 <code>S*</code>로부터 새로운 토큰 임베딩 <code>v*</code>를 학습합니다. 모델의 아웃풋은 디퓨전 모델을 조정하는 데 사용되며, 디퓨전 모델이 단 몇 개의 예제 이미지에서 신속하고 새로운 콘셉트를 이해하는 데 도움을 줍니다.",ut,ve,Ht="이를 위해 textual-inversion은 제너레이터 모델과 학습용 이미지의 노이즈 버전을 사용합니다. 제너레이터는 노이즈가 적은 버전의 이미지를 예측하려고 시도하며 토큰 임베딩 <code>v*</code>은 제너레이터의 성능에 따라 최적화됩니다. 토큰 임베딩이 새로운 콘셉트를 성공적으로 포착하면 디퓨전 모델에 더 유용한 정보를 제공하고 노이즈가 적은 더 선명한 이미지를 생성하는 데 도움이 됩니다. 이러한 최적화 프로세스는 일반적으로 다양한 프롬프트와 이미지에 수천 번에 노출됨으로써 이루어집니다.",ct,xe,dt,je,$t;return g=new At({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),M=new Ue({props:{title:"Textual-Inversion",local:"textual-inversion",headingTag:"h1"}}),c=new Pt({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"}]}}),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}}),se=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:[sl]},$$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(){n=m("meta"),d=i(),a=m("p"),o=i(),b(g.$$.fragment),J=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,v=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=_t,Ie=i(),b(D.$$.fragment),Le=i(),P=m("p"),P.textContent=gt,Ne=i(),b(K.$$.fragment),Be=i(),O=m("p"),O.innerHTML=Jt,Re=i(),b(ee.$$.fragment),Ge=i(),te=m("p"),te.textContent=vt,He=i(),b(le.$$.fragment),Fe=i(),b(se.$$.fragment),Ee=i(),ne=m("p"),ne.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,st=i(),b(be.$$.fragment),nt=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(),_e=m("p"),_e.innerHTML=Bt,ft=i(),ge=m("small"),ge.innerHTML=Rt,mt=i(),Je=m("p"),Je.innerHTML=Gt,ut=i(),ve=m("p"),ve.innerHTML=Ht,ct=i(),b(xe.$$.fragment),dt=i(),je=m("p"),this.h()},l(e){const l=zt("svelte-u9bgzb",document.head);n=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(g.$$.fragment,e),J=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),v=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=_t),Ie=p(e),h(D.$$.fragment,e),Le=p(e),P=u(e,"P",{"data-svelte-h":!0}),$(P)!=="svelte-e9ddhp"&&(P.textContent=gt),Ne=p(e),h(K.$$.fragment,e),Be=p(e),O=u(e,"P",{"data-svelte-h":!0}),$(O)!=="svelte-1djpdsa"&&(O.innerHTML=Jt),Re=p(e),h(ee.$$.fragment,e),Ge=p(e),te=u(e,"P",{"data-svelte-h":!0}),$(te)!=="svelte-fr8nft"&&(te.textContent=vt),He=p(e),h(le.$$.fragment,e),Fe=p(e),h(se.$$.fragment,e),Ee=p(e),ne=u(e,"P",{"data-svelte-h":!0}),$(ne)!=="svelte-1ntxetc"&&(ne.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),st=p(e),h(be.$$.fragment,e),nt=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),_e=u(e,"P",{"data-svelte-h":!0}),$(_e)!=="svelte-4oyjpc"&&(_e.innerHTML=Bt),ft=p(e),ge=u(e,"SMALL",{"data-svelte-h":!0}),$(ge)!=="svelte-1t7e7o6"&&(ge.innerHTML=Rt),mt=p(e),Je=u(e,"P",{"data-svelte-h":!0}),$(Je)!=="svelte-699n2d"&&(Je.innerHTML=Gt),ut=p(e),ve=u(e,"P",{"data-svelte-h":!0}),$(ve)!=="svelte-12bb61m"&&(ve.innerHTML=Ht),ct=p(e),h(xe.$$.fragment,e),dt=p(e),je=u(e,"P",{}),ht(je).forEach(t),this.h()},h(){ke(n,"name","hf:doc:metadata"),ke(n,"content",pl),ke(F,"class","tip")},m(e,l){wt(document.head,n),s(e,d,l),s(e,a,l),s(e,o,l),w(g,e,l),s(e,J,l),w(M,e,l),s(e,U,l),w(c,e,l),s(e,j,l),s(e,C,l),s(e,N,l),s(e,x,l),s(e,I,l),s(e,f,l),s(e,B,l),s(e,H,l),s(e,R,l),s(e,G,l),s(e,v,l),s(e,S,l),s(e,Ze,l),w(Q,e,l),s(e,Xe,l),s(e,q,l),s(e,Ce,l),w(z,e,l),s(e,We,l),s(e,A,l),s(e,Ie,l),w(D,e,l),s(e,Le,l),s(e,P,l),s(e,Ne,l),w(K,e,l),s(e,Be,l),s(e,O,l),s(e,Re,l),w(ee,e,l),s(e,Ge,l),s(e,te,l),s(e,He,l),w(le,e,l),s(e,Fe,l),w(se,e,l),s(e,Ee,l),s(e,ne,l),s(e,Ye,l),w(ae,e,l),s(e,Ve,l),s(e,ie,l),s(e,Se,l),w(pe,e,l),s(e,Qe,l),w(oe,e,l),s(e,qe,l),s(e,re,l),s(e,ze,l),w(fe,e,l),s(e,Ae,l),s(e,me,l),s(e,De,l),s(e,ue,l),s(e,Pe,l),s(e,ce,l),s(e,Ke,l),s(e,F,l),s(e,Oe,l),w(E,e,l),s(e,et,l),w(de,e,l),s(e,tt,l),s(e,$e,l),s(e,lt,l),s(e,Me,l),s(e,st,l),w(be,e,l),s(e,nt,l),w(he,e,l),s(e,at,l),s(e,we,l),s(e,it,l),s(e,ye,l),s(e,pt,l),w(Y,e,l),s(e,ot,l),w(Te,e,l),s(e,rt,l),s(e,_e,l),s(e,ft,l),s(e,ge,l),s(e,mt,l),s(e,Je,l),s(e,ut,l),s(e,ve,l),s(e,ct,l),w(xe,e,l),s(e,dt,l),s(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(g.$$.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(se.$$.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(g.$$.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(se.$$.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(J),t(U),t(j),t(C),t(N),t(x),t(I),t(f),t(B),t(H),t(R),t(G),t(v),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(ne),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(st),t(nt),t(at),t(we),t(it),t(ye),t(pt),t(ot),t(rt),t(_e),t(ft),t(ge),t(mt),t(Je),t(ut),t(ve),t(ct),t(dt),t(je)),t(n),_(g,e),_(M,e),_(c,e),_(Q,e),_(z,e),_(D,e),_(K,e),_(ee,e),_(le,e),_(se,e),_(ae,e),_(pe,e),_(oe,e),_(fe,e),_(E,e),_(de,e),_(be,e),_(he,e),_(Y,e),_(Te,e),_(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(n){super(),qt(this,n,ol,il,Vt,{})}}export{$l as component};
