Buckets:
| import{s as et,o as tt,n as Oe}from"../chunks/scheduler.8c3d61f6.js";import{S as nt,i as ot,g as r,s,r as g,A as st,h as i,f as t,c as a,j as U,u as f,x as w,k as v,y as o,a as c,v as h,d as _,t as y,w as b}from"../chunks/index.da70eac4.js";import{T as at}from"../chunks/Tip.1d9b8c37.js";import{D as B}from"../chunks/Docstring.6b390b9a.js";import{C as Ke}from"../chunks/CodeBlock.00a903b3.js";import{E as lt}from"../chunks/ExampleCodeBlock.db12be95.js";import{H as $e,E as rt}from"../chunks/EditOnGithub.1e64e623.js";function it(q){let l,x='Flux 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. For an exhaustive list of resources, check out <a href="https://gist.github.com/sayakpaul/b664605caf0aa3bf8585ab109dd5ac9c" rel="nofollow">this gist</a>.';return{c(){l=r("p"),l.innerHTML=x},l(u){l=i(u,"P",{"data-svelte-h":!0}),w(l)!=="svelte-lx7p45"&&(l.innerHTML=x)},m(u,M){c(u,l,M)},p:Oe,d(u){u&&t(l)}}}function pt(q){let l,x="Examples:",u,M,T;return M=new Ke({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRmx1eENvbnRyb2xJbnBhaW50UGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLm1vZGVscy50cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBGbHV4VHJhbnNmb3JtZXIyRE1vZGVsJTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFQ1RW5jb2Rlck1vZGVsJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRf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yZ2UtaGYlMjIpJTBBY29udHJvbF9pbWFnZSUyMCUzRCUyMHByb2Nlc3NvcihpbWFnZSklNUIwJTVELmNvbnZlcnQoJTIyUkdCJTIyKSUwQSUwQW91dHB1dCUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTNEcHJvbXB0JTJDJTBBJTIwJTIwJTIwJTIwaW1hZ2UlM0RpbWFnZSUyQyUwQSUyMCUyMCUyMCUyMGNvbnRyb2xfaW1hZ2UlM0Rjb250cm9sX2ltYWdlJTJDJTBBJTIwJTIwJTIwJTIwbWFza19pbWFnZSUzRG1hc2tfaW1hZ2UlMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMzAlMkMlMEElMjAlMjAlMjAlMjBzdHJlbmd0aCUzRDAuOSUyQyUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNEMTAuMCUyQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRHRvcmNoLkdlbmVyYXRvcigpLm1hbnVhbF9zZWVkKDQyKSUyQyUwQSkuaW1hZ2VzJTVCMCU1RCUwQW1ha2VfaW1hZ2VfZ3JpZCglNUJpbWFnZSUyQyUyMGNvbnRyb2xfaW1hZ2UlMkMlMjBtYXNrX2ltYWdlJTJDJTIwb3V0cHV0LnJlc2l6ZShpbWFnZS5zaXplKSU1RCUyQyUyMHJvd3MlM0QxJTJDJTIwY29scyUzRDQpLnNhdmUoJTBBJTIwJTIwJTIwJTIwJTIyb3V0cHV0LnBuZyUyMiUwQSk=",highlighted:`<span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> FluxControlInpaintPipeline | |
| <span class="hljs-keyword">from</span> diffusers.models.transformers <span class="hljs-keyword">import</span> FluxTransformer2DModel | |
| <span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> T5EncoderModel | |
| <span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image, make_image_grid | |
| <span class="hljs-keyword">from</span> image_gen_aux <span class="hljs-keyword">import</span> DepthPreprocessor <span class="hljs-comment"># https://github.com/huggingface/image_gen_aux</span> | |
| <span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image | |
| <span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np | |
| pipe = FluxControlInpaintPipeline.from_pretrained( | |
| <span class="hljs-string">"black-forest-labs/FLUX.1-Depth-dev"</span>, | |
| torch_dtype=torch.bfloat16, | |
| ) | |
| <span class="hljs-comment"># use following lines if you have GPU constraints</span> | |
| <span class="hljs-comment"># ---------------------------------------------------------------</span> | |
| transformer = FluxTransformer2DModel.from_pretrained( | |
| <span class="hljs-string">"sayakpaul/FLUX.1-Depth-dev-nf4"</span>, subfolder=<span class="hljs-string">"transformer"</span>, torch_dtype=torch.bfloat16 | |
| ) | |
| text_encoder_2 = T5EncoderModel.from_pretrained( | |
| <span class="hljs-string">"sayakpaul/FLUX.1-Depth-dev-nf4"</span>, subfolder=<span class="hljs-string">"text_encoder_2"</span>, torch_dtype=torch.bfloat16 | |
| ) | |
| pipe.transformer = transformer | |
| pipe.text_encoder_2 = text_encoder_2 | |
| pipe.enable_model_cpu_offload() | |
| <span class="hljs-comment"># ---------------------------------------------------------------</span> | |
| pipe.to(<span class="hljs-string">"cuda"</span>) | |
| prompt = <span class="hljs-string">"a blue robot singing opera with human-like expressions"</span> | |
| image = load_image(<span class="hljs-string">"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/robot.png"</span>) | |
| head_mask = np.zeros_like(image) | |
| head_mask[<span class="hljs-number">65</span>:<span class="hljs-number">580</span>, <span class="hljs-number">300</span>:<span class="hljs-number">642</span>] = <span class="hljs-number">255</span> | |
| mask_image = Image.fromarray(head_mask) | |
| processor = DepthPreprocessor.from_pretrained(<span class="hljs-string">"LiheYoung/depth-anything-large-hf"</span>) | |
| control_image = processor(image)[<span class="hljs-number">0</span>].convert(<span class="hljs-string">"RGB"</span>) | |
| output = pipe( | |
| prompt=prompt, | |
| image=image, | |
| control_image=control_image, | |
| mask_image=mask_image, | |
| num_inference_steps=<span class="hljs-number">30</span>, | |
| strength=<span class="hljs-number">0.9</span>, | |
| guidance_scale=<span class="hljs-number">10.0</span>, | |
| generator=torch.Generator().manual_seed(<span class="hljs-number">42</span>), | |
| ).images[<span class="hljs-number">0</span>] | |
| make_image_grid([image, control_image, mask_image, output.resize(image.size)], rows=<span class="hljs-number">1</span>, cols=<span class="hljs-number">4</span>).save( | |
| <span class="hljs-string">"output.png"</span> | |
| )`,wrap:!1}}),{c(){l=r("p"),l.textContent=x,u=s(),g(M.$$.fragment)},l(m){l=i(m,"P",{"data-svelte-h":!0}),w(l)!=="svelte-kvfsh7"&&(l.textContent=x),u=a(m),f(M.$$.fragment,m)},m(m,I){c(m,l,I),c(m,u,I),h(M,m,I),T=!0},p:Oe,i(m){T||(_(M.$$.fragment,m),T=!0)},o(m){y(M.$$.fragment,m),T=!1},d(m){m&&(t(l),t(u)),b(M,m)}}}function ct(q){let l,x,u,M,T,m,I,Ee="FluxControlInpaintPipeline is an implementation of Inpainting for Flux.1 Depth/Canny models. It is a pipeline that allows you to inpaint images using the Flux.1 Depth/Canny models. The pipeline takes an image and a mask as input and returns the inpainted image.",ie,G,Pe="FLUX.1 Depth and Canny [dev] is a 12 billion parameter rectified flow transformer capable of generating an image based on a text description while following the structure of a given input image. <strong>This is not a ControlNet model</strong>.",pe,V,Ne='<thead><tr><th>Control type</th> <th>Developer</th> <th>Link</th></tr></thead> <tbody><tr><td>Depth</td> <td><a href="https://huggingface.co/black-forest-labs" rel="nofollow">Black Forest Labs</a></td> <td><a href="https://huggingface.co/black-forest-labs/FLUX.1-Depth-dev" rel="nofollow">Link</a></td></tr> <tr><td>Canny</td> <td><a href="https://huggingface.co/black-forest-labs" rel="nofollow">Black Forest Labs</a></td> <td><a href="https://huggingface.co/black-forest-labs/FLUX.1-Canny-dev" rel="nofollow">Link</a></td></tr></tbody>',ce,L,de,$,me,E,ue,p,P,xe,O,Xe="The Flux pipeline for image inpainting using Flux-dev-Depth/Canny.",Je,K,Re='Reference: <a href="https://blackforestlabs.ai/announcing-black-forest-labs/" rel="nofollow">https://blackforestlabs.ai/announcing-black-forest-labs/</a>',Ue,J,N,ve,ee,ze="Function invoked when calling the pipeline for generation.",Ce,Z,ke,F,X,Le,te,He=`Disable sliced VAE decoding. If <code>enable_vae_slicing</code> was previously enabled, this method will go back to | |
| computing decoding in one step.`,Ze,j,R,Fe,ne,Ye=`Disable tiled VAE decoding. If <code>enable_vae_tiling</code> was previously enabled, this method will go back to | |
| computing decoding in one step.`,je,W,z,We,oe,De=`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.`,Se,S,H,Be,se,Ae=`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.`,Ge,ae,Y,ge,D,fe,C,A,Ve,le,Qe="Output class for Stable Diffusion pipelines.",he,Q,_e,re,ye;return T=new $e({props:{title:"FluxControlInpaint",local:"fluxcontrolinpaint",headingTag:"h1"}}),L=new at({props:{$$slots:{default:[it]},$$scope:{ctx:q}}}),$=new Ke({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRmx1eENvbnRyb2xJbnBhaW50UGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLm1vZGVscy50cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBGbHV4VHJhbnNmb3JtZXIyRE1vZGVsJTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFQ1RW5jb2Rlck1vZGVsJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMkMlMjBtYWtlX2ltYWdlX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UzRCUyMHByb2Nlc3NvcihpbWFnZSklNUIwJTVELmNvbnZlcnQoJTIyUkdCJTIyKSUwQSUwQW91dHB1dCUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTNEcHJvbXB0JTJDJTBBJTIwJTIwJTIwJTIwaW1hZ2UlM0RpbWFnZSUyQyUwQSUyMCUyMCUyMCUyMGNvbnRyb2xfaW1hZ2UlM0Rjb250cm9sX2ltYWdlJTJDJTBBJTIwJTIwJTIwJTIwbWFza19pbWFnZSUzRG1hc2tfaW1hZ2UlMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMzAlMkMlMEElMjAlMjAlMjAlMjBzdHJlbmd0aCUzRDAuOSUyQyUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNEMTAuMCUyQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRHRvcmNoLkdlbmVyYXRvcigpLm1hbnVhbF9zZWVkKDQyKSUyQyUwQSkuaW1hZ2VzJTVCMCU1RCUwQW1ha2VfaW1hZ2VfZ3JpZCglNUJpbWFnZSUyQyUyMGNvbnRyb2xfaW1hZ2UlMkMlMjBtYXNrX2ltYWdlJTJDJTIwb3V0cHV0LnJlc2l6ZShpbWFnZS5zaXplKSU1RCUyQyUyMHJvd3MlM0QxJTJDJTIwY29scyUzRDQpLnNhdmUoJTIyb3V0cHV0LnBuZyUyMik=",highlighted:`<span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> FluxControlInpaintPipeline | |
| <span class="hljs-keyword">from</span> diffusers.models.transformers <span class="hljs-keyword">import</span> FluxTransformer2DModel | |
| <span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> T5EncoderModel | |
| <span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image, make_image_grid | |
| <span class="hljs-keyword">from</span> image_gen_aux <span class="hljs-keyword">import</span> DepthPreprocessor <span class="hljs-comment"># https://github.com/huggingface/image_gen_aux</span> | |
| <span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image | |
| <span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np | |
| pipe = FluxControlInpaintPipeline.from_pretrained( | |
| <span class="hljs-string">"black-forest-labs/FLUX.1-Depth-dev"</span>, | |
| torch_dtype=torch.bfloat16, | |
| ) | |
| <span class="hljs-comment"># use following lines if you have GPU constraints</span> | |
| <span class="hljs-comment"># ---------------------------------------------------------------</span> | |
| transformer = FluxTransformer2DModel.from_pretrained( | |
| <span class="hljs-string">"sayakpaul/FLUX.1-Depth-dev-nf4"</span>, subfolder=<span class="hljs-string">"transformer"</span>, torch_dtype=torch.bfloat16 | |
| ) | |
| text_encoder_2 = T5EncoderModel.from_pretrained( | |
| <span class="hljs-string">"sayakpaul/FLUX.1-Depth-dev-nf4"</span>, subfolder=<span class="hljs-string">"text_encoder_2"</span>, torch_dtype=torch.bfloat16 | |
| ) | |
| pipe.transformer = transformer | |
| pipe.text_encoder_2 = text_encoder_2 | |
| pipe.enable_model_cpu_offload() | |
| <span class="hljs-comment"># ---------------------------------------------------------------</span> | |
| pipe.to(<span class="hljs-string">"cuda"</span>) | |
| prompt = <span class="hljs-string">"a blue robot singing opera with human-like expressions"</span> | |
| image = load_image(<span class="hljs-string">"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/robot.png"</span>) | |
| head_mask = np.zeros_like(image) | |
| head_mask[<span class="hljs-number">65</span>:<span class="hljs-number">580</span>,<span class="hljs-number">300</span>:<span class="hljs-number">642</span>] = <span class="hljs-number">255</span> | |
| mask_image = Image.fromarray(head_mask) | |
| processor = DepthPreprocessor.from_pretrained(<span class="hljs-string">"LiheYoung/depth-anything-large-hf"</span>) | |
| control_image = processor(image)[<span class="hljs-number">0</span>].convert(<span class="hljs-string">"RGB"</span>) | |
| output = pipe( | |
| prompt=prompt, | |
| image=image, | |
| control_image=control_image, | |
| mask_image=mask_image, | |
| num_inference_steps=<span class="hljs-number">30</span>, | |
| strength=<span class="hljs-number">0.9</span>, | |
| guidance_scale=<span class="hljs-number">10.0</span>, | |
| generator=torch.Generator().manual_seed(<span class="hljs-number">42</span>), | |
| ).images[<span class="hljs-number">0</span>] | |
| make_image_grid([image, control_image, mask_image, output.resize(image.size)], rows=<span class="hljs-number">1</span>, cols=<span class="hljs-number">4</span>).save(<span class="hljs-string">"output.png"</span>)`,wrap:!1}}),E=new $e({props:{title:"FluxControlInpaintPipeline",local:"diffusers.FluxControlInpaintPipeline",headingTag:"h2"}}),P=new B({props:{name:"class diffusers.FluxControlInpaintPipeline",anchor:"diffusers.FluxControlInpaintPipeline",parameters:[{name:"scheduler",val:": FlowMatchEulerDiscreteScheduler"},{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"text_encoder_2",val:": T5EncoderModel"},{name:"tokenizer_2",val:": T5TokenizerFast"},{name:"transformer",val:": FluxTransformer2DModel"}],parametersDescription:[{anchor:"diffusers.FluxControlInpaintPipeline.transformer",description:`<strong>transformer</strong> (<a href="/docs/diffusers/pr_10312/en/api/models/flux_transformer#diffusers.FluxTransformer2DModel">FluxTransformer2DModel</a>) — | |
| Conditional Transformer (MMDiT) architecture to denoise the encoded image latents.`,name:"transformer"},{anchor:"diffusers.FluxControlInpaintPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/pr_10312/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.FluxControlInpaintPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/pr_10312/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) — | |
| Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.FluxControlInpaintPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) — | |
| <a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically | |
| the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.FluxControlInpaintPipeline.text_encoder_2",description:`<strong>text_encoder_2</strong> (<code>T5EncoderModel</code>) — | |
| <a href="https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5EncoderModel" rel="nofollow">T5</a>, specifically | |
| the <a href="https://huggingface.co/google/t5-v1_1-xxl" rel="nofollow">google/t5-v1_1-xxl</a> variant.`,name:"text_encoder_2"},{anchor:"diffusers.FluxControlInpaintPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) — | |
| Tokenizer of class | |
| <a href="https://huggingface.co/docs/transformers/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.FluxControlInpaintPipeline.tokenizer_2",description:`<strong>tokenizer_2</strong> (<code>T5TokenizerFast</code>) — | |
| Second Tokenizer of class | |
| <a href="https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5TokenizerFast" rel="nofollow">T5TokenizerFast</a>.`,name:"tokenizer_2"}],source:"https://github.com/huggingface/diffusers/blob/vr_10312/src/diffusers/pipelines/flux/pipeline_flux_control_inpaint.py#L204"}}),N=new B({props:{name:"__call__",anchor:"diffusers.FluxControlInpaintPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"prompt_2",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.Tensor]] = None"},{name:"control_image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.Tensor]] = None"},{name:"mask_image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.Tensor]] = None"},{name:"masked_image_latents",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.Tensor]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"strength",val:": float = 0.6"},{name:"num_inference_steps",val:": int = 28"},{name:"sigmas",val:": typing.Optional[typing.List[float]] = None"},{name:"guidance_scale",val:": float = 7.0"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pooled_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"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.FluxControlInpaintPipeline.__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.FluxControlInpaintPipeline.__call__.prompt_2",description:`<strong>prompt_2</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) — | |
| The prompt or prompts to be sent to <code>tokenizer_2</code> and <code>text_encoder_2</code>. If not defined, <code>prompt</code> is | |
| will be used instead`,name:"prompt_2"},{anchor:"diffusers.FluxControlInpaintPipeline.__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>) — | |
| <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’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.FluxControlInpaintPipeline.__call__.control_image",description:`<strong>control_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>, <code>List[np.ndarray]</code>, — | |
| <code>List[List[torch.Tensor]]</code>, <code>List[List[np.ndarray]]</code> or <code>List[List[PIL.Image.Image]]</code>): | |
| The ControlNet input condition to provide guidance to the <code>unet</code> for generation. If the type is | |
| specified as <code>torch.Tensor</code>, it is passed to ControlNet as is. <code>PIL.Image.Image</code> can also be accepted | |
| as an image. The dimensions of the output image defaults to <code>image</code>’s dimensions. If height and/or | |
| width are passed, <code>image</code> is resized accordingly. If multiple ControlNets are specified in <code>init</code>, | |
| images must be passed as a list such that each element of the list can be correctly batched for input | |
| to a single ControlNet.`,name:"control_image"},{anchor:"diffusers.FluxControlInpaintPipeline.__call__.mask_image",description:`<strong>mask_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>) — | |
| <code>Image</code>, numpy array or tensor representing an image batch to mask <code>image</code>. White pixels in the mask | |
| are repainted while black pixels are preserved. If <code>mask_image</code> is a PIL image, it is converted to a | |
| single channel (luminance) before use. If it’s a numpy array or pytorch tensor, it should contain one | |
| color channel (L) instead of 3, so the expected shape for pytorch tensor would be <code>(B, 1, H, W)</code>, <code>(B, H, W)</code>, <code>(1, H, W)</code>, <code>(H, W)</code>. And for numpy array would be for <code>(B, H, W, 1)</code>, <code>(B, H, W)</code>, <code>(H, W, 1)</code>, or <code>(H, W)</code>.`,name:"mask_image"},{anchor:"diffusers.FluxControlInpaintPipeline.__call__.mask_image_latent",description:`<strong>mask_image_latent</strong> (<code>torch.Tensor</code>, <code>List[torch.Tensor]</code>) — | |
| <code>Tensor</code> representing an image batch to mask <code>image</code> generated by VAE. If not provided, the mask | |
| latents tensor will ge generated by <code>mask_image</code>.`,name:"mask_image_latent"},{anchor:"diffusers.FluxControlInpaintPipeline.__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.FluxControlInpaintPipeline.__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.FluxControlInpaintPipeline.__call__.strength",description:`<strong>strength</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) — | |
| Indicates extent to transform the reference <code>image</code>. Must be between 0 and 1. <code>image</code> is used as a | |
| starting point and more noise is added the higher the <code>strength</code>. The number of denoising steps depends | |
| on the amount of noise initially added. When <code>strength</code> is 1, added noise is maximum and the denoising | |
| process runs for the full number of iterations specified in <code>num_inference_steps</code>. A value of 1 | |
| essentially ignores <code>image</code>.`,name:"strength"},{anchor:"diffusers.FluxControlInpaintPipeline.__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.FluxControlInpaintPipeline.__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.FluxControlInpaintPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.0) — | |
| 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.FluxControlInpaintPipeline.__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.FluxControlInpaintPipeline.__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.FluxControlInpaintPipeline.__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.FluxControlInpaintPipeline.__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.FluxControlInpaintPipeline.__call__.pooled_prompt_embeds",description:`<strong>pooled_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) — | |
| Pre-generated pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. | |
| If not provided, pooled text embeddings will be generated from <code>prompt</code> input argument.`,name:"pooled_prompt_embeds"},{anchor:"diffusers.FluxControlInpaintPipeline.__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.FluxControlInpaintPipeline.__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.FluxPipelineOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.FluxControlInpaintPipeline.__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.FluxControlInpaintPipeline.__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.FluxControlInpaintPipeline.__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.FluxControlInpaintPipeline.__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_10312/src/diffusers/pipelines/flux/pipeline_flux_control_inpaint.py#L782",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>~pipelines.flux.FluxPipelineOutput</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.flux.FluxPipelineOutput</code> or <code>tuple</code></p> | |
| `}}),Z=new lt({props:{anchor:"diffusers.FluxControlInpaintPipeline.__call__.example",$$slots:{default:[pt]},$$scope:{ctx:q}}}),X=new B({props:{name:"disable_vae_slicing",anchor:"diffusers.FluxControlInpaintPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_10312/src/diffusers/pipelines/flux/pipeline_flux_control_inpaint.py#L584"}}),R=new B({props:{name:"disable_vae_tiling",anchor:"diffusers.FluxControlInpaintPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_10312/src/diffusers/pipelines/flux/pipeline_flux_control_inpaint.py#L599"}}),z=new B({props:{name:"enable_vae_slicing",anchor:"diffusers.FluxControlInpaintPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_10312/src/diffusers/pipelines/flux/pipeline_flux_control_inpaint.py#L577"}}),H=new B({props:{name:"enable_vae_tiling",anchor:"diffusers.FluxControlInpaintPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_10312/src/diffusers/pipelines/flux/pipeline_flux_control_inpaint.py#L591"}}),Y=new B({props:{name:"encode_prompt",anchor:"diffusers.FluxControlInpaintPipeline.encode_prompt",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]]"},{name:"prompt_2",val:": typing.Union[str, typing.List[str]]"},{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:"pooled_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"max_sequence_length",val:": int = 512"},{name:"lora_scale",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"diffusers.FluxControlInpaintPipeline.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.FluxControlInpaintPipeline.encode_prompt.prompt_2",description:`<strong>prompt_2</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) — | |
| The prompt or prompts to be sent to the <code>tokenizer_2</code> and <code>text_encoder_2</code>. If not defined, <code>prompt</code> is | |
| used in all text-encoders`,name:"prompt_2"},{anchor:"diffusers.FluxControlInpaintPipeline.encode_prompt.device",description:`<strong>device</strong> — (<code>torch.device</code>): | |
| torch device`,name:"device"},{anchor:"diffusers.FluxControlInpaintPipeline.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.FluxControlInpaintPipeline.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.FluxControlInpaintPipeline.encode_prompt.pooled_prompt_embeds",description:`<strong>pooled_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) — | |
| Pre-generated pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. | |
| If not provided, pooled text embeddings will be generated from <code>prompt</code> input argument.`,name:"pooled_prompt_embeds"},{anchor:"diffusers.FluxControlInpaintPipeline.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_10312/src/diffusers/pipelines/flux/pipeline_flux_control_inpaint.py#L375"}}),D=new $e({props:{title:"FluxPipelineOutput",local:"diffusers.pipelines.flux.pipeline_output.FluxPipelineOutput",headingTag:"h2"}}),A=new B({props:{name:"class diffusers.pipelines.flux.pipeline_output.FluxPipelineOutput",anchor:"diffusers.pipelines.flux.pipeline_output.FluxPipelineOutput",parameters:[{name:"images",val:": typing.Union[typing.List[PIL.Image.Image], numpy.ndarray]"}],parametersDescription:[{anchor:"diffusers.pipelines.flux.pipeline_output.FluxPipelineOutput.images",description:`<strong>images</strong> (<code>List[PIL.Image.Image]</code> or <code>np.ndarray</code>) — | |
| List of denoised PIL images of length <code>batch_size</code> or numpy array of shape <code>(batch_size, height, width, num_channels)</code>. PIL images or numpy array present the denoised images of the diffusion pipeline.`,name:"images"}],source:"https://github.com/huggingface/diffusers/blob/vr_10312/src/diffusers/pipelines/flux/pipeline_output.py#L11"}}),Q=new rt({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/control_flux_inpaint.md"}}),{c(){l=r("meta"),x=s(),u=r("p"),M=s(),g(T.$$.fragment),m=s(),I=r("p"),I.textContent=Ee,ie=s(),G=r("p"),G.innerHTML=Pe,pe=s(),V=r("table"),V.innerHTML=Ne,ce=s(),g(L.$$.fragment),de=s(),g($.$$.fragment),me=s(),g(E.$$.fragment),ue=s(),p=r("div"),g(P.$$.fragment),xe=s(),O=r("p"),O.textContent=Xe,Je=s(),K=r("p"),K.innerHTML=Re,Ue=s(),J=r("div"),g(N.$$.fragment),ve=s(),ee=r("p"),ee.textContent=ze,Ce=s(),g(Z.$$.fragment),ke=s(),F=r("div"),g(X.$$.fragment),Le=s(),te=r("p"),te.innerHTML=He,Ze=s(),j=r("div"),g(R.$$.fragment),Fe=s(),ne=r("p"),ne.innerHTML=Ye,je=s(),W=r("div"),g(z.$$.fragment),We=s(),oe=r("p"),oe.textContent=De,Se=s(),S=r("div"),g(H.$$.fragment),Be=s(),se=r("p"),se.textContent=Ae,Ge=s(),ae=r("div"),g(Y.$$.fragment),ge=s(),g(D.$$.fragment),fe=s(),C=r("div"),g(A.$$.fragment),Ve=s(),le=r("p"),le.textContent=Qe,he=s(),g(Q.$$.fragment),_e=s(),re=r("p"),this.h()},l(e){const n=st("svelte-u9bgzb",document.head);l=i(n,"META",{name:!0,content:!0}),n.forEach(t),x=a(e),u=i(e,"P",{}),U(u).forEach(t),M=a(e),f(T.$$.fragment,e),m=a(e),I=i(e,"P",{"data-svelte-h":!0}),w(I)!=="svelte-thlb2p"&&(I.textContent=Ee),ie=a(e),G=i(e,"P",{"data-svelte-h":!0}),w(G)!=="svelte-1poqhj5"&&(G.innerHTML=Pe),pe=a(e),V=i(e,"TABLE",{"data-svelte-h":!0}),w(V)!=="svelte-15v4ttf"&&(V.innerHTML=Ne),ce=a(e),f(L.$$.fragment,e),de=a(e),f($.$$.fragment,e),me=a(e),f(E.$$.fragment,e),ue=a(e),p=i(e,"DIV",{class:!0});var d=U(p);f(P.$$.fragment,d),xe=a(d),O=i(d,"P",{"data-svelte-h":!0}),w(O)!=="svelte-1t0mqls"&&(O.textContent=Xe),Je=a(d),K=i(d,"P",{"data-svelte-h":!0}),w(K)!=="svelte-mxgguy"&&(K.innerHTML=Re),Ue=a(d),J=i(d,"DIV",{class:!0});var k=U(J);f(N.$$.fragment,k),ve=a(k),ee=i(k,"P",{"data-svelte-h":!0}),w(ee)!=="svelte-v78lg8"&&(ee.textContent=ze),Ce=a(k),f(Z.$$.fragment,k),k.forEach(t),ke=a(d),F=i(d,"DIV",{class:!0});var be=U(F);f(X.$$.fragment,be),Le=a(be),te=i(be,"P",{"data-svelte-h":!0}),w(te)!=="svelte-1s3c06i"&&(te.innerHTML=He),be.forEach(t),Ze=a(d),j=i(d,"DIV",{class:!0});var Me=U(j);f(R.$$.fragment,Me),Fe=a(Me),ne=i(Me,"P",{"data-svelte-h":!0}),w(ne)!=="svelte-pkn4ui"&&(ne.innerHTML=Ye),Me.forEach(t),je=a(d),W=i(d,"DIV",{class:!0});var we=U(W);f(z.$$.fragment,we),We=a(we),oe=i(we,"P",{"data-svelte-h":!0}),w(oe)!=="svelte-14bnrb6"&&(oe.textContent=De),we.forEach(t),Se=a(d),S=i(d,"DIV",{class:!0});var Te=U(S);f(H.$$.fragment,Te),Be=a(Te),se=i(Te,"P",{"data-svelte-h":!0}),w(se)!=="svelte-1xwrf7t"&&(se.textContent=Ae),Te.forEach(t),Ge=a(d),ae=i(d,"DIV",{class:!0});var qe=U(ae);f(Y.$$.fragment,qe),qe.forEach(t),d.forEach(t),ge=a(e),f(D.$$.fragment,e),fe=a(e),C=i(e,"DIV",{class:!0});var Ie=U(C);f(A.$$.fragment,Ie),Ve=a(Ie),le=i(Ie,"P",{"data-svelte-h":!0}),w(le)!=="svelte-1qpjiuf"&&(le.textContent=Qe),Ie.forEach(t),he=a(e),f(Q.$$.fragment,e),_e=a(e),re=i(e,"P",{}),U(re).forEach(t),this.h()},h(){v(l,"name","hf:doc:metadata"),v(l,"content",dt),v(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(p,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(C,"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){o(document.head,l),c(e,x,n),c(e,u,n),c(e,M,n),h(T,e,n),c(e,m,n),c(e,I,n),c(e,ie,n),c(e,G,n),c(e,pe,n),c(e,V,n),c(e,ce,n),h(L,e,n),c(e,de,n),h($,e,n),c(e,me,n),h(E,e,n),c(e,ue,n),c(e,p,n),h(P,p,null),o(p,xe),o(p,O),o(p,Je),o(p,K),o(p,Ue),o(p,J),h(N,J,null),o(J,ve),o(J,ee),o(J,Ce),h(Z,J,null),o(p,ke),o(p,F),h(X,F,null),o(F,Le),o(F,te),o(p,Ze),o(p,j),h(R,j,null),o(j,Fe),o(j,ne),o(p,je),o(p,W),h(z,W,null),o(W,We),o(W,oe),o(p,Se),o(p,S),h(H,S,null),o(S,Be),o(S,se),o(p,Ge),o(p,ae),h(Y,ae,null),c(e,ge,n),h(D,e,n),c(e,fe,n),c(e,C,n),h(A,C,null),o(C,Ve),o(C,le),c(e,he,n),h(Q,e,n),c(e,_e,n),c(e,re,n),ye=!0},p(e,[n]){const d={};n&2&&(d.$$scope={dirty:n,ctx:e}),L.$set(d);const k={};n&2&&(k.$$scope={dirty:n,ctx:e}),Z.$set(k)},i(e){ye||(_(T.$$.fragment,e),_(L.$$.fragment,e),_($.$$.fragment,e),_(E.$$.fragment,e),_(P.$$.fragment,e),_(N.$$.fragment,e),_(Z.$$.fragment,e),_(X.$$.fragment,e),_(R.$$.fragment,e),_(z.$$.fragment,e),_(H.$$.fragment,e),_(Y.$$.fragment,e),_(D.$$.fragment,e),_(A.$$.fragment,e),_(Q.$$.fragment,e),ye=!0)},o(e){y(T.$$.fragment,e),y(L.$$.fragment,e),y($.$$.fragment,e),y(E.$$.fragment,e),y(P.$$.fragment,e),y(N.$$.fragment,e),y(Z.$$.fragment,e),y(X.$$.fragment,e),y(R.$$.fragment,e),y(z.$$.fragment,e),y(H.$$.fragment,e),y(Y.$$.fragment,e),y(D.$$.fragment,e),y(A.$$.fragment,e),y(Q.$$.fragment,e),ye=!1},d(e){e&&(t(x),t(u),t(M),t(m),t(I),t(ie),t(G),t(pe),t(V),t(ce),t(de),t(me),t(ue),t(p),t(ge),t(fe),t(C),t(he),t(_e),t(re)),t(l),b(T,e),b(L,e),b($,e),b(E,e),b(P),b(N),b(Z),b(X),b(R),b(z),b(H),b(Y),b(D,e),b(A),b(Q,e)}}}const dt='{"title":"FluxControlInpaint","local":"fluxcontrolinpaint","sections":[{"title":"FluxControlInpaintPipeline","local":"diffusers.FluxControlInpaintPipeline","sections":[],"depth":2},{"title":"FluxPipelineOutput","local":"diffusers.pipelines.flux.pipeline_output.FluxPipelineOutput","sections":[],"depth":2}],"depth":1}';function mt(q){return tt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Mt extends nt{constructor(l){super(),ot(this,l,mt,ct,et,{})}}export{Mt as component}; | |
Xet Storage Details
- Size:
- 45.6 kB
- Xet hash:
- 7202a7934f08f350fd89bfc3ea054489615cb99890a2b146ebe00aeed976c4c9
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.