import{s as ve,o as $e,n as Ge}from"../chunks/scheduler.94020406.js";import{S as Ce,i as Ie,g as i,s,r as o,E as Be,h as p,f as e,c as a,j as Re,u as c,x as m,k as Ve,y as We,a as n,v as M,d as r,t as u,w as d}from"../chunks/index.a08c8d92.js";import{T as Xe}from"../chunks/Tip.7c41dfd5.js";import{C as b}from"../chunks/CodeBlock.f1fae7de.js";import{H as J,E as Ee}from"../chunks/getInferenceSnippets.a623b4cf.js";function xe(Ct){let U,T="가장 최신 버전의 예시 스크립트를 성공적으로 실행하기 위해서는, 소스에서 설치하고 최신 버전의 설치를 유지하는 것을 강력하게 추천합니다. 우리는 예시 스크립트들을 자주 업데이트하고 예시에 맞춘 특정한 요구사항을 설치합니다.";return{c(){U=i("p"),U.textContent=T},l(f){U=p(f,"P",{"data-svelte-h":!0}),m(U)!=="svelte-89o4gq"&&(U.textContent=T)},m(f,$t){n(f,U,$t)},p:Ge,d(f){f&&e(U)}}}function Ne(Ct){let U,T,f,$t,h,It,y,kl='<a href="https://huggingface.co/papers/2302.05543" rel="nofollow">Adding Conditional Control to Text-to-Image Diffusion Models</a> (ControlNet)은 Lvmin Zhang과 Maneesh Agrawala에 의해 쓰여졌습니다.',Bt,_,Sl='이 예시는 <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>을 사용해서 학습됩니다.',Wt,w,Xt,j,Al="아래의 스크립트를 실행하기 전에, 라이브러리의 학습 의존성을 설치해야 합니다.",Et,g,xt,Z,Hl="위 사항을 만족시키기 위해서, 새로운 가상환경에서 다음 일련의 스텝을 실행하세요:",Nt,R,Yt,V,Dl='그 다음에는 <a href="https://github.com/huggingface/diffusers/tree/main/examples/controlnet" rel="nofollow">예시 폴더</a>으로 이동합니다.',Ft,v,Qt,$,ql="이제 실행하세요:",Lt,G,kt,C,zl='<a href="https://github.com/huggingface/accelerate/" rel="nofollow">🤗Accelerate</a> 환경을 초기화 합니다:',St,I,At,B,Pl="혹은 여러분의 환경이 무엇인지 몰라도 기본적인 🤗Accelerate 구성으로 초기화할 수 있습니다:",Ht,W,Dt,X,Ol="혹은 당신의 환경이 노트북 같은 상호작용하는 쉘을 지원하지 않는다면, 아래의 코드로 초기화 할 수 있습니다:",qt,E,zt,x,Kl='자체 데이터셋을 사용하기 위해서는 <a href="create_dataset">학습을 위한 데이터셋 생성하기</a> 가이드를 확인하세요.',Pt,N,Ot,Y,te="이 학습에 사용될 다음 이미지들을 다운로드하세요:",Kt,F,tl,Q,le='<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> 인자로 환경변수를 보냅니다.',ll,L,ee="학습 스크립트는 당신의 리포지토리에 <code>diffusion_pytorch_model.bin</code> 파일을 생성하고 저장합니다.",el,k,nl,S,ne="이 기본적인 설정으로는 ~38GB VRAM이 필요합니다.",sl,A,se="기본적으로 학습 스크립트는 결과를 텐서보드에 기록합니다. 가중치(weight)와 편향(bias)을 사용하기 위해 <code>--report_to wandb</code> 를 전달합니다.",al,H,ae="더 작은 batch(배치) 크기로 gradient accumulation(기울기 누적)을 하면 학습 요구사항을 ~20 GB VRAM으로 줄일 수 있습니다.",il,D,pl,q,ml,z,ie=`<code>accelerate</code> 은 seamless multi-GPU 학습을 고려합니다. <code>accelerate</code>과 함께 분산된 학습을 실행하기 위해 <a href="https://huggingface.co/docs/accelerate/basic_tutorials/launch" rel="nofollow">여기</a>
의 설명을 확인하세요. 아래는 예시 명령어입니다:`,ol,P,cl,O,Ml,K,rl,tt,pe='<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>',ul,lt,dl,et,me='<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>',Ul,nt,bl,st,oe="16GB GPU에서 학습하기 위해 다음의 최적화를 진행하세요:",fl,at,ce='<li>기울기 체크포인트 저장하기</li> <li>bitsandbyte의 <a href="https://github.com/TimDettmers/bitsandbytes#requirements--installation" rel="nofollow">8-bit optimizer</a>가 설치되지 않았다면 링크에 연결된 설명서를 보세요.</li>',Jl,it,Me="이제 학습 스크립트를 시작할 수 있습니다:",gl,pt,Tl,mt,hl,ot,re="12GB GPU에서 실행하기 위해 다음의 최적화를 진행하세요:",yl,ct,ue='<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>',_l,Mt,wl,rt,de="<code>pip install xformers</code>으로 <code>xformers</code>을 확실히 설치하고 <code>enable_xformers_memory_efficient_attention</code>을 사용하세요.",jl,ut,Zl,dt,Ue=`우리는 ControlNet을 지원하기 위한 DeepSpeed를 철저하게 테스트하지 않았습니다. 환경설정이 메모리를 저장할 때,
그 환경이 성공적으로 학습했는지를 확정하지 않았습니다. 성공한 학습 실행을 위해 설정을 변경해야 할 가능성이 높습니다.`,Rl,Ut,be="8GB GPU에서 실행하기 위해 다음의 최적화를 진행하세요:",Vl,bt,fe='<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>',vl,ft,Je=`<a href="https://www.deepspeed.ai/" rel="nofollow">DeepSpeed</a>는 CPU 또는 NVME로 텐서를 VRAM에서 오프로드할 수 있습니다.
이를 위해서 훨씬 더 많은 RAM(약 25 GB)가 필요합니다.`,$l,Jt,ge="DeepSpeed stage 2를 활성화하기 위해서 <code>accelerate config</code>로 환경을 구성해야합니다.",Gl,gt,Te="구성(configuration) 파일은 이런 모습이어야 합니다:",Cl,Tt,Il,ht,he="<팁>",Bl,yt,ye='<a href="https://huggingface.co/docs/accelerate/usage_guides/deepspeed" rel="nofollow">문서</a>를 더 많은 DeepSpeed 설정 옵션을 위해 보세요.',Wl,_t,_e="<팁>",Xl,wt,we=`기본 Adam optimizer를 DeepSpeed’의 Adam
<code>deepspeed.ops.adam.DeepSpeedCPUAdam</code> 으로 바꾸면 상당한 속도 향상을 이룰수 있지만,
Pytorch와 같은 버전의 CUDA toolchain이 필요합니다. 8-비트 optimizer는 현재 DeepSpeed와
호환되지 않는 것 같습니다.`,El,jt,xl,Zt,Nl,Rt,je=`학습된 모델은 <code>StableDiffusionControlNetPipeline</code>과 함께 실행될 수 있습니다.
<code>base_model_path</code>와 <code>controlnet_path</code> 에 값을 지정하세요 <code>--pretrained_model_name_or_path</code> 와
<code>--output_dir</code> 는 학습 스크립트에 개별적으로 지정됩니다.`,Yl,Vt,Fl,vt,Ql,Gt,Ll;return h=new J({props:{title:"ControlNet",local:"controlnet",headingTag:"h1"}}),w=new J({props:{title:"의존성 설치하기",local:"의존성-설치하기",headingTag:"h2"}}),g=new Xe({props:{warning:!0,$$slots:{default:[xe]},$$scope:{ctx:Ct}}}),R=new b({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}}),v=new b({props:{code:"Y2QlMjBleGFtcGxlcyUyRmNvbnRyb2xuZXQ=",highlighted:'<span class="hljs-built_in">cd</span> examples/controlnet',wrap:!1}}),G=new b({props:{code:"cGlwJTIwaW5zdGFsbCUyMC1yJTIwcmVxdWlyZW1lbnRzLnR4dA==",highlighted:"pip install -r requirements.txt",wrap:!1}}),I=new b({props:{code:"YWNjZWxlcmF0ZSUyMGNvbmZpZw==",highlighted:"accelerate config",wrap:!1}}),W=new b({props:{code:"YWNjZWxlcmF0ZSUyMGNvbmZpZyUyMGRlZmF1bHQ=",highlighted:"accelerate config default",wrap:!1}}),E=new b({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}}),N=new J({props:{title:"학습",local:"학습",headingTag:"h2"}}),F=new b({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}}),k=new b({props:{code:"ZXhwb3J0JTIwTU9ERUxfRElSJTNEJTIyc3RhYmxlLWRpZmZ1c2lvbi12MS01JTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTBBZXhwb3J0JTIwT1VUUFVUX0RJUiUzRCUyMnBhdGglMjB0byUyMHNhdmUlMjBtb2RlbCUyMiUwQSUwQWFjY2VsZXJhdGUlMjBsYXVuY2glMjB0cmFpbl9jb250cm9sbmV0LnB5JTIwJTVDJTBBJTIwLS1wcmV0cmFpbmVkX21vZGVsX25hbWVfb3JfcGF0aCUzRCUyNE1PREVMX0RJUiUyMCU1QyUwQSUyMC0tb3V0cHV0X2RpciUzRCUyNE9VVFBVVF9ESVIlMjAlNUMlMEElMjAtLWRhdGFzZXRfbmFtZSUzRGZ1c2luZyUyRmZpbGw1MGslMjAlNUMlMEElMjAtLXJlc29sdXRpb24lM0Q1MTIlMjAlNUMlMEElMjAtLWxlYXJuaW5nX3JhdGUlM0QxZS01JTIwJTVDJTBBJTIwLS12YWxpZGF0aW9uX2ltYWdlJTIwJTIyLiUyRmNvbmRpdGlvbmluZ19pbWFnZV8xLnBuZyUyMiUyMCUyMi4lMkZjb25kaXRpb25pbmdfaW1hZ2VfMi5wbmclMjIlMjAlNUMlMEElMjAtLXZhbGlkYXRpb25fcHJvbXB0JTIwJTIycmVkJTIwY2lyY2xlJTIwd2l0aCUyMGJsdWUlMjBiYWNrZ3JvdW5kJTIyJTIwJTIyY3lhbiUyMGNpcmNsZSUyMHdpdGglMjBicm93biUyMGZsb3JhbCUyMGJhY2tncm91bmQlMjIlMjAlNUMlMEElMjAtLXRyYWluX2JhdGNoX3NpemUlM0Q0JTIwJTVDJTBBJTIwLS1wdXNoX3RvX2h1Yg==",highlighted:`<span class="hljs-built_in">export</span> MODEL_DIR=<span class="hljs-string">&quot;stable-diffusion-v1-5/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}}),D=new b({props:{code:"ZXhwb3J0JTIwTU9ERUxfRElSJTNEJTIyc3RhYmxlLWRpZmZ1c2lvbi12MS01JTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTBBZXhwb3J0JTIwT1VUUFVUX0RJUiUzRCUyMnBhdGglMjB0byUyMHNhdmUlMjBtb2RlbCUyMiUwQSUwQWFjY2VsZXJhdGUlMjBsYXVuY2glMjB0cmFpbl9jb250cm9sbmV0LnB5JTIwJTVDJTBBJTIwLS1wcmV0cmFpbmVkX21vZGVsX25hbWVfb3JfcGF0aCUzRCUyNE1PREVMX0RJUiUyMCU1QyUwQSUyMC0tb3V0cHV0X2RpciUzRCUyNE9VVFBVVF9ESVIlMjAlNUMlMEElMjAtLWRhdGFzZXRfbmFtZSUzRGZ1c2luZyUyRmZpbGw1MGslMjAlNUMlMEElMjAtLXJlc29sdXRpb24lM0Q1MTIlMjAlNUMlMEElMjAtLWxlYXJuaW5nX3JhdGUlM0QxZS01JTIwJTVDJTBBJTIwLS12YWxpZGF0aW9uX2ltYWdlJTIwJTIyLiUyRmNvbmRpdGlvbmluZ19pbWFnZV8xLnBuZyUyMiUyMCUyMi4lMkZjb25kaXRpb25pbmdfaW1hZ2VfMi5wbmclMjIlMjAlNUMlMEElMjAtLXZhbGlkYXRpb25fcHJvbXB0JTIwJTIycmVkJTIwY2lyY2xlJTIwd2l0aCUyMGJsdWUlMjBiYWNrZ3JvdW5kJTIyJTIwJTIyY3lhbiUyMGNpcmNsZSUyMHdpdGglMjBicm93biUyMGZsb3JhbCUyMGJhY2tncm91bmQlMjIlMjAlNUMlMEElMjAtLXRyYWluX2JhdGNoX3NpemUlM0QxJTIwJTVDJTBBJTIwLS1ncmFkaWVudF9hY2N1bXVsYXRpb25fc3RlcHMlM0Q0JTIwJTVDJTBBJTIwJTIwLS1wdXNoX3RvX2h1Yg==",highlighted:`<span class="hljs-built_in">export</span> MODEL_DIR=<span class="hljs-string">&quot;stable-diffusion-v1-5/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}}),q=new J({props:{title:"여러개 GPU로 학습하기",local:"여러개-gpu로-학습하기",headingTag:"h2"}}),P=new b({props:{code:"ZXhwb3J0JTIwTU9ERUxfRElSJTNEJTIyc3RhYmxlLWRpZmZ1c2lvbi12MS01JTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTBBZXhwb3J0JTIwT1VUUFVUX0RJUiUzRCUyMnBhdGglMjB0byUyMHNhdmUlMjBtb2RlbCUyMiUwQSUwQWFjY2VsZXJhdGUlMjBsYXVuY2glMjAtLW1peGVkX3ByZWNpc2lvbiUzRCUyMmZwMTYlMjIlMjAtLW11bHRpX2dwdSUyMHRyYWluX2NvbnRyb2xuZXQucHklMjAlNUMlMEElMjAtLXByZXRyYWluZWRfbW9kZWxfbmFtZV9vcl9wYXRoJTNEJTI0TU9ERUxfRElSJTIwJTVDJTBBJTIwLS1vdXRwdXRfZGlyJTNEJTI0T1VUUFVUX0RJUiUyMCU1QyUwQSUyMC0tZGF0YXNldF9uYW1lJTNEZnVzaW5nJTJGZmlsbDUwayUyMCU1QyUwQSUyMC0tcmVzb2x1dGlvbiUzRDUxMiUyMCU1QyUwQSUyMC0tbGVhcm5pbmdfcmF0ZSUzRDFlLTUlMjAlNUMlMEElMjAtLXZhbGlkYXRpb25faW1hZ2UlMjAlMjIuJTJGY29uZGl0aW9uaW5nX2ltYWdlXzEucG5nJTIyJTIwJTIyLiUyRmNvbmRpdGlvbmluZ19pbWFnZV8yLnBuZyUyMiUyMCU1QyUwQSUyMC0tdmFsaWRhdGlvbl9wcm9tcHQlMjAlMjJyZWQlMjBjaXJjbGUlMjB3aXRoJTIwYmx1ZSUyMGJhY2tncm91bmQlMjIlMjAlMjJjeWFuJTIwY2lyY2xlJTIwd2l0aCUyMGJyb3duJTIwZmxvcmFsJTIwYmFja2dyb3VuZCUyMiUyMCU1QyUwQSUyMC0tdHJhaW5fYmF0Y2hfc2l6ZSUzRDQlMjAlNUMlMEElMjAtLW1peGVkX3ByZWNpc2lvbiUzRCUyMmZwMTYlMjIlMjAlNUMlMEElMjAtLXRyYWNrZXJfcHJvamVjdF9uYW1lJTNEJTIyY29udHJvbG5ldC1kZW1vJTIyJTIwJTVDJTBBJTIwLS1yZXBvcnRfdG8lM0R3YW5kYiUyMCU1QyUwQSUyMCUyMC0tcHVzaF90b19odWI=",highlighted:`<span class="hljs-built_in">export</span> MODEL_DIR=<span class="hljs-string">&quot;stable-diffusion-v1-5/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}}),O=new J({props:{title:"예시 결과",local:"예시-결과",headingTag:"h2"}}),K=new J({props:{title:"배치 사이즈 8로 300 스텝 이후:",local:"배치-사이즈-8로-300-스텝-이후",headingTag:"h4"}}),lt=new J({props:{title:"배치 사이즈 8로 6000 스텝 이후:",local:"배치-사이즈-8로-6000-스텝-이후",headingTag:"h4"}}),nt=new J({props:{title:"16GB GPU에서 학습하기",local:"16gb-gpu에서-학습하기",headingTag:"h2"}}),pt=new b({props:{code:"ZXhwb3J0JTIwTU9ERUxfRElSJTNEJTIyc3RhYmxlLWRpZmZ1c2lvbi12MS01JTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTBBZXhwb3J0JTIwT1VUUFVUX0RJUiUzRCUyMnBhdGglMjB0byUyMHNhdmUlMjBtb2RlbCUyMiUwQSUwQWFjY2VsZXJhdGUlMjBsYXVuY2glMjB0cmFpbl9jb250cm9sbmV0LnB5JTIwJTVDJTBBJTIwLS1wcmV0cmFpbmVkX21vZGVsX25hbWVfb3JfcGF0aCUzRCUyNE1PREVMX0RJUiUyMCU1QyUwQSUyMC0tb3V0cHV0X2RpciUzRCUyNE9VVFBVVF9ESVIlMjAlNUMlMEElMjAtLWRhdGFzZXRfbmFtZSUzRGZ1c2luZyUyRmZpbGw1MGslMjAlNUMlMEElMjAtLXJlc29sdXRpb24lM0Q1MTIlMjAlNUMlMEElMjAtLWxlYXJuaW5nX3JhdGUlM0QxZS01JTIwJTVDJTBBJTIwLS12YWxpZGF0aW9uX2ltYWdlJTIwJTIyLiUyRmNvbmRpdGlvbmluZ19pbWFnZV8xLnBuZyUyMiUyMCUyMi4lMkZjb25kaXRpb25pbmdfaW1hZ2VfMi5wbmclMjIlMjAlNUMlMEElMjAtLXZhbGlkYXRpb25fcHJvbXB0JTIwJTIycmVkJTIwY2lyY2xlJTIwd2l0aCUyMGJsdWUlMjBiYWNrZ3JvdW5kJTIyJTIwJTIyY3lhbiUyMGNpcmNsZSUyMHdpdGglMjBicm93biUyMGZsb3JhbCUyMGJhY2tncm91bmQlMjIlMjAlNUMlMEElMjAtLXRyYWluX2JhdGNoX3NpemUlM0QxJTIwJTVDJTBBJTIwLS1ncmFkaWVudF9hY2N1bXVsYXRpb25fc3RlcHMlM0Q0JTIwJTVDJTBBJTIwLS1ncmFkaWVudF9jaGVja3BvaW50aW5nJTIwJTVDJTBBJTIwLS11c2VfOGJpdF9hZGFtJTIwJTVDJTBBJTIwJTIwLS1wdXNoX3RvX2h1Yg==",highlighted:`<span class="hljs-built_in">export</span> MODEL_DIR=<span class="hljs-string">&quot;stable-diffusion-v1-5/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}}),mt=new J({props:{title:"12GB GPU에서 학습하기",local:"12gb-gpu에서-학습하기",headingTag:"h2"}}),Mt=new b({props:{code:"ZXhwb3J0JTIwTU9ERUxfRElSJTNEJTIyc3RhYmxlLWRpZmZ1c2lvbi12MS01JTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTBBZXhwb3J0JTIwT1VUUFVUX0RJUiUzRCUyMnBhdGglMjB0byUyMHNhdmUlMjBtb2RlbCUyMiUwQSUwQWFjY2VsZXJhdGUlMjBsYXVuY2glMjB0cmFpbl9jb250cm9sbmV0LnB5JTIwJTVDJTBBJTIwLS1wcmV0cmFpbmVkX21vZGVsX25hbWVfb3JfcGF0aCUzRCUyNE1PREVMX0RJUiUyMCU1QyUwQSUyMC0tb3V0cHV0X2RpciUzRCUyNE9VVFBVVF9ESVIlMjAlNUMlMEElMjAtLWRhdGFzZXRfbmFtZSUzRGZ1c2luZyUyRmZpbGw1MGslMjAlNUMlMEElMjAtLXJlc29sdXRpb24lM0Q1MTIlMjAlNUMlMEElMjAtLWxlYXJuaW5nX3JhdGUlM0QxZS01JTIwJTVDJTBBJTIwLS12YWxpZGF0aW9uX2ltYWdlJTIwJTIyLiUyRmNvbmRpdGlvbmluZ19pbWFnZV8xLnBuZyUyMiUyMCUyMi4lMkZjb25kaXRpb25pbmdfaW1hZ2VfMi5wbmclMjIlMjAlNUMlMEElMjAtLXZhbGlkYXRpb25fcHJvbXB0JTIwJTIycmVkJTIwY2lyY2xlJTIwd2l0aCUyMGJsdWUlMjBiYWNrZ3JvdW5kJTIyJTIwJTIyY3lhbiUyMGNpcmNsZSUyMHdpdGglMjBicm93biUyMGZsb3JhbCUyMGJhY2tncm91bmQlMjIlMjAlNUMlMEElMjAtLXRyYWluX2JhdGNoX3NpemUlM0QxJTIwJTVDJTBBJTIwLS1ncmFkaWVudF9hY2N1bXVsYXRpb25fc3RlcHMlM0Q0JTIwJTVDJTBBJTIwLS1ncmFkaWVudF9jaGVja3BvaW50aW5nJTIwJTVDJTBBJTIwLS11c2VfOGJpdF9hZGFtJTIwJTVDJTBBJTIwLS1lbmFibGVfeGZvcm1lcnNfbWVtb3J5X2VmZmljaWVudF9hdHRlbnRpb24lMjAlNUMlMEElMjAtLXNldF9ncmFkc190b19ub25lJTIwJTVDJTBBJTIwJTIwLS1wdXNoX3RvX2h1Yg==",highlighted:`<span class="hljs-built_in">export</span> MODEL_DIR=<span class="hljs-string">&quot;stable-diffusion-v1-5/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}}),ut=new J({props:{title:"8GB GPU에서 학습하기",local:"8gb-gpu에서-학습하기",headingTag:"h2"}}),Tt=new b({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-string">DEEPSPEED</span>`,wrap:!1}}),jt=new b({props:{code:"ZXhwb3J0JTIwTU9ERUxfRElSJTNEJTIyc3RhYmxlLWRpZmZ1c2lvbi12MS01JTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTBBZXhwb3J0JTIwT1VUUFVUX0RJUiUzRCUyMnBhdGglMjB0byUyMHNhdmUlMjBtb2RlbCUyMiUwQSUwQWFjY2VsZXJhdGUlMjBsYXVuY2glMjB0cmFpbl9jb250cm9sbmV0LnB5JTIwJTVDJTBBJTIwLS1wcmV0cmFpbmVkX21vZGVsX25hbWVfb3JfcGF0aCUzRCUyNE1PREVMX0RJUiUyMCU1QyUwQSUyMC0tb3V0cHV0X2RpciUzRCUyNE9VVFBVVF9ESVIlMjAlNUMlMEElMjAtLWRhdGFzZXRfbmFtZSUzRGZ1c2luZyUyRmZpbGw1MGslMjAlNUMlMEElMjAtLXJlc29sdXRpb24lM0Q1MTIlMjAlNUMlMEElMjAtLXZhbGlkYXRpb25faW1hZ2UlMjAlMjIuJTJGY29uZGl0aW9uaW5nX2ltYWdlXzEucG5nJTIyJTIwJTIyLiUyRmNvbmRpdGlvbmluZ19pbWFnZV8yLnBuZyUyMiUyMCU1QyUwQSUyMC0tdmFsaWRhdGlvbl9wcm9tcHQlMjAlMjJyZWQlMjBjaXJjbGUlMjB3aXRoJTIwYmx1ZSUyMGJhY2tncm91bmQlMjIlMjAlMjJjeWFuJTIwY2lyY2xlJTIwd2l0aCUyMGJyb3duJTIwZmxvcmFsJTIwYmFja2dyb3VuZCUyMiUyMCU1QyUwQSUyMC0tdHJhaW5fYmF0Y2hfc2l6ZSUzRDElMjAlNUMlMEElMjAtLWdyYWRpZW50X2FjY3VtdWxhdGlvbl9zdGVwcyUzRDQlMjAlNUMlMEElMjAtLWdyYWRpZW50X2NoZWNrcG9pbnRpbmclMjAlNUMlMEElMjAtLWVuYWJsZV94Zm9ybWVyc19tZW1vcnlfZWZmaWNpZW50X2F0dGVudGlvbiUyMCU1QyUwQSUyMC0tc2V0X2dyYWRzX3RvX25vbmUlMjAlNUMlMEElMjAtLW1peGVkX3ByZWNpc2lvbiUyMGZwMTYlMjAlNUMlMEElMjAtLXB1c2hfdG9faHVi",highlighted:`<span class="hljs-built_in">export</span> MODEL_DIR=<span class="hljs-string">&quot;stable-diffusion-v1-5/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}}),Zt=new J({props:{title:"추론",local:"추론",headingTag:"h2"}}),Vt=new b({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvbkNvbnRyb2xOZXRQaXBlbGluZSUyQyUyMENvbnRyb2xOZXRNb2RlbCUyQyUyMFVuaVBDTXVsdGlzdGVwU2NoZWR1bGVyJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQWJhc2VfbW9kZWxfcGF0aCUyMCUzRCUyMCUyMnBhdGglMjB0byUyMG1vZGVsJTIyJTBBY29udHJvbG5ldF9wYXRoJTIwJTNEJTIwJTIycGF0aCUyMHRvJTIwY29udHJvbG5ldCUyMiUwQSUwQWNvbnRyb2xuZXQlMjAlM0QlMjBDb250cm9sTmV0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKGNvbnRyb2xuZXRfcGF0aCUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uQ29udHJvbE5ldFBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjBiYXNlX21vZGVsX3BhdGglMkMlMjBjb250cm9sbmV0JTNEY29udHJvbG5ldCUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUwQSklMEElMEElMjMlMjAlRUIlOEQlOTQlMjAlRUIlQjklQTAlRUIlQTUlQjglMjAlRUMlOEElQTQlRUMlQkMlODAlRUMlQTQlODQlRUIlOUYlQUMlRUMlOTklODAlMjAlRUIlQTklOTQlRUIlQUElQTglRUIlQTYlQUMlMjAlRUMlQjUlOUMlRUMlQTAlODElRUQlOTklOTQlRUIlQTElOUMlMjBkaWZmdXNpb24lMjAlRUQlOTQlODQlRUIlQTElOUMlRUMlODQlQjglRUMlOEElQTQlMjAlRUMlODYlOEQlRUIlOEYlODQlMjAlRUMlOTglQUMlRUIlQTYlQUMlRUElQjglQjAlMEFwaXBlLnNjaGVkdWxlciUyMCUzRCUyMFVuaVBDTXVsdGlzdGVwU2NoZWR1bGVyLmZyb21fY29uZmlnKHBpcGUuc2NoZWR1bGVyLmNvbmZpZyklMEElMjMlMjB4Zm9ybWVycyVFQSVCMCU4MCUyMCVFQyU4NCVBNCVFQyVCOSU5OCVFQiU5MCU5OCVFQyVBNyU4MCUyMCVFQyU5NSU4QSVFQyU5QyVCQyVFQiVBOSVCNCUyMCVFQyU5NSU4NCVFQiU5RSU5OCUyMCVFQyVBNCU4NCVFQyU5RCU4NCUyMCVFQyU4MiVBRCVFQyVBMCU5QyVFRCU5NSU5OCVFQSVCOCVCMCUwQXBpcGUuZW5hYmxlX3hmb3JtZXJzX21lbW9yeV9lZmZpY2llbnRfYXR0ZW50aW9uKCklMEElMEFwaXBlLmVuYWJsZV9tb2RlbF9jcHVfb2ZmbG9hZCgpJTBBJTBBY29udHJvbF9pbWFnZSUyMCUzRCUyMGxvYWRfaW1hZ2UoJTIyLiUyRmNvbmRpdGlvbmluZ19pbWFnZV8xLnBuZyUyMiklMEFwcm9tcHQlMjAlM0QlMjAlMjJwYWxlJTIwZ29sZGVuJTIwcm9kJTIwY2lyY2xlJTIwd2l0aCUyMG9sZCUyMGxhY2UlMjBiYWNrZ3JvdW5kJTIyJTBBJTBBJTIzJTIwJUVDJTlEJUI0JUVCJUFGJUI4JUVDJUE3JTgwJTIwJUVDJTgzJTlEJUVDJTg0JUIxJUVEJTk1JTk4JUVBJUI4JUIwJTBBZ2VuZXJhdG9yJTIwJTNEJTIwdG9yY2gubWFudWFsX3NlZWQoMCklMEFpbWFnZSUyMCUzRCUyMHBpcGUocHJvbXB0JTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDIwJTJDJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTJDJTIwaW1hZ2UlM0Rjb250cm9sX2ltYWdlKS5pbWFnZXMlNUIwJTVEJTBBJTBBaW1hZ2Uuc2F2ZSglMjIuJTJGb3V0cHV0LnBuZyUyMik=",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}}),vt=new Ee({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/ko/training/controlnet.md"}}),{c(){U=i("meta"),T=s(),f=i("p"),$t=s(),o(h.$$.fragment),It=s(),y=i("p"),y.innerHTML=kl,Bt=s(),_=i("p"),_.innerHTML=Sl,Wt=s(),o(w.$$.fragment),Xt=s(),j=i("p"),j.textContent=Al,Et=s(),o(g.$$.fragment),xt=s(),Z=i("p"),Z.textContent=Hl,Nt=s(),o(R.$$.fragment),Yt=s(),V=i("p"),V.innerHTML=Dl,Ft=s(),o(v.$$.fragment),Qt=s(),$=i("p"),$.textContent=ql,Lt=s(),o(G.$$.fragment),kt=s(),C=i("p"),C.innerHTML=zl,St=s(),o(I.$$.fragment),At=s(),B=i("p"),B.textContent=Pl,Ht=s(),o(W.$$.fragment),Dt=s(),X=i("p"),X.textContent=Ol,qt=s(),o(E.$$.fragment),zt=s(),x=i("p"),x.innerHTML=Kl,Pt=s(),o(N.$$.fragment),Ot=s(),Y=i("p"),Y.textContent=te,Kt=s(),o(F.$$.fragment),tl=s(),Q=i("p"),Q.innerHTML=le,ll=s(),L=i("p"),L.innerHTML=ee,el=s(),o(k.$$.fragment),nl=s(),S=i("p"),S.textContent=ne,sl=s(),A=i("p"),A.innerHTML=se,al=s(),H=i("p"),H.textContent=ae,il=s(),o(D.$$.fragment),pl=s(),o(q.$$.fragment),ml=s(),z=i("p"),z.innerHTML=ie,ol=s(),o(P.$$.fragment),cl=s(),o(O.$$.fragment),Ml=s(),o(K.$$.fragment),rl=s(),tt=i("table"),tt.innerHTML=pe,ul=s(),o(lt.$$.fragment),dl=s(),et=i("table"),et.innerHTML=me,Ul=s(),o(nt.$$.fragment),bl=s(),st=i("p"),st.textContent=oe,fl=s(),at=i("ul"),at.innerHTML=ce,Jl=s(),it=i("p"),it.textContent=Me,gl=s(),o(pt.$$.fragment),Tl=s(),o(mt.$$.fragment),hl=s(),ot=i("p"),ot.textContent=re,yl=s(),ct=i("ul"),ct.innerHTML=ue,_l=s(),o(Mt.$$.fragment),wl=s(),rt=i("p"),rt.innerHTML=de,jl=s(),o(ut.$$.fragment),Zl=s(),dt=i("p"),dt.textContent=Ue,Rl=s(),Ut=i("p"),Ut.textContent=be,Vl=s(),bt=i("ul"),bt.innerHTML=fe,vl=s(),ft=i("p"),ft.innerHTML=Je,$l=s(),Jt=i("p"),Jt.innerHTML=ge,Gl=s(),gt=i("p"),gt.textContent=Te,Cl=s(),o(Tt.$$.fragment),Il=s(),ht=i("p"),ht.textContent=he,Bl=s(),yt=i("p"),yt.innerHTML=ye,Wl=s(),_t=i("p"),_t.textContent=_e,Xl=s(),wt=i("p"),wt.innerHTML=we,El=s(),o(jt.$$.fragment),xl=s(),o(Zt.$$.fragment),Nl=s(),Rt=i("p"),Rt.innerHTML=je,Yl=s(),o(Vt.$$.fragment),Fl=s(),o(vt.$$.fragment),Ql=s(),Gt=i("p"),this.h()},l(t){const l=Be("svelte-u9bgzb",document.head);U=p(l,"META",{name:!0,content:!0}),l.forEach(e),T=a(t),f=p(t,"P",{}),Re(f).forEach(e),$t=a(t),c(h.$$.fragment,t),It=a(t),y=p(t,"P",{"data-svelte-h":!0}),m(y)!=="svelte-1k5o3fb"&&(y.innerHTML=kl),Bt=a(t),_=p(t,"P",{"data-svelte-h":!0}),m(_)!=="svelte-srp9tb"&&(_.innerHTML=Sl),Wt=a(t),c(w.$$.fragment,t),Xt=a(t),j=p(t,"P",{"data-svelte-h":!0}),m(j)!=="svelte-audt4e"&&(j.textContent=Al),Et=a(t),c(g.$$.fragment,t),xt=a(t),Z=p(t,"P",{"data-svelte-h":!0}),m(Z)!=="svelte-enix0a"&&(Z.textContent=Hl),Nt=a(t),c(R.$$.fragment,t),Yt=a(t),V=p(t,"P",{"data-svelte-h":!0}),m(V)!=="svelte-1k8zlp9"&&(V.innerHTML=Dl),Ft=a(t),c(v.$$.fragment,t),Qt=a(t),$=p(t,"P",{"data-svelte-h":!0}),m($)!=="svelte-1fgpi95"&&($.textContent=ql),Lt=a(t),c(G.$$.fragment,t),kt=a(t),C=p(t,"P",{"data-svelte-h":!0}),m(C)!=="svelte-12bqcqg"&&(C.innerHTML=zl),St=a(t),c(I.$$.fragment,t),At=a(t),B=p(t,"P",{"data-svelte-h":!0}),m(B)!=="svelte-wd3dp4"&&(B.textContent=Pl),Ht=a(t),c(W.$$.fragment,t),Dt=a(t),X=p(t,"P",{"data-svelte-h":!0}),m(X)!=="svelte-1gibgaz"&&(X.textContent=Ol),qt=a(t),c(E.$$.fragment,t),zt=a(t),x=p(t,"P",{"data-svelte-h":!0}),m(x)!=="svelte-18vs9m4"&&(x.innerHTML=Kl),Pt=a(t),c(N.$$.fragment,t),Ot=a(t),Y=p(t,"P",{"data-svelte-h":!0}),m(Y)!=="svelte-64o031"&&(Y.textContent=te),Kt=a(t),c(F.$$.fragment,t),tl=a(t),Q=p(t,"P",{"data-svelte-h":!0}),m(Q)!=="svelte-ky63v0"&&(Q.innerHTML=le),ll=a(t),L=p(t,"P",{"data-svelte-h":!0}),m(L)!=="svelte-1v3g5fv"&&(L.innerHTML=ee),el=a(t),c(k.$$.fragment,t),nl=a(t),S=p(t,"P",{"data-svelte-h":!0}),m(S)!=="svelte-on7i15"&&(S.textContent=ne),sl=a(t),A=p(t,"P",{"data-svelte-h":!0}),m(A)!=="svelte-j3jf4w"&&(A.innerHTML=se),al=a(t),H=p(t,"P",{"data-svelte-h":!0}),m(H)!=="svelte-ibpfse"&&(H.textContent=ae),il=a(t),c(D.$$.fragment,t),pl=a(t),c(q.$$.fragment,t),ml=a(t),z=p(t,"P",{"data-svelte-h":!0}),m(z)!=="svelte-kn2k8f"&&(z.innerHTML=ie),ol=a(t),c(P.$$.fragment,t),cl=a(t),c(O.$$.fragment,t),Ml=a(t),c(K.$$.fragment,t),rl=a(t),tt=p(t,"TABLE",{"data-svelte-h":!0}),m(tt)!=="svelte-7n8ul8"&&(tt.innerHTML=pe),ul=a(t),c(lt.$$.fragment,t),dl=a(t),et=p(t,"TABLE",{"data-svelte-h":!0}),m(et)!=="svelte-197rfee"&&(et.innerHTML=me),Ul=a(t),c(nt.$$.fragment,t),bl=a(t),st=p(t,"P",{"data-svelte-h":!0}),m(st)!=="svelte-1a3ynwi"&&(st.textContent=oe),fl=a(t),at=p(t,"UL",{"data-svelte-h":!0}),m(at)!=="svelte-gud7gs"&&(at.innerHTML=ce),Jl=a(t),it=p(t,"P",{"data-svelte-h":!0}),m(it)!=="svelte-fmnd9z"&&(it.textContent=Me),gl=a(t),c(pt.$$.fragment,t),Tl=a(t),c(mt.$$.fragment,t),hl=a(t),ot=p(t,"P",{"data-svelte-h":!0}),m(ot)!=="svelte-ulemqz"&&(ot.textContent=re),yl=a(t),ct=p(t,"UL",{"data-svelte-h":!0}),m(ct)!=="svelte-ezl5xe"&&(ct.innerHTML=ue),_l=a(t),c(Mt.$$.fragment,t),wl=a(t),rt=p(t,"P",{"data-svelte-h":!0}),m(rt)!=="svelte-m0yrgw"&&(rt.innerHTML=de),jl=a(t),c(ut.$$.fragment,t),Zl=a(t),dt=p(t,"P",{"data-svelte-h":!0}),m(dt)!=="svelte-1bj00p0"&&(dt.textContent=Ue),Rl=a(t),Ut=p(t,"P",{"data-svelte-h":!0}),m(Ut)!=="svelte-sh9kz6"&&(Ut.textContent=be),Vl=a(t),bt=p(t,"UL",{"data-svelte-h":!0}),m(bt)!=="svelte-xjm66k"&&(bt.innerHTML=fe),vl=a(t),ft=p(t,"P",{"data-svelte-h":!0}),m(ft)!=="svelte-2hnilk"&&(ft.innerHTML=Je),$l=a(t),Jt=p(t,"P",{"data-svelte-h":!0}),m(Jt)!=="svelte-b5or85"&&(Jt.innerHTML=ge),Gl=a(t),gt=p(t,"P",{"data-svelte-h":!0}),m(gt)!=="svelte-1y0d6k"&&(gt.textContent=Te),Cl=a(t),c(Tt.$$.fragment,t),Il=a(t),ht=p(t,"P",{"data-svelte-h":!0}),m(ht)!=="svelte-1terwo1"&&(ht.textContent=he),Bl=a(t),yt=p(t,"P",{"data-svelte-h":!0}),m(yt)!=="svelte-1p0c8l1"&&(yt.innerHTML=ye),Wl=a(t),_t=p(t,"P",{"data-svelte-h":!0}),m(_t)!=="svelte-1terwo1"&&(_t.textContent=_e),Xl=a(t),wt=p(t,"P",{"data-svelte-h":!0}),m(wt)!=="svelte-1en0huo"&&(wt.innerHTML=we),El=a(t),c(jt.$$.fragment,t),xl=a(t),c(Zt.$$.fragment,t),Nl=a(t),Rt=p(t,"P",{"data-svelte-h":!0}),m(Rt)!=="svelte-1erw0pq"&&(Rt.innerHTML=je),Yl=a(t),c(Vt.$$.fragment,t),Fl=a(t),c(vt.$$.fragment,t),Ql=a(t),Gt=p(t,"P",{}),Re(Gt).forEach(e),this.h()},h(){Ve(U,"name","hf:doc:metadata"),Ve(U,"content",Ye)},m(t,l){We(document.head,U),n(t,T,l),n(t,f,l),n(t,$t,l),M(h,t,l),n(t,It,l),n(t,y,l),n(t,Bt,l),n(t,_,l),n(t,Wt,l),M(w,t,l),n(t,Xt,l),n(t,j,l),n(t,Et,l),M(g,t,l),n(t,xt,l),n(t,Z,l),n(t,Nt,l),M(R,t,l),n(t,Yt,l),n(t,V,l),n(t,Ft,l),M(v,t,l),n(t,Qt,l),n(t,$,l),n(t,Lt,l),M(G,t,l),n(t,kt,l),n(t,C,l),n(t,St,l),M(I,t,l),n(t,At,l),n(t,B,l),n(t,Ht,l),M(W,t,l),n(t,Dt,l),n(t,X,l),n(t,qt,l),M(E,t,l),n(t,zt,l),n(t,x,l),n(t,Pt,l),M(N,t,l),n(t,Ot,l),n(t,Y,l),n(t,Kt,l),M(F,t,l),n(t,tl,l),n(t,Q,l),n(t,ll,l),n(t,L,l),n(t,el,l),M(k,t,l),n(t,nl,l),n(t,S,l),n(t,sl,l),n(t,A,l),n(t,al,l),n(t,H,l),n(t,il,l),M(D,t,l),n(t,pl,l),M(q,t,l),n(t,ml,l),n(t,z,l),n(t,ol,l),M(P,t,l),n(t,cl,l),M(O,t,l),n(t,Ml,l),M(K,t,l),n(t,rl,l),n(t,tt,l),n(t,ul,l),M(lt,t,l),n(t,dl,l),n(t,et,l),n(t,Ul,l),M(nt,t,l),n(t,bl,l),n(t,st,l),n(t,fl,l),n(t,at,l),n(t,Jl,l),n(t,it,l),n(t,gl,l),M(pt,t,l),n(t,Tl,l),M(mt,t,l),n(t,hl,l),n(t,ot,l),n(t,yl,l),n(t,ct,l),n(t,_l,l),M(Mt,t,l),n(t,wl,l),n(t,rt,l),n(t,jl,l),M(ut,t,l),n(t,Zl,l),n(t,dt,l),n(t,Rl,l),n(t,Ut,l),n(t,Vl,l),n(t,bt,l),n(t,vl,l),n(t,ft,l),n(t,$l,l),n(t,Jt,l),n(t,Gl,l),n(t,gt,l),n(t,Cl,l),M(Tt,t,l),n(t,Il,l),n(t,ht,l),n(t,Bl,l),n(t,yt,l),n(t,Wl,l),n(t,_t,l),n(t,Xl,l),n(t,wt,l),n(t,El,l),M(jt,t,l),n(t,xl,l),M(Zt,t,l),n(t,Nl,l),n(t,Rt,l),n(t,Yl,l),M(Vt,t,l),n(t,Fl,l),M(vt,t,l),n(t,Ql,l),n(t,Gt,l),Ll=!0},p(t,[l]){const Ze={};l&2&&(Ze.$$scope={dirty:l,ctx:t}),g.$set(Ze)},i(t){Ll||(r(h.$$.fragment,t),r(w.$$.fragment,t),r(g.$$.fragment,t),r(R.$$.fragment,t),r(v.$$.fragment,t),r(G.$$.fragment,t),r(I.$$.fragment,t),r(W.$$.fragment,t),r(E.$$.fragment,t),r(N.$$.fragment,t),r(F.$$.fragment,t),r(k.$$.fragment,t),r(D.$$.fragment,t),r(q.$$.fragment,t),r(P.$$.fragment,t),r(O.$$.fragment,t),r(K.$$.fragment,t),r(lt.$$.fragment,t),r(nt.$$.fragment,t),r(pt.$$.fragment,t),r(mt.$$.fragment,t),r(Mt.$$.fragment,t),r(ut.$$.fragment,t),r(Tt.$$.fragment,t),r(jt.$$.fragment,t),r(Zt.$$.fragment,t),r(Vt.$$.fragment,t),r(vt.$$.fragment,t),Ll=!0)},o(t){u(h.$$.fragment,t),u(w.$$.fragment,t),u(g.$$.fragment,t),u(R.$$.fragment,t),u(v.$$.fragment,t),u(G.$$.fragment,t),u(I.$$.fragment,t),u(W.$$.fragment,t),u(E.$$.fragment,t),u(N.$$.fragment,t),u(F.$$.fragment,t),u(k.$$.fragment,t),u(D.$$.fragment,t),u(q.$$.fragment,t),u(P.$$.fragment,t),u(O.$$.fragment,t),u(K.$$.fragment,t),u(lt.$$.fragment,t),u(nt.$$.fragment,t),u(pt.$$.fragment,t),u(mt.$$.fragment,t),u(Mt.$$.fragment,t),u(ut.$$.fragment,t),u(Tt.$$.fragment,t),u(jt.$$.fragment,t),u(Zt.$$.fragment,t),u(Vt.$$.fragment,t),u(vt.$$.fragment,t),Ll=!1},d(t){t&&(e(T),e(f),e($t),e(It),e(y),e(Bt),e(_),e(Wt),e(Xt),e(j),e(Et),e(xt),e(Z),e(Nt),e(Yt),e(V),e(Ft),e(Qt),e($),e(Lt),e(kt),e(C),e(St),e(At),e(B),e(Ht),e(Dt),e(X),e(qt),e(zt),e(x),e(Pt),e(Ot),e(Y),e(Kt),e(tl),e(Q),e(ll),e(L),e(el),e(nl),e(S),e(sl),e(A),e(al),e(H),e(il),e(pl),e(ml),e(z),e(ol),e(cl),e(Ml),e(rl),e(tt),e(ul),e(dl),e(et),e(Ul),e(bl),e(st),e(fl),e(at),e(Jl),e(it),e(gl),e(Tl),e(hl),e(ot),e(yl),e(ct),e(_l),e(wl),e(rt),e(jl),e(Zl),e(dt),e(Rl),e(Ut),e(Vl),e(bt),e(vl),e(ft),e($l),e(Jt),e(Gl),e(gt),e(Cl),e(Il),e(ht),e(Bl),e(yt),e(Wl),e(_t),e(Xl),e(wt),e(El),e(xl),e(Nl),e(Rt),e(Yl),e(Fl),e(Ql),e(Gt)),e(U),d(h,t),d(w,t),d(g,t),d(R,t),d(v,t),d(G,t),d(I,t),d(W,t),d(E,t),d(N,t),d(F,t),d(k,t),d(D,t),d(q,t),d(P,t),d(O,t),d(K,t),d(lt,t),d(nt,t),d(pt,t),d(mt,t),d(Mt,t),d(ut,t),d(Tt,t),d(jt,t),d(Zt,t),d(Vt,t),d(vt,t)}}}const Ye='{"title":"ControlNet","local":"controlnet","sections":[{"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 Fe(Ct){return $e(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class He extends Ce{constructor(U){super(),Ie(this,U,Fe,Ne,ve,{})}}export{He as component};
