import{s as Qe,o as Be,n as Ne}from"../chunks/scheduler.6e0d5ff7.js";import{S as Xe,i as Fe,g as i,s as a,r as m,E as Ye,h as p,f as e,c as s,j as xe,u as r,x as o,k as Ee,y as Se,a as n,v as u,d as c,t as M,w as U}from"../chunks/index.d7c1b260.js";import{T as Le}from"../chunks/Tip.c000e27b.js";import{C as f}from"../chunks/CodeBlock.09a08494.js";import{H as y,E as ke}from"../chunks/EditOnGithub.733546da.js";function He(xt){let d,T="가장 최신 버전의 예시 스크립트를 성공적으로 실행하기 위해서는, 소스에서 설치하고 최신 버전의 설치를 유지하는 것을 강력하게 추천합니다. 우리는 예시 스크립트들을 자주 업데이트하고 예시에 맞춘 특정한 요구사항을 설치합니다.";return{c(){d=i("p"),d.textContent=T},l(b){d=p(b,"P",{"data-svelte-h":!0}),o(d)!=="svelte-89o4gq"&&(d.textContent=T)},m(b,Vt){n(b,d,Vt)},p:Ne,d(b){b&&e(d)}}}function ze(xt){let d,T,b,Vt,J,Et,h,ql='<a href="https://arxiv.org/abs/2302.05543" rel="nofollow">Adding Conditional Control to Text-to-Image Diffusion Models</a> (ControlNet)은 Lvmin Zhang과 Maneesh Agrawala에 의해 쓰여졌습니다.',Qt,_,Pl='이 예시는 <a href="https://github.com/lllyasviel/ControlNet/blob/main/docs/train.md" rel="nofollow">원본 ControlNet 리포지토리에서 예시 학습하기</a>에 기반합니다. ControlNet은 원들을 채우기 위해 <a href="https://huggingface.co/datasets/fusing/fill50k" rel="nofollow">small synthetic dataset</a>을 사용해서 학습됩니다.',Bt,Z,Nt,w,Ol="아래의 스크립트를 실행하기 전에, 라이브러리의 학습 의존성을 설치해야 합니다.",Xt,g,Ft,j,Kl="위 사항을 만족시키기 위해서, 새로운 가상환경에서 다음 일련의 스텝을 실행하세요:",Yt,R,St,C,te='그 다음에는 <a href="https://github.com/huggingface/diffusers/tree/main/examples/controlnet" rel="nofollow">예시 폴더</a>으로 이동합니다.',Lt,W,kt,v,le="이제 실행하세요:",Ht,G,zt,$,ee='<a href="https://github.com/huggingface/accelerate/" rel="nofollow">🤗Accelerate</a> 환경을 초기화 합니다:',Dt,V,At,I,ne="혹은 여러분의 환경이 무엇인지 몰라도 기본적인 🤗Accelerate 구성으로 초기화할 수 있습니다:",qt,x,Pt,E,ae="혹은 당신의 환경이 노트북 같은 상호작용하는 쉘을 지원하지 않는다면, 아래의 코드로 초기화 할 수 있습니다:",Ot,Q,Kt,B,tl,N,se='원본 데이터셋은 ControlNet <a href="https://huggingface.co/lllyasviel/ControlNet/blob/main/training/fill50k.zip" rel="nofollow">repo</a>에 올라와있지만, 우리는 <a href="https://huggingface.co/datasets/fusing/fill50k" rel="nofollow">여기</a>에 새롭게 다시 올려서 🤗 Datasets 과 호환가능합니다. 그래서 학습 스크립트 상에서 데이터 불러오기를 다룰 수 있습니다.',ll,X,ie='우리의 학습 예시는 원래 ControlNet의 학습에 쓰였던 <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow"><code>runwayml/stable-diffusion-v1-5</code></a>을 사용합니다. 그렇지만 ControlNet은 대응되는 어느 Stable Diffusion 모델(<a href="https://huggingface.co/CompVis/stable-diffusion-v1-4" rel="nofollow"><code>CompVis/stable-diffusion-v1-4</code></a>) 혹은 <a href="https://huggingface.co/stabilityai/stable-diffusion-2-1" rel="nofollow"><code>stabilityai/stable-diffusion-2-1</code></a>의 증가를 위해 학습될 수 있습니다.',el,F,pe='자체 데이터셋을 사용하기 위해서는 <a href="create_dataset">학습을 위한 데이터셋 생성하기</a> 가이드를 확인하세요.',nl,Y,al,S,oe="이 학습에 사용될 다음 이미지들을 다운로드하세요:",sl,L,il,k,me='<code>MODEL_NAME</code> 환경 변수 (Hub 모델 리포지토리 아이디 혹은 모델 가중치가 있는 디렉토리로 가는 주소)를 명시하고 <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> 인자로 환경변수를 보냅니다.',pl,H,re="학습 스크립트는 당신의 리포지토리에 <code>diffusion_pytorch_model.bin</code> 파일을 생성하고 저장합니다.",ol,z,ml,D,ue="이 기본적인 설정으로는 ~38GB VRAM이 필요합니다.",rl,A,ce="기본적으로 학습 스크립트는 결과를 텐서보드에 기록합니다. 가중치(weight)와 편향(bias)을 사용하기 위해 <code>--report_to wandb</code> 를 전달합니다.",ul,q,Me="더 작은 batch(배치) 크기로 gradient accumulation(기울기 누적)을 하면 학습 요구사항을 ~20 GB VRAM으로 줄일 수 있습니다.",cl,P,Ml,O,Ul,K,Ue=`<code>accelerate</code> 은 seamless multi-GPU 학습을 고려합니다. <code>accelerate</code>과 함께 분산된 학습을 실행하기 위해 <a href="https://huggingface.co/docs/accelerate/basic_tutorials/launch" rel="nofollow">여기</a>
의 설명을 확인하세요. 아래는 예시 명령어입니다:`,dl,tt,fl,lt,yl,et,bl,nt,de='<thead><tr><th></th> <th align="center"></th></tr></thead> <tbody><tr><td></td> <td align="center">푸른 배경과 빨간 원</td></tr> <tr><td><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/controlnet_training/conditioning_image_1.png" alt="conditioning image"/></td> <td align="center"><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/controlnet_training/red_circle_with_blue_background_300_steps.png" alt="푸른 배경과 빨간 원"/></td></tr> <tr><td></td> <td align="center">갈색 꽃 배경과 청록색 원</td></tr> <tr><td><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/controlnet_training/conditioning_image_2.png" alt="conditioning image"/></td> <td align="center"><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/controlnet_training/cyan_circle_with_brown_floral_background_300_steps.png" alt="갈색 꽃 배경과 청록색 원"/></td></tr></tbody>',gl,at,Tl,st,fe='<thead><tr><th></th> <th align="center"></th></tr></thead> <tbody><tr><td></td> <td align="center">푸른 배경과 빨간 원</td></tr> <tr><td><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/controlnet_training/conditioning_image_1.png" alt="conditioning image"/></td> <td align="center"><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/controlnet_training/red_circle_with_blue_background_6000_steps.png" alt="푸른 배경과 빨간 원"/></td></tr> <tr><td></td> <td align="center">갈색 꽃 배경과 청록색 원</td></tr> <tr><td><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/controlnet_training/conditioning_image_2.png" alt="conditioning image"/></td> <td align="center"><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/controlnet_training/cyan_circle_with_brown_floral_background_6000_steps.png" alt="갈색 꽃 배경과 청록색 원"/></td></tr></tbody>',Jl,it,hl,pt,ye="16GB GPU에서 학습하기 위해 다음의 최적화를 진행하세요:",_l,ot,be='<li>기울기 체크포인트 저장하기</li> <li>bitsandbyte의 <a href="https://github.com/TimDettmers/bitsandbytes#requirements--installation" rel="nofollow">8-bit optimizer</a>가 설치되지 않았다면 링크에 연결된 설명서를 보세요.</li>',Zl,mt,ge="이제 학습 스크립트를 시작할 수 있습니다:",wl,rt,jl,ut,Rl,ct,Te="12GB GPU에서 실행하기 위해 다음의 최적화를 진행하세요:",Cl,Mt,Je='<li>기울기 체크포인트 저장하기</li> <li>bitsandbyte의 8-bit <a href="https://github.com/TimDettmers/bitsandbytes#requirements--installation" rel="nofollow">optimizer</a>(가 설치되지 않았다면 링크에 연결된 설명서를 보세요)</li> <li><a href="https://huggingface.co/docs/diffusers/training/optimization/xformers" rel="nofollow">xFormers</a>(가 설치되지 않았다면 링크에 연결된 설명서를 보세요)</li> <li>기울기를 <code>None</code>으로 설정</li>',Wl,Ut,vl,dt,he="<code>pip install xformers</code>으로 <code>xformers</code>을 확실히 설치하고 <code>enable_xformers_memory_efficient_attention</code>을 사용하세요.",Gl,ft,$l,yt,_e=`우리는 ControlNet을 지원하기 위한 DeepSpeed를 철저하게 테스트하지 않았습니다. 환경설정이 메모리를 저장할 때,
그 환경이 성공적으로 학습했는지를 확정하지 않았습니다. 성공한 학습 실행을 위해 설정을 변경해야 할 가능성이 높습니다.`,Vl,bt,Ze="8GB GPU에서 실행하기 위해 다음의 최적화를 진행하세요:",Il,gt,we='<li>기울기 체크포인트 저장하기</li> <li>bitsandbyte의 8-bit <a href="https://github.com/TimDettmers/bitsandbytes#requirements--installation" rel="nofollow">optimizer</a>(가 설치되지 않았다면 링크에 연결된 설명서를 보세요)</li> <li><a href="https://huggingface.co/docs/diffusers/training/optimization/xformers" rel="nofollow">xFormers</a>(가 설치되지 않았다면 링크에 연결된 설명서를 보세요)</li> <li>기울기를 <code>None</code>으로 설정</li> <li>DeepSpeed stage 2 변수와 optimizer 없에기</li> <li>fp16 혼합 정밀도(precision)</li>',xl,Tt,je=`<a href="https://www.deepspeed.ai/" rel="nofollow">DeepSpeed</a>는 CPU 또는 NVME로 텐서를 VRAM에서 오프로드할 수 있습니다.
이를 위해서 훨씬 더 많은 RAM(약 25 GB)가 필요합니다.`,El,Jt,Re="DeepSpeed stage 2를 활성화하기 위해서 <code>accelerate config</code>로 환경을 구성해야합니다.",Ql,ht,Ce="구성(configuration) 파일은 이런 모습이어야 합니다:",Bl,_t,Nl,Zt,We="<팁>",Xl,wt,ve='<a href="https://huggingface.co/docs/accelerate/usage_guides/deepspeed" rel="nofollow">문서</a>를 더 많은 DeepSpeed 설정 옵션을 위해 보세요.',Fl,jt,Ge="<팁>",Yl,Rt,$e=`기본 Adam optimizer를 DeepSpeed’의 Adam
<code>deepspeed.ops.adam.DeepSpeedCPUAdam</code> 으로 바꾸면 상당한 속도 향상을 이룰수 있지만,
Pytorch와 같은 버전의 CUDA toolchain이 필요합니다. 8-비트 optimizer는 현재 DeepSpeed와
호환되지 않는 것 같습니다.`,Sl,Ct,Ll,Wt,kl,vt,Ve=`학습된 모델은 <code>StableDiffusionControlNetPipeline</code>과 함께 실행될 수 있습니다.
<code>base_model_path</code>와 <code>controlnet_path</code> 에 값을 지정하세요 <code>--pretrained_model_name_or_path</code> 와
<code>--output_dir</code> 는 학습 스크립트에 개별적으로 지정됩니다.`,Hl,Gt,zl,$t,Dl,It,Al;return J=new y({props:{title:"ControlNet",local:"controlnet",headingTag:"h1"}}),Z=new y({props:{title:"의존성 설치하기",local:"의존성-설치하기",headingTag:"h2"}}),g=new Le({props:{warning:!0,$$slots:{default:[He]},$$scope:{ctx:xt}}}),R=new f({props:{code:"Z2l0JTIwY2xvbmUlMjBodHRwcyUzQSUyRiUyRmdpdGh1Yi5jb20lMkZodWdnaW5nZmFjZSUyRmRpZmZ1c2VycyUwQWNkJTIwZGlmZnVzZXJzJTBBcGlwJTIwaW5zdGFsbCUyMC1lJTIwLg==",highlighted:`git <span class="hljs-built_in">clone</span> https://github.com/huggingface/diffusers
<span class="hljs-built_in">cd</span> diffusers
pip install -e .`,wrap:!1}}),W=new f({props:{code:"Y2QlMjBleGFtcGxlcyUyRmNvbnRyb2xuZXQ=",highlighted:'<span class="hljs-built_in">cd</span> examples/controlnet',wrap:!1}}),G=new f({props:{code:"cGlwJTIwaW5zdGFsbCUyMC1yJTIwcmVxdWlyZW1lbnRzLnR4dA==",highlighted:"pip install -r requirements.txt",wrap:!1}}),V=new f({props:{code:"YWNjZWxlcmF0ZSUyMGNvbmZpZw==",highlighted:"accelerate config",wrap:!1}}),x=new f({props:{code:"YWNjZWxlcmF0ZSUyMGNvbmZpZyUyMGRlZmF1bHQ=",highlighted:"accelerate config default",wrap:!1}}),Q=new f({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}}),B=new y({props:{title:"원을 채우는 데이터셋",local:"원을-채우는-데이터셋",headingTag:"h2"}}),Y=new y({props:{title:"학습",local:"학습",headingTag:"h2"}}),L=new f({props:{code:"d2dldCUyMGh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmh1Z2dpbmdmYWNlJTJGZG9jdW1lbnRhdGlvbi1pbWFnZXMlMkZyZXNvbHZlJTJGbWFpbiUyRmRpZmZ1c2VycyUyRmNvbnRyb2xuZXRfdHJhaW5pbmclMkZjb25kaXRpb25pbmdfaW1hZ2VfMS5wbmclMEElMEF3Z2V0JTIwaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmRhdGFzZXRzJTJGaHVnZ2luZ2ZhY2UlMkZkb2N1bWVudGF0aW9uLWltYWdlcyUyRnJlc29sdmUlMkZtYWluJTJGZGlmZnVzZXJzJTJGY29udHJvbG5ldF90cmFpbmluZyUyRmNvbmRpdGlvbmluZ19pbWFnZV8yLnBuZw==",highlighted:`wget https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/controlnet_training/conditioning_image_1.png

wget https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/controlnet_training/conditioning_image_2.png`,wrap:!1}}),z=new f({props:{code:"ZXhwb3J0JTIwTU9ERUxfRElSJTNEJTIycnVud2F5bWwlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIlMEFleHBvcnQlMjBPVVRQVVRfRElSJTNEJTIycGF0aCUyMHRvJTIwc2F2ZSUyMG1vZGVsJTIyJTBBJTBBYWNjZWxlcmF0ZSUyMGxhdW5jaCUyMHRyYWluX2NvbnRyb2xuZXQucHklMjAlNUMlMEElMjAtLXByZXRyYWluZWRfbW9kZWxfbmFtZV9vcl9wYXRoJTNEJTI0TU9ERUxfRElSJTIwJTVDJTBBJTIwLS1vdXRwdXRfZGlyJTNEJTI0T1VUUFVUX0RJUiUyMCU1QyUwQSUyMC0tZGF0YXNldF9uYW1lJTNEZnVzaW5nJTJGZmlsbDUwayUyMCU1QyUwQSUyMC0tcmVzb2x1dGlvbiUzRDUxMiUyMCU1QyUwQSUyMC0tbGVhcm5pbmdfcmF0ZSUzRDFlLTUlMjAlNUMlMEElMjAtLXZhbGlkYXRpb25faW1hZ2UlMjAlMjIuJTJGY29uZGl0aW9uaW5nX2ltYWdlXzEucG5nJTIyJTIwJTIyLiUyRmNvbmRpdGlvbmluZ19pbWFnZV8yLnBuZyUyMiUyMCU1QyUwQSUyMC0tdmFsaWRhdGlvbl9wcm9tcHQlMjAlMjJyZWQlMjBjaXJjbGUlMjB3aXRoJTIwYmx1ZSUyMGJhY2tncm91bmQlMjIlMjAlMjJjeWFuJTIwY2lyY2xlJTIwd2l0aCUyMGJyb3duJTIwZmxvcmFsJTIwYmFja2dyb3VuZCUyMiUyMCU1QyUwQSUyMC0tdHJhaW5fYmF0Y2hfc2l6ZSUzRDQlMjAlNUMlMEElMjAtLXB1c2hfdG9faHVi",highlighted:`<span class="hljs-built_in">export</span> MODEL_DIR=<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
<span class="hljs-built_in">export</span> OUTPUT_DIR=<span class="hljs-string">&quot;path to save model&quot;</span>

accelerate launch train_controlnet.py \\
 --pretrained_model_name_or_path=<span class="hljs-variable">$MODEL_DIR</span> \\
 --output_dir=<span class="hljs-variable">$OUTPUT_DIR</span> \\
 --dataset_name=fusing/fill50k \\
 --resolution=512 \\
 --learning_rate=1e-5 \\
 --validation_image <span class="hljs-string">&quot;./conditioning_image_1.png&quot;</span> <span class="hljs-string">&quot;./conditioning_image_2.png&quot;</span> \\
 --validation_prompt <span class="hljs-string">&quot;red circle with blue background&quot;</span> <span class="hljs-string">&quot;cyan circle with brown floral background&quot;</span> \\
 --train_batch_size=4 \\
 --push_to_hub`,wrap:!1}}),P=new f({props:{code:"ZXhwb3J0JTIwTU9ERUxfRElSJTNEJTIycnVud2F5bWwlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIlMEFleHBvcnQlMjBPVVRQVVRfRElSJTNEJTIycGF0aCUyMHRvJTIwc2F2ZSUyMG1vZGVsJTIyJTBBJTBBYWNjZWxlcmF0ZSUyMGxhdW5jaCUyMHRyYWluX2NvbnRyb2xuZXQucHklMjAlNUMlMEElMjAtLXByZXRyYWluZWRfbW9kZWxfbmFtZV9vcl9wYXRoJTNEJTI0TU9ERUxfRElSJTIwJTVDJTBBJTIwLS1vdXRwdXRfZGlyJTNEJTI0T1VUUFVUX0RJUiUyMCU1QyUwQSUyMC0tZGF0YXNldF9uYW1lJTNEZnVzaW5nJTJGZmlsbDUwayUyMCU1QyUwQSUyMC0tcmVzb2x1dGlvbiUzRDUxMiUyMCU1QyUwQSUyMC0tbGVhcm5pbmdfcmF0ZSUzRDFlLTUlMjAlNUMlMEElMjAtLXZhbGlkYXRpb25faW1hZ2UlMjAlMjIuJTJGY29uZGl0aW9uaW5nX2ltYWdlXzEucG5nJTIyJTIwJTIyLiUyRmNvbmRpdGlvbmluZ19pbWFnZV8yLnBuZyUyMiUyMCU1QyUwQSUyMC0tdmFsaWRhdGlvbl9wcm9tcHQlMjAlMjJyZWQlMjBjaXJjbGUlMjB3aXRoJTIwYmx1ZSUyMGJhY2tncm91bmQlMjIlMjAlMjJjeWFuJTIwY2lyY2xlJTIwd2l0aCUyMGJyb3duJTIwZmxvcmFsJTIwYmFja2dyb3VuZCUyMiUyMCU1QyUwQSUyMC0tdHJhaW5fYmF0Y2hfc2l6ZSUzRDElMjAlNUMlMEElMjAtLWdyYWRpZW50X2FjY3VtdWxhdGlvbl9zdGVwcyUzRDQlMjAlNUMlMEElMjAlMjAtLXB1c2hfdG9faHVi",highlighted:`<span class="hljs-built_in">export</span> MODEL_DIR=<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
<span class="hljs-built_in">export</span> OUTPUT_DIR=<span class="hljs-string">&quot;path to save model&quot;</span>

accelerate launch train_controlnet.py \\
 --pretrained_model_name_or_path=<span class="hljs-variable">$MODEL_DIR</span> \\
 --output_dir=<span class="hljs-variable">$OUTPUT_DIR</span> \\
 --dataset_name=fusing/fill50k \\
 --resolution=512 \\
 --learning_rate=1e-5 \\
 --validation_image <span class="hljs-string">&quot;./conditioning_image_1.png&quot;</span> <span class="hljs-string">&quot;./conditioning_image_2.png&quot;</span> \\
 --validation_prompt <span class="hljs-string">&quot;red circle with blue background&quot;</span> <span class="hljs-string">&quot;cyan circle with brown floral background&quot;</span> \\
 --train_batch_size=1 \\
 --gradient_accumulation_steps=4 \\
  --push_to_hub`,wrap:!1}}),O=new y({props:{title:"여러개 GPU로 학습하기",local:"여러개-gpu로-학습하기",headingTag:"h2"}}),tt=new f({props:{code:"ZXhwb3J0JTIwTU9ERUxfRElSJTNEJTIycnVud2F5bWwlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIlMEFleHBvcnQlMjBPVVRQVVRfRElSJTNEJTIycGF0aCUyMHRvJTIwc2F2ZSUyMG1vZGVsJTIyJTBBJTBBYWNjZWxlcmF0ZSUyMGxhdW5jaCUyMC0tbWl4ZWRfcHJlY2lzaW9uJTNEJTIyZnAxNiUyMiUyMC0tbXVsdGlfZ3B1JTIwdHJhaW5fY29udHJvbG5ldC5weSUyMCU1QyUwQSUyMC0tcHJldHJhaW5lZF9tb2RlbF9uYW1lX29yX3BhdGglM0QlMjRNT0RFTF9ESVIlMjAlNUMlMEElMjAtLW91dHB1dF9kaXIlM0QlMjRPVVRQVVRfRElSJTIwJTVDJTBBJTIwLS1kYXRhc2V0X25hbWUlM0RmdXNpbmclMkZmaWxsNTBrJTIwJTVDJTBBJTIwLS1yZXNvbHV0aW9uJTNENTEyJTIwJTVDJTBBJTIwLS1sZWFybmluZ19yYXRlJTNEMWUtNSUyMCU1QyUwQSUyMC0tdmFsaWRhdGlvbl9pbWFnZSUyMCUyMi4lMkZjb25kaXRpb25pbmdfaW1hZ2VfMS5wbmclMjIlMjAlMjIuJTJGY29uZGl0aW9uaW5nX2ltYWdlXzIucG5nJTIyJTIwJTVDJTBBJTIwLS12YWxpZGF0aW9uX3Byb21wdCUyMCUyMnJlZCUyMGNpcmNsZSUyMHdpdGglMjBibHVlJTIwYmFja2dyb3VuZCUyMiUyMCUyMmN5YW4lMjBjaXJjbGUlMjB3aXRoJTIwYnJvd24lMjBmbG9yYWwlMjBiYWNrZ3JvdW5kJTIyJTIwJTVDJTBBJTIwLS10cmFpbl9iYXRjaF9zaXplJTNENCUyMCU1QyUwQSUyMC0tbWl4ZWRfcHJlY2lzaW9uJTNEJTIyZnAxNiUyMiUyMCU1QyUwQSUyMC0tdHJhY2tlcl9wcm9qZWN0X25hbWUlM0QlMjJjb250cm9sbmV0LWRlbW8lMjIlMjAlNUMlMEElMjAtLXJlcG9ydF90byUzRHdhbmRiJTIwJTVDJTBBJTIwJTIwLS1wdXNoX3RvX2h1Yg==",highlighted:`<span class="hljs-built_in">export</span> MODEL_DIR=<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
<span class="hljs-built_in">export</span> OUTPUT_DIR=<span class="hljs-string">&quot;path to save model&quot;</span>

accelerate launch --mixed_precision=<span class="hljs-string">&quot;fp16&quot;</span> --multi_gpu train_controlnet.py \\
 --pretrained_model_name_or_path=<span class="hljs-variable">$MODEL_DIR</span> \\
 --output_dir=<span class="hljs-variable">$OUTPUT_DIR</span> \\
 --dataset_name=fusing/fill50k \\
 --resolution=512 \\
 --learning_rate=1e-5 \\
 --validation_image <span class="hljs-string">&quot;./conditioning_image_1.png&quot;</span> <span class="hljs-string">&quot;./conditioning_image_2.png&quot;</span> \\
 --validation_prompt <span class="hljs-string">&quot;red circle with blue background&quot;</span> <span class="hljs-string">&quot;cyan circle with brown floral background&quot;</span> \\
 --train_batch_size=4 \\
 --mixed_precision=<span class="hljs-string">&quot;fp16&quot;</span> \\
 --tracker_project_name=<span class="hljs-string">&quot;controlnet-demo&quot;</span> \\
 --report_to=wandb \\
  --push_to_hub`,wrap:!1}}),lt=new y({props:{title:"예시 결과",local:"예시-결과",headingTag:"h2"}}),et=new y({props:{title:"배치 사이즈 8로 300 스텝 이후:",local:"배치-사이즈-8로-300-스텝-이후",headingTag:"h4"}}),at=new y({props:{title:"배치 사이즈 8로 6000 스텝 이후:",local:"배치-사이즈-8로-6000-스텝-이후",headingTag:"h4"}}),it=new y({props:{title:"16GB GPU에서 학습하기",local:"16gb-gpu에서-학습하기",headingTag:"h2"}}),rt=new f({props:{code:"ZXhwb3J0JTIwTU9ERUxfRElSJTNEJTIycnVud2F5bWwlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIlMEFleHBvcnQlMjBPVVRQVVRfRElSJTNEJTIycGF0aCUyMHRvJTIwc2F2ZSUyMG1vZGVsJTIyJTBBJTBBYWNjZWxlcmF0ZSUyMGxhdW5jaCUyMHRyYWluX2NvbnRyb2xuZXQucHklMjAlNUMlMEElMjAtLXByZXRyYWluZWRfbW9kZWxfbmFtZV9vcl9wYXRoJTNEJTI0TU9ERUxfRElSJTIwJTVDJTBBJTIwLS1vdXRwdXRfZGlyJTNEJTI0T1VUUFVUX0RJUiUyMCU1QyUwQSUyMC0tZGF0YXNldF9uYW1lJTNEZnVzaW5nJTJGZmlsbDUwayUyMCU1QyUwQSUyMC0tcmVzb2x1dGlvbiUzRDUxMiUyMCU1QyUwQSUyMC0tbGVhcm5pbmdfcmF0ZSUzRDFlLTUlMjAlNUMlMEElMjAtLXZhbGlkYXRpb25faW1hZ2UlMjAlMjIuJTJGY29uZGl0aW9uaW5nX2ltYWdlXzEucG5nJTIyJTIwJTIyLiUyRmNvbmRpdGlvbmluZ19pbWFnZV8yLnBuZyUyMiUyMCU1QyUwQSUyMC0tdmFsaWRhdGlvbl9wcm9tcHQlMjAlMjJyZWQlMjBjaXJjbGUlMjB3aXRoJTIwYmx1ZSUyMGJhY2tncm91bmQlMjIlMjAlMjJjeWFuJTIwY2lyY2xlJTIwd2l0aCUyMGJyb3duJTIwZmxvcmFsJTIwYmFja2dyb3VuZCUyMiUyMCU1QyUwQSUyMC0tdHJhaW5fYmF0Y2hfc2l6ZSUzRDElMjAlNUMlMEElMjAtLWdyYWRpZW50X2FjY3VtdWxhdGlvbl9zdGVwcyUzRDQlMjAlNUMlMEElMjAtLWdyYWRpZW50X2NoZWNrcG9pbnRpbmclMjAlNUMlMEElMjAtLXVzZV84Yml0X2FkYW0lMjAlNUMlMEElMjAlMjAtLXB1c2hfdG9faHVi",highlighted:`<span class="hljs-built_in">export</span> MODEL_DIR=<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
<span class="hljs-built_in">export</span> OUTPUT_DIR=<span class="hljs-string">&quot;path to save model&quot;</span>

accelerate launch train_controlnet.py \\
 --pretrained_model_name_or_path=<span class="hljs-variable">$MODEL_DIR</span> \\
 --output_dir=<span class="hljs-variable">$OUTPUT_DIR</span> \\
 --dataset_name=fusing/fill50k \\
 --resolution=512 \\
 --learning_rate=1e-5 \\
 --validation_image <span class="hljs-string">&quot;./conditioning_image_1.png&quot;</span> <span class="hljs-string">&quot;./conditioning_image_2.png&quot;</span> \\
 --validation_prompt <span class="hljs-string">&quot;red circle with blue background&quot;</span> <span class="hljs-string">&quot;cyan circle with brown floral background&quot;</span> \\
 --train_batch_size=1 \\
 --gradient_accumulation_steps=4 \\
 --gradient_checkpointing \\
 --use_8bit_adam \\
  --push_to_hub`,wrap:!1}}),ut=new y({props:{title:"12GB GPU에서 학습하기",local:"12gb-gpu에서-학습하기",headingTag:"h2"}}),Ut=new f({props:{code:"ZXhwb3J0JTIwTU9ERUxfRElSJTNEJTIycnVud2F5bWwlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIlMEFleHBvcnQlMjBPVVRQVVRfRElSJTNEJTIycGF0aCUyMHRvJTIwc2F2ZSUyMG1vZGVsJTIyJTBBJTBBYWNjZWxlcmF0ZSUyMGxhdW5jaCUyMHRyYWluX2NvbnRyb2xuZXQucHklMjAlNUMlMEElMjAtLXByZXRyYWluZWRfbW9kZWxfbmFtZV9vcl9wYXRoJTNEJTI0TU9ERUxfRElSJTIwJTVDJTBBJTIwLS1vdXRwdXRfZGlyJTNEJTI0T1VUUFVUX0RJUiUyMCU1QyUwQSUyMC0tZGF0YXNldF9uYW1lJTNEZnVzaW5nJTJGZmlsbDUwayUyMCU1QyUwQSUyMC0tcmVzb2x1dGlvbiUzRDUxMiUyMCU1QyUwQSUyMC0tbGVhcm5pbmdfcmF0ZSUzRDFlLTUlMjAlNUMlMEElMjAtLXZhbGlkYXRpb25faW1hZ2UlMjAlMjIuJTJGY29uZGl0aW9uaW5nX2ltYWdlXzEucG5nJTIyJTIwJTIyLiUyRmNvbmRpdGlvbmluZ19pbWFnZV8yLnBuZyUyMiUyMCU1QyUwQSUyMC0tdmFsaWRhdGlvbl9wcm9tcHQlMjAlMjJyZWQlMjBjaXJjbGUlMjB3aXRoJTIwYmx1ZSUyMGJhY2tncm91bmQlMjIlMjAlMjJjeWFuJTIwY2lyY2xlJTIwd2l0aCUyMGJyb3duJTIwZmxvcmFsJTIwYmFja2dyb3VuZCUyMiUyMCU1QyUwQSUyMC0tdHJhaW5fYmF0Y2hfc2l6ZSUzRDElMjAlNUMlMEElMjAtLWdyYWRpZW50X2FjY3VtdWxhdGlvbl9zdGVwcyUzRDQlMjAlNUMlMEElMjAtLWdyYWRpZW50X2NoZWNrcG9pbnRpbmclMjAlNUMlMEElMjAtLXVzZV84Yml0X2FkYW0lMjAlNUMlMEElMjAtLWVuYWJsZV94Zm9ybWVyc19tZW1vcnlfZWZmaWNpZW50X2F0dGVudGlvbiUyMCU1QyUwQSUyMC0tc2V0X2dyYWRzX3RvX25vbmUlMjAlNUMlMEElMjAlMjAtLXB1c2hfdG9faHVi",highlighted:`<span class="hljs-built_in">export</span> MODEL_DIR=<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
<span class="hljs-built_in">export</span> OUTPUT_DIR=<span class="hljs-string">&quot;path to save model&quot;</span>

accelerate launch train_controlnet.py \\
 --pretrained_model_name_or_path=<span class="hljs-variable">$MODEL_DIR</span> \\
 --output_dir=<span class="hljs-variable">$OUTPUT_DIR</span> \\
 --dataset_name=fusing/fill50k \\
 --resolution=512 \\
 --learning_rate=1e-5 \\
 --validation_image <span class="hljs-string">&quot;./conditioning_image_1.png&quot;</span> <span class="hljs-string">&quot;./conditioning_image_2.png&quot;</span> \\
 --validation_prompt <span class="hljs-string">&quot;red circle with blue background&quot;</span> <span class="hljs-string">&quot;cyan circle with brown floral background&quot;</span> \\
 --train_batch_size=1 \\
 --gradient_accumulation_steps=4 \\
 --gradient_checkpointing \\
 --use_8bit_adam \\
 --enable_xformers_memory_efficient_attention \\
 --set_grads_to_none \\
  --push_to_hub`,wrap:!1}}),ft=new y({props:{title:"8GB GPU에서 학습하기",local:"8gb-gpu에서-학습하기",headingTag:"h2"}}),_t=new f({props:{code:"Y29tcHV0ZV9lbnZpcm9ubWVudCUzQSUyMExPQ0FMX01BQ0hJTkUlMEFkZWVwc3BlZWRfY29uZmlnJTNBJTBBJTIwJTIwZ3JhZGllbnRfYWNjdW11bGF0aW9uX3N0ZXBzJTNBJTIwNCUwQSUyMCUyMG9mZmxvYWRfb3B0aW1pemVyX2RldmljZSUzQSUyMGNwdSUwQSUyMCUyMG9mZmxvYWRfcGFyYW1fZGV2aWNlJTNBJTIwY3B1JTBBJTIwJTIwemVybzNfaW5pdF9mbGFnJTNBJTIwZmFsc2UlMEElMjAlMjB6ZXJvX3N0YWdlJTNBJTIwMiUwQWRpc3RyaWJ1dGVkX3R5cGUlM0ElMjBERUVQU1BFRUQ=",highlighted:`<span class="hljs-attr">compute_environment:</span> <span class="hljs-string">LOCAL_MACHINE</span>
<span class="hljs-attr">deepspeed_config:</span>
  <span class="hljs-attr">gradient_accumulation_steps:</span> <span class="hljs-number">4</span>
  <span class="hljs-attr">offload_optimizer_device:</span> <span class="hljs-string">cpu</span>
  <span class="hljs-attr">offload_param_device:</span> <span class="hljs-string">cpu</span>
  <span class="hljs-attr">zero3_init_flag:</span> <span class="hljs-literal">false</span>
  <span class="hljs-attr">zero_stage:</span> <span class="hljs-number">2</span>
<span class="hljs-attr">distributed_type:</span> <span class="hljs-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XRfZ3JhZHNfdG9fbm9uZSUyMCU1QyUwQSUyMC0tbWl4ZWRfcHJlY2lzaW9uJTIwZnAxNiUyMCU1QyUwQSUyMC0tcHVzaF90b19odWI=",highlighted:`<span class="hljs-built_in">export</span> MODEL_DIR=<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
<span class="hljs-built_in">export</span> OUTPUT_DIR=<span class="hljs-string">&quot;path to save model&quot;</span>

accelerate launch train_controlnet.py \\
 --pretrained_model_name_or_path=<span class="hljs-variable">$MODEL_DIR</span> \\
 --output_dir=<span class="hljs-variable">$OUTPUT_DIR</span> \\
 --dataset_name=fusing/fill50k \\
 --resolution=512 \\
 --validation_image <span class="hljs-string">&quot;./conditioning_image_1.png&quot;</span> <span class="hljs-string">&quot;./conditioning_image_2.png&quot;</span> \\
 --validation_prompt <span class="hljs-string">&quot;red circle with blue background&quot;</span> <span class="hljs-string">&quot;cyan circle with brown floral background&quot;</span> \\
 --train_batch_size=1 \\
 --gradient_accumulation_steps=4 \\
 --gradient_checkpointing \\
 --enable_xformers_memory_efficient_attention \\
 --set_grads_to_none \\
 --mixed_precision fp16 \\
 --push_to_hub`,wrap:!1}}),Wt=new y({props:{title:"추론",local:"추론",headingTag:"h2"}}),Gt=new f({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvbkNvbnRyb2xOZXRQaXBlbGluZSUyQyUyMENvbnRyb2xOZXRNb2RlbCUyQyUyMFVuaVBDTXVsdGlzdGVwU2NoZWR1bGVyJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQWJhc2VfbW9kZWxfcGF0aCUyMCUzRCUyMCUyMnBhdGglMjB0byUyMG1vZGVsJTIyJTBBY29udHJvbG5ldF9wYXRoJTIwJTNEJTIwJTIycGF0aCUyMHRvJTIwY29udHJvbG5ldCUyMiU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b3JtZXJzX21lbW9yeV9lZmZpY2llbnRfYXR0ZW50aW9uKCklMEElMEFwaXBlLmVuYWJsZV9tb2RlbF9jcHVfb2ZmbG9hZCgpJTBBJTBBY29udHJvbF9pbWFnZSUyMCUzRCUyMGxvYWRfaW1hZ2UoJTIyLiUyRmNvbmRpdGlvbmluZ19pbWFnZV8xLnBuZyUyMiklMEFwcm9tcHQlMjAlM0QlMjAlMjJwYWxlJTIwZ29sZGVuJTIwcm9kJTIwY2lyY2xlJTIwd2l0aCUyMG9sZCUyMGxhY2UlMjBiYWNrZ3JvdW5kJTIyJTBBJTBBJTIzJTIwJUVDJTlEJUI0JUVCJUFGJUI4JUVDJUE3JTgwJTIwJUVDJTgzJTlEJUVDJTg0JUIxJUVEJTk1JTk4JUVBJUI4JUIwJTBBZ2VuZXJhdG9yJTIwJTNEJTIwdG9yY2gubWFudWFsX3NlZWQoMCklMEFpbWFnZSUyMCUzRCUyMHBpcGUocHJvbXB0JTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDIwJTJDJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTJDJTIwaW1hZ2UlM0Rjb250cm9sX2ltYWdlKS5pbWFnZXMlNUIwJTVEJTBBJTBBaW1hZ2Uuc2F2ZSglMjIuJTJGb3V0cHV0LnBuZyUyMik=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionControlNetPipeline, ControlNetModel, UniPCMultistepScheduler
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-keyword">import</span> torch

base_model_path = <span class="hljs-string">&quot;path to model&quot;</span>
controlnet_path = <span class="hljs-string">&quot;path to controlnet&quot;</span>

controlnet = ControlNetModel.from_pretrained(controlnet_path, torch_dtype=torch.float16)
pipe = StableDiffusionControlNetPipeline.from_pretrained(
    base_model_path, controlnet=controlnet, torch_dtype=torch.float16
)

<span class="hljs-comment"># 더 빠른 스케줄러와 메모리 최적화로 diffusion 프로세스 속도 올리기</span>
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
<span class="hljs-comment"># xformers가 설치되지 않으면 아래 줄을 삭제하기</span>
pipe.enable_xformers_memory_efficient_attention()

pipe.enable_model_cpu_offload()

control_image = load_image(<span class="hljs-string">&quot;./conditioning_image_1.png&quot;</span>)
prompt = <span class="hljs-string">&quot;pale golden rod circle with old lace background&quot;</span>

<span class="hljs-comment"># 이미지 생성하기</span>
generator = torch.manual_seed(<span class="hljs-number">0</span>)
image = pipe(prompt, num_inference_steps=<span class="hljs-number">20</span>, generator=generator, image=control_image).images[<span class="hljs-number">0</span>]

image.save(<span class="hljs-string">&quot;./output.png&quot;</span>)`,wrap:!1}}),$t=new ke({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/ko/training/controlnet.md"}}),{c(){d=i("meta"),T=a(),b=i("p"),Vt=a(),m(J.$$.fragment),Et=a(),h=i("p"),h.innerHTML=ql,Qt=a(),_=i("p"),_.innerHTML=Pl,Bt=a(),m(Z.$$.fragment),Nt=a(),w=i("p"),w.textContent=Ol,Xt=a(),m(g.$$.fragment),Ft=a(),j=i("p"),j.textContent=Kl,Yt=a(),m(R.$$.fragment),St=a(),C=i("p"),C.innerHTML=te,Lt=a(),m(W.$$.fragment),kt=a(),v=i("p"),v.textContent=le,Ht=a(),m(G.$$.fragment),zt=a(),$=i("p"),$.innerHTML=ee,Dt=a(),m(V.$$.fragment),At=a(),I=i("p"),I.textContent=ne,qt=a(),m(x.$$.fragment),Pt=a(),E=i("p"),E.textContent=ae,Ot=a(),m(Q.$$.fragment),Kt=a(),m(B.$$.fragment),tl=a(),N=i("p"),N.innerHTML=se,ll=a(),X=i("p"),X.innerHTML=ie,el=a(),F=i("p"),F.innerHTML=pe,nl=a(),m(Y.$$.fragment),al=a(),S=i("p"),S.textContent=oe,sl=a(),m(L.$$.fragment),il=a(),k=i("p"),k.innerHTML=me,pl=a(),H=i("p"),H.innerHTML=re,ol=a(),m(z.$$.fragment),ml=a(),D=i("p"),D.textContent=ue,rl=a(),A=i("p"),A.innerHTML=ce,ul=a(),q=i("p"),q.textContent=Me,cl=a(),m(P.$$.fragment),Ml=a(),m(O.$$.fragment),Ul=a(),K=i("p"),K.innerHTML=Ue,dl=a(),m(tt.$$.fragment),fl=a(),m(lt.$$.fragment),yl=a(),m(et.$$.fragment),bl=a(),nt=i("table"),nt.innerHTML=de,gl=a(),m(at.$$.fragment),Tl=a(),st=i("table"),st.innerHTML=fe,Jl=a(),m(it.$$.fragment),hl=a(),pt=i("p"),pt.textContent=ye,_l=a(),ot=i("ul"),ot.innerHTML=be,Zl=a(),mt=i("p"),mt.textContent=ge,wl=a(),m(rt.$$.fragment),jl=a(),m(ut.$$.fragment),Rl=a(),ct=i("p"),ct.textContent=Te,Cl=a(),Mt=i("ul"),Mt.innerHTML=Je,Wl=a(),m(Ut.$$.fragment),vl=a(),dt=i("p"),dt.innerHTML=he,Gl=a(),m(ft.$$.fragment),$l=a(),yt=i("p"),yt.textContent=_e,Vl=a(),bt=i("p"),bt.textContent=Ze,Il=a(),gt=i("ul"),gt.innerHTML=we,xl=a(),Tt=i("p"),Tt.innerHTML=je,El=a(),Jt=i("p"),Jt.innerHTML=Re,Ql=a(),ht=i("p"),ht.textContent=Ce,Bl=a(),m(_t.$$.fragment),Nl=a(),Zt=i("p"),Zt.textContent=We,Xl=a(),wt=i("p"),wt.innerHTML=ve,Fl=a(),jt=i("p"),jt.textContent=Ge,Yl=a(),Rt=i("p"),Rt.innerHTML=$e,Sl=a(),m(Ct.$$.fragment),Ll=a(),m(Wt.$$.fragment),kl=a(),vt=i("p"),vt.innerHTML=Ve,Hl=a(),m(Gt.$$.fragment),zl=a(),m($t.$$.fragment),Dl=a(),It=i("p"),this.h()},l(t){const l=Ye("svelte-u9bgzb",document.head);d=p(l,"META",{name:!0,content:!0}),l.forEach(e),T=s(t),b=p(t,"P",{}),xe(b).forEach(e),Vt=s(t),r(J.$$.fragment,t),Et=s(t),h=p(t,"P",{"data-svelte-h":!0}),o(h)!=="svelte-9fufis"&&(h.innerHTML=ql),Qt=s(t),_=p(t,"P",{"data-svelte-h":!0}),o(_)!=="svelte-srp9tb"&&(_.innerHTML=Pl),Bt=s(t),r(Z.$$.fragment,t),Nt=s(t),w=p(t,"P",{"data-svelte-h":!0}),o(w)!=="svelte-audt4e"&&(w.textContent=Ol),Xt=s(t),r(g.$$.fragment,t),Ft=s(t),j=p(t,"P",{"data-svelte-h":!0}),o(j)!=="svelte-enix0a"&&(j.textContent=Kl),Yt=s(t),r(R.$$.fragment,t),St=s(t),C=p(t,"P",{"data-svelte-h":!0}),o(C)!=="svelte-1k8zlp9"&&(C.innerHTML=te),Lt=s(t),r(W.$$.fragment,t),kt=s(t),v=p(t,"P",{"data-svelte-h":!0}),o(v)!=="svelte-1fgpi95"&&(v.textContent=le),Ht=s(t),r(G.$$.fragment,t),zt=s(t),$=p(t,"P",{"data-svelte-h":!0}),o($)!=="svelte-12bqcqg"&&($.innerHTML=ee),Dt=s(t),r(V.$$.fragment,t),At=s(t),I=p(t,"P",{"data-svelte-h":!0}),o(I)!=="svelte-wd3dp4"&&(I.textContent=ne),qt=s(t),r(x.$$.fragment,t),Pt=s(t),E=p(t,"P",{"data-svelte-h":!0}),o(E)!=="svelte-1gibgaz"&&(E.textContent=ae),Ot=s(t),r(Q.$$.fragment,t),Kt=s(t),r(B.$$.fragment,t),tl=s(t),N=p(t,"P",{"data-svelte-h":!0}),o(N)!=="svelte-u51kgh"&&(N.innerHTML=se),ll=s(t),X=p(t,"P",{"data-svelte-h":!0}),o(X)!=="svelte-1kxzxc6"&&(X.innerHTML=ie),el=s(t),F=p(t,"P",{"data-svelte-h":!0}),o(F)!=="svelte-18vs9m4"&&(F.innerHTML=pe),nl=s(t),r(Y.$$.fragment,t),al=s(t),S=p(t,"P",{"data-svelte-h":!0}),o(S)!=="svelte-64o031"&&(S.textContent=oe),sl=s(t),r(L.$$.fragment,t),il=s(t),k=p(t,"P",{"data-svelte-h":!0}),o(k)!=="svelte-ky63v0"&&(k.innerHTML=me),pl=s(t),H=p(t,"P",{"data-svelte-h":!0}),o(H)!=="svelte-1v3g5fv"&&(H.innerHTML=re),ol=s(t),r(z.$$.fragment,t),ml=s(t),D=p(t,"P",{"data-svelte-h":!0}),o(D)!=="svelte-on7i15"&&(D.textContent=ue),rl=s(t),A=p(t,"P",{"data-svelte-h":!0}),o(A)!=="svelte-j3jf4w"&&(A.innerHTML=ce),ul=s(t),q=p(t,"P",{"data-svelte-h":!0}),o(q)!=="svelte-ibpfse"&&(q.textContent=Me),cl=s(t),r(P.$$.fragment,t),Ml=s(t),r(O.$$.fragment,t),Ul=s(t),K=p(t,"P",{"data-svelte-h":!0}),o(K)!=="svelte-kn2k8f"&&(K.innerHTML=Ue),dl=s(t),r(tt.$$.fragment,t),fl=s(t),r(lt.$$.fragment,t),yl=s(t),r(et.$$.fragment,t),bl=s(t),nt=p(t,"TABLE",{"data-svelte-h":!0}),o(nt)!=="svelte-7n8ul8"&&(nt.innerHTML=de),gl=s(t),r(at.$$.fragment,t),Tl=s(t),st=p(t,"TABLE",{"data-svelte-h":!0}),o(st)!=="svelte-197rfee"&&(st.innerHTML=fe),Jl=s(t),r(it.$$.fragment,t),hl=s(t),pt=p(t,"P",{"data-svelte-h":!0}),o(pt)!=="svelte-1a3ynwi"&&(pt.textContent=ye),_l=s(t),ot=p(t,"UL",{"data-svelte-h":!0}),o(ot)!=="svelte-gud7gs"&&(ot.innerHTML=be),Zl=s(t),mt=p(t,"P",{"data-svelte-h":!0}),o(mt)!=="svelte-fmnd9z"&&(mt.textContent=ge),wl=s(t),r(rt.$$.fragment,t),jl=s(t),r(ut.$$.fragment,t),Rl=s(t),ct=p(t,"P",{"data-svelte-h":!0}),o(ct)!=="svelte-ulemqz"&&(ct.textContent=Te),Cl=s(t),Mt=p(t,"UL",{"data-svelte-h":!0}),o(Mt)!=="svelte-ezl5xe"&&(Mt.innerHTML=Je),Wl=s(t),r(Ut.$$.fragment,t),vl=s(t),dt=p(t,"P",{"data-svelte-h":!0}),o(dt)!=="svelte-m0yrgw"&&(dt.innerHTML=he),Gl=s(t),r(ft.$$.fragment,t),$l=s(t),yt=p(t,"P",{"data-svelte-h":!0}),o(yt)!=="svelte-1bj00p0"&&(yt.textContent=_e),Vl=s(t),bt=p(t,"P",{"data-svelte-h":!0}),o(bt)!=="svelte-sh9kz6"&&(bt.textContent=Ze),Il=s(t),gt=p(t,"UL",{"data-svelte-h":!0}),o(gt)!=="svelte-xjm66k"&&(gt.innerHTML=we),xl=s(t),Tt=p(t,"P",{"data-svelte-h":!0}),o(Tt)!=="svelte-2hnilk"&&(Tt.innerHTML=je),El=s(t),Jt=p(t,"P",{"data-svelte-h":!0}),o(Jt)!=="svelte-b5or85"&&(Jt.innerHTML=Re),Ql=s(t),ht=p(t,"P",{"data-svelte-h":!0}),o(ht)!=="svelte-1y0d6k"&&(ht.textContent=Ce),Bl=s(t),r(_t.$$.fragment,t),Nl=s(t),Zt=p(t,"P",{"data-svelte-h":!0}),o(Zt)!=="svelte-1terwo1"&&(Zt.textContent=We),Xl=s(t),wt=p(t,"P",{"data-svelte-h":!0}),o(wt)!=="svelte-1p0c8l1"&&(wt.innerHTML=ve),Fl=s(t),jt=p(t,"P",{"data-svelte-h":!0}),o(jt)!=="svelte-1terwo1"&&(jt.textContent=Ge),Yl=s(t),Rt=p(t,"P",{"data-svelte-h":!0}),o(Rt)!=="svelte-1en0huo"&&(Rt.innerHTML=$e),Sl=s(t),r(Ct.$$.fragment,t),Ll=s(t),r(Wt.$$.fragment,t),kl=s(t),vt=p(t,"P",{"data-svelte-h":!0}),o(vt)!=="svelte-1erw0pq"&&(vt.innerHTML=Ve),Hl=s(t),r(Gt.$$.fragment,t),zl=s(t),r($t.$$.fragment,t),Dl=s(t),It=p(t,"P",{}),xe(It).forEach(e),this.h()},h(){Ee(d,"name","hf:doc:metadata"),Ee(d,"content",De)},m(t,l){Se(document.head,d),n(t,T,l),n(t,b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l),u(_t,t,l),n(t,Nl,l),n(t,Zt,l),n(t,Xl,l),n(t,wt,l),n(t,Fl,l),n(t,jt,l),n(t,Yl,l),n(t,Rt,l),n(t,Sl,l),u(Ct,t,l),n(t,Ll,l),u(Wt,t,l),n(t,kl,l),n(t,vt,l),n(t,Hl,l),u(Gt,t,l),n(t,zl,l),u($t,t,l),n(t,Dl,l),n(t,It,l),Al=!0},p(t,[l]){const Ie={};l&2&&(Ie.$$scope={dirty:l,ctx:t}),g.$set(Ie)},i(t){Al||(c(J.$$.fragment,t),c(Z.$$.fragment,t),c(g.$$.fragment,t),c(R.$$.fragment,t),c(W.$$.fragment,t),c(G.$$.fragment,t),c(V.$$.fragment,t),c(x.$$.fragment,t),c(Q.$$.fragment,t),c(B.$$.fragment,t),c(Y.$$.fragment,t),c(L.$$.fragment,t),c(z.$$.fragment,t),c(P.$$.fragment,t),c(O.$$.fragment,t),c(tt.$$.fragment,t),c(lt.$$.fragment,t),c(et.$$.fragment,t),c(at.$$.fragment,t),c(it.$$.fragment,t),c(rt.$$.fragment,t),c(ut.$$.fragment,t),c(Ut.$$.fragment,t),c(ft.$$.fragment,t),c(_t.$$.fragment,t),c(Ct.$$.fragment,t),c(Wt.$$.fragment,t),c(Gt.$$.fragment,t),c($t.$$.fragment,t),Al=!0)},o(t){M(J.$$.fragment,t),M(Z.$$.fragment,t),M(g.$$.fragment,t),M(R.$$.fragment,t),M(W.$$.fragment,t),M(G.$$.fragment,t),M(V.$$.fragment,t),M(x.$$.fragment,t),M(Q.$$.fragment,t),M(B.$$.fragment,t),M(Y.$$.fragment,t),M(L.$$.fragment,t),M(z.$$.fragment,t),M(P.$$.fragment,t),M(O.$$.fragment,t),M(tt.$$.fragment,t),M(lt.$$.fragment,t),M(et.$$.fragment,t),M(at.$$.fragment,t),M(it.$$.fragment,t),M(rt.$$.fragment,t),M(ut.$$.fragment,t),M(Ut.$$.fragment,t),M(ft.$$.fragment,t),M(_t.$$.fragment,t),M(Ct.$$.fragment,t),M(Wt.$$.fragment,t),M(Gt.$$.fragment,t),M($t.$$.fragment,t),Al=!1},d(t){t&&(e(T),e(b),e(Vt),e(Et),e(h),e(Qt),e(_),e(Bt),e(Nt),e(w),e(Xt),e(Ft),e(j),e(Yt),e(St),e(C),e(Lt),e(kt),e(v),e(Ht),e(zt),e($),e(Dt),e(At),e(I),e(qt),e(Pt),e(E),e(Ot),e(Kt),e(tl),e(N),e(ll),e(X),e(el),e(F),e(nl),e(al),e(S),e(sl),e(il),e(k),e(pl),e(H),e(ol),e(ml),e(D),e(rl),e(A),e(ul),e(q),e(cl),e(Ml),e(Ul),e(K),e(dl),e(fl),e(yl),e(bl),e(nt),e(gl),e(Tl),e(st),e(Jl),e(hl),e(pt),e(_l),e(ot),e(Zl),e(mt),e(wl),e(jl),e(Rl),e(ct),e(Cl),e(Mt),e(Wl),e(vl),e(dt),e(Gl),e($l),e(yt),e(Vl),e(bt),e(Il),e(gt),e(xl),e(Tt),e(El),e(Jt),e(Ql),e(ht),e(Bl),e(Nl),e(Zt),e(Xl),e(wt),e(Fl),e(jt),e(Yl),e(Rt),e(Sl),e(Ll),e(kl),e(vt),e(Hl),e(zl),e(Dl),e(It)),e(d),U(J,t),U(Z,t),U(g,t),U(R,t),U(W,t),U(G,t),U(V,t),U(x,t),U(Q,t),U(B,t),U(Y,t),U(L,t),U(z,t),U(P,t),U(O,t),U(tt,t),U(lt,t),U(et,t),U(at,t),U(it,t),U(rt,t),U(ut,t),U(Ut,t),U(ft,t),U(_t,t),U(Ct,t),U(Wt,t),U(Gt,t),U($t,t)}}}const De='{"title":"ControlNet","local":"controlnet","sections":[{"title":"의존성 설치하기","local":"의존성-설치하기","sections":[],"depth":2},{"title":"원을 채우는 데이터셋","local":"원을-채우는-데이터셋","sections":[],"depth":2},{"title":"학습","local":"학습","sections":[],"depth":2},{"title":"여러개 GPU로 학습하기","local":"여러개-gpu로-학습하기","sections":[],"depth":2},{"title":"예시 결과","local":"예시-결과","sections":[{"title":"배치 사이즈 8로 300 스텝 이후:","local":"배치-사이즈-8로-300-스텝-이후","sections":[],"depth":4},{"title":"배치 사이즈 8로 6000 스텝 이후:","local":"배치-사이즈-8로-6000-스텝-이후","sections":[],"depth":4}],"depth":2},{"title":"16GB GPU에서 학습하기","local":"16gb-gpu에서-학습하기","sections":[],"depth":2},{"title":"12GB GPU에서 학습하기","local":"12gb-gpu에서-학습하기","sections":[],"depth":2},{"title":"8GB GPU에서 학습하기","local":"8gb-gpu에서-학습하기","sections":[],"depth":2},{"title":"추론","local":"추론","sections":[],"depth":2}],"depth":1}';function Ae(xt){return Be(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ln extends Xe{constructor(d){super(),Fe(this,d,Ae,ze,Qe,{})}}export{ln as component};
