Buckets:
| import{s as Nn,o as En,n as pn}from"../chunks/scheduler.53228c21.js";import{S as Vn,i as zn,e as r,s as o,c as d,h as Hn,a as l,d as n,b as a,f as J,g as c,j as b,k as I,l as t,m as p,n as g,t as h,o as f,p as _}from"../chunks/index.100fac89.js";import{C as Xn}from"../chunks/CopyLLMTxtMenu.133e28e0.js";import{D as k}from"../chunks/Docstring.f8721f67.js";import{C as Oe}from"../chunks/CodeBlock.d30a6509.js";import{E as ln}from"../chunks/ExampleCodeBlock.24511344.js";import{H as qe,E as Dn}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.d8195636.js";function Rn(B){let m,Z="Examples:",T,u,w;return u=new Oe({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQ2hyb21hUGlwZWxpbmUlMEElMEFtb2RlbF9pZCUyMCUzRCUyMCUyMmxvZGVzdG9uZXMlMkZDaHJvbWExLUhEJTIyJTBBY2twdF9wYXRoJTIwJTNEJTIwJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmxvZGVzdG9uZXMlMkZDaHJvbWExLUhEJTJGYmxvYiUyRm1haW4lMkZDaHJvbWExLUhELnNhZmV0ZW5zb3JzJTIyJTBBdHJhbnNmb3JtZXIlMjAlM0QlMjBDaHJvbWFUcmFuc2Zvcm1lcjJETW9kZWwuZnJvbV9zaW5nbGVfZmlsZShja3B0X3BhdGglMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2KSUwQXBpcGUlMjAlM0QlMjBDaHJvbWFQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwbW9kZWxfaWQlMkMlMEElMjAlMjAlMjAlMjB0cmFuc2Zvcm1lciUzRHRyYW5zZm9ybWVyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5iZmxvYXQxNiUyQyUwQSklMEFwaXBlLmV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1hZ2VzJTVCMCU1RCUwQWltYWdlLnNhdmUoJTIyY2hyb21hLnBuZyUyMik=",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> ChromaPipeline | |
| <span class="hljs-meta">>>> </span>model_id = <span class="hljs-string">"lodestones/Chroma1-HD"</span> | |
| <span class="hljs-meta">>>> </span>ckpt_path = <span class="hljs-string">"https://huggingface.co/lodestones/Chroma1-HD/blob/main/Chroma1-HD.safetensors"</span> | |
| <span class="hljs-meta">>>> </span>transformer = ChromaTransformer2DModel.from_single_file(ckpt_path, torch_dtype=torch.bfloat16) | |
| <span class="hljs-meta">>>> </span>pipe = ChromaPipeline.from_pretrained( | |
| <span class="hljs-meta">... </span> model_id, | |
| <span class="hljs-meta">... </span> transformer=transformer, | |
| <span class="hljs-meta">... </span> torch_dtype=torch.bfloat16, | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>pipe.enable_model_cpu_offload() | |
| <span class="hljs-meta">>>> </span>prompt = [ | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"A high-fashion close-up portrait of a blonde woman in clear sunglasses. The image uses a bold teal and red color split for dramatic lighting. The background is a simple teal-green. The photo is sharp and well-composed, and is designed for viewing with anaglyph 3D glasses for optimal effect. It looks professionally done."</span> | |
| <span class="hljs-meta">... </span>] | |
| <span class="hljs-meta">>>> </span>negative_prompt = [ | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"low quality, ugly, unfinished, out of focus, deformed, disfigure, blurry, smudged, restricted palette, flat colors"</span> | |
| <span class="hljs-meta">... </span>] | |
| <span class="hljs-meta">>>> </span>image = pipe(prompt, negative_prompt=negative_prompt).images[<span class="hljs-number">0</span>] | |
| <span class="hljs-meta">>>> </span>image.save(<span class="hljs-string">"chroma.png"</span>)`,wrap:!1}}),{c(){m=r("p"),m.textContent=Z,T=o(),d(u.$$.fragment)},l(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mFzc2V0cyUyRnN0YWJsZS1zYW1wbGVzJTJGaW1nMmltZyUyRnNrZXRjaC1tb3VudGFpbnMtaW5wdXQuanBnJTIyJTBBKSUwQXByb21wdCUyMCUzRCUyMCUyMmElMjBzY2VuaWMlMjBmYXN0YXN5JTIwbGFuZHNjYXBlJTIwd2l0aCUyMGElMjByaXZlciUyMGFuZCUyMG1vdW50YWlucyUyMGluJTIwdGhlJTIwYmFja2dyb3VuZCUyQyUyMHZpYnJhbnQlMjBjb2xvcnMlMkMlMjBkZXRhaWxlZCUyQyUyMGhpZ2glMjByZXNvbHV0aW9uJTIyJTBBbmVnYXRpdmVfcHJvbXB0JTIwJTNEJTIwJTIybG93JTIwcXVhbGl0eSUyQyUyMHVnbHklMkMlMjB1bmZpbmlzaGVkJTJDJTIwb3V0JTIwb2YlMjBmb2N1cyUyQyUyMGRlZm9ybWVkJTJDJTIwZGlzZmlndXJlJTJDJTIwYmx1cnJ5JTJDJTIwc211ZGdlZCUyQyUyMHJlc3RyaWN0ZWQlMjBwYWxldHRlJTJDJTIwZmxhdCUyMGNvbG9ycyUyMiUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQlMkMlMjBpbWFnZSUzRGluaXRfaW1hZ2UlMkMlMjBuZWdhdGl2ZV9wcm9tcHQlM0RuZWdhdGl2ZV9wcm9tcHQpLmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMmNocm9tYS1pbWcyaW1nLnBuZyUyMik=",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> ChromaTransformer2DModel, ChromaImg2ImgPipeline | |
| <span class="hljs-meta">>>> </span>model_id = <span class="hljs-string">"lodestones/Chroma1-HD"</span> | |
| <span class="hljs-meta">>>> </span>ckpt_path = <span class="hljs-string">"https://huggingface.co/lodestones/Chroma1-HD/blob/main/Chroma1-HD.safetensors"</span> | |
| <span class="hljs-meta">>>> </span>pipe = ChromaImg2ImgPipeline.from_pretrained( | |
| <span class="hljs-meta">... </span> model_id, | |
| <span class="hljs-meta">... </span> transformer=transformer, | |
| <span class="hljs-meta">... </span> torch_dtype=torch.bfloat16, | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>pipe.enable_model_cpu_offload() | |
| <span class="hljs-meta">>>> </span>init_image = load_image( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg"</span> | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>prompt = <span class="hljs-string">"a scenic fastasy landscape with a river and mountains in the background, vibrant colors, detailed, high resolution"</span> | |
| <span class="hljs-meta">>>> </span>negative_prompt = <span class="hljs-string">"low quality, ugly, unfinished, out of focus, deformed, disfigure, blurry, smudged, restricted palette, flat colors"</span> | |
| <span class="hljs-meta">>>> </span>image = pipe(prompt, image=init_image, negative_prompt=negative_prompt).images[<span class="hljs-number">0</span>] | |
| <span class="hljs-meta">>>> </span>image.save(<span class="hljs-string">"chroma-img2img.png"</span>)`,wrap:!1}}),{c(){m=r("p"),m.textContent=Z,T=o(),d(u.$$.fragment)},l(i){m=l(i,"P",{"data-svelte-h":!0}),b(m)!=="svelte-kvfsh7"&&(m.textContent=Z),T=a(i),c(u.$$.fragment,i)},m(i,C){p(i,m,C),p(i,T,C),g(u,i,C),w=!0},p:pn,i(i){w||(h(u.$$.fragment,i),w=!0)},o(i){f(u.$$.fragment,i),w=!1},d(i){i&&(n(m),n(T)),_(u,i)}}}function Yn(B){let m,Z="Examples:",T,u,w;return u=new Oe({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQ2hyb21hSW5wYWludFBpcGVsaW5lJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1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cucG5nJTIyKQ==",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> ChromaInpaintPipeline | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image | |
| <span class="hljs-meta">>>> </span>pipe = ChromaInpaintPipeline.from_pretrained(<span class="hljs-string">"lodestones/Chroma1-HD"</span>, torch_dtype=torch.bfloat16) | |
| <span class="hljs-meta">>>> </span>pipe.to(<span class="hljs-string">"cuda"</span>) | |
| <span class="hljs-meta">>>> </span>prompt = <span class="hljs-string">"Face of a yellow cat, high resolution, sitting on a park bench"</span> | |
| <span class="hljs-meta">>>> </span>img_url = <span class="hljs-string">"https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png"</span> | |
| <span class="hljs-meta">>>> </span>mask_url = <span class="hljs-string">"https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png"</span> | |
| <span class="hljs-meta">>>> </span>source = load_image(img_url) | |
| <span class="hljs-meta">>>> </span>mask = load_image(mask_url) | |
| <span class="hljs-meta">>>> </span>image = pipe(prompt=prompt, image=source, mask_image=mask).images[<span class="hljs-number">0</span>] | |
| <span class="hljs-meta">>>> </span>image.save(<span class="hljs-string">"chroma_inpainting.png"</span>)`,wrap:!1}}),{c(){m=r("p"),m.textContent=Z,T=o(),d(u.$$.fragment)},l(i){m=l(i,"P",{"data-svelte-h":!0}),b(m)!=="svelte-kvfsh7"&&(m.textContent=Z),T=a(i),c(u.$$.fragment,i)},m(i,C){p(i,m,C),p(i,T,C),g(u,i,C),w=!0},p:pn,i(i){w||(h(u.$$.fragment,i),w=!0)},o(i){f(u.$$.fragment,i),w=!1},d(i){i&&(n(m),n(T)),_(u,i)}}}function Qn(B){let m,Z,T,u,w,i,C,Ke,W,mn='<img alt="LoRA" src="https://img.shields.io/badge/LoRA-d8b4fe?style=flat"/> <img alt="MPS" src="https://img.shields.io/badge/MPS-000000?style=flat&logo=apple&logoColor=white%22"/>',et,q,dn="Chroma is a text to image generation model based on Flux.",tt,S,cn="Original model checkpoints for Chroma can be found here:",nt,O,gn='<li>High-resolution finetune: <a href="https://huggingface.co/lodestones/Chroma1-HD" rel="nofollow">lodestones/Chroma1-HD</a></li> <li>Base model: <a href="https://huggingface.co/lodestones/Chroma1-Base" rel="nofollow">lodestones/Chroma1-Base</a></li> <li>Original repo with progress checkpoints: <a href="https://huggingface.co/lodestones/Chroma" rel="nofollow">lodestones/Chroma</a> (loading this repo with <code>from_pretrained</code> will load a Diffusers-compatible version of the <code>unlocked-v37</code> checkpoint)</li>',ot,N,hn="<p>Chroma can use all the same optimizations as Flux.</p>",at,K,st,ee,it,te,rt,ne,fn="To use updated model checkpoints that are not in the Diffusers format, you can use the <code>ChromaTransformer2DModel</code> class to load the model from a single file in the original format. This is also useful when trying to load finetunes or quantized versions of the models that have been published by the community.",lt,oe,_n="The following example demonstrates how to run Chroma from a single file.",pt,ae,un="Then run the following example",mt,se,dt,ie,ct,y,re,xt,ke,bn="The Chroma pipeline for text-to-image generation.",kt,Ue,yn='Reference: <a href="https://huggingface.co/lodestones/Chroma1-HD/" rel="nofollow">https://huggingface.co/lodestones/Chroma1-HD/</a>',Ut,j,le,Zt,Ze,vn="Function invoked when calling the pipeline for generation.",jt,E,Pt,V,pe,$t,je,wn=`Disable sliced VAE decoding. If <code>enable_vae_slicing</code> was previously enabled, this method will go back to | |
| computing decoding in one step.`,Gt,z,me,Lt,Pe,Mn=`Disable tiled VAE decoding. If <code>enable_vae_tiling</code> was previously enabled, this method will go back to | |
| computing decoding in one step.`,Bt,H,de,Wt,$e,In=`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to | |
| compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`,Nt,X,ce,Et,Ge,Tn=`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to | |
| compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow | |
| processing larger images.`,Vt,Le,ge,gt,he,ht,v,fe,zt,Be,Cn="The Chroma pipeline for image-to-image generation.",Ht,We,Jn='Reference: <a href="https://huggingface.co/lodestones/Chroma1-HD/" rel="nofollow">https://huggingface.co/lodestones/Chroma1-HD/</a>',Xt,P,_e,Dt,Ne,xn="Function invoked when calling the pipeline for generation.",Rt,D,Ft,R,ue,Yt,Ee,kn=`Disable sliced VAE decoding. If <code>enable_vae_slicing</code> was previously enabled, this method will go back to | |
| computing decoding in one step.`,Qt,F,be,At,Ve,Un=`Disable tiled VAE decoding. If <code>enable_vae_tiling</code> was previously enabled, this method will go back to | |
| computing decoding in one step.`,qt,Y,ye,St,ze,Zn=`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to | |
| compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`,Ot,Q,ve,Kt,He,jn=`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to | |
| compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow | |
| processing larger images.`,en,Xe,we,ft,Me,_t,U,Ie,tn,De,Pn="The Flux pipeline for image inpainting.",nn,Re,$n='Reference: <a href="https://blackforestlabs.ai/announcing-black-forest-labs/" rel="nofollow">https://blackforestlabs.ai/announcing-black-forest-labs/</a>',on,$,Te,an,Fe,Gn="Function invoked when calling the pipeline for generation.",sn,A,rn,Ye,Ce,ut,Je,bt,Se,yt;return w=new Xn({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),C=new qe({props:{title:"Chroma",local:"chroma",headingTag:"h1"}}),K=new qe({props:{title:"Inference",local:"inference",headingTag:"h2"}}),ee=new Oe({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQ2hyb21hUGlwZWxpbmUlMEEl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RlZCUyMHBhbGV0dGUlMkMlMjBmbGF0JTIwY29sb3JzJTIyJTVEJTBBJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMHByb21wdCUzRHByb21wdCUyQyUwQSUyMCUyMCUyMCUyMG5lZ2F0aXZlX3Byb21wdCUzRG5lZ2F0aXZlX3Byb21wdCUyQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRHRvcmNoLkdlbmVyYXRvciglMjJjcHUlMjIpLm1hbnVhbF9zZWVkKDQzMyklMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENDAlMkMlMEElMjAlMjAlMjAlMjBndWlkYW5jZV9zY2FsZSUzRDMuMCUyQyUwQSUyMCUyMCUyMCUyMG51bV9pbWFnZXNfcGVyX3Byb21wdCUzRDElMkMlMEEpLmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMmNocm9tYS5wbmclMjIp",highlighted:`<span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> ChromaPipeline | |
| pipe = ChromaPipeline.from_pretrained(<span class="hljs-string">"lodestones/Chroma1-HD"</span>, torch_dtype=torch.bfloat16) | |
| pipe.enable_model_cpu_offload() | |
| prompt = [ | |
| <span class="hljs-string">"A high-fashion close-up portrait of a blonde woman in clear sunglasses. The image uses a bold teal and red color split for dramatic lighting. The background is a simple teal-green. The photo is sharp and well-composed, and is designed for viewing with anaglyph 3D glasses for optimal effect. It looks professionally done."</span> | |
| ] | |
| negative_prompt = [<span class="hljs-string">"low quality, ugly, unfinished, out of focus, deformed, disfigure, blurry, smudged, restricted palette, flat colors"</span>] | |
| image = pipe( | |
| prompt=prompt, | |
| negative_prompt=negative_prompt, | |
| generator=torch.Generator(<span class="hljs-string">"cpu"</span>).manual_seed(<span class="hljs-number">433</span>), | |
| num_inference_steps=<span class="hljs-number">40</span>, | |
| guidance_scale=<span class="hljs-number">3.0</span>, | |
| num_images_per_prompt=<span class="hljs-number">1</span>, | |
| ).images[<span class="hljs-number">0</span>] | |
| image.save(<span class="hljs-string">"chroma.png"</span>)`,wrap:!1}}),te=new qe({props:{title:"Loading from a single file",local:"loading-from-a-single-file",headingTag:"h2"}}),se=new Oe({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQ2hyb21hVHJhbnNmb3JtZXIyRE1vZGVsJTJDJTIwQ2hyb21hUGlwZWxpbmUlMEElMEFtb2RlbF9pZCUyMCUzRCUyMCUyMmxvZGVzdG9uZXMlMkZDaHJvbWExLUhEJTIyJTBBZHR5cGUlMjAlM0QlMjB0b3JjaC5iZmxvYXQxNiUwQSUwQXRyYW5zZm9ybWVyJTIwJTNEJTIwQ2hyb21hVHJhbnNmb3JtZXIyRE1vZGVsLmZyb21fc2luZ2xlX2ZpbGUoJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmxvZGVzdG9uZXMlMkZDaHJvbWExLUhEJTJGYmxvYiUyRm1haW4lMkZDaHJvbWExLUhELnNhZmV0ZW5zb3JzJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0RkdHlwZSklMEElMEFwaXBlJTIwJTNEJTIwQ2hyb21hUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKG1vZGVsX2lkJTJDJTIwdHJhbnNmb3JtZXIlM0R0cmFuc2Zvcm1lciUyQyUyMHRvcmNoX2R0eXBlJTNEZHR5cGUpJTBBcGlwZS5lbmFibGVfbW9kZWxfY3B1X29mZmxvYWQoKSUwQSUwQXByb21wdCUyMCUzRCUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMkElMjBoaWdoLWZhc2hpb24lMjBjbG9zZS11cCUyMHBvcnRyYWl0JTIwb2YlMjBhJTIwYmxvbmRlJTIwd29tYW4lMjBpbiUyMGNsZWFyJTIwc3VuZ2xhc3Nlcy4lMjBUaGUlMjBpbWFnZS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c2NhbGUlM0QzLjAlMkMlMEEpLmltYWdlcyU1QjAlNUQlMEElMEFpbWFnZS5zYXZlKCUyMmNocm9tYS1zaW5nbGUtZmlsZS5wbmclMjIp",highlighted:`<span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> ChromaTransformer2DModel, ChromaPipeline | |
| model_id = <span class="hljs-string">"lodestones/Chroma1-HD"</span> | |
| dtype = torch.bfloat16 | |
| transformer = ChromaTransformer2DModel.from_single_file(<span class="hljs-string">"https://huggingface.co/lodestones/Chroma1-HD/blob/main/Chroma1-HD.safetensors"</span>, torch_dtype=dtype) | |
| pipe = ChromaPipeline.from_pretrained(model_id, transformer=transformer, torch_dtype=dtype) | |
| pipe.enable_model_cpu_offload() | |
| prompt = [ | |
| <span class="hljs-string">"A high-fashion close-up portrait of a blonde woman in clear sunglasses. The image uses a bold teal and red color split for dramatic lighting. The background is a simple teal-green. The photo is sharp and well-composed, and is designed for viewing with anaglyph 3D glasses for optimal effect. It looks professionally done."</span> | |
| ] | |
| negative_prompt = [<span class="hljs-string">"low quality, ugly, unfinished, out of focus, deformed, disfigure, blurry, smudged, restricted palette, flat colors"</span>] | |
| image = pipe( | |
| prompt=prompt, | |
| negative_prompt=negative_prompt, | |
| generator=torch.Generator(<span class="hljs-string">"cpu"</span>).manual_seed(<span class="hljs-number">433</span>), | |
| num_inference_steps=<span class="hljs-number">40</span>, | |
| guidance_scale=<span class="hljs-number">3.0</span>, | |
| ).images[<span class="hljs-number">0</span>] | |
| image.save(<span class="hljs-string">"chroma-single-file.png"</span>)`,wrap:!1}}),ie=new qe({props:{title:"ChromaPipeline",local:"diffusers.ChromaPipeline",headingTag:"h2"}}),re=new k({props:{name:"class diffusers.ChromaPipeline",anchor:"diffusers.ChromaPipeline",parameters:[{name:"scheduler",val:": FlowMatchEulerDiscreteScheduler"},{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": T5EncoderModel"},{name:"tokenizer",val:": T5TokenizerFast"},{name:"transformer",val:": ChromaTransformer2DModel"},{name:"image_encoder",val:": CLIPVisionModelWithProjection = None"},{name:"feature_extractor",val:": CLIPImageProcessor = None"}],parametersDescription:[{anchor:"diffusers.ChromaPipeline.transformer",description:`<strong>transformer</strong> (<a href="/docs/diffusers/pr_12249/en/api/models/chroma_transformer#diffusers.ChromaTransformer2DModel">ChromaTransformer2DModel</a>) — | |
| Conditional Transformer (MMDiT) architecture to denoise the encoded image latents.`,name:"transformer"},{anchor:"diffusers.ChromaPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/pr_12249/en/api/schedulers/flow_match_euler_discrete#diffusers.FlowMatchEulerDiscreteScheduler">FlowMatchEulerDiscreteScheduler</a>) — | |
| A scheduler to be used in combination with <code>transformer</code> to denoise the encoded image latents.`,name:"scheduler"},{anchor:"diffusers.ChromaPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/pr_12249/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) — | |
| Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representation`,name:"vae"},{anchor:"diffusers.ChromaPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>T5EncoderModel</code>) — | |
| <a href="https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5EncoderModel" rel="nofollow">T5</a>, specifically | |
| the <a href="https://huggingface.co/google/t5-v1_1-xxl" rel="nofollow">google/t5-v1_1-xxl</a> variant.`,name:"text_encoder"},{anchor:"diffusers.ChromaPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>T5TokenizerFast</code>) — | |
| Second Tokenizer of class | |
| <a href="https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5TokenizerFast" rel="nofollow">T5TokenizerFast</a>.`,name:"tokenizer"}],source:"https://github.com/huggingface/diffusers/blob/vr_12249/src/diffusers/pipelines/chroma/pipeline_chroma.py#L151"}}),le=new k({props:{name:"__call__",anchor:"diffusers.ChromaPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 35"},{name:"sigmas",val:": typing.Optional[typing.List[float]] = None"},{name:"guidance_scale",val:": float = 5.0"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.Tensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"ip_adapter_image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.Tensor], NoneType] = None"},{name:"ip_adapter_image_embeds",val:": typing.Optional[typing.List[torch.Tensor]] = None"},{name:"negative_ip_adapter_image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.Tensor], NoneType] = None"},{name:"negative_ip_adapter_image_embeds",val:": typing.Optional[typing.List[torch.Tensor]] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"prompt_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_prompt_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"joint_attention_kwargs",val:": typing.Optional[typing.Dict[str, typing.Any]] = None"},{name:"callback_on_step_end",val:": typing.Optional[typing.Callable[[int, int, typing.Dict], NoneType]] = None"},{name:"callback_on_step_end_tensor_inputs",val:": typing.List[str] = ['latents']"},{name:"max_sequence_length",val:": int = 512"}],parametersDescription:[{anchor:"diffusers.ChromaPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) — | |
| The prompt or prompts to guide the image generation. If not defined, one has to pass <code>prompt_embeds</code>. | |
| instead.`,name:"prompt"},{anchor:"diffusers.ChromaPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) — | |
| The prompt or prompts not to guide the image generation. If not defined, one has to pass | |
| <code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is | |
| not greater than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.ChromaPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) — | |
| The height in pixels of the generated image. This is set to 1024 by default for the best results.`,name:"height"},{anchor:"diffusers.ChromaPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) — | |
| The width in pixels of the generated image. This is set to 1024 by default for the best results.`,name:"width"},{anchor:"diffusers.ChromaPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) — | |
| The number of denoising steps. More denoising steps usually lead to a higher quality image at the | |
| expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.ChromaPipeline.__call__.sigmas",description:`<strong>sigmas</strong> (<code>List[float]</code>, <em>optional</em>) — | |
| Custom sigmas to use for the denoising process with schedulers which support a <code>sigmas</code> argument in | |
| their <code>set_timesteps</code> method. If not defined, the default behavior when <code>num_inference_steps</code> is passed | |
| will be used.`,name:"sigmas"},{anchor:"diffusers.ChromaPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 3.5) — | |
| Guidance scale as defined in <a href="https://huggingface.co/papers/2207.12598" rel="nofollow">Classifier-Free Diffusion | |
| Guidance</a>. <code>guidance_scale</code> is defined as <code>w</code> of equation 2. | |
| of <a href="https://huggingface.co/papers/2205.11487" rel="nofollow">Imagen Paper</a>. Guidance scale is enabled by setting | |
| <code>guidance_scale > 1</code>. Higher guidance scale encourages to generate images that are closely linked to | |
| the text <code>prompt</code>, usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.ChromaPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — | |
| The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.ChromaPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) — | |
| One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a> | |
| to make generation deterministic.`,name:"generator"},{anchor:"diffusers.ChromaPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image | |
| generation. Can be used to tweak the same generation with different prompts. If not provided, a latents | |
| tensor will be generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.ChromaPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not | |
| provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.ChromaPipeline.__call__.ip_adapter_image",description:"<strong>ip_adapter_image</strong> — (<code>PipelineImageInput</code>, <em>optional</em>): Optional image input to work with IP Adapters.",name:"ip_adapter_image"},{anchor:"diffusers.ChromaPipeline.__call__.ip_adapter_image_embeds",description:`<strong>ip_adapter_image_embeds</strong> (<code>List[torch.Tensor]</code>, <em>optional</em>) — | |
| Pre-generated image embeddings for IP-Adapter. It should be a list of length same as number of | |
| IP-adapters. Each element should be a tensor of shape <code>(batch_size, num_images, emb_dim)</code>. If not | |
| provided, embeddings are computed from the <code>ip_adapter_image</code> input argument.`,name:"ip_adapter_image_embeds"},{anchor:"diffusers.ChromaPipeline.__call__.negative_ip_adapter_image",description:`<strong>negative_ip_adapter_image</strong> — | |
| (<code>PipelineImageInput</code>, <em>optional</em>): Optional image input to work with IP Adapters.`,name:"negative_ip_adapter_image"},{anchor:"diffusers.ChromaPipeline.__call__.negative_ip_adapter_image_embeds",description:`<strong>negative_ip_adapter_image_embeds</strong> (<code>List[torch.Tensor]</code>, <em>optional</em>) — | |
| Pre-generated image embeddings for IP-Adapter. It should be a list of length same as number of | |
| IP-adapters. Each element should be a tensor of shape <code>(batch_size, num_images, emb_dim)</code>. If not | |
| provided, embeddings are computed from the <code>ip_adapter_image</code> input argument.`,name:"negative_ip_adapter_image_embeds"},{anchor:"diffusers.ChromaPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt | |
| weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input | |
| argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.ChromaPipeline.__call__.prompt_attention_mask",description:`<strong>prompt_attention_mask</strong> (torch.Tensor, <em>optional</em>) — | |
| Attention mask for the prompt embeddings. Used to mask out padding tokens in the prompt sequence. | |
| Chroma requires a single padding token remain unmasked. Please refer to | |
| <a href="https://huggingface.co/lodestones/Chroma#tldr-masking-t5-padding-tokens-enhanced-fidelity-and-increased-stability-during-training" rel="nofollow">https://huggingface.co/lodestones/Chroma#tldr-masking-t5-padding-tokens-enhanced-fidelity-and-increased-stability-during-training</a>`,name:"prompt_attention_mask"},{anchor:"diffusers.ChromaPipeline.__call__.negative_prompt_attention_mask",description:`<strong>negative_prompt_attention_mask</strong> (torch.Tensor, <em>optional</em>) — | |
| Attention mask for the negative prompt embeddings. Used to mask out padding tokens in the negative | |
| prompt sequence. Chroma requires a single padding token remain unmasked. PLease refer to | |
| <a href="https://huggingface.co/lodestones/Chroma#tldr-masking-t5-padding-tokens-enhanced-fidelity-and-increased-stability-during-training" rel="nofollow">https://huggingface.co/lodestones/Chroma#tldr-masking-t5-padding-tokens-enhanced-fidelity-and-increased-stability-during-training</a>`,name:"negative_prompt_attention_mask"},{anchor:"diffusers.ChromaPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"pil"</code>) — | |
| The output format of the generate image. Choose between | |
| <a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.ChromaPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether or not to return a <code>~pipelines.flux.ChromaPipelineOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.ChromaPipeline.__call__.joint_attention_kwargs",description:`<strong>joint_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) — | |
| A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined under | |
| <code>self.processor</code> in | |
| <a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow">diffusers.models.attention_processor</a>.`,name:"joint_attention_kwargs"},{anchor:"diffusers.ChromaPipeline.__call__.callback_on_step_end",description:`<strong>callback_on_step_end</strong> (<code>Callable</code>, <em>optional</em>) — | |
| A function that calls at the end of each denoising steps during the inference. The function is called | |
| with the following arguments: <code>callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict)</code>. <code>callback_kwargs</code> will include a list of all tensors as specified by | |
| <code>callback_on_step_end_tensor_inputs</code>.`,name:"callback_on_step_end"},{anchor:"diffusers.ChromaPipeline.__call__.callback_on_step_end_tensor_inputs",description:`<strong>callback_on_step_end_tensor_inputs</strong> (<code>List</code>, <em>optional</em>) — | |
| The list of tensor inputs for the <code>callback_on_step_end</code> function. The tensors specified in the list | |
| will be passed as <code>callback_kwargs</code> argument. You will only be able to include variables listed in the | |
| <code>._callback_tensor_inputs</code> attribute of your pipeline class.`,name:"callback_on_step_end_tensor_inputs"},{anchor:"diffusers.ChromaPipeline.__call__.max_sequence_length",description:"<strong>max_sequence_length</strong> (<code>int</code> defaults to 512) — Maximum sequence length to use with the <code>prompt</code>.",name:"max_sequence_length"}],source:"https://github.com/huggingface/diffusers/blob/vr_12249/src/diffusers/pipelines/chroma/pipeline_chroma.py#L641",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>~pipelines.chroma.ChromaPipelineOutput</code> if | |
| <code>return_dict</code> is True, otherwise a <code>tuple</code>. When returning a tuple, the first element is a list with the | |
| generated images.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>~pipelines.chroma.ChromaPipelineOutput</code> or <code>tuple</code></p> | |
| `}}),E=new ln({props:{anchor:"diffusers.ChromaPipeline.__call__.example",$$slots:{default:[Rn]},$$scope:{ctx:B}}}),pe=new k({props:{name:"disable_vae_slicing",anchor:"diffusers.ChromaPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_12249/src/diffusers/pipelines/chroma/pipeline_chroma.py#L523"}}),me=new k({props:{name:"disable_vae_tiling",anchor:"diffusers.ChromaPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_12249/src/diffusers/pipelines/chroma/pipeline_chroma.py#L550"}}),de=new k({props:{name:"enable_vae_slicing",anchor:"diffusers.ChromaPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_12249/src/diffusers/pipelines/chroma/pipeline_chroma.py#L510"}}),ce=new k({props:{name:"enable_vae_tiling",anchor:"diffusers.ChromaPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_12249/src/diffusers/pipelines/chroma/pipeline_chroma.py#L536"}}),ge=new k({props:{name:"encode_prompt",anchor:"diffusers.ChromaPipeline.encode_prompt",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]]"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"device",val:": typing.Optional[torch.device] = None"},{name:"num_images_per_prompt",val:": int = 1"},{name:"prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"prompt_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_prompt_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"do_classifier_free_guidance",val:": bool = True"},{name:"max_sequence_length",val:": int = 512"},{name:"lora_scale",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"diffusers.ChromaPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) — | |
| prompt to be encoded`,name:"prompt"},{anchor:"diffusers.ChromaPipeline.encode_prompt.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) — | |
| The prompt not to guide the image generation. If not defined, one has to pass <code>negative_prompt_embeds</code> | |
| instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.ChromaPipeline.encode_prompt.device",description:`<strong>device</strong> — (<code>torch.device</code>): | |
| torch device`,name:"device"},{anchor:"diffusers.ChromaPipeline.encode_prompt.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>) — | |
| number of images that should be generated per prompt`,name:"num_images_per_prompt"},{anchor:"diffusers.ChromaPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not | |
| provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.ChromaPipeline.encode_prompt.lora_scale",description:`<strong>lora_scale</strong> (<code>float</code>, <em>optional</em>) — | |
| A lora scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded.`,name:"lora_scale"}],source:"https://github.com/huggingface/diffusers/blob/vr_12249/src/diffusers/pipelines/chroma/pipeline_chroma.py#L265"}}),he=new qe({props:{title:"ChromaImg2ImgPipeline",local:"diffusers.ChromaImg2ImgPipeline",headingTag:"h2"}}),fe=new k({props:{name:"class diffusers.ChromaImg2ImgPipeline",anchor:"diffusers.ChromaImg2ImgPipeline",parameters:[{name:"scheduler",val:": FlowMatchEulerDiscreteScheduler"},{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": T5EncoderModel"},{name:"tokenizer",val:": T5TokenizerFast"},{name:"transformer",val:": ChromaTransformer2DModel"},{name:"image_encoder",val:": CLIPVisionModelWithProjection = None"},{name:"feature_extractor",val:": CLIPImageProcessor = None"}],parametersDescription:[{anchor:"diffusers.ChromaImg2ImgPipeline.transformer",description:`<strong>transformer</strong> (<a href="/docs/diffusers/pr_12249/en/api/models/chroma_transformer#diffusers.ChromaTransformer2DModel">ChromaTransformer2DModel</a>) — | |
| Conditional Transformer (MMDiT) architecture to denoise the encoded image latents.`,name:"transformer"},{anchor:"diffusers.ChromaImg2ImgPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/pr_12249/en/api/schedulers/flow_match_euler_discrete#diffusers.FlowMatchEulerDiscreteScheduler">FlowMatchEulerDiscreteScheduler</a>) — | |
| A scheduler to be used in combination with <code>transformer</code> to denoise the encoded image latents.`,name:"scheduler"},{anchor:"diffusers.ChromaImg2ImgPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/pr_12249/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) — | |
| Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representation`,name:"vae"},{anchor:"diffusers.ChromaImg2ImgPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>T5EncoderModel</code>) — | |
| <a href="https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5EncoderModel" rel="nofollow">T5</a>, specifically | |
| the <a href="https://huggingface.co/google/t5-v1_1-xxl" rel="nofollow">google/t5-v1_1-xxl</a> variant.`,name:"text_encoder"},{anchor:"diffusers.ChromaImg2ImgPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>T5TokenizerFast</code>) — | |
| Second Tokenizer of class | |
| <a href="https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5TokenizerFast" rel="nofollow">T5TokenizerFast</a>.`,name:"tokenizer"}],source:"https://github.com/huggingface/diffusers/blob/vr_12249/src/diffusers/pipelines/chroma/pipeline_chroma_img2img.py#L163"}}),_e=new k({props:{name:"__call__",anchor:"diffusers.ChromaImg2ImgPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.Tensor]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 35"},{name:"sigmas",val:": typing.Optional[typing.List[float]] = None"},{name:"guidance_scale",val:": float = 5.0"},{name:"strength",val:": float = 0.9"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.Tensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"ip_adapter_image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.Tensor], NoneType] = None"},{name:"ip_adapter_image_embeds",val:": typing.Optional[typing.List[torch.Tensor]] = None"},{name:"negative_ip_adapter_image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.Tensor], NoneType] = None"},{name:"negative_ip_adapter_image_embeds",val:": typing.Optional[typing.List[torch.Tensor]] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"prompt_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_prompt_attention_mask",val:": typing.Optional[<built-in method tensor of type object at 0x7fcf06f836a0>] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"joint_attention_kwargs",val:": typing.Optional[typing.Dict[str, typing.Any]] = None"},{name:"callback_on_step_end",val:": typing.Optional[typing.Callable[[int, int, typing.Dict], NoneType]] = None"},{name:"callback_on_step_end_tensor_inputs",val:": typing.List[str] = ['latents']"},{name:"max_sequence_length",val:": int = 512"}],parametersDescription:[{anchor:"diffusers.ChromaImg2ImgPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) — | |
| The prompt or prompts to guide the image generation. If not defined, one has to pass <code>prompt_embeds</code>. | |
| instead.`,name:"prompt"},{anchor:"diffusers.ChromaImg2ImgPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) — | |
| The prompt or prompts not to guide the image generation. If not defined, one has to pass | |
| <code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is | |
| not greater than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.ChromaImg2ImgPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) — | |
| The height in pixels of the generated image. This is set to 1024 by default for the best results.`,name:"height"},{anchor:"diffusers.ChromaImg2ImgPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) — | |
| The width in pixels of the generated image. This is set to 1024 by default for the best results.`,name:"width"},{anchor:"diffusers.ChromaImg2ImgPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 35) — | |
| The number of denoising steps. More denoising steps usually lead to a higher quality image at the | |
| expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.ChromaImg2ImgPipeline.__call__.sigmas",description:`<strong>sigmas</strong> (<code>List[float]</code>, <em>optional</em>) — | |
| Custom sigmas to use for the denoising process with schedulers which support a <code>sigmas</code> argument in | |
| their <code>set_timesteps</code> method. If not defined, the default behavior when <code>num_inference_steps</code> is passed | |
| will be used.`,name:"sigmas"},{anchor:"diffusers.ChromaImg2ImgPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 3.5) — | |
| Guidance scale as defined in <a href="https://huggingface.co/papers/2207.12598" rel="nofollow">Classifier-Free Diffusion | |
| Guidance</a>. <code>guidance_scale</code> is defined as <code>w</code> of equation 2. | |
| of <a href="https://huggingface.co/papers/2205.11487" rel="nofollow">Imagen Paper</a>. Guidance scale is enabled by setting | |
| <code>guidance_scale > 1</code>. Higher guidance scale encourages to generate images that are closely linked to | |
| the text <code>prompt</code>, usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.ChromaImg2ImgPipeline.__call__.strength",description:`<strong>strength</strong> (\`float, <em>optional</em>, defaults to 0.9) — | |
| Conceptually, indicates how much to transform the reference image. Must be between 0 and 1. image will | |
| be used as a starting point, adding more noise to it the larger the strength. The number of denoising | |
| steps depends on the amount of noise initially added. When strength is 1, added noise will be maximum | |
| and the denoising process will run for the full number of iterations specified in num_inference_steps. | |
| A value of 1, therefore, essentially ignores image.`,name:"strength"},{anchor:"diffusers.ChromaImg2ImgPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — | |
| The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.ChromaImg2ImgPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) — | |
| One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a> | |
| to make generation deterministic.`,name:"generator"},{anchor:"diffusers.ChromaImg2ImgPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image | |
| generation. Can be used to tweak the same generation with different prompts. If not provided, a latents | |
| tensor will be generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.ChromaImg2ImgPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not | |
| provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.ChromaImg2ImgPipeline.__call__.ip_adapter_image",description:"<strong>ip_adapter_image</strong> — (<code>PipelineImageInput</code>, <em>optional</em>): Optional image input to work with IP Adapters.",name:"ip_adapter_image"},{anchor:"diffusers.ChromaImg2ImgPipeline.__call__.ip_adapter_image_embeds",description:`<strong>ip_adapter_image_embeds</strong> (<code>List[torch.Tensor]</code>, <em>optional</em>) — | |
| Pre-generated image embeddings for IP-Adapter. It should be a list of length same as number of | |
| IP-adapters. Each element should be a tensor of shape <code>(batch_size, num_images, emb_dim)</code>. If not | |
| provided, embeddings are computed from the <code>ip_adapter_image</code> input argument.`,name:"ip_adapter_image_embeds"},{anchor:"diffusers.ChromaImg2ImgPipeline.__call__.negative_ip_adapter_image",description:`<strong>negative_ip_adapter_image</strong> — | |
| (<code>PipelineImageInput</code>, <em>optional</em>): Optional image input to work with IP Adapters.`,name:"negative_ip_adapter_image"},{anchor:"diffusers.ChromaImg2ImgPipeline.__call__.negative_ip_adapter_image_embeds",description:`<strong>negative_ip_adapter_image_embeds</strong> (<code>List[torch.Tensor]</code>, <em>optional</em>) — | |
| Pre-generated image embeddings for IP-Adapter. It should be a list of length same as number of | |
| IP-adapters. Each element should be a tensor of shape <code>(batch_size, num_images, emb_dim)</code>. If not | |
| provided, embeddings are computed from the <code>ip_adapter_image</code> input argument.`,name:"negative_ip_adapter_image_embeds"},{anchor:"diffusers.ChromaImg2ImgPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt | |
| weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input | |
| argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.ChromaImg2ImgPipeline.__call__.prompt_attention_mask",description:`<strong>prompt_attention_mask</strong> (torch.Tensor, <em>optional</em>) — | |
| Attention mask for the prompt embeddings. Used to mask out padding tokens in the prompt sequence. | |
| Chroma requires a single padding token remain unmasked. Please refer to | |
| <a href="https://huggingface.co/lodestones/Chroma#tldr-masking-t5-padding-tokens-enhanced-fidelity-and-increased-stability-during-training" rel="nofollow">https://huggingface.co/lodestones/Chroma#tldr-masking-t5-padding-tokens-enhanced-fidelity-and-increased-stability-during-training</a>`,name:"prompt_attention_mask"},{anchor:"diffusers.ChromaImg2ImgPipeline.__call__.negative_prompt_attention_mask",description:`<strong>negative_prompt_attention_mask</strong> (torch.Tensor, <em>optional</em>) — | |
| Attention mask for the negative prompt embeddings. Used to mask out padding tokens in the negative | |
| prompt sequence. Chroma requires a single padding token remain unmasked. PLease refer to | |
| <a href="https://huggingface.co/lodestones/Chroma#tldr-masking-t5-padding-tokens-enhanced-fidelity-and-increased-stability-during-training" rel="nofollow">https://huggingface.co/lodestones/Chroma#tldr-masking-t5-padding-tokens-enhanced-fidelity-and-increased-stability-during-training</a>`,name:"negative_prompt_attention_mask"},{anchor:"diffusers.ChromaImg2ImgPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"pil"</code>) — | |
| The output format of the generate image. Choose between | |
| <a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.ChromaImg2ImgPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether or not to return a <code>~pipelines.flux.ChromaPipelineOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.ChromaImg2ImgPipeline.__call__.joint_attention_kwargs",description:`<strong>joint_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) — | |
| A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined under | |
| <code>self.processor</code> in | |
| <a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow">diffusers.models.attention_processor</a>.`,name:"joint_attention_kwargs"},{anchor:"diffusers.ChromaImg2ImgPipeline.__call__.callback_on_step_end",description:`<strong>callback_on_step_end</strong> (<code>Callable</code>, <em>optional</em>) — | |
| A function that calls at the end of each denoising steps during the inference. The function is called | |
| with the following arguments: <code>callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict)</code>. <code>callback_kwargs</code> will include a list of all tensors as specified by | |
| <code>callback_on_step_end_tensor_inputs</code>.`,name:"callback_on_step_end"},{anchor:"diffusers.ChromaImg2ImgPipeline.__call__.callback_on_step_end_tensor_inputs",description:`<strong>callback_on_step_end_tensor_inputs</strong> (<code>List</code>, <em>optional</em>) — | |
| The list of tensor inputs for the <code>callback_on_step_end</code> function. The tensors specified in the list | |
| will be passed as <code>callback_kwargs</code> argument. You will only be able to include variables listed in the | |
| <code>._callback_tensor_inputs</code> attribute of your pipeline class.`,name:"callback_on_step_end_tensor_inputs"},{anchor:"diffusers.ChromaImg2ImgPipeline.__call__.max_sequence_length",description:"<strong>max_sequence_length</strong> (<code>int</code> defaults to 512) — Maximum sequence length to use with the <code>prompt</code>.",name:"max_sequence_length"}],source:"https://github.com/huggingface/diffusers/blob/vr_12249/src/diffusers/pipelines/chroma/pipeline_chroma_img2img.py#L700",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>~pipelines.chroma.ChromaPipelineOutput</code> if | |
| <code>return_dict</code> is True, otherwise a <code>tuple</code>. When returning a tuple, the first element is a list with the | |
| generated images.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>~pipelines.chroma.ChromaPipelineOutput</code> or <code>tuple</code></p> | |
| `}}),D=new ln({props:{anchor:"diffusers.ChromaImg2ImgPipeline.__call__.example",$$slots:{default:[Fn]},$$scope:{ctx:B}}}),ue=new k({props:{name:"disable_vae_slicing",anchor:"diffusers.ChromaImg2ImgPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_12249/src/diffusers/pipelines/chroma/pipeline_chroma_img2img.py#L555"}}),be=new k({props:{name:"disable_vae_tiling",anchor:"diffusers.ChromaImg2ImgPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_12249/src/diffusers/pipelines/chroma/pipeline_chroma_img2img.py#L582"}}),ye=new k({props:{name:"enable_vae_slicing",anchor:"diffusers.ChromaImg2ImgPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_12249/src/diffusers/pipelines/chroma/pipeline_chroma_img2img.py#L542"}}),ve=new k({props:{name:"enable_vae_tiling",anchor:"diffusers.ChromaImg2ImgPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_12249/src/diffusers/pipelines/chroma/pipeline_chroma_img2img.py#L568"}}),we=new k({props:{name:"encode_prompt",anchor:"diffusers.ChromaImg2ImgPipeline.encode_prompt",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]]"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"device",val:": typing.Optional[torch.device] = None"},{name:"num_images_per_prompt",val:": int = 1"},{name:"prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"prompt_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_prompt_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"do_classifier_free_guidance",val:": bool = True"},{name:"max_sequence_length",val:": int = 512"},{name:"lora_scale",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"diffusers.ChromaImg2ImgPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) — | |
| prompt to be encoded`,name:"prompt"},{anchor:"diffusers.ChromaImg2ImgPipeline.encode_prompt.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) — | |
| The prompt not to guide the image generation. If not defined, one has to pass <code>negative_prompt_embeds</code> | |
| instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.ChromaImg2ImgPipeline.encode_prompt.device",description:`<strong>device</strong> — (<code>torch.device</code>): | |
| torch device`,name:"device"},{anchor:"diffusers.ChromaImg2ImgPipeline.encode_prompt.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>) — | |
| number of images that should be generated per prompt`,name:"num_images_per_prompt"},{anchor:"diffusers.ChromaImg2ImgPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not | |
| provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.ChromaImg2ImgPipeline.encode_prompt.lora_scale",description:`<strong>lora_scale</strong> (<code>float</code>, <em>optional</em>) — | |
| A lora scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded.`,name:"lora_scale"}],source:"https://github.com/huggingface/diffusers/blob/vr_12249/src/diffusers/pipelines/chroma/pipeline_chroma_img2img.py#L292"}}),Me=new qe({props:{title:"ChromaInpaintPipeline",local:"diffusers.ChromaInpaintPipeline",headingTag:"h2"}}),Ie=new k({props:{name:"class diffusers.ChromaInpaintPipeline",anchor:"diffusers.ChromaInpaintPipeline",parameters:[{name:"scheduler",val:": FlowMatchEulerDiscreteScheduler"},{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": T5EncoderModel"},{name:"tokenizer",val:": T5TokenizerFast"},{name:"transformer",val:": ChromaTransformer2DModel"},{name:"image_encoder",val:": CLIPVisionModelWithProjection = None"},{name:"feature_extractor",val:": CLIPImageProcessor = None"}],parametersDescription:[{anchor:"diffusers.ChromaInpaintPipeline.transformer",description:`<strong>transformer</strong> (<a href="/docs/diffusers/pr_12249/en/api/models/chroma_transformer#diffusers.ChromaTransformer2DModel">ChromaTransformer2DModel</a>) — | |
| Conditional Transformer (MMDiT) architecture to denoise the encoded image latents.`,name:"transformer"},{anchor:"diffusers.ChromaInpaintPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/pr_12249/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>) — | |
| A scheduler to be used in combination with <code>transformer</code> to denoise the encoded image latents.`,name:"scheduler"},{anchor:"diffusers.ChromaInpaintPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/pr_12249/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) — | |
| Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.ChromaInpaintPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) — | |
| <a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically | |
| the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.ChromaInpaintPipeline.text_encoder_2",description:`<strong>text_encoder_2</strong> (<code>T5EncoderModel</code>) — | |
| <a href="https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5EncoderModel" rel="nofollow">T5</a>, specifically | |
| the <a href="https://huggingface.co/google/t5-v1_1-xxl" rel="nofollow">google/t5-v1_1-xxl</a> variant.`,name:"text_encoder_2"},{anchor:"diffusers.ChromaInpaintPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) — | |
| Tokenizer of class | |
| <a href="https://huggingface.co/docs/transformers/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.ChromaInpaintPipeline.tokenizer_2",description:`<strong>tokenizer_2</strong> (<code>T5TokenizerFast</code>) — | |
| Second Tokenizer of class | |
| <a href="https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5TokenizerFast" rel="nofollow">T5TokenizerFast</a>.`,name:"tokenizer_2"}],source:"https://github.com/huggingface/diffusers/blob/vr_12249/src/diffusers/pipelines/chroma/pipeline_chroma_inpainting.py#L169"}}),Te=new k({props:{name:"__call__",anchor:"diffusers.ChromaInpaintPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"true_cfg_scale",val:": float = 1.0"},{name:"image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.Tensor]] = None"},{name:"mask_image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.Tensor]] = None"},{name:"masked_image_latents",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.Tensor]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"padding_mask_crop",val:": typing.Optional[int] = None"},{name:"strength",val:": float = 0.6"},{name:"num_inference_steps",val:": int = 28"},{name:"sigmas",val:": typing.Optional[typing.List[float]] = None"},{name:"guidance_scale",val:": float = 7.0"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pooled_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"ip_adapter_image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.Tensor], NoneType] = None"},{name:"ip_adapter_image_embeds",val:": typing.Optional[typing.List[torch.Tensor]] = None"},{name:"negative_ip_adapter_image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.Tensor], NoneType] = None"},{name:"negative_ip_adapter_image_embeds",val:": typing.Optional[typing.List[torch.Tensor]] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_pooled_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"joint_attention_kwargs",val:": typing.Optional[typing.Dict[str, typing.Any]] = None"},{name:"callback_on_step_end",val:": typing.Optional[typing.Callable[[int, int, typing.Dict], NoneType]] = None"},{name:"callback_on_step_end_tensor_inputs",val:": typing.List[str] = ['latents']"},{name:"max_sequence_length",val:": int = 256"},{name:"prompt_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_prompt_attention_mask",val:": typing.Optional[torch.Tensor] = None"}],parametersDescription:[{anchor:"diffusers.ChromaInpaintPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) — | |
| The prompt or prompts to guide the image generation. If not defined, one has to pass <code>prompt_embeds</code>. | |
| instead.`,name:"prompt"},{anchor:"diffusers.ChromaInpaintPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) — | |
| The prompt or prompts not to guide the image generation. If not defined, one has to pass | |
| <code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is | |
| not greater than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.ChromaInpaintPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) — | |
| The height in pixels of the generated image. This is set to 1024 by default for the best results.`,name:"height"},{anchor:"diffusers.ChromaInpaintPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) — | |
| The width in pixels of the generated image. This is set to 1024 by default for the best results.`,name:"width"},{anchor:"diffusers.ChromaInpaintPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 35) — | |
| The number of denoising steps. More denoising steps usually lead to a higher quality image at the | |
| expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.ChromaInpaintPipeline.__call__.sigmas",description:`<strong>sigmas</strong> (<code>List[float]</code>, <em>optional</em>) — | |
| Custom sigmas to use for the denoising process with schedulers which support a <code>sigmas</code> argument in | |
| their <code>set_timesteps</code> method. If not defined, the default behavior when <code>num_inference_steps</code> is passed | |
| will be used.`,name:"sigmas"},{anchor:"diffusers.ChromaInpaintPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 3.5) — | |
| Guidance scale as defined in <a href="https://huggingface.co/papers/2207.12598" rel="nofollow">Classifier-Free Diffusion | |
| Guidance</a>. <code>guidance_scale</code> is defined as <code>w</code> of equation 2. | |
| of <a href="https://huggingface.co/papers/2205.11487" rel="nofollow">Imagen Paper</a>. Guidance scale is enabled by setting | |
| <code>guidance_scale > 1</code>. Higher guidance scale encourages to generate images that are closely linked to | |
| the text <code>prompt</code>, usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.ChromaInpaintPipeline.__call__.strength",description:`<strong>strength</strong> (\`float, <em>optional</em>, defaults to 0.9) — | |
| Conceptually, indicates how much to transform the reference image. Must be between 0 and 1. image will | |
| be used as a starting point, adding more noise to it the larger the strength. The number of denoising | |
| steps depends on the amount of noise initially added. When strength is 1, added noise will be maximum | |
| and the denoising process will run for the full number of iterations specified in num_inference_steps. | |
| A value of 1, therefore, essentially ignores image.`,name:"strength"},{anchor:"diffusers.ChromaInpaintPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — | |
| The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.ChromaInpaintPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) — | |
| One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a> | |
| to make generation deterministic.`,name:"generator"},{anchor:"diffusers.ChromaInpaintPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image | |
| generation. Can be used to tweak the same generation with different prompts. If not provided, a latents | |
| tensor will be generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.ChromaInpaintPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not | |
| provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.ChromaInpaintPipeline.__call__.ip_adapter_image",description:"<strong>ip_adapter_image</strong> — (<code>PipelineImageInput</code>, <em>optional</em>): Optional image input to work with IP Adapters.",name:"ip_adapter_image"},{anchor:"diffusers.ChromaInpaintPipeline.__call__.ip_adapter_image_embeds",description:`<strong>ip_adapter_image_embeds</strong> (<code>List[torch.Tensor]</code>, <em>optional</em>) — | |
| Pre-generated image embeddings for IP-Adapter. It should be a list of length same as number of | |
| IP-adapters. Each element should be a tensor of shape <code>(batch_size, num_images, emb_dim)</code>. If not | |
| provided, embeddings are computed from the <code>ip_adapter_image</code> input argument.`,name:"ip_adapter_image_embeds"},{anchor:"diffusers.ChromaInpaintPipeline.__call__.negative_ip_adapter_image",description:`<strong>negative_ip_adapter_image</strong> — | |
| (<code>PipelineImageInput</code>, <em>optional</em>): Optional image input to work with IP Adapters.`,name:"negative_ip_adapter_image"},{anchor:"diffusers.ChromaInpaintPipeline.__call__.negative_ip_adapter_image_embeds",description:`<strong>negative_ip_adapter_image_embeds</strong> (<code>List[torch.Tensor]</code>, <em>optional</em>) — | |
| Pre-generated image embeddings for IP-Adapter. It should be a list of length same as number of | |
| IP-adapters. Each element should be a tensor of shape <code>(batch_size, num_images, emb_dim)</code>. If not | |
| provided, embeddings are computed from the <code>ip_adapter_image</code> input argument.`,name:"negative_ip_adapter_image_embeds"},{anchor:"diffusers.ChromaInpaintPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt | |
| weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input | |
| argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.ChromaInpaintPipeline.__call__.prompt_attention_mask",description:`<strong>prompt_attention_mask</strong> (torch.Tensor, <em>optional</em>) — | |
| Attention mask for the prompt embeddings. Used to mask out padding tokens in the prompt sequence. | |
| Chroma requires a single padding token remain unmasked. Please refer to | |
| <a href="https://huggingface.co/lodestones/Chroma#tldr-masking-t5-padding-tokens-enhanced-fidelity-and-increased-stability-during-training" rel="nofollow">https://huggingface.co/lodestones/Chroma#tldr-masking-t5-padding-tokens-enhanced-fidelity-and-increased-stability-during-training</a>`,name:"prompt_attention_mask"},{anchor:"diffusers.ChromaInpaintPipeline.__call__.negative_prompt_attention_mask",description:`<strong>negative_prompt_attention_mask</strong> (torch.Tensor, <em>optional</em>) — | |
| Attention mask for the negative prompt embeddings. Used to mask out padding tokens in the negative | |
| prompt sequence. Chroma requires a single padding token remain unmasked. PLease refer to | |
| <a href="https://huggingface.co/lodestones/Chroma#tldr-masking-t5-padding-tokens-enhanced-fidelity-and-increased-stability-during-training" rel="nofollow">https://huggingface.co/lodestones/Chroma#tldr-masking-t5-padding-tokens-enhanced-fidelity-and-increased-stability-during-training</a>`,name:"negative_prompt_attention_mask"},{anchor:"diffusers.ChromaInpaintPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"pil"</code>) — | |
| The output format of the generate image. Choose between | |
| <a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.ChromaInpaintPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether or not to return a <code>~pipelines.chroma.ChromaPipelineOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.ChromaInpaintPipeline.__call__.joint_attention_kwargs",description:`<strong>joint_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) — | |
| A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined under | |
| <code>self.processor</code> in | |
| <a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow">diffusers.models.attention_processor</a>.`,name:"joint_attention_kwargs"},{anchor:"diffusers.ChromaInpaintPipeline.__call__.callback_on_step_end",description:`<strong>callback_on_step_end</strong> (<code>Callable</code>, <em>optional</em>) — | |
| A function that calls at the end of each denoising steps during the inference. The function is called | |
| with the following arguments: <code>callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict)</code>. <code>callback_kwargs</code> will include a list of all tensors as specified by | |
| <code>callback_on_step_end_tensor_inputs</code>.`,name:"callback_on_step_end"},{anchor:"diffusers.ChromaInpaintPipeline.__call__.callback_on_step_end_tensor_inputs",description:`<strong>callback_on_step_end_tensor_inputs</strong> (<code>List</code>, <em>optional</em>) — | |
| The list of tensor inputs for the <code>callback_on_step_end</code> function. The tensors specified in the list | |
| will be passed as <code>callback_kwargs</code> argument. You will only be able to include variables listed in the | |
| <code>._callback_tensor_inputs</code> attribute of your pipeline class.`,name:"callback_on_step_end_tensor_inputs"},{anchor:"diffusers.ChromaInpaintPipeline.__call__.max_sequence_length",description:"<strong>max_sequence_length</strong> (<code>int</code> defaults to 512) — Maximum sequence length to use with the <code>prompt</code>.",name:"max_sequence_length"}],source:"https://github.com/huggingface/diffusers/blob/vr_12249/src/diffusers/pipelines/chroma/pipeline_chroma_inpainting.py#L775",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>~pipelines.chroma.ChromaPipelineOutput</code> if | |
| <code>return_dict</code> is True, otherwise a <code>tuple</code>. When returning a tuple, the first element is a list with the | |
| generated images.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>~pipelines.chroma.ChromaPipelineOutput</code> or <code>tuple</code></p> | |
| `}}),A=new ln({props:{anchor:"diffusers.ChromaInpaintPipeline.__call__.example",$$slots:{default:[Yn]},$$scope:{ctx:B}}}),Ce=new k({props:{name:"encode_prompt",anchor:"diffusers.ChromaInpaintPipeline.encode_prompt",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]]"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"device",val:": typing.Optional[torch.device] = None"},{name:"num_images_per_prompt",val:": int = 1"},{name:"prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"prompt_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_prompt_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"do_classifier_free_guidance",val:": bool = True"},{name:"max_sequence_length",val:": int = 256"},{name:"lora_scale",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"diffusers.ChromaInpaintPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) — | |
| prompt to be encoded`,name:"prompt"},{anchor:"diffusers.ChromaInpaintPipeline.encode_prompt.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) — | |
| The prompt not to guide the image generation. If not defined, one has to pass <code>negative_prompt_embeds</code> | |
| instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.ChromaInpaintPipeline.encode_prompt.device",description:`<strong>device</strong> — (<code>torch.device</code>): | |
| torch device`,name:"device"},{anchor:"diffusers.ChromaInpaintPipeline.encode_prompt.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>) — | |
| number of images that should be generated per prompt`,name:"num_images_per_prompt"},{anchor:"diffusers.ChromaInpaintPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not | |
| provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.ChromaInpaintPipeline.encode_prompt.lora_scale",description:`<strong>lora_scale</strong> (<code>float</code>, <em>optional</em>) — | |
| A lora scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded.`,name:"lora_scale"}],source:"https://github.com/huggingface/diffusers/blob/vr_12249/src/diffusers/pipelines/chroma/pipeline_chroma_inpainting.py#L293"}}),Je=new Dn({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/chroma.md"}}),{c(){m=r("meta"),Z=o(),T=r("p"),u=o(),d(w.$$.fragment),i=o(),d(C.$$.fragment),Ke=o(),W=r("div"),W.innerHTML=mn,et=o(),q=r("p"),q.textContent=dn,tt=o(),S=r("p"),S.textContent=cn,nt=o(),O=r("ul"),O.innerHTML=gn,ot=o(),N=r("blockquote"),N.innerHTML=hn,at=o(),d(K.$$.fragment),st=o(),d(ee.$$.fragment),it=o(),d(te.$$.fragment),rt=o(),ne=r("p"),ne.innerHTML=fn,lt=o(),oe=r("p"),oe.textContent=_n,pt=o(),ae=r("p"),ae.textContent=un,mt=o(),d(se.$$.fragment),dt=o(),d(ie.$$.fragment),ct=o(),y=r("div"),d(re.$$.fragment),xt=o(),ke=r("p"),ke.textContent=bn,kt=o(),Ue=r("p"),Ue.innerHTML=yn,Ut=o(),j=r("div"),d(le.$$.fragment),Zt=o(),Ze=r("p"),Ze.textContent=vn,jt=o(),d(E.$$.fragment),Pt=o(),V=r("div"),d(pe.$$.fragment),$t=o(),je=r("p"),je.innerHTML=wn,Gt=o(),z=r("div"),d(me.$$.fragment),Lt=o(),Pe=r("p"),Pe.innerHTML=Mn,Bt=o(),H=r("div"),d(de.$$.fragment),Wt=o(),$e=r("p"),$e.textContent=In,Nt=o(),X=r("div"),d(ce.$$.fragment),Et=o(),Ge=r("p"),Ge.textContent=Tn,Vt=o(),Le=r("div"),d(ge.$$.fragment),gt=o(),d(he.$$.fragment),ht=o(),v=r("div"),d(fe.$$.fragment),zt=o(),Be=r("p"),Be.textContent=Cn,Ht=o(),We=r("p"),We.innerHTML=Jn,Xt=o(),P=r("div"),d(_e.$$.fragment),Dt=o(),Ne=r("p"),Ne.textContent=xn,Rt=o(),d(D.$$.fragment),Ft=o(),R=r("div"),d(ue.$$.fragment),Yt=o(),Ee=r("p"),Ee.innerHTML=kn,Qt=o(),F=r("div"),d(be.$$.fragment),At=o(),Ve=r("p"),Ve.innerHTML=Un,qt=o(),Y=r("div"),d(ye.$$.fragment),St=o(),ze=r("p"),ze.textContent=Zn,Ot=o(),Q=r("div"),d(ve.$$.fragment),Kt=o(),He=r("p"),He.textContent=jn,en=o(),Xe=r("div"),d(we.$$.fragment),ft=o(),d(Me.$$.fragment),_t=o(),U=r("div"),d(Ie.$$.fragment),tn=o(),De=r("p"),De.textContent=Pn,nn=o(),Re=r("p"),Re.innerHTML=$n,on=o(),$=r("div"),d(Te.$$.fragment),an=o(),Fe=r("p"),Fe.textContent=Gn,sn=o(),d(A.$$.fragment),rn=o(),Ye=r("div"),d(Ce.$$.fragment),ut=o(),d(Je.$$.fragment),bt=o(),Se=r("p"),this.h()},l(e){const s=Hn("svelte-u9bgzb",document.head);m=l(s,"META",{name:!0,content:!0}),s.forEach(n),Z=a(e),T=l(e,"P",{}),J(T).forEach(n),u=a(e),c(w.$$.fragment,e),i=a(e),c(C.$$.fragment,e),Ke=a(e),W=l(e,"DIV",{class:!0,"data-svelte-h":!0}),b(W)!=="svelte-1elo7hh"&&(W.innerHTML=mn),et=a(e),q=l(e,"P",{"data-svelte-h":!0}),b(q)!=="svelte-zz935e"&&(q.textContent=dn),tt=a(e),S=l(e,"P",{"data-svelte-h":!0}),b(S)!=="svelte-9mb6m9"&&(S.textContent=cn),nt=a(e),O=l(e,"UL",{"data-svelte-h":!0}),b(O)!=="svelte-1mx6of9"&&(O.innerHTML=gn),ot=a(e),N=l(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),b(N)!=="svelte-1hm6mkx"&&(N.innerHTML=hn),at=a(e),c(K.$$.fragment,e),st=a(e),c(ee.$$.fragment,e),it=a(e),c(te.$$.fragment,e),rt=a(e),ne=l(e,"P",{"data-svelte-h":!0}),b(ne)!=="svelte-1dlqcbc"&&(ne.innerHTML=fn),lt=a(e),oe=l(e,"P",{"data-svelte-h":!0}),b(oe)!=="svelte-1fix8nw"&&(oe.textContent=_n),pt=a(e),ae=l(e,"P",{"data-svelte-h":!0}),b(ae)!=="svelte-15rpvn4"&&(ae.textContent=un),mt=a(e),c(se.$$.fragment,e),dt=a(e),c(ie.$$.fragment,e),ct=a(e),y=l(e,"DIV",{class:!0});var M=J(y);c(re.$$.fragment,M),xt=a(M),ke=l(M,"P",{"data-svelte-h":!0}),b(ke)!=="svelte-x23rez"&&(ke.textContent=bn),kt=a(M),Ue=l(M,"P",{"data-svelte-h":!0}),b(Ue)!=="svelte-au8uhu"&&(Ue.innerHTML=yn),Ut=a(M),j=l(M,"DIV",{class:!0});var L=J(j);c(le.$$.fragment,L),Zt=a(L),Ze=l(L,"P",{"data-svelte-h":!0}),b(Ze)!=="svelte-v78lg8"&&(Ze.textContent=vn),jt=a(L),c(E.$$.fragment,L),L.forEach(n),Pt=a(M),V=l(M,"DIV",{class:!0});var xe=J(V);c(pe.$$.fragment,xe),$t=a(xe),je=l(xe,"P",{"data-svelte-h":!0}),b(je)!=="svelte-1s3c06i"&&(je.innerHTML=wn),xe.forEach(n),Gt=a(M),z=l(M,"DIV",{class:!0});var vt=J(z);c(me.$$.fragment,vt),Lt=a(vt),Pe=l(vt,"P",{"data-svelte-h":!0}),b(Pe)!=="svelte-pkn4ui"&&(Pe.innerHTML=Mn),vt.forEach(n),Bt=a(M),H=l(M,"DIV",{class:!0});var wt=J(H);c(de.$$.fragment,wt),Wt=a(wt),$e=l(wt,"P",{"data-svelte-h":!0}),b($e)!=="svelte-14bnrb6"&&($e.textContent=In),wt.forEach(n),Nt=a(M),X=l(M,"DIV",{class:!0});var Mt=J(X);c(ce.$$.fragment,Mt),Et=a(Mt),Ge=l(Mt,"P",{"data-svelte-h":!0}),b(Ge)!=="svelte-1xwrf7t"&&(Ge.textContent=Tn),Mt.forEach(n),Vt=a(M),Le=l(M,"DIV",{class:!0});var Ln=J(Le);c(ge.$$.fragment,Ln),Ln.forEach(n),M.forEach(n),gt=a(e),c(he.$$.fragment,e),ht=a(e),v=l(e,"DIV",{class:!0});var x=J(v);c(fe.$$.fragment,x),zt=a(x),Be=l(x,"P",{"data-svelte-h":!0}),b(Be)!=="svelte-1mk0zn"&&(Be.textContent=Cn),Ht=a(x),We=l(x,"P",{"data-svelte-h":!0}),b(We)!=="svelte-au8uhu"&&(We.innerHTML=Jn),Xt=a(x),P=l(x,"DIV",{class:!0});var Qe=J(P);c(_e.$$.fragment,Qe),Dt=a(Qe),Ne=l(Qe,"P",{"data-svelte-h":!0}),b(Ne)!=="svelte-v78lg8"&&(Ne.textContent=xn),Rt=a(Qe),c(D.$$.fragment,Qe),Qe.forEach(n),Ft=a(x),R=l(x,"DIV",{class:!0});var It=J(R);c(ue.$$.fragment,It),Yt=a(It),Ee=l(It,"P",{"data-svelte-h":!0}),b(Ee)!=="svelte-1s3c06i"&&(Ee.innerHTML=kn),It.forEach(n),Qt=a(x),F=l(x,"DIV",{class:!0});var Tt=J(F);c(be.$$.fragment,Tt),At=a(Tt),Ve=l(Tt,"P",{"data-svelte-h":!0}),b(Ve)!=="svelte-pkn4ui"&&(Ve.innerHTML=Un),Tt.forEach(n),qt=a(x),Y=l(x,"DIV",{class:!0});var Ct=J(Y);c(ye.$$.fragment,Ct),St=a(Ct),ze=l(Ct,"P",{"data-svelte-h":!0}),b(ze)!=="svelte-14bnrb6"&&(ze.textContent=Zn),Ct.forEach(n),Ot=a(x),Q=l(x,"DIV",{class:!0});var Jt=J(Q);c(ve.$$.fragment,Jt),Kt=a(Jt),He=l(Jt,"P",{"data-svelte-h":!0}),b(He)!=="svelte-1xwrf7t"&&(He.textContent=jn),Jt.forEach(n),en=a(x),Xe=l(x,"DIV",{class:!0});var Bn=J(Xe);c(we.$$.fragment,Bn),Bn.forEach(n),x.forEach(n),ft=a(e),c(Me.$$.fragment,e),_t=a(e),U=l(e,"DIV",{class:!0});var G=J(U);c(Ie.$$.fragment,G),tn=a(G),De=l(G,"P",{"data-svelte-h":!0}),b(De)!=="svelte-9yovg9"&&(De.textContent=Pn),nn=a(G),Re=l(G,"P",{"data-svelte-h":!0}),b(Re)!=="svelte-mxgguy"&&(Re.innerHTML=$n),on=a(G),$=l(G,"DIV",{class:!0});var Ae=J($);c(Te.$$.fragment,Ae),an=a(Ae),Fe=l(Ae,"P",{"data-svelte-h":!0}),b(Fe)!=="svelte-v78lg8"&&(Fe.textContent=Gn),sn=a(Ae),c(A.$$.fragment,Ae),Ae.forEach(n),rn=a(G),Ye=l(G,"DIV",{class:!0});var Wn=J(Ye);c(Ce.$$.fragment,Wn),Wn.forEach(n),G.forEach(n),ut=a(e),c(Je.$$.fragment,e),bt=a(e),Se=l(e,"P",{}),J(Se).forEach(n),this.h()},h(){I(m,"name","hf:doc:metadata"),I(m,"content",An),I(W,"class","flex flex-wrap space-x-1"),I(N,"class","tip"),I(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(Le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(Xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(Ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,s){t(document.head,m),p(e,Z,s),p(e,T,s),p(e,u,s),g(w,e,s),p(e,i,s),g(C,e,s),p(e,Ke,s),p(e,W,s),p(e,et,s),p(e,q,s),p(e,tt,s),p(e,S,s),p(e,nt,s),p(e,O,s),p(e,ot,s),p(e,N,s),p(e,at,s),g(K,e,s),p(e,st,s),g(ee,e,s),p(e,it,s),g(te,e,s),p(e,rt,s),p(e,ne,s),p(e,lt,s),p(e,oe,s),p(e,pt,s),p(e,ae,s),p(e,mt,s),g(se,e,s),p(e,dt,s),g(ie,e,s),p(e,ct,s),p(e,y,s),g(re,y,null),t(y,xt),t(y,ke),t(y,kt),t(y,Ue),t(y,Ut),t(y,j),g(le,j,null),t(j,Zt),t(j,Ze),t(j,jt),g(E,j,null),t(y,Pt),t(y,V),g(pe,V,null),t(V,$t),t(V,je),t(y,Gt),t(y,z),g(me,z,null),t(z,Lt),t(z,Pe),t(y,Bt),t(y,H),g(de,H,null),t(H,Wt),t(H,$e),t(y,Nt),t(y,X),g(ce,X,null),t(X,Et),t(X,Ge),t(y,Vt),t(y,Le),g(ge,Le,null),p(e,gt,s),g(he,e,s),p(e,ht,s),p(e,v,s),g(fe,v,null),t(v,zt),t(v,Be),t(v,Ht),t(v,We),t(v,Xt),t(v,P),g(_e,P,null),t(P,Dt),t(P,Ne),t(P,Rt),g(D,P,null),t(v,Ft),t(v,R),g(ue,R,null),t(R,Yt),t(R,Ee),t(v,Qt),t(v,F),g(be,F,null),t(F,At),t(F,Ve),t(v,qt),t(v,Y),g(ye,Y,null),t(Y,St),t(Y,ze),t(v,Ot),t(v,Q),g(ve,Q,null),t(Q,Kt),t(Q,He),t(v,en),t(v,Xe),g(we,Xe,null),p(e,ft,s),g(Me,e,s),p(e,_t,s),p(e,U,s),g(Ie,U,null),t(U,tn),t(U,De),t(U,nn),t(U,Re),t(U,on),t(U,$),g(Te,$,null),t($,an),t($,Fe),t($,sn),g(A,$,null),t(U,rn),t(U,Ye),g(Ce,Ye,null),p(e,ut,s),g(Je,e,s),p(e,bt,s),p(e,Se,s),yt=!0},p(e,[s]){const M={};s&2&&(M.$$scope={dirty:s,ctx:e}),E.$set(M);const L={};s&2&&(L.$$scope={dirty:s,ctx:e}),D.$set(L);const xe={};s&2&&(xe.$$scope={dirty:s,ctx:e}),A.$set(xe)},i(e){yt||(h(w.$$.fragment,e),h(C.$$.fragment,e),h(K.$$.fragment,e),h(ee.$$.fragment,e),h(te.$$.fragment,e),h(se.$$.fragment,e),h(ie.$$.fragment,e),h(re.$$.fragment,e),h(le.$$.fragment,e),h(E.$$.fragment,e),h(pe.$$.fragment,e),h(me.$$.fragment,e),h(de.$$.fragment,e),h(ce.$$.fragment,e),h(ge.$$.fragment,e),h(he.$$.fragment,e),h(fe.$$.fragment,e),h(_e.$$.fragment,e),h(D.$$.fragment,e),h(ue.$$.fragment,e),h(be.$$.fragment,e),h(ye.$$.fragment,e),h(ve.$$.fragment,e),h(we.$$.fragment,e),h(Me.$$.fragment,e),h(Ie.$$.fragment,e),h(Te.$$.fragment,e),h(A.$$.fragment,e),h(Ce.$$.fragment,e),h(Je.$$.fragment,e),yt=!0)},o(e){f(w.$$.fragment,e),f(C.$$.fragment,e),f(K.$$.fragment,e),f(ee.$$.fragment,e),f(te.$$.fragment,e),f(se.$$.fragment,e),f(ie.$$.fragment,e),f(re.$$.fragment,e),f(le.$$.fragment,e),f(E.$$.fragment,e),f(pe.$$.fragment,e),f(me.$$.fragment,e),f(de.$$.fragment,e),f(ce.$$.fragment,e),f(ge.$$.fragment,e),f(he.$$.fragment,e),f(fe.$$.fragment,e),f(_e.$$.fragment,e),f(D.$$.fragment,e),f(ue.$$.fragment,e),f(be.$$.fragment,e),f(ye.$$.fragment,e),f(ve.$$.fragment,e),f(we.$$.fragment,e),f(Me.$$.fragment,e),f(Ie.$$.fragment,e),f(Te.$$.fragment,e),f(A.$$.fragment,e),f(Ce.$$.fragment,e),f(Je.$$.fragment,e),yt=!1},d(e){e&&(n(Z),n(T),n(u),n(i),n(Ke),n(W),n(et),n(q),n(tt),n(S),n(nt),n(O),n(ot),n(N),n(at),n(st),n(it),n(rt),n(ne),n(lt),n(oe),n(pt),n(ae),n(mt),n(dt),n(ct),n(y),n(gt),n(ht),n(v),n(ft),n(_t),n(U),n(ut),n(bt),n(Se)),n(m),_(w,e),_(C,e),_(K,e),_(ee,e),_(te,e),_(se,e),_(ie,e),_(re),_(le),_(E),_(pe),_(me),_(de),_(ce),_(ge),_(he,e),_(fe),_(_e),_(D),_(ue),_(be),_(ye),_(ve),_(we),_(Me,e),_(Ie),_(Te),_(A),_(Ce),_(Je,e)}}}const An='{"title":"Chroma","local":"chroma","sections":[{"title":"Inference","local":"inference","sections":[],"depth":2},{"title":"Loading from a single file","local":"loading-from-a-single-file","sections":[],"depth":2},{"title":"ChromaPipeline","local":"diffusers.ChromaPipeline","sections":[],"depth":2},{"title":"ChromaImg2ImgPipeline","local":"diffusers.ChromaImg2ImgPipeline","sections":[],"depth":2},{"title":"ChromaInpaintPipeline","local":"diffusers.ChromaInpaintPipeline","sections":[],"depth":2}],"depth":1}';function qn(B){return En(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ao extends Vn{constructor(m){super(),zn(this,m,qn,Qn,Nn,{})}}export{ao as component}; | |
Xet Storage Details
- Size:
- 94.6 kB
- Xet hash:
- 7a13521be612e8c10f21821dfb0f1232fe7e14a8b7ef215da7472ebf0ecfbead
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.