import{s as X,n as D,o as Q}from"../chunks/scheduler.53228c21.js";import{S as R,i as F,e as h,s as n,c as x,h as Y,a as g,d as s,b as i,f as q,g as Z,j as k,k as H,l as A,m as a,n as E,t as U,o as V,p as z}from"../chunks/index.100fac89.js";import{C as N}from"../chunks/CopyLLMTxtMenu.b0ff86f3.js";import{C as K}from"../chunks/CodeBlock.d30a6509.js";import{H as O,E as ee}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.136ef3fd.js";function te(W){let l,M,w,b,r,J,m,T,p,C='<a href="https://huggingface.co/papers/2208.12242" rel="nofollow">DreamBooth</a> is a method for generating personalized images of a specific instance. It works by fine-tuning the model on 3-5 images of the subject (for example, a cat) that is associated with a unique identifier (<code>sks cat</code>). This allows you to use <code>sks cat</code> in your prompt to trigger the model to generate images of your cat in different settings, lighting, poses, and styles.',$,c,L="DreamBooth checkpoints are typically a few GBs in size because it contains the full model weights.",G,f,P='Load the DreamBooth checkpoint with <a href="/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline.from_pretrained">from_pretrained()</a> and include the unique identifier in the prompt to activate its generation.',j,u,_,o,S='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/load_dreambooth.png"/>',I,d,v,y,B;return r=new N({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),m=new O({props:{title:"DreamBooth",local:"dreambooth",headingTag:"h1"}}),u=new K({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQXV0b1BpcGVsaW5lRm9yVGV4dDJJbWFnZSUwQSUwQXBpcGVsaW5lJTIwJTNEJTIwQXV0b1BpcGVsaW5lRm9yVGV4dDJJbWFnZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyc2QtZHJlYW1ib290aC1saWJyYXJ5JTJGaGVyZ2Utc3R5bGUlMjIlMkMlMEElMjAlMjAlMjAlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMEEpLnRvKCUyMmN1ZGElMjIpJTBBcHJvbXB0JTIwJTNEJTIwJTIyQSUyMGN1dGUlMjBza3MlMjBoZXJnZV9zdHlsZSUyMGJyb3duJTIwYmVhciUyMGVhdGluZyUyMGElMjBzbGljZSUyMG9mJTIwcGl6emElMkMlMjBzdHVubmluZyUyMGNvbG9yJTIwc2NoZW1lJTJDJTIwbWFzdGVycGllY2UlMkMlMjBpbGx1c3RyYXRpb24lMjIlMEFwaXBlbGluZShwcm9tcHQpLmltYWdlcyU1QjAlNUQ=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoPipelineForText2Image

pipeline = AutoPipelineForText2Image.from_pretrained(
    <span class="hljs-string">&quot;sd-dreambooth-library/herge-style&quot;</span>,
    torch_dtype=torch.float16
).to(<span class="hljs-string">&quot;cuda&quot;</span>)
prompt = <span class="hljs-string">&quot;A cute sks herge_style brown bear eating a slice of pizza, stunning color scheme, masterpiece, illustration&quot;</span>
pipeline(prompt).images[<span class="hljs-number">0</span>]`,wrap:!1}}),d=new ee({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/using-diffusers/dreambooth.md"}}),{c(){l=h("meta"),M=n(),w=h("p"),b=n(),x(r.$$.fragment),J=n(),x(m.$$.fragment),T=n(),p=h("p"),p.innerHTML=C,$=n(),c=h("p"),c.textContent=L,G=n(),f=h("p"),f.innerHTML=P,j=n(),x(u.$$.fragment),_=n(),o=h("div"),o.innerHTML=S,I=n(),x(d.$$.fragment),v=n(),y=h("p"),this.h()},l(e){const t=Y("svelte-u9bgzb",document.head);l=g(t,"META",{name:!0,content:!0}),t.forEach(s),M=i(e),w=g(e,"P",{}),q(w).forEach(s),b=i(e),Z(r.$$.fragment,e),J=i(e),Z(m.$$.fragment,e),T=i(e),p=g(e,"P",{"data-svelte-h":!0}),k(p)!=="svelte-1xkhepj"&&(p.innerHTML=C),$=i(e),c=g(e,"P",{"data-svelte-h":!0}),k(c)!=="svelte-1n5tgzo"&&(c.textContent=L),G=i(e),f=g(e,"P",{"data-svelte-h":!0}),k(f)!=="svelte-12z8xaw"&&(f.innerHTML=P),j=i(e),Z(u.$$.fragment,e),_=i(e),o=g(e,"DIV",{class:!0,"data-svelte-h":!0}),k(o)!=="svelte-1qqjocv"&&(o.innerHTML=S),I=i(e),Z(d.$$.fragment,e),v=i(e),y=g(e,"P",{}),q(y).forEach(s),this.h()},h(){H(l,"name","hf:doc:metadata"),H(l,"content",se),H(o,"class","flex justify-center")},m(e,t){A(document.head,l),a(e,M,t),a(e,w,t),a(e,b,t),E(r,e,t),a(e,J,t),E(m,e,t),a(e,T,t),a(e,p,t),a(e,$,t),a(e,c,t),a(e,G,t),a(e,f,t),a(e,j,t),E(u,e,t),a(e,_,t),a(e,o,t),a(e,I,t),E(d,e,t),a(e,v,t),a(e,y,t),B=!0},p:D,i(e){B||(U(r.$$.fragment,e),U(m.$$.fragment,e),U(u.$$.fragment,e),U(d.$$.fragment,e),B=!0)},o(e){V(r.$$.fragment,e),V(m.$$.fragment,e),V(u.$$.fragment,e),V(d.$$.fragment,e),B=!1},d(e){e&&(s(M),s(w),s(b),s(J),s(T),s(p),s($),s(c),s(G),s(f),s(j),s(_),s(o),s(I),s(v),s(y)),s(l),z(r,e),z(m,e),z(u,e),z(d,e)}}}const se='{"title":"DreamBooth","local":"dreambooth","sections":[],"depth":1}';function ae(W){return Q(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class me extends R{constructor(l){super(),F(this,l,ae,te,X,{})}}export{me as component};
