Buckets:
| import{s as nt,o as ot,n as et}from"../chunks/scheduler.8c3d61f6.js";import{S as at,i as st,g as l,s as o,r as h,A as rt,h as p,f as n,c as a,j as I,u as f,x as v,k as x,y as s,a as r,v as u,d as _,t as b,w as y}from"../chunks/index.da70eac4.js";import{T as it}from"../chunks/Tip.1d9b8c37.js";import{D as S}from"../chunks/Docstring.d7448bb3.js";import{C as tt}from"../chunks/CodeBlock.a9c4becf.js";import{E as lt}from"../chunks/ExampleCodeBlock.bdbc5937.js";import{H as Xe,E as pt}from"../chunks/getInferenceSnippets.1d18021a.js";function dt(O){let i,J="Chroma can use all the same optimizations as Flux.";return{c(){i=l("p"),i.textContent=J},l(g){i=p(g,"P",{"data-svelte-h":!0}),v(i)!=="svelte-6y6pq4"&&(i.textContent=J)},m(g,T){r(g,i,T)},p:et,d(g){g&&n(i)}}}function mt(O){let i,J="Examples:",g,T,w;return T=new tt({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQ2hyb21hUGlwZWxpbmUlMEElMEFja3B0X3BhdGglMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGbG9kZXN0b25lcyUyRkNocm9tYSUyRmJsb2IlMkZtYWluJTJGY2hyb21hLXVubG9ja2VkLXYzNy5zYWZldGVuc29ycyUyMiUwQXRyYW5zZm9ybWVyJTIwJTNEJTIwQ2hyb21hVHJhbnNmb3JtZXIyRE1vZGVsLmZyb21fc2luZ2xlX2ZpbGUoY2twdF9wYXRoJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5iZmxvYXQxNiklMEF0ZXh0X2VuY29kZXIlMjAlM0QlMjBBdXRvTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmJsYWNrLWZvcmVzdC1sYWJzJTJGRkxVWC4xLXNjaG5lbGwlMjIlMkMlMjBzdWJmb2xkZXIlM0QlMjJ0ZXh0X2VuY29kZXJfMiUyMiklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJibGFjay1mb3Jlc3QtbGFicyUyRkZMVVguMS1zY2huZWxsJTIyJTJDJTIwc3ViZm9sZGVyJTNEJTIydG9rZW5pemVyXzIlMjIpJTBBcGlwZSUyMCUzRCUyMENocm9tYUltZzJJbWdQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyYmxhY2stZm9yZXN0LWxhYnMlMkZGTFVYLjEtc2NobmVsbCUyMiUyQyUwQSUyMCUyMCUyMCUyMHRyYW5zZm9ybWVyJTNEdHJhbnNmb3JtZXIlMkMlMEElMjAlMjAlMjAlMjB0ZXh0X2VuY29kZXIlM0R0ZXh0X2VuY29kZXIlMkMlMEElMjAlMjAlMjAlMjB0b2tlbml6ZXIlM0R0b2tlbml6ZXIlMkMlMEElMjAlMjAlMjAlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2JTJDJTBBKSUwQXBpcGUuZW5hYmxlX21vZGVsX2NwdV9vZmZsb2FkKCklMEFwcm9tcHQlMjAlM0QlMjAlMjJBJTIwY2F0JTIwaG9sZGluZyUyMGElMjBzaWduJTIwdGhhdCUyMHNheXMlMjBoZWxsbyUyMHdvcmxkJTIyJTBBbmVnYXRpdmVfcHJvbXB0JTIwJTNEJTIwJTIybG93JTIwcXVhbGl0eSUyQyUyMHVnbHklMkMlMjB1bmZpbmlzaGVkJTJDJTIwb3V0JTIwb2YlMjBmb2N1cyUyQyUyMGRlZm9ybWVkJTJDJTIwZGlzZmlndXJlJTJDJTIwYmx1cnJ5JTJDJTIwc211ZGdlZCUyQyUyMHJlc3RyaWN0ZWQlMjBwYWxldHRlJTJDJTIwZmxhdCUyMGNvbG9ycyUyMiUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQlMkMlMjBuZWdhdGl2ZV9wcm9tcHQlM0RuZWdhdGl2ZV9wcm9tcHQpLmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMmNocm9tYS5wbmclMjIp",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>ckpt_path = <span class="hljs-string">"https://huggingface.co/lodestones/Chroma/blob/main/chroma-unlocked-v37.safetensors"</span> | |
| <span class="hljs-meta">>>> </span>transformer = ChromaTransformer2DModel.from_single_file(ckpt_path, torch_dtype=torch.bfloat16) | |
| <span class="hljs-meta">>>> </span>text_encoder = AutoModel.from_pretrained(<span class="hljs-string">"black-forest-labs/FLUX.1-schnell"</span>, subfolder=<span class="hljs-string">"text_encoder_2"</span>) | |
| <span class="hljs-meta">>>> </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">"black-forest-labs/FLUX.1-schnell"</span>, subfolder=<span class="hljs-string">"tokenizer_2"</span>) | |
| <span class="hljs-meta">>>> </span>pipe = ChromaImg2ImgPipeline.from_pretrained( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"black-forest-labs/FLUX.1-schnell"</span>, | |
| <span class="hljs-meta">... </span> transformer=transformer, | |
| <span class="hljs-meta">... </span> text_encoder=text_encoder, | |
| <span class="hljs-meta">... </span> tokenizer=tokenizer, | |
| <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-string">"A cat holding a sign that says hello world"</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, 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(){i=l("p"),i.textContent=J,g=o(),h(T.$$.fragment)},l(c){i=p(c,"P",{"data-svelte-h":!0}),v(i)!=="svelte-kvfsh7"&&(i.textContent=J),g=a(c),f(T.$$.fragment,c)},m(c,M){r(c,i,M),r(c,g,M),u(T,c,M),w=!0},p:et,i(c){w||(_(T.$$.fragment,c),w=!0)},o(c){b(T.$$.fragment,c),w=!1},d(c){c&&(n(i),n(g)),y(T,c)}}}function ct(O){let i,J,g,T,w,c,M,Le='<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"/>',le,G,ze="Chroma is a text to image generation model based on Flux.",pe,E,Ye='Original model checkpoints for Chroma can be found <a href="https://huggingface.co/lodestones/Chroma" rel="nofollow">here</a>.',de,Z,me,W,ce,N,Be="The <code>ChromaTransformer2DModel</code> supports loading checkpoints 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.",ge,X,Re="The following example demonstrates how to run Chroma from a single file.",he,L,Ae="Then run the following example",fe,z,ue,Y,_e,d,B,Ce,K,Fe="The Chroma pipeline for text-to-image generation.",xe,ee,De='Reference: <a href="https://huggingface.co/lodestones/Chroma/" rel="nofollow">https://huggingface.co/lodestones/Chroma/</a>',ke,C,R,Ie,te,He="Function invoked when calling the pipeline for generation.",Ze,$,$e,j,A,je,ne,qe=`Disable sliced VAE decoding. If <code>enable_vae_slicing</code> was previously enabled, this method will go back to | |
| computing decoding in one step.`,Pe,P,F,Ue,oe,Qe=`Disable tiled VAE decoding. If <code>enable_vae_tiling</code> was previously enabled, this method will go back to | |
| computing decoding in one step.`,Ve,U,D,Ge,ae,Se=`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.`,Ee,V,H,We,se,Oe=`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.`,Ne,re,q,be,Q,ye,ie,ve;return w=new Xe({props:{title:"Chroma",local:"chroma",headingTag:"h1"}}),Z=new it({props:{$$slots:{default:[dt]},$$scope:{ctx:O}}}),W=new Xe({props:{title:"Inference (Single File)",local:"inference-single-file",headingTag:"h2"}}),z=new tt({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQ2hyb21hVHJhbnNmb3JtZXIyRE1vZGVsJTJDJTIwQ2hyb21hUGlwZWxpbmUlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwVDVFbmNvZGVyTW9kZWwlMEElMEFiZmxfcmVwbyUyMCUzRCUyMCUyMmJsYWNrLWZvcmVzdC1sYWJzJTJGRkxVWC4xLWRldiUyMiUwQWR0eXBlJTIwJTNEJTIwdG9yY2guYmZsb2F0MTYlMEElMEF0cmFuc2Zvcm1lciUyMCUzRCUyMENocm9tYVRyYW5zZm9ybWVyMkRNb2RlbC5mcm9tX3NpbmdsZV9maWxlKCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZsb2Rlc3RvbmVzJTJGQ2hyb21hJTJGYmxvYiUyRm1haW4lMkZjaHJvbWEtdW5sb2NrZWQtdjM1LnNhZmV0ZW5zb3JzJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0RkdHlwZSklMEElMEF0ZXh0X2VuY29kZXIlMjAlM0QlMjBUNUVuY29kZXJNb2RlbC5mcm9tX3ByZXRyYWluZWQoYmZsX3JlcG8lMkMlMjBzdWJmb2xkZXIlM0QlMjJ0ZXh0X2VuY29kZXJfMiUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEZHR5cGUpJTBBdG9rZW5pemVyJTIwJTNEJTIwVDVUb2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKGJmbF9yZXBvJTJDJTIwc3ViZm9sZGVyJTNEJTIydG9rZW5pemVyXzIlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRGR0eXBlKSUwQSUwQXBpcGUlMjAlM0QlMjBDaHJvbWFQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoYmZsX3JlcG8lMkMlMjB0cmFuc2Zvcm1lciUzRHRyYW5zZm9ybWVyJTJDJTIwdGV4dF9lbmNvZGVyJTNEdGV4dF9lbmNvZGVyJTJDJTIwdG9rZW5pemVyJTNEdG9rZW5pemVyJTJDJTIwdG9yY2hfZHR5cGUlM0RkdHlwZSklMEElMEFwaXBlLmVuYWJsZV9tb2RlbF9jcHVfb2ZmbG9hZCgpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyQSUyMGNhdCUyMGhvbGRpbmclMjBhJTIwc2lnbiUyMHRoYXQlMjBzYXlzJTIwaGVsbG8lMjB3b3JsZCUyMiUwQWltYWdlJTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBwcm9tcHQlMkMlMEElMjAlMjAlMjAlMjBndWlkYW5jZV9zY2FsZSUzRDQuMCUyQyUwQSUyMCUyMCUyMCUyMG91dHB1dF90eXBlJTNEJTIycGlsJTIyJTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDI2JTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEdG9yY2guR2VuZXJhdG9yKCUyMmNwdSUyMikubWFudWFsX3NlZWQoMCklMEEpLmltYWdlcyU1QjAlNUQlMEElMEFpbWFnZS5zYXZlKCUyMmltYWdlLnBuZyUyMik=",highlighted:`<span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> ChromaTransformer2DModel, ChromaPipeline | |
| <span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> T5EncoderModel | |
| bfl_repo = <span class="hljs-string">"black-forest-labs/FLUX.1-dev"</span> | |
| dtype = torch.bfloat16 | |
| transformer = ChromaTransformer2DModel.from_single_file(<span class="hljs-string">"https://huggingface.co/lodestones/Chroma/blob/main/chroma-unlocked-v35.safetensors"</span>, torch_dtype=dtype) | |
| text_encoder = T5EncoderModel.from_pretrained(bfl_repo, subfolder=<span class="hljs-string">"text_encoder_2"</span>, torch_dtype=dtype) | |
| tokenizer = T5Tokenizer.from_pretrained(bfl_repo, subfolder=<span class="hljs-string">"tokenizer_2"</span>, torch_dtype=dtype) | |
| pipe = ChromaPipeline.from_pretrained(bfl_repo, transformer=transformer, text_encoder=text_encoder, tokenizer=tokenizer, torch_dtype=dtype) | |
| pipe.enable_model_cpu_offload() | |
| prompt = <span class="hljs-string">"A cat holding a sign that says hello world"</span> | |
| image = pipe( | |
| prompt, | |
| guidance_scale=<span class="hljs-number">4.0</span>, | |
| output_type=<span class="hljs-string">"pil"</span>, | |
| num_inference_steps=<span class="hljs-number">26</span>, | |
| generator=torch.Generator(<span class="hljs-string">"cpu"</span>).manual_seed(<span class="hljs-number">0</span>) | |
| ).images[<span class="hljs-number">0</span>] | |
| image.save(<span class="hljs-string">"image.png"</span>)`,wrap:!1}}),Y=new Xe({props:{title:"ChromaPipeline",local:"diffusers.ChromaPipeline",headingTag:"h2"}}),B=new S({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_11743/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_11743/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_11743/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_11743/src/diffusers/pipelines/chroma/pipeline_chroma.py#L149"}}),R=new S({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://arxiv.org/abs/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://arxiv.org/pdf/2205.11487.pdf" 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 ge 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_11743/src/diffusers/pipelines/chroma/pipeline_chroma.py#L613",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> | |
| `}}),$=new lt({props:{anchor:"diffusers.ChromaPipeline.__call__.example",$$slots:{default:[mt]},$$scope:{ctx:O}}}),A=new S({props:{name:"disable_vae_slicing",anchor:"diffusers.ChromaPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_11743/src/diffusers/pipelines/chroma/pipeline_chroma.py#L512"}}),F=new S({props:{name:"disable_vae_tiling",anchor:"diffusers.ChromaPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_11743/src/diffusers/pipelines/chroma/pipeline_chroma.py#L527"}}),D=new S({props:{name:"enable_vae_slicing",anchor:"diffusers.ChromaPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_11743/src/diffusers/pipelines/chroma/pipeline_chroma.py#L505"}}),H=new S({props:{name:"enable_vae_tiling",anchor:"diffusers.ChromaPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_11743/src/diffusers/pipelines/chroma/pipeline_chroma.py#L519"}}),q=new S({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_11743/src/diffusers/pipelines/chroma/pipeline_chroma.py#L260"}}),Q=new pt({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/chroma.md"}}),{c(){i=l("meta"),J=o(),g=l("p"),T=o(),h(w.$$.fragment),c=o(),M=l("div"),M.innerHTML=Le,le=o(),G=l("p"),G.textContent=ze,pe=o(),E=l("p"),E.innerHTML=Ye,de=o(),h(Z.$$.fragment),me=o(),h(W.$$.fragment),ce=o(),N=l("p"),N.innerHTML=Be,ge=o(),X=l("p"),X.textContent=Re,he=o(),L=l("p"),L.textContent=Ae,fe=o(),h(z.$$.fragment),ue=o(),h(Y.$$.fragment),_e=o(),d=l("div"),h(B.$$.fragment),Ce=o(),K=l("p"),K.textContent=Fe,xe=o(),ee=l("p"),ee.innerHTML=De,ke=o(),C=l("div"),h(R.$$.fragment),Ie=o(),te=l("p"),te.textContent=He,Ze=o(),h($.$$.fragment),$e=o(),j=l("div"),h(A.$$.fragment),je=o(),ne=l("p"),ne.innerHTML=qe,Pe=o(),P=l("div"),h(F.$$.fragment),Ue=o(),oe=l("p"),oe.innerHTML=Qe,Ve=o(),U=l("div"),h(D.$$.fragment),Ge=o(),ae=l("p"),ae.textContent=Se,Ee=o(),V=l("div"),h(H.$$.fragment),We=o(),se=l("p"),se.textContent=Oe,Ne=o(),re=l("div"),h(q.$$.fragment),be=o(),h(Q.$$.fragment),ye=o(),ie=l("p"),this.h()},l(e){const t=rt("svelte-u9bgzb",document.head);i=p(t,"META",{name:!0,content:!0}),t.forEach(n),J=a(e),g=p(e,"P",{}),I(g).forEach(n),T=a(e),f(w.$$.fragment,e),c=a(e),M=p(e,"DIV",{class:!0,"data-svelte-h":!0}),v(M)!=="svelte-1elo7hh"&&(M.innerHTML=Le),le=a(e),G=p(e,"P",{"data-svelte-h":!0}),v(G)!=="svelte-zz935e"&&(G.textContent=ze),pe=a(e),E=p(e,"P",{"data-svelte-h":!0}),v(E)!=="svelte-13s2per"&&(E.innerHTML=Ye),de=a(e),f(Z.$$.fragment,e),me=a(e),f(W.$$.fragment,e),ce=a(e),N=p(e,"P",{"data-svelte-h":!0}),v(N)!=="svelte-4r38xc"&&(N.innerHTML=Be),ge=a(e),X=p(e,"P",{"data-svelte-h":!0}),v(X)!=="svelte-1fix8nw"&&(X.textContent=Re),he=a(e),L=p(e,"P",{"data-svelte-h":!0}),v(L)!=="svelte-15rpvn4"&&(L.textContent=Ae),fe=a(e),f(z.$$.fragment,e),ue=a(e),f(Y.$$.fragment,e),_e=a(e),d=p(e,"DIV",{class:!0});var m=I(d);f(B.$$.fragment,m),Ce=a(m),K=p(m,"P",{"data-svelte-h":!0}),v(K)!=="svelte-x23rez"&&(K.textContent=Fe),xe=a(m),ee=p(m,"P",{"data-svelte-h":!0}),v(ee)!=="svelte-44oie6"&&(ee.innerHTML=De),ke=a(m),C=p(m,"DIV",{class:!0});var k=I(C);f(R.$$.fragment,k),Ie=a(k),te=p(k,"P",{"data-svelte-h":!0}),v(te)!=="svelte-v78lg8"&&(te.textContent=He),Ze=a(k),f($.$$.fragment,k),k.forEach(n),$e=a(m),j=p(m,"DIV",{class:!0});var Te=I(j);f(A.$$.fragment,Te),je=a(Te),ne=p(Te,"P",{"data-svelte-h":!0}),v(ne)!=="svelte-1s3c06i"&&(ne.innerHTML=qe),Te.forEach(n),Pe=a(m),P=p(m,"DIV",{class:!0});var we=I(P);f(F.$$.fragment,we),Ue=a(we),oe=p(we,"P",{"data-svelte-h":!0}),v(oe)!=="svelte-pkn4ui"&&(oe.innerHTML=Qe),we.forEach(n),Ve=a(m),U=p(m,"DIV",{class:!0});var Me=I(U);f(D.$$.fragment,Me),Ge=a(Me),ae=p(Me,"P",{"data-svelte-h":!0}),v(ae)!=="svelte-14bnrb6"&&(ae.textContent=Se),Me.forEach(n),Ee=a(m),V=p(m,"DIV",{class:!0});var Je=I(V);f(H.$$.fragment,Je),We=a(Je),se=p(Je,"P",{"data-svelte-h":!0}),v(se)!=="svelte-1xwrf7t"&&(se.textContent=Oe),Je.forEach(n),Ne=a(m),re=p(m,"DIV",{class:!0});var Ke=I(re);f(q.$$.fragment,Ke),Ke.forEach(n),m.forEach(n),be=a(e),f(Q.$$.fragment,e),ye=a(e),ie=p(e,"P",{}),I(ie).forEach(n),this.h()},h(){x(i,"name","hf:doc:metadata"),x(i,"content",gt),x(M,"class","flex flex-wrap space-x-1"),x(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(d,"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,t){s(document.head,i),r(e,J,t),r(e,g,t),r(e,T,t),u(w,e,t),r(e,c,t),r(e,M,t),r(e,le,t),r(e,G,t),r(e,pe,t),r(e,E,t),r(e,de,t),u(Z,e,t),r(e,me,t),u(W,e,t),r(e,ce,t),r(e,N,t),r(e,ge,t),r(e,X,t),r(e,he,t),r(e,L,t),r(e,fe,t),u(z,e,t),r(e,ue,t),u(Y,e,t),r(e,_e,t),r(e,d,t),u(B,d,null),s(d,Ce),s(d,K),s(d,xe),s(d,ee),s(d,ke),s(d,C),u(R,C,null),s(C,Ie),s(C,te),s(C,Ze),u($,C,null),s(d,$e),s(d,j),u(A,j,null),s(j,je),s(j,ne),s(d,Pe),s(d,P),u(F,P,null),s(P,Ue),s(P,oe),s(d,Ve),s(d,U),u(D,U,null),s(U,Ge),s(U,ae),s(d,Ee),s(d,V),u(H,V,null),s(V,We),s(V,se),s(d,Ne),s(d,re),u(q,re,null),r(e,be,t),u(Q,e,t),r(e,ye,t),r(e,ie,t),ve=!0},p(e,[t]){const m={};t&2&&(m.$$scope={dirty:t,ctx:e}),Z.$set(m);const k={};t&2&&(k.$$scope={dirty:t,ctx:e}),$.$set(k)},i(e){ve||(_(w.$$.fragment,e),_(Z.$$.fragment,e),_(W.$$.fragment,e),_(z.$$.fragment,e),_(Y.$$.fragment,e),_(B.$$.fragment,e),_(R.$$.fragment,e),_($.$$.fragment,e),_(A.$$.fragment,e),_(F.$$.fragment,e),_(D.$$.fragment,e),_(H.$$.fragment,e),_(q.$$.fragment,e),_(Q.$$.fragment,e),ve=!0)},o(e){b(w.$$.fragment,e),b(Z.$$.fragment,e),b(W.$$.fragment,e),b(z.$$.fragment,e),b(Y.$$.fragment,e),b(B.$$.fragment,e),b(R.$$.fragment,e),b($.$$.fragment,e),b(A.$$.fragment,e),b(F.$$.fragment,e),b(D.$$.fragment,e),b(H.$$.fragment,e),b(q.$$.fragment,e),b(Q.$$.fragment,e),ve=!1},d(e){e&&(n(J),n(g),n(T),n(c),n(M),n(le),n(G),n(pe),n(E),n(de),n(me),n(ce),n(N),n(ge),n(X),n(he),n(L),n(fe),n(ue),n(_e),n(d),n(be),n(ye),n(ie)),n(i),y(w,e),y(Z,e),y(W,e),y(z,e),y(Y,e),y(B),y(R),y($),y(A),y(F),y(D),y(H),y(q),y(Q,e)}}}const gt='{"title":"Chroma","local":"chroma","sections":[{"title":"Inference (Single File)","local":"inference-single-file","sections":[],"depth":2},{"title":"ChromaPipeline","local":"diffusers.ChromaPipeline","sections":[],"depth":2}],"depth":1}';function ht(O){return ot(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class wt extends at{constructor(i){super(),st(this,i,ht,ct,nt,{})}}export{wt as component}; | |
Xet Storage Details
- Size:
- 35.3 kB
- Xet hash:
- b1e64756387a388dbe2fa9e4650b69a9ad90c2a38eb38b25bee6d178b538a308
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.