Buckets:

HuggingFaceDocBuilder's picture
download
raw
49.9 kB
import{s as pt,o as mt,n as Se}from"../chunks/scheduler.53228c21.js";import{S as ut,i as ft,e as d,s,c as g,h as gt,a as p,d as o,b as a,f as W,g as _,j as y,k as C,l as r,m as i,n as h,t as x,o as b,p as w}from"../chunks/index.100fac89.js";import{C as _t}from"../chunks/CopyLLMTxtMenu.9fc4ddc7.js";import{D as ue}from"../chunks/Docstring.d1a78bd6.js";import{C as Ye}from"../chunks/CodeBlock.0adb3827.js";import{E as Qe}from"../chunks/ExampleCodeBlock.651f4599.js";import{H as ge,E as ht}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.58a7b074.js";function xt(L){let l,F="Examples:",u,c,m;return c=new Ye({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRmx1eDJQaXBlbGluZSUwQSUwQXBpcGUlMjAlM0QlMjBGbHV4MlBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJibGFjay1mb3Jlc3QtbGFicyUyRkZMVVguMi1kZXYlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2KSUwQXBpcGUudG8oJTIyY3VkYSUyMiklMEFwcm9tcHQlMjAlM0QlMjAlMjJBJTIwY2F0JTIwaG9sZGluZyUyMGElMjBzaWduJTIwdGhhdCUyMHNheXMlMjBoZWxsbyUyMHdvcmxkJTIyJTBBJTIzJTIwRGVwZW5kaW5nJTIwb24lMjB0aGUlMjB2YXJpYW50JTIwYmVpbmclMjB1c2VkJTJDJTIwdGhlJTIwcGlwZWxpbmUlMjBjYWxsJTIwd2lsbCUyMHNsaWdodGx5JTIwdmFyeS4lMEElMjMlMjBSZWZlciUyMHRvJTIwdGhlJTIwcGlwZWxpbmUlMjBkb2N1bWVudGF0aW9uJTIwZm9yJTIwbW9yZSUyMGRldGFpbHMuJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKHByb21wdCUyQyUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0Q1MCUyQyUyMGd1aWRhbmNlX3NjYWxlJTNEMi41KS5pbWFnZXMlNUIwJTVEJTBBaW1hZ2Uuc2F2ZSglMjJmbHV4LnBuZyUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> Flux2Pipeline
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = Flux2Pipeline.from_pretrained(<span class="hljs-string">&quot;black-forest-labs/FLUX.2-dev&quot;</span>, torch_dtype=torch.bfloat16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;A cat holding a sign that says hello world&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Depending on the variant being used, the pipeline call will slightly vary.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Refer to the pipeline documentation for more details.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt, num_inference_steps=<span class="hljs-number">50</span>, guidance_scale=<span class="hljs-number">2.5</span>).images[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>image.save(<span class="hljs-string">&quot;flux.png&quot;</span>)`,lang:"py",wrap:!1}}),{c(){l=d("p"),l.textContent=F,u=s(),g(c.$$.fragment)},l(t){l=p(t,"P",{"data-svelte-h":!0}),y(l)!=="svelte-kvfsh7"&&(l.textContent=F),u=a(t),_(c.$$.fragment,t)},m(t,f){i(t,l,f),i(t,u,f),h(c,t,f),m=!0},p:Se,i(t){m||(x(c.$$.fragment,t),m=!0)},o(t){b(c.$$.fragment,t),m=!1},d(t){t&&(o(l),o(u)),w(c,t)}}}function bt(L){let l,F="Examples:",u,c,m;return c=new Ye({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRmx1eDJLbGVpblBpcGVsaW5lJTBBJTBBcGlwZSUyMCUzRCUyMEZsdXgyS2xlaW5QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyYmxhY2stZm9yZXN0LWxhYnMlMkZGTFVYLjIta2xlaW4tYmFzZS05QiUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guYmZsb2F0MTYlMEEpJTBBcGlwZS50byglMjJjdWRhJTIyKSUwQXByb21wdCUyMCUzRCUyMCUyMkElMjBjYXQlMjBob2xkaW5nJTIwYSUyMHNpZ24lMjB0aGF0JTIwc2F5cyUyMGhlbGxvJTIwd29ybGQlMjIlMEElMjMlMjBEZXBlbmRpbmclMjBvbiUyMHRoZSUyMHZhcmlhbnQlMjBiZWluZyUyMHVzZWQlMkMlMjB0aGUlMjBwaXBlbGluZSUyMGNhbGwlMjB3aWxsJTIwc2xpZ2h0bHklMjB2YXJ5LiUwQSUyMyUyMFJlZmVyJTIwdG8lMjB0aGUlMjBwaXBlbGluZSUyMGRvY3VtZW50YXRpb24lMjBmb3IlMjBtb3JlJTIwZGV0YWlscy4lMEFpbWFnZSUyMCUzRCUyMHBpcGUocHJvbXB0JTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDUwJTJDJTIwZ3VpZGFuY2Vfc2NhbGUlM0Q0LjApLmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMmZsdXgyX291dHB1dC5wbmclMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> Flux2KleinPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = Flux2KleinPipeline.from_pretrained(
<span class="hljs-meta">... </span> <span class="hljs-string">&quot;black-forest-labs/FLUX.2-klein-base-9B&quot;</span>, torch_dtype=torch.bfloat16
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;A cat holding a sign that says hello world&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Depending on the variant being used, the pipeline call will slightly vary.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Refer to the pipeline documentation for more details.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt, num_inference_steps=<span class="hljs-number">50</span>, guidance_scale=<span class="hljs-number">4.0</span>).images[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>image.save(<span class="hljs-string">&quot;flux2_output.png&quot;</span>)`,lang:"py",wrap:!1}}),{c(){l=d("p"),l.textContent=F,u=s(),g(c.$$.fragment)},l(t){l=p(t,"P",{"data-svelte-h":!0}),y(l)!=="svelte-kvfsh7"&&(l.textContent=F),u=a(t),_(c.$$.fragment,t)},m(t,f){i(t,l,f),i(t,u,f),h(c,t,f),m=!0},p:Se,i(t){m||(x(c.$$.fragment,t),m=!0)},o(t){b(c.$$.fragment,t),m=!1},d(t){t&&(o(l),o(u)),w(c,t)}}}function wt(L){let l,F="Examples:",u,c,m;return c=new Ye({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRmx1eDJLbGVpbktWUGlwZWxpbmUlMEElMEFwaXBlJTIwJTNEJTIwRmx1eDJLbGVpbktWUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmJsYWNrLWZvcmVzdC1sYWJzJTJGRkxVWC4yLWtsZWluLTliLWt2JTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5iZmxvYXQxNiUwQSklMEFwaXBlLnRvKCUyMmN1ZGElMjIpJTBBcmVmX2ltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbiglMjJyZWZlcmVuY2UucG5nJTIyKSUwQWltYWdlJTIwJTNEJTIwcGlwZSglMjJBJTIwY2F0JTIwZHJlc3NlZCUyMGxpa2UlMjBhJTIwd2l6YXJkJTIyJTJDJTIwaW1hZ2UlM0RyZWZfaW1hZ2UlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENCkuaW1hZ2VzJTVCMCU1RCUwQWltYWdlLnNhdmUoJTIyZmx1eDJfa3Zfb3V0cHV0LnBuZyUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> Flux2KleinKVPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = Flux2KleinKVPipeline.from_pretrained(
<span class="hljs-meta">... </span> <span class="hljs-string">&quot;black-forest-labs/FLUX.2-klein-9b-kv&quot;</span>, torch_dtype=torch.bfloat16
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>ref_image = Image.<span class="hljs-built_in">open</span>(<span class="hljs-string">&quot;reference.png&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(<span class="hljs-string">&quot;A cat dressed like a wizard&quot;</span>, image=ref_image, num_inference_steps=<span class="hljs-number">4</span>).images[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>image.save(<span class="hljs-string">&quot;flux2_kv_output.png&quot;</span>)`,lang:"py",wrap:!1}}),{c(){l=d("p"),l.textContent=F,u=s(),g(c.$$.fragment)},l(t){l=p(t,"P",{"data-svelte-h":!0}),y(l)!=="svelte-kvfsh7"&&(l.textContent=F),u=a(t),_(c.$$.fragment,t)},m(t,f){i(t,l,f),i(t,u,f),h(c,t,f),m=!0},p:Se,i(t){m||(x(c.$$.fragment,t),m=!0)},o(t){b(c.$$.fragment,t),m=!1},d(t){t&&(o(l),o(u)),w(c,t)}}}function yt(L){let l,F,u,c,m,t,f,_e,V,Xe='<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&amp;logo=apple&amp;logoColor=white%22"/>',he,B,Re='Flux.2 is the recent series of image generation models from Black Forest Labs, preceded by the <a href="./flux">Flux.1</a> series. It is an entirely new model with a new architecture and pre-training done from scratch!',xe,q,Ae='Original model checkpoints for Flux can be found <a href="https://huggingface.co/black-forest-labs" rel="nofollow">here</a>. Original inference code can be found <a href="https://github.com/black-forest-labs/flux2" rel="nofollow">here</a>.',be,G,Oe='<p>Flux2 can be quite expensive to run on consumer hardware devices. However, you can perform a suite of optimizations to run it faster and in a more memory-friendly manner. Check out <a href="https://huggingface.co/blog/sd3#memory-optimizations-for-sd3" rel="nofollow">this section</a> for more details. Additionally, Flux can benefit from quantization for memory efficiency with a trade-off in inference latency. Refer to <a href="https://huggingface.co/blog/quanto-diffusers" rel="nofollow">this blog post</a> to learn more.</p> <p><a href="../../optimization/cache">Caching</a> may also speed up inference by storing and reusing intermediate outputs.</p>',we,E,ye,z,et=`Flux.2 can potentially generate better better outputs with better prompts. We can “upsample”
an input prompt by setting the <code>caption_upsample_temperature</code> argument in the pipeline call arguments.
The <a href="https://github.com/black-forest-labs/flux2/blob/5a5d316b1b42f6b59a8c9194b77c8256be848432/src/flux2/text_encoder.py#L140" rel="nofollow">official implementation</a> recommends this value to be 0.15.`,ve,D,Fe,T,H,je,te,tt="The Flux2 pipeline for text-to-image generation.",Ce,ne,nt='Reference: <a href="https://bfl.ai/blog/flux-2" rel="nofollow">https://bfl.ai/blog/flux-2</a>',Ke,P,Q,Le,oe,ot="Function invoked when calling the pipeline for generation.",Ve,N,Te,S,Me,M,Y,Ge,se,st="The Flux2 Klein pipeline for text-to-image generation.",Ne,ae,at=`Reference:
<a href="https://bfl.ai/blog/flux2-klein-towards-interactive-visual-intelligence" rel="nofollow">https://bfl.ai/blog/flux2-klein-towards-interactive-visual-intelligence</a>`,Ue,I,X,Ze,le,lt="Function invoked when calling the pipeline for generation.",We,U,ke,R,$e,v,A,Be,ie,it="The Flux2 Klein KV pipeline for text-to-image generation with KV-cached reference image conditioning.",qe,re,rt=`On the first denoising step, reference image tokens are included in the forward pass and their attention K/V
projections are cached. On subsequent steps, the cached K/V are reused without recomputing, providing faster
inference when using reference images.`,Ee,ce,ct=`Reference:
<a href="https://bfl.ai/blog/flux2-klein-towards-interactive-visual-intelligence" rel="nofollow">https://bfl.ai/blog/flux2-klein-towards-interactive-visual-intelligence</a>`,ze,J,O,De,de,dt="Function invoked when calling the pipeline for generation.",He,Z,Pe,ee,Ie,fe,Je;return m=new _t({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),f=new ge({props:{title:"Flux2",local:"flux2",headingTag:"h1"}}),E=new ge({props:{title:"Caption upsampling",local:"caption-upsampling",headingTag:"h2"}}),D=new ge({props:{title:"Flux2Pipeline",local:"diffusers.Flux2Pipeline",headingTag:"h2"}}),H=new ue({props:{name:"class diffusers.Flux2Pipeline",anchor:"diffusers.Flux2Pipeline",parameters:[{name:"scheduler",val:": FlowMatchEulerDiscreteScheduler"},{name:"vae",val:": AutoencoderKLFlux2"},{name:"text_encoder",val:": Mistral3ForConditionalGeneration"},{name:"tokenizer",val:": AutoProcessor"},{name:"transformer",val:": Flux2Transformer2DModel"}],parametersDescription:[{anchor:"diffusers.Flux2Pipeline.transformer",description:`<strong>transformer</strong> (<a href="/docs/diffusers/pr_13766/en/api/models/flux2_transformer#diffusers.Flux2Transformer2DModel">Flux2Transformer2DModel</a>) &#x2014;
Conditional Transformer (MMDiT) architecture to denoise the encoded image latents.`,name:"transformer"},{anchor:"diffusers.Flux2Pipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/pr_13766/en/api/schedulers/flow_match_euler_discrete#diffusers.FlowMatchEulerDiscreteScheduler">FlowMatchEulerDiscreteScheduler</a>) &#x2014;
A scheduler to be used in combination with <code>transformer</code> to denoise the encoded image latents.`,name:"scheduler"},{anchor:"diffusers.Flux2Pipeline.vae",description:`<strong>vae</strong> (<code>AutoencoderKLFlux2</code>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.Flux2Pipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>Mistral3ForConditionalGeneration</code>) &#x2014;
<a href="https://huggingface.co/docs/transformers/en/model_doc/mistral3#transformers.Mistral3ForConditionalGeneration" rel="nofollow">Mistral3ForConditionalGeneration</a>`,name:"text_encoder"},{anchor:"diffusers.Flux2Pipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>AutoProcessor</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/en/model_doc/pixtral#transformers.PixtralProcessor" rel="nofollow">PixtralProcessor</a>.`,name:"tokenizer"}],source:"https://github.com/huggingface/diffusers/blob/vr_13766/src/diffusers/pipelines/flux2/pipeline_flux2.py#L251"}}),Q=new ue({props:{name:"__call__",anchor:"diffusers.Flux2Pipeline.__call__",parameters:[{name:"image",val:": PIL.Image.Image | list[PIL.Image.Image] | None = None"},{name:"prompt",val:": str | list[str] = None"},{name:"height",val:": int | None = None"},{name:"width",val:": int | None = None"},{name:"num_inference_steps",val:": int = 50"},{name:"sigmas",val:": list[float] | None = None"},{name:"guidance_scale",val:": float | None = 4.0"},{name:"num_images_per_prompt",val:": int = 1"},{name:"generator",val:": torch._C.Generator | list[torch._C.Generator] | None = None"},{name:"latents",val:": torch.Tensor | None = None"},{name:"prompt_embeds",val:": torch.Tensor | None = None"},{name:"output_type",val:": str | None = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"attention_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"callback_on_step_end",val:": typing.Optional[typing.Callable[[int, int], NoneType]] = None"},{name:"callback_on_step_end_tensor_inputs",val:": list = ['latents']"},{name:"max_sequence_length",val:": int = 512"},{name:"text_encoder_out_layers",val:": tuple = (10, 20, 30)"},{name:"caption_upsample_temperature",val:": float = None"}],parametersDescription:[{anchor:"diffusers.Flux2Pipeline.__call__.image",description:`<strong>image</strong> (<code>torch.Tensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>list[torch.Tensor]</code>, <code>list[PIL.Image.Image]</code>, or <code>list[np.ndarray]</code>) &#x2014;
<code>Image</code>, numpy array or tensor representing an image batch to be used as the starting point. For both
numpy array and pytorch tensor, the expected value range is between <code>[0, 1]</code> If it&#x2019;s a tensor or a list
or tensors, the expected shape should be <code>(B, C, H, W)</code> or <code>(C, H, W)</code>. If it is a numpy array or a
list of arrays, the expected shape should be <code>(B, H, W, C)</code> or <code>(H, W, C)</code> It can also accept image
latents as <code>image</code>, but if passing latents directly it is not encoded again.`,name:"image"},{anchor:"diffusers.Flux2Pipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>list[str]</code>, <em>optional</em>) &#x2014;
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.Flux2Pipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Embedded guiddance scale is enabled by setting <code>guidance_scale</code> &gt; 1. Higher <code>guidance_scale</code> encourages
a model to generate images more aligned with <code>prompt</code> at the expense of lower image quality.</p>
<p>Guidance-distilled models approximates true classifer-free guidance for <code>guidance_scale</code> &gt; 1. Refer to
the <a href="https://huggingface.co/papers/2210.03142" rel="nofollow">paper</a> to learn more.`,name:"guidance_scale"},{anchor:"diffusers.Flux2Pipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The height in pixels of the generated image. This is set to 1024 by default for the best results.`,name:"height"},{anchor:"diffusers.Flux2Pipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The width in pixels of the generated image. This is set to 1024 by default for the best results.`,name:"width"},{anchor:"diffusers.Flux2Pipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
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.Flux2Pipeline.__call__.sigmas",description:`<strong>sigmas</strong> (<code>list[float]</code>, <em>optional</em>) &#x2014;
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.Flux2Pipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.Flux2Pipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>list[torch.Generator]</code>, <em>optional</em>) &#x2014;
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.Flux2Pipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
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.Flux2Pipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
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.Flux2Pipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
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.Flux2Pipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <code>~pipelines.qwenimage.QwenImagePipelineOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.Flux2Pipeline.__call__.attention_kwargs",description:`<strong>attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
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:"attention_kwargs"},{anchor:"diffusers.Flux2Pipeline.__call__.callback_on_step_end",description:`<strong>callback_on_step_end</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
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.Flux2Pipeline.__call__.callback_on_step_end_tensor_inputs",description:`<strong>callback_on_step_end_tensor_inputs</strong> (<code>List</code>, <em>optional</em>) &#x2014;
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.Flux2Pipeline.__call__.max_sequence_length",description:"<strong>max_sequence_length</strong> (<code>int</code> defaults to 512) &#x2014; Maximum sequence length to use with the <code>prompt</code>.",name:"max_sequence_length"},{anchor:"diffusers.Flux2Pipeline.__call__.text_encoder_out_layers",description:`<strong>text_encoder_out_layers</strong> (<code>tuple[int]</code>) &#x2014;
Layer indices to use in the <code>text_encoder</code> to derive the final prompt embeddings.`,name:"text_encoder_out_layers"},{anchor:"diffusers.Flux2Pipeline.__call__.caption_upsample_temperature",description:`<strong>caption_upsample_temperature</strong> (<code>float</code>) &#x2014;
When specified, we will try to perform caption upsampling for potentially improved outputs. We
recommend setting it to 0.15 if caption upsampling is to be performed.`,name:"caption_upsample_temperature"}],source:"https://github.com/huggingface/diffusers/blob/vr_13766/src/diffusers/pipelines/flux2/pipeline_flux2.py#L745",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p><code>~pipelines.flux2.Flux2PipelineOutput</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.flux2.Flux2PipelineOutput</code> or <code>tuple</code></p>
`}}),N=new Qe({props:{anchor:"diffusers.Flux2Pipeline.__call__.example",$$slots:{default:[xt]},$$scope:{ctx:L}}}),S=new ge({props:{title:"Flux2KleinPipeline",local:"diffusers.Flux2KleinPipeline",headingTag:"h2"}}),Y=new ue({props:{name:"class diffusers.Flux2KleinPipeline",anchor:"diffusers.Flux2KleinPipeline",parameters:[{name:"scheduler",val:": FlowMatchEulerDiscreteScheduler"},{name:"vae",val:": AutoencoderKLFlux2"},{name:"text_encoder",val:": Qwen3ForCausalLM"},{name:"tokenizer",val:": Qwen2Tokenizer"},{name:"transformer",val:": Flux2Transformer2DModel"},{name:"is_distilled",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.Flux2KleinPipeline.transformer",description:`<strong>transformer</strong> (<a href="/docs/diffusers/pr_13766/en/api/models/flux2_transformer#diffusers.Flux2Transformer2DModel">Flux2Transformer2DModel</a>) &#x2014;
Conditional Transformer (MMDiT) architecture to denoise the encoded image latents.`,name:"transformer"},{anchor:"diffusers.Flux2KleinPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/pr_13766/en/api/schedulers/flow_match_euler_discrete#diffusers.FlowMatchEulerDiscreteScheduler">FlowMatchEulerDiscreteScheduler</a>) &#x2014;
A scheduler to be used in combination with <code>transformer</code> to denoise the encoded image latents.`,name:"scheduler"},{anchor:"diffusers.Flux2KleinPipeline.vae",description:`<strong>vae</strong> (<code>AutoencoderKLFlux2</code>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.Flux2KleinPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>Qwen3ForCausalLM</code>) &#x2014;
<a href="https://huggingface.co/docs/transformers/en/model_doc/qwen3#transformers.Qwen3ForCausalLM" rel="nofollow">Qwen3ForCausalLM</a>`,name:"text_encoder"},{anchor:"diffusers.Flux2KleinPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>Qwen2TokenizerFast</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/en/model_doc/qwen2#transformers.Qwen2TokenizerFast" rel="nofollow">Qwen2TokenizerFast</a>.`,name:"tokenizer"}],source:"https://github.com/huggingface/diffusers/blob/vr_13766/src/diffusers/pipelines/flux2/pipeline_flux2_klein.py#L155"}}),X=new ue({props:{name:"__call__",anchor:"diffusers.Flux2KleinPipeline.__call__",parameters:[{name:"image",val:": list[PIL.Image.Image] | PIL.Image.Image | None = None"},{name:"prompt",val:": str | list[str] = None"},{name:"height",val:": int | None = None"},{name:"width",val:": int | None = None"},{name:"num_inference_steps",val:": int = 50"},{name:"sigmas",val:": list[float] | None = None"},{name:"guidance_scale",val:": float = 4.0"},{name:"num_images_per_prompt",val:": int = 1"},{name:"generator",val:": torch._C.Generator | list[torch._C.Generator] | None = None"},{name:"latents",val:": torch.Tensor | None = None"},{name:"prompt_embeds",val:": torch.Tensor | None = None"},{name:"negative_prompt_embeds",val:": str | list[str] | None = None"},{name:"output_type",val:": str = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"attention_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"callback_on_step_end",val:": typing.Optional[typing.Callable[[int, int, dict], NoneType]] = None"},{name:"callback_on_step_end_tensor_inputs",val:": list = ['latents']"},{name:"max_sequence_length",val:": int = 512"},{name:"text_encoder_out_layers",val:": tuple = (9, 18, 27)"}],parametersDescription:[{anchor:"diffusers.Flux2KleinPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.Tensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.Tensor]</code>, <code>List[PIL.Image.Image]</code>, or <code>List[np.ndarray]</code>) &#x2014;
<code>Image</code>, numpy array or tensor representing an image batch to be used as the starting point. For both
numpy array and pytorch tensor, the expected value range is between <code>[0, 1]</code> If it&#x2019;s a tensor or a list
or tensors, the expected shape should be <code>(B, C, H, W)</code> or <code>(C, H, W)</code>. If it is a numpy array or a
list of arrays, the expected shape should be <code>(B, H, W, C)</code> or <code>(H, W, C)</code> It can also accept image
latents as <code>image</code>, but if passing latents directly it is not encoded again.`,name:"image"},{anchor:"diffusers.Flux2KleinPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
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.Flux2KleinPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
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 &gt; 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. For step-wise distilled models,
<code>guidance_scale</code> is ignored.`,name:"guidance_scale"},{anchor:"diffusers.Flux2KleinPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The height in pixels of the generated image. This is set to 1024 by default for the best results.`,name:"height"},{anchor:"diffusers.Flux2KleinPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The width in pixels of the generated image. This is set to 1024 by default for the best results.`,name:"width"},{anchor:"diffusers.Flux2KleinPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
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.Flux2KleinPipeline.__call__.sigmas",description:`<strong>sigmas</strong> (<code>List[float]</code>, <em>optional</em>) &#x2014;
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.Flux2KleinPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.Flux2KleinPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
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.Flux2KleinPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
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.Flux2KleinPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
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.Flux2KleinPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Note that &quot;&quot; is used as the negative prompt in this pipeline.
If not provided, will be generated from &quot;&quot;.`,name:"negative_prompt_embeds"},{anchor:"diffusers.Flux2KleinPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
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.Flux2KleinPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <code>~pipelines.qwenimage.QwenImagePipelineOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.Flux2KleinPipeline.__call__.attention_kwargs",description:`<strong>attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
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:"attention_kwargs"},{anchor:"diffusers.Flux2KleinPipeline.__call__.callback_on_step_end",description:`<strong>callback_on_step_end</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
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.Flux2KleinPipeline.__call__.callback_on_step_end_tensor_inputs",description:`<strong>callback_on_step_end_tensor_inputs</strong> (<code>List</code>, <em>optional</em>) &#x2014;
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.Flux2KleinPipeline.__call__.max_sequence_length",description:"<strong>max_sequence_length</strong> (<code>int</code> defaults to 512) &#x2014; Maximum sequence length to use with the <code>prompt</code>.",name:"max_sequence_length"},{anchor:"diffusers.Flux2KleinPipeline.__call__.text_encoder_out_layers",description:`<strong>text_encoder_out_layers</strong> (<code>tuple[int]</code>) &#x2014;
Layer indices to use in the <code>text_encoder</code> to derive the final prompt embeddings.`,name:"text_encoder_out_layers"}],source:"https://github.com/huggingface/diffusers/blob/vr_13766/src/diffusers/pipelines/flux2/pipeline_flux2_klein.py#L611",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p><code>~pipelines.flux2.Flux2PipelineOutput</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.flux2.Flux2PipelineOutput</code> or <code>tuple</code></p>
`}}),U=new Qe({props:{anchor:"diffusers.Flux2KleinPipeline.__call__.example",$$slots:{default:[bt]},$$scope:{ctx:L}}}),R=new ge({props:{title:"Flux2KleinKVPipeline",local:"diffusers.Flux2KleinKVPipeline",headingTag:"h2"}}),A=new ue({props:{name:"class diffusers.Flux2KleinKVPipeline",anchor:"diffusers.Flux2KleinKVPipeline",parameters:[{name:"scheduler",val:": FlowMatchEulerDiscreteScheduler"},{name:"vae",val:": AutoencoderKLFlux2"},{name:"text_encoder",val:": Qwen3ForCausalLM"},{name:"tokenizer",val:": Qwen2Tokenizer"},{name:"transformer",val:": Flux2Transformer2DModel"},{name:"is_distilled",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.Flux2KleinKVPipeline.transformer",description:`<strong>transformer</strong> (<a href="/docs/diffusers/pr_13766/en/api/models/flux2_transformer#diffusers.Flux2Transformer2DModel">Flux2Transformer2DModel</a>) &#x2014;
Conditional Transformer (MMDiT) architecture to denoise the encoded image latents.`,name:"transformer"},{anchor:"diffusers.Flux2KleinKVPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/pr_13766/en/api/schedulers/flow_match_euler_discrete#diffusers.FlowMatchEulerDiscreteScheduler">FlowMatchEulerDiscreteScheduler</a>) &#x2014;
A scheduler to be used in combination with <code>transformer</code> to denoise the encoded image latents.`,name:"scheduler"},{anchor:"diffusers.Flux2KleinKVPipeline.vae",description:`<strong>vae</strong> (<code>AutoencoderKLFlux2</code>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.Flux2KleinKVPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>Qwen3ForCausalLM</code>) &#x2014;
<a href="https://huggingface.co/docs/transformers/en/model_doc/qwen3#transformers.Qwen3ForCausalLM" rel="nofollow">Qwen3ForCausalLM</a>`,name:"text_encoder"},{anchor:"diffusers.Flux2KleinKVPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>Qwen2TokenizerFast</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/en/model_doc/qwen2#transformers.Qwen2TokenizerFast" rel="nofollow">Qwen2TokenizerFast</a>.`,name:"tokenizer"}],source:"https://github.com/huggingface/diffusers/blob/vr_13766/src/diffusers/pipelines/flux2/pipeline_flux2_klein_kv.py#L155"}}),O=new ue({props:{name:"__call__",anchor:"diffusers.Flux2KleinKVPipeline.__call__",parameters:[{name:"image",val:": list[PIL.Image.Image] | PIL.Image.Image | None = None"},{name:"prompt",val:": str | list[str] = None"},{name:"height",val:": int | None = None"},{name:"width",val:": int | None = None"},{name:"num_inference_steps",val:": int = 4"},{name:"sigmas",val:": list[float] | None = None"},{name:"num_images_per_prompt",val:": int = 1"},{name:"generator",val:": torch._C.Generator | list[torch._C.Generator] | None = None"},{name:"latents",val:": torch.Tensor | None = None"},{name:"prompt_embeds",val:": torch.Tensor | None = None"},{name:"output_type",val:": str = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"attention_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"callback_on_step_end",val:": typing.Optional[typing.Callable[[int, int, dict], NoneType]] = None"},{name:"callback_on_step_end_tensor_inputs",val:": list = ['latents']"},{name:"max_sequence_length",val:": int = 512"},{name:"text_encoder_out_layers",val:": tuple = (9, 18, 27)"}],parametersDescription:[{anchor:"diffusers.Flux2KleinKVPipeline.__call__.image",description:`<strong>image</strong> (<code>PIL.Image.Image</code> or <code>List[PIL.Image.Image]</code>, <em>optional</em>) &#x2014;
Reference image(s) for conditioning. On the first denoising step, reference tokens are included in the
forward pass and their attention K/V are cached. On subsequent steps, the cached K/V are reused without
recomputing.`,name:"image"},{anchor:"diffusers.Flux2KleinKVPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide the image generation.`,name:"prompt"},{anchor:"diffusers.Flux2KleinKVPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.Flux2KleinKVPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.Flux2KleinKVPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The number of denoising steps.`,name:"num_inference_steps"},{anchor:"diffusers.Flux2KleinKVPipeline.__call__.sigmas",description:`<strong>sigmas</strong> (<code>List[float]</code>, <em>optional</em>) &#x2014;
Custom sigmas for the denoising schedule.`,name:"sigmas"},{anchor:"diffusers.Flux2KleinKVPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.Flux2KleinKVPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
Generator(s) for deterministic generation.`,name:"generator"},{anchor:"diffusers.Flux2KleinKVPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents.`,name:"latents"},{anchor:"diffusers.Flux2KleinKVPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings.`,name:"prompt_embeds"},{anchor:"diffusers.Flux2KleinKVPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
Output format: <code>&quot;pil&quot;</code> or <code>&quot;np&quot;</code>.`,name:"output_type"},{anchor:"diffusers.Flux2KleinKVPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to return a <code>Flux2PipelineOutput</code> or a plain tuple.`,name:"return_dict"},{anchor:"diffusers.Flux2KleinKVPipeline.__call__.attention_kwargs",description:`<strong>attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Extra kwargs passed to attention processors.`,name:"attention_kwargs"},{anchor:"diffusers.Flux2KleinKVPipeline.__call__.callback_on_step_end",description:`<strong>callback_on_step_end</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
Callback function called at the end of each denoising step.`,name:"callback_on_step_end"},{anchor:"diffusers.Flux2KleinKVPipeline.__call__.callback_on_step_end_tensor_inputs",description:`<strong>callback_on_step_end_tensor_inputs</strong> (<code>List</code>, <em>optional</em>) &#x2014;
Tensor inputs for the callback function.`,name:"callback_on_step_end_tensor_inputs"},{anchor:"diffusers.Flux2KleinKVPipeline.__call__.max_sequence_length",description:`<strong>max_sequence_length</strong> (<code>int</code>, defaults to 512) &#x2014;
Maximum sequence length for the prompt.`,name:"max_sequence_length"},{anchor:"diffusers.Flux2KleinKVPipeline.__call__.text_encoder_out_layers",description:`<strong>text_encoder_out_layers</strong> (<code>tuple[int]</code>) &#x2014;
Layer indices for text encoder hidden state extraction.`,name:"text_encoder_out_layers"}],source:"https://github.com/huggingface/diffusers/blob/vr_13766/src/diffusers/pipelines/flux2/pipeline_flux2_klein_kv.py#L609",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p><code>~pipelines.flux2.Flux2PipelineOutput</code> or <code>tuple</code>.</p>
`}}),Z=new Qe({props:{anchor:"diffusers.Flux2KleinKVPipeline.__call__.example",$$slots:{default:[wt]},$$scope:{ctx:L}}}),ee=new ht({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/flux2.md"}}),{c(){l=d("meta"),F=s(),u=d("p"),c=s(),g(m.$$.fragment),t=s(),g(f.$$.fragment),_e=s(),V=d("div"),V.innerHTML=Xe,he=s(),B=d("p"),B.innerHTML=Re,xe=s(),q=d("p"),q.innerHTML=Ae,be=s(),G=d("blockquote"),G.innerHTML=Oe,we=s(),g(E.$$.fragment),ye=s(),z=d("p"),z.innerHTML=et,ve=s(),g(D.$$.fragment),Fe=s(),T=d("div"),g(H.$$.fragment),je=s(),te=d("p"),te.textContent=tt,Ce=s(),ne=d("p"),ne.innerHTML=nt,Ke=s(),P=d("div"),g(Q.$$.fragment),Le=s(),oe=d("p"),oe.textContent=ot,Ve=s(),g(N.$$.fragment),Te=s(),g(S.$$.fragment),Me=s(),M=d("div"),g(Y.$$.fragment),Ge=s(),se=d("p"),se.textContent=st,Ne=s(),ae=d("p"),ae.innerHTML=at,Ue=s(),I=d("div"),g(X.$$.fragment),Ze=s(),le=d("p"),le.textContent=lt,We=s(),g(U.$$.fragment),ke=s(),g(R.$$.fragment),$e=s(),v=d("div"),g(A.$$.fragment),Be=s(),ie=d("p"),ie.textContent=it,qe=s(),re=d("p"),re.textContent=rt,Ee=s(),ce=d("p"),ce.innerHTML=ct,ze=s(),J=d("div"),g(O.$$.fragment),De=s(),de=d("p"),de.textContent=dt,He=s(),g(Z.$$.fragment),Pe=s(),g(ee.$$.fragment),Ie=s(),fe=d("p"),this.h()},l(e){const n=gt("svelte-u9bgzb",document.head);l=p(n,"META",{name:!0,content:!0}),n.forEach(o),F=a(e),u=p(e,"P",{}),W(u).forEach(o),c=a(e),_(m.$$.fragment,e),t=a(e),_(f.$$.fragment,e),_e=a(e),V=p(e,"DIV",{class:!0,"data-svelte-h":!0}),y(V)!=="svelte-1elo7hh"&&(V.innerHTML=Xe),he=a(e),B=p(e,"P",{"data-svelte-h":!0}),y(B)!=="svelte-1togc7r"&&(B.innerHTML=Re),xe=a(e),q=p(e,"P",{"data-svelte-h":!0}),y(q)!=="svelte-otikoq"&&(q.innerHTML=Ae),be=a(e),G=p(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),y(G)!=="svelte-79zmu7"&&(G.innerHTML=Oe),we=a(e),_(E.$$.fragment,e),ye=a(e),z=p(e,"P",{"data-svelte-h":!0}),y(z)!=="svelte-1r5tu3c"&&(z.innerHTML=et),ve=a(e),_(D.$$.fragment,e),Fe=a(e),T=p(e,"DIV",{class:!0});var k=W(T);_(H.$$.fragment,k),je=a(k),te=p(k,"P",{"data-svelte-h":!0}),y(te)!=="svelte-1hjjsby"&&(te.textContent=tt),Ce=a(k),ne=p(k,"P",{"data-svelte-h":!0}),y(ne)!=="svelte-a2p6bq"&&(ne.innerHTML=nt),Ke=a(k),P=p(k,"DIV",{class:!0});var K=W(P);_(Q.$$.fragment,K),Le=a(K),oe=p(K,"P",{"data-svelte-h":!0}),y(oe)!=="svelte-v78lg8"&&(oe.textContent=ot),Ve=a(K),_(N.$$.fragment,K),K.forEach(o),k.forEach(o),Te=a(e),_(S.$$.fragment,e),Me=a(e),M=p(e,"DIV",{class:!0});var $=W(M);_(Y.$$.fragment,$),Ge=a($),se=p($,"P",{"data-svelte-h":!0}),y(se)!=="svelte-186p0nz"&&(se.textContent=st),Ne=a($),ae=p($,"P",{"data-svelte-h":!0}),y(ae)!=="svelte-1m90spa"&&(ae.innerHTML=at),Ue=a($),I=p($,"DIV",{class:!0});var pe=W(I);_(X.$$.fragment,pe),Ze=a(pe),le=p(pe,"P",{"data-svelte-h":!0}),y(le)!=="svelte-v78lg8"&&(le.textContent=lt),We=a(pe),_(U.$$.fragment,pe),pe.forEach(o),$.forEach(o),ke=a(e),_(R.$$.fragment,e),$e=a(e),v=p(e,"DIV",{class:!0});var j=W(v);_(A.$$.fragment,j),Be=a(j),ie=p(j,"P",{"data-svelte-h":!0}),y(ie)!=="svelte-1n3kv6z"&&(ie.textContent=it),qe=a(j),re=p(j,"P",{"data-svelte-h":!0}),y(re)!=="svelte-17f9z1b"&&(re.textContent=rt),Ee=a(j),ce=p(j,"P",{"data-svelte-h":!0}),y(ce)!=="svelte-1m90spa"&&(ce.innerHTML=ct),ze=a(j),J=p(j,"DIV",{class:!0});var me=W(J);_(O.$$.fragment,me),De=a(me),de=p(me,"P",{"data-svelte-h":!0}),y(de)!=="svelte-v78lg8"&&(de.textContent=dt),He=a(me),_(Z.$$.fragment,me),me.forEach(o),j.forEach(o),Pe=a(e),_(ee.$$.fragment,e),Ie=a(e),fe=p(e,"P",{}),W(fe).forEach(o),this.h()},h(){C(l,"name","hf:doc:metadata"),C(l,"content",vt),C(V,"class","flex flex-wrap space-x-1"),C(G,"class","tip"),C(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(v,"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,n){r(document.head,l),i(e,F,n),i(e,u,n),i(e,c,n),h(m,e,n),i(e,t,n),h(f,e,n),i(e,_e,n),i(e,V,n),i(e,he,n),i(e,B,n),i(e,xe,n),i(e,q,n),i(e,be,n),i(e,G,n),i(e,we,n),h(E,e,n),i(e,ye,n),i(e,z,n),i(e,ve,n),h(D,e,n),i(e,Fe,n),i(e,T,n),h(H,T,null),r(T,je),r(T,te),r(T,Ce),r(T,ne),r(T,Ke),r(T,P),h(Q,P,null),r(P,Le),r(P,oe),r(P,Ve),h(N,P,null),i(e,Te,n),h(S,e,n),i(e,Me,n),i(e,M,n),h(Y,M,null),r(M,Ge),r(M,se),r(M,Ne),r(M,ae),r(M,Ue),r(M,I),h(X,I,null),r(I,Ze),r(I,le),r(I,We),h(U,I,null),i(e,ke,n),h(R,e,n),i(e,$e,n),i(e,v,n),h(A,v,null),r(v,Be),r(v,ie),r(v,qe),r(v,re),r(v,Ee),r(v,ce),r(v,ze),r(v,J),h(O,J,null),r(J,De),r(J,de),r(J,He),h(Z,J,null),i(e,Pe,n),h(ee,e,n),i(e,Ie,n),i(e,fe,n),Je=!0},p(e,[n]){const k={};n&2&&(k.$$scope={dirty:n,ctx:e}),N.$set(k);const K={};n&2&&(K.$$scope={dirty:n,ctx:e}),U.$set(K);const $={};n&2&&($.$$scope={dirty:n,ctx:e}),Z.$set($)},i(e){Je||(x(m.$$.fragment,e),x(f.$$.fragment,e),x(E.$$.fragment,e),x(D.$$.fragment,e),x(H.$$.fragment,e),x(Q.$$.fragment,e),x(N.$$.fragment,e),x(S.$$.fragment,e),x(Y.$$.fragment,e),x(X.$$.fragment,e),x(U.$$.fragment,e),x(R.$$.fragment,e),x(A.$$.fragment,e),x(O.$$.fragment,e),x(Z.$$.fragment,e),x(ee.$$.fragment,e),Je=!0)},o(e){b(m.$$.fragment,e),b(f.$$.fragment,e),b(E.$$.fragment,e),b(D.$$.fragment,e),b(H.$$.fragment,e),b(Q.$$.fragment,e),b(N.$$.fragment,e),b(S.$$.fragment,e),b(Y.$$.fragment,e),b(X.$$.fragment,e),b(U.$$.fragment,e),b(R.$$.fragment,e),b(A.$$.fragment,e),b(O.$$.fragment,e),b(Z.$$.fragment,e),b(ee.$$.fragment,e),Je=!1},d(e){e&&(o(F),o(u),o(c),o(t),o(_e),o(V),o(he),o(B),o(xe),o(q),o(be),o(G),o(we),o(ye),o(z),o(ve),o(Fe),o(T),o(Te),o(Me),o(M),o(ke),o($e),o(v),o(Pe),o(Ie),o(fe)),o(l),w(m,e),w(f,e),w(E,e),w(D,e),w(H),w(Q),w(N),w(S,e),w(Y),w(X),w(U),w(R,e),w(A),w(O),w(Z),w(ee,e)}}}const vt='{"title":"Flux2","local":"flux2","sections":[{"title":"Caption upsampling","local":"caption-upsampling","sections":[],"depth":2},{"title":"Flux2Pipeline","local":"diffusers.Flux2Pipeline","sections":[],"depth":2},{"title":"Flux2KleinPipeline","local":"diffusers.Flux2KleinPipeline","sections":[],"depth":2},{"title":"Flux2KleinKVPipeline","local":"diffusers.Flux2KleinKVPipeline","sections":[],"depth":2}],"depth":1}';function Ft(L){return mt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class jt extends ut{constructor(l){super(),ft(this,l,Ft,yt,pt,{})}}export{jt as component};

Xet Storage Details

Size:
49.9 kB
·
Xet hash:
c467be28222d50f0c492b39a73d47bc0f92440b2ed37ad01a621a40200e5d407

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.