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 y,k as J,y as s,a as r,v as u,d as _,t as b,w as v}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 Ne,E as pt}from"../chunks/getInferenceSnippets.1d18021a.js";function dt(O){let i,x="Chroma can use all the same optimizations as Flux.";return{c(){i=l("p"),i.textContent=x},l(g){i=p(g,"P",{"data-svelte-h":!0}),y(i)!=="svelte-6y6pq4"&&(i.textContent=x)},m(g,w){r(g,i,w)},p:et,d(g){g&&n(i)}}}function mt(O){let i,x="Examples:",g,w,T;return w=new tt({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQ2hyb21hUGlwZWxpbmUlMEElMEFwaXBlJTIwJTNEJTIwQ2hyb21hUGlwZWxpbmUuZnJvbV9zaW5nbGVfZmlsZSglMEElMjAlMjAlMjAlMjAlMjJjaHJvbWEtdW5sb2NrZWQtdjM1LWRldGFpbC1jYWxpYnJhdGVkLnNhZmV0ZW5zb3JzJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5iZmxvYXQxNiUwQSklMEFwaXBlLnRvKCUyMmN1ZGElMjIpJTBBcHJvbXB0JTIwJTNEJTIwJTIyQSUyMGNhdCUyMGhvbGRpbmclMjBhJTIwc2lnbiUyMHRoYXQlMjBzYXlzJTIwaGVsbG8lMjB3b3JsZCUyMiUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMjglMkMlMjBndWlkYW5jZV9zY2FsZSUzRDQuMCkuaW1hZ2VzJTVCMCU1RCUwQWltYWdlLnNhdmUoJTIyY2hyb21hLnBuZyUyMik=",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>pipe = ChromaPipeline.from_single_file( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"chroma-unlocked-v35-detail-calibrated.safetensors"</span>, torch_dtype=torch.bfloat16 | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>pipe.to(<span class="hljs-string">"cuda"</span>) | |
| <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>image = pipe(prompt, num_inference_steps=<span class="hljs-number">28</span>, guidance_scale=<span class="hljs-number">4.0</span>).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=x,g=o(),h(w.$$.fragment)},l(c){i=p(c,"P",{"data-svelte-h":!0}),y(i)!=="svelte-kvfsh7"&&(i.textContent=x),g=a(c),f(w.$$.fragment,c)},m(c,C){r(c,i,C),r(c,g,C),u(w,c,C),T=!0},p:et,i(c){T||(_(w.$$.fragment,c),T=!0)},o(c){b(w.$$.fragment,c),T=!1},d(c){c&&(n(i),n(g)),v(w,c)}}}function ct(O){let i,x,g,w,T,c,C,ze='<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,Fe="Chroma is a text to image generation model based on Flux.",pe,L,Be='Original model checkpoints for Chroma can be found <a href="https://huggingface.co/lodestones/Chroma" rel="nofollow">here</a>.',de,P,me,V,ce,W,Xe="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,N,De="The following example demonstrates how to run Chroma from a single file.",he,z,Re="Then run the following example",fe,F,ue,B,_e,d,X,Me,K,Ye="The Chroma pipeline for text-to-image generation.",Je,ee,Ae='Reference: <a href="https://huggingface.co/lodestones/Chroma/" rel="nofollow">https://huggingface.co/lodestones/Chroma/</a>',$e,M,D,Ie,te,He="Function invoked when calling the pipeline for generation.",Pe,k,ke,Z,R,Ze,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.`,je,j,Y,Ee,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.`,Ue,E,A,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.`,Le,U,H,Ve,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.`,We,re,q,be,Q,ve,ie,ye;return T=new Ne({props:{title:"Chroma",local:"chroma",headingTag:"h1"}}),P=new it({props:{$$slots:{default:[dt]},$$scope:{ctx:O}}}),V=new Ne({props:{title:"Inference (Single File)",local:"inference-single-file",headingTag:"h2"}}),F=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}}),B=new Ne({props:{title:"ChromaPipeline",local:"diffusers.ChromaPipeline",headingTag:"h2"}}),X=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_11739/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_11739/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_11739/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_11739/src/diffusers/pipelines/chroma/pipeline_chroma.py#L140"}}),D=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 = 28"},{name:"sigmas",val:": typing.Optional[typing.List[float]] = None"},{name:"guidance_scale",val:": float = 3.5"},{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:"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:"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.FloatTensor</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.FloatTensor</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.FloatTensor</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__.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_11739/src/diffusers/pipelines/chroma/pipeline_chroma.py#L561",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> | |
| `}}),k=new lt({props:{anchor:"diffusers.ChromaPipeline.__call__.example",$$slots:{default:[mt]},$$scope:{ctx:O}}}),R=new S({props:{name:"disable_vae_slicing",anchor:"diffusers.ChromaPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_11739/src/diffusers/pipelines/chroma/pipeline_chroma.py#L479"}}),Y=new S({props:{name:"disable_vae_tiling",anchor:"diffusers.ChromaPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_11739/src/diffusers/pipelines/chroma/pipeline_chroma.py#L494"}}),A=new S({props:{name:"enable_vae_slicing",anchor:"diffusers.ChromaPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_11739/src/diffusers/pipelines/chroma/pipeline_chroma.py#L472"}}),H=new S({props:{name:"enable_vae_tiling",anchor:"diffusers.ChromaPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_11739/src/diffusers/pipelines/chroma/pipeline_chroma.py#L486"}}),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.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = 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.FloatTensor</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_11739/src/diffusers/pipelines/chroma/pipeline_chroma.py#L247"}}),Q=new pt({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/chroma.md"}}),{c(){i=l("meta"),x=o(),g=l("p"),w=o(),h(T.$$.fragment),c=o(),C=l("div"),C.innerHTML=ze,le=o(),G=l("p"),G.textContent=Fe,pe=o(),L=l("p"),L.innerHTML=Be,de=o(),h(P.$$.fragment),me=o(),h(V.$$.fragment),ce=o(),W=l("p"),W.innerHTML=Xe,ge=o(),N=l("p"),N.textContent=De,he=o(),z=l("p"),z.textContent=Re,fe=o(),h(F.$$.fragment),ue=o(),h(B.$$.fragment),_e=o(),d=l("div"),h(X.$$.fragment),Me=o(),K=l("p"),K.textContent=Ye,Je=o(),ee=l("p"),ee.innerHTML=Ae,$e=o(),M=l("div"),h(D.$$.fragment),Ie=o(),te=l("p"),te.textContent=He,Pe=o(),h(k.$$.fragment),ke=o(),Z=l("div"),h(R.$$.fragment),Ze=o(),ne=l("p"),ne.innerHTML=qe,je=o(),j=l("div"),h(Y.$$.fragment),Ee=o(),oe=l("p"),oe.innerHTML=Qe,Ue=o(),E=l("div"),h(A.$$.fragment),Ge=o(),ae=l("p"),ae.textContent=Se,Le=o(),U=l("div"),h(H.$$.fragment),Ve=o(),se=l("p"),se.textContent=Oe,We=o(),re=l("div"),h(q.$$.fragment),be=o(),h(Q.$$.fragment),ve=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),x=a(e),g=p(e,"P",{}),I(g).forEach(n),w=a(e),f(T.$$.fragment,e),c=a(e),C=p(e,"DIV",{class:!0,"data-svelte-h":!0}),y(C)!=="svelte-1elo7hh"&&(C.innerHTML=ze),le=a(e),G=p(e,"P",{"data-svelte-h":!0}),y(G)!=="svelte-zz935e"&&(G.textContent=Fe),pe=a(e),L=p(e,"P",{"data-svelte-h":!0}),y(L)!=="svelte-13s2per"&&(L.innerHTML=Be),de=a(e),f(P.$$.fragment,e),me=a(e),f(V.$$.fragment,e),ce=a(e),W=p(e,"P",{"data-svelte-h":!0}),y(W)!=="svelte-4r38xc"&&(W.innerHTML=Xe),ge=a(e),N=p(e,"P",{"data-svelte-h":!0}),y(N)!=="svelte-1fix8nw"&&(N.textContent=De),he=a(e),z=p(e,"P",{"data-svelte-h":!0}),y(z)!=="svelte-15rpvn4"&&(z.textContent=Re),fe=a(e),f(F.$$.fragment,e),ue=a(e),f(B.$$.fragment,e),_e=a(e),d=p(e,"DIV",{class:!0});var m=I(d);f(X.$$.fragment,m),Me=a(m),K=p(m,"P",{"data-svelte-h":!0}),y(K)!=="svelte-x23rez"&&(K.textContent=Ye),Je=a(m),ee=p(m,"P",{"data-svelte-h":!0}),y(ee)!=="svelte-44oie6"&&(ee.innerHTML=Ae),$e=a(m),M=p(m,"DIV",{class:!0});var $=I(M);f(D.$$.fragment,$),Ie=a($),te=p($,"P",{"data-svelte-h":!0}),y(te)!=="svelte-v78lg8"&&(te.textContent=He),Pe=a($),f(k.$$.fragment,$),$.forEach(n),ke=a(m),Z=p(m,"DIV",{class:!0});var we=I(Z);f(R.$$.fragment,we),Ze=a(we),ne=p(we,"P",{"data-svelte-h":!0}),y(ne)!=="svelte-1s3c06i"&&(ne.innerHTML=qe),we.forEach(n),je=a(m),j=p(m,"DIV",{class:!0});var Te=I(j);f(Y.$$.fragment,Te),Ee=a(Te),oe=p(Te,"P",{"data-svelte-h":!0}),y(oe)!=="svelte-pkn4ui"&&(oe.innerHTML=Qe),Te.forEach(n),Ue=a(m),E=p(m,"DIV",{class:!0});var Ce=I(E);f(A.$$.fragment,Ce),Ge=a(Ce),ae=p(Ce,"P",{"data-svelte-h":!0}),y(ae)!=="svelte-14bnrb6"&&(ae.textContent=Se),Ce.forEach(n),Le=a(m),U=p(m,"DIV",{class:!0});var xe=I(U);f(H.$$.fragment,xe),Ve=a(xe),se=p(xe,"P",{"data-svelte-h":!0}),y(se)!=="svelte-1xwrf7t"&&(se.textContent=Oe),xe.forEach(n),We=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),ve=a(e),ie=p(e,"P",{}),I(ie).forEach(n),this.h()},h(){J(i,"name","hf:doc:metadata"),J(i,"content",gt),J(C,"class","flex flex-wrap space-x-1"),J(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(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,x,t),r(e,g,t),r(e,w,t),u(T,e,t),r(e,c,t),r(e,C,t),r(e,le,t),r(e,G,t),r(e,pe,t),r(e,L,t),r(e,de,t),u(P,e,t),r(e,me,t),u(V,e,t),r(e,ce,t),r(e,W,t),r(e,ge,t),r(e,N,t),r(e,he,t),r(e,z,t),r(e,fe,t),u(F,e,t),r(e,ue,t),u(B,e,t),r(e,_e,t),r(e,d,t),u(X,d,null),s(d,Me),s(d,K),s(d,Je),s(d,ee),s(d,$e),s(d,M),u(D,M,null),s(M,Ie),s(M,te),s(M,Pe),u(k,M,null),s(d,ke),s(d,Z),u(R,Z,null),s(Z,Ze),s(Z,ne),s(d,je),s(d,j),u(Y,j,null),s(j,Ee),s(j,oe),s(d,Ue),s(d,E),u(A,E,null),s(E,Ge),s(E,ae),s(d,Le),s(d,U),u(H,U,null),s(U,Ve),s(U,se),s(d,We),s(d,re),u(q,re,null),r(e,be,t),u(Q,e,t),r(e,ve,t),r(e,ie,t),ye=!0},p(e,[t]){const m={};t&2&&(m.$$scope={dirty:t,ctx:e}),P.$set(m);const $={};t&2&&($.$$scope={dirty:t,ctx:e}),k.$set($)},i(e){ye||(_(T.$$.fragment,e),_(P.$$.fragment,e),_(V.$$.fragment,e),_(F.$$.fragment,e),_(B.$$.fragment,e),_(X.$$.fragment,e),_(D.$$.fragment,e),_(k.$$.fragment,e),_(R.$$.fragment,e),_(Y.$$.fragment,e),_(A.$$.fragment,e),_(H.$$.fragment,e),_(q.$$.fragment,e),_(Q.$$.fragment,e),ye=!0)},o(e){b(T.$$.fragment,e),b(P.$$.fragment,e),b(V.$$.fragment,e),b(F.$$.fragment,e),b(B.$$.fragment,e),b(X.$$.fragment,e),b(D.$$.fragment,e),b(k.$$.fragment,e),b(R.$$.fragment,e),b(Y.$$.fragment,e),b(A.$$.fragment,e),b(H.$$.fragment,e),b(q.$$.fragment,e),b(Q.$$.fragment,e),ye=!1},d(e){e&&(n(x),n(g),n(w),n(c),n(C),n(le),n(G),n(pe),n(L),n(de),n(me),n(ce),n(W),n(ge),n(N),n(he),n(z),n(fe),n(ue),n(_e),n(d),n(be),n(ve),n(ie)),n(i),v(T,e),v(P,e),v(V,e),v(F,e),v(B,e),v(X),v(D),v(k),v(R),v(Y),v(A),v(H),v(q),v(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 Tt extends at{constructor(i){super(),st(this,i,ht,ct,nt,{})}}export{Tt as component}; | |
Xet Storage Details
- Size:
- 31.5 kB
- Xet hash:
- cbcb72fed7a705a766bc6d8c8f58afb9d3f456c5698ba702283b718b6c9662b7
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.