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