Buckets:
| import{s as ke,o as Be,n as be}from"../chunks/scheduler.8c3d61f6.js";import{S as je,i as Se,g as p,s as i,r as _,A as Ce,h as c,f as n,c as o,j as H,u as y,x as T,k as O,y as g,a as s,v as b,d as x,t as w,w as P}from"../chunks/index.da70eac4.js";import{T as Je}from"../chunks/Tip.1d9b8c37.js";import{D as ye}from"../chunks/Docstring.567bc132.js";import{C as Le}from"../chunks/CodeBlock.a9c4becf.js";import{E as We}from"../chunks/ExampleCodeBlock.15b54358.js";import{H as ce,E as Ue}from"../chunks/index.5d4ab994.js";function De(E){let a,f='Make sure to check out the Schedulers <a href="../../using-diffusers/schedulers">guide</a> to learn how to explore the tradeoff between scheduler speed and quality, and see the <a href="../../using-diffusers/loading#reuse-a-pipeline">reuse components across pipelines</a> section to learn how to efficiently load the same components into multiple pipelines.';return{c(){a=p("p"),a.innerHTML=f},l(l){a=c(l,"P",{"data-svelte-h":!0}),T(a)!=="svelte-1qn15hi"&&(a.innerHTML=f)},m(l,d){s(l,a,d)},p:be,d(l){l&&n(a)}}}function Ge(E){let a,f="🧪 This is an experimental feature!";return{c(){a=p("p"),a.textContent=f},l(l){a=c(l,"P",{"data-svelte-h":!0}),T(a)!=="svelte-15q3ih4"&&(a.textContent=f)},m(l,d){s(l,a,d)},p:be,d(l){l&&n(a)}}}function Ze(E){let a,f="Example:",l,d,h;return d=new Le({props:{code:"aW1wb3J0JTIwUElMJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBpbyUyMGltcG9ydCUyMEJ5dGVzSU8lMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwUGFpbnRCeUV4YW1wbGVQaXBlbGluZSUwQSUwQSUwQWRlZiUyMGRvd25sb2FkX2ltYWdlKHVybCklM0ElMEElMjAlMjAlMjAlMjByZXNwb25zZSUyMCUzRCUyMHJlcXVlc3RzLmdldCh1cmwpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwUElMLkltYWdlLm9wZW4oQnl0ZXNJTyhyZXNwb25zZS5jb250ZW50KSkuY29udmVydCglMjJSR0IlMjIpJTBBJTBBJTBBaW1nX3VybCUyMCUzRCUyMCglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRnJhdy5naXRodWJ1c2VyY29udGVudC5jb20lMkZGYW50YXN5LVN0dWRpbyUyRlBhaW50LWJ5LUV4YW1wbGUlMkZtYWluJTJGZXhhbXBsZXMlMkZpbWFnZSUyRmV4YW1wbGVfMS5wbmclMjIlMEEpJTBBbWFza191cmwlMjAlM0QlMjAoJTBBJTIwJTIwJTIwJTIwJTIyaHR0cHMlM0ElMkYlMkZyYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tJTJGRmFudGFzeS1TdHVkaW8lMkZQYWludC1ieS1FeGFtcGxlJTJGbWFpbiUyRmV4YW1wbGVzJTJGbWFzayUyRmV4YW1wbGVfMS5wbmclMjIlMEEpJTBBZXhhbXBsZV91cmwlMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRnJhdy5naXRodWJ1c2VyY29udGVudC5jb20lMkZGYW50YXN5LVN0dWRpbyUyRlBhaW50LWJ5LUV4YW1wbGUlMkZtYWluJTJGZXhhbXBsZXMlMkZyZWZlcmVuY2UlMkZleGFtcGxlXzEuanBnJTIyJTBBJTBBaW5pdF9pbWFnZSUyMCUzRCUyMGRvd25sb2FkX2ltYWdlKGltZ191cmwpLnJlc2l6ZSgoNTEyJTJDJTIwNTEyKSklMEFtYXNrX2ltYWdlJTIwJTNEJTIwZG93bmxvYWRfaW1hZ2UobWFza191cmwpLnJlc2l6ZSgoNTEyJTJDJTIwNTEyKSklMEFleGFtcGxlX2ltYWdlJTIwJTNEJTIwZG93bmxvYWRfaW1hZ2UoZXhhbXBsZV91cmwpLnJlc2l6ZSgoNTEyJTJDJTIwNTEyKSklMEElMEFwaXBlJTIwJTNEJTIwUGFpbnRCeUV4YW1wbGVQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyRmFudGFzeS1TdHVkaW8lMkZQYWludC1ieS1FeGFtcGxlJTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBKSUwQXBpcGUlMjAlM0QlMjBwaXBlLnRvKCUyMmN1ZGElMjIpJTBBJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKGltYWdlJTNEaW5pdF9pbWFnZSUyQyUyMG1hc2tfaW1hZ2UlM0RtYXNrX2ltYWdlJTJDJTIwZXhhbXBsZV9pbWFnZSUzRGV4YW1wbGVfaW1hZ2UpLmltYWdlcyU1QjAlNUQlMEFpbWFnZQ==",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> PIL | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> requests | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> PaintByExamplePipeline | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">download_image</span>(<span class="hljs-params">url</span>): | |
| <span class="hljs-meta">... </span> response = requests.get(url) | |
| <span class="hljs-meta">... </span> <span class="hljs-keyword">return</span> PIL.Image.<span class="hljs-built_in">open</span>(BytesIO(response.content)).convert(<span class="hljs-string">"RGB"</span>) | |
| <span class="hljs-meta">>>> </span>img_url = ( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"https://raw.githubusercontent.com/Fantasy-Studio/Paint-by-Example/main/examples/image/example_1.png"</span> | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>mask_url = ( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"https://raw.githubusercontent.com/Fantasy-Studio/Paint-by-Example/main/examples/mask/example_1.png"</span> | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>example_url = <span class="hljs-string">"https://raw.githubusercontent.com/Fantasy-Studio/Paint-by-Example/main/examples/reference/example_1.jpg"</span> | |
| <span class="hljs-meta">>>> </span>init_image = download_image(img_url).resize((<span class="hljs-number">512</span>, <span class="hljs-number">512</span>)) | |
| <span class="hljs-meta">>>> </span>mask_image = download_image(mask_url).resize((<span class="hljs-number">512</span>, <span class="hljs-number">512</span>)) | |
| <span class="hljs-meta">>>> </span>example_image = download_image(example_url).resize((<span class="hljs-number">512</span>, <span class="hljs-number">512</span>)) | |
| <span class="hljs-meta">>>> </span>pipe = PaintByExamplePipeline.from_pretrained( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"Fantasy-Studio/Paint-by-Example"</span>, | |
| <span class="hljs-meta">... </span> torch_dtype=torch.float16, | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>pipe = pipe.to(<span class="hljs-string">"cuda"</span>) | |
| <span class="hljs-meta">>>> </span>image = pipe(image=init_image, mask_image=mask_image, example_image=example_image).images[<span class="hljs-number">0</span>] | |
| <span class="hljs-meta">>>> </span>image`,wrap:!1}}),{c(){a=p("p"),a.textContent=f,l=i(),_(d.$$.fragment)},l(r){a=c(r,"P",{"data-svelte-h":!0}),T(a)!=="svelte-11lpom8"&&(a.textContent=f),l=o(r),y(d.$$.fragment,r)},m(r,v){s(r,a,v),s(r,l,v),b(d,r,v),h=!0},p:be,i(r){h||(x(d.$$.fragment,r),h=!0)},o(r){w(d.$$.fragment,r),h=!1},d(r){r&&(n(a),n(l)),P(d,r)}}}function Xe(E){let a,f,l,d,h,r,v,xe='<a href="https://huggingface.co/papers/2211.13227" rel="nofollow">Paint by Example: Exemplar-based Image Editing with Diffusion Models</a> is by Binxin Yang, Shuyang Gu, Bo Zhang, Ting Zhang, Xuejin Chen, Xiaoyan Sun, Dong Chen, Fang Wen.',q,j,we="The abstract from the paper is:",Q,S,Pe="<em>Language-guided image editing has achieved great success recently. In this paper, for the first time, we investigate exemplar-guided image editing for more precise control. We achieve this goal by leveraging self-supervised training to disentangle and re-organize the source image and the exemplar. However, the naive approach will cause obvious fusing artifacts. We carefully analyze it and propose an information bottleneck and strong augmentations to avoid the trivial solution of directly copying and pasting the exemplar image. Meanwhile, to ensure the controllability of the editing process, we design an arbitrary shape mask for the exemplar image and leverage the classifier-free guidance to increase the similarity to the exemplar image. The whole framework involves a single forward of the diffusion model without any iterative optimization. We demonstrate that our method achieves an impressive performance and enables controllable editing on in-the-wild images with high fidelity.</em>",K,C,Te='The original codebase can be found at <a href="https://github.com/Fantasy-Studio/Paint-by-Example" rel="nofollow">Fantasy-Studio/Paint-by-Example</a>, and you can try it out in a <a href="https://huggingface.co/spaces/Fantasy-Studio/Paint-by-Example" rel="nofollow">demo</a>.',ee,L,te,W,ve='Paint by Example is supported by the official <a href="https://huggingface.co/Fantasy-Studio/Paint-by-Example" rel="nofollow">Fantasy-Studio/Paint-by-Example</a> checkpoint. The checkpoint is warm-started from <a href="https://huggingface.co/CompVis/stable-diffusion-v1-4" rel="nofollow">CompVis/stable-diffusion-v1-4</a> to inpaint partly masked images conditioned on example and reference images.',ne,J,ae,U,se,m,D,de,k,me,N,$e="Pipeline for image-guided image inpainting using Stable Diffusion.",fe,z,Ie=`This model inherits from <a href="/docs/diffusers/pr_11234/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a>. Check the superclass documentation for the generic methods | |
| implemented for all pipelines (downloading, saving, running on a particular device, etc.).`,ue,$,G,ge,R,Me="The call function to the pipeline for generation.",he,B,ie,Z,oe,I,X,_e,Y,Ee="Output class for Stable Diffusion pipelines.",le,V,re,A,pe;return h=new ce({props:{title:"Paint by Example",local:"paint-by-example",headingTag:"h1"}}),L=new ce({props:{title:"Tips",local:"tips",headingTag:"h2"}}),J=new Je({props:{$$slots:{default:[De]},$$scope:{ctx:E}}}),U=new ce({props:{title:"PaintByExamplePipeline",local:"diffusers.PaintByExamplePipeline",headingTag:"h2"}}),D=new ye({props:{name:"class diffusers.PaintByExamplePipeline",anchor:"diffusers.PaintByExamplePipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"image_encoder",val:": PaintByExampleImageEncoder"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": typing.Union[diffusers.schedulers.scheduling_ddim.DDIMScheduler, diffusers.schedulers.scheduling_pndm.PNDMScheduler, diffusers.schedulers.scheduling_lms_discrete.LMSDiscreteScheduler]"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"requires_safety_checker",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.PaintByExamplePipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/pr_11234/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.PaintByExamplePipeline.image_encoder",description:`<strong>image_encoder</strong> (<code>PaintByExampleImageEncoder</code>) — | |
| Encodes the example input image. The <code>unet</code> is conditioned on the example image instead of a text prompt.`,name:"image_encoder"},{anchor:"diffusers.PaintByExamplePipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>) — | |
| A <code>CLIPTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.PaintByExamplePipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/pr_11234/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) — | |
| A <code>UNet2DConditionModel</code> to denoise the encoded image latents.`,name:"unet"},{anchor:"diffusers.PaintByExamplePipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/pr_11234/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) — | |
| A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of | |
| <a href="/docs/diffusers/pr_11234/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/pr_11234/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/pr_11234/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.PaintByExamplePipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) — | |
| Classification module that estimates whether generated images could be considered offensive or harmful. | |
| Please refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for more details | |
| about a model’s potential harms.`,name:"safety_checker"},{anchor:"diffusers.PaintByExamplePipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPImageProcessor" rel="nofollow">CLIPImageProcessor</a>) — | |
| A <code>CLIPImageProcessor</code> to extract features from generated images; used as inputs to the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/vr_11234/src/diffusers/pipelines/paint_by_example/pipeline_paint_by_example.py#L158"}}),k=new Je({props:{warning:!0,$$slots:{default:[Ge]},$$scope:{ctx:E}}}),G=new ye({props:{name:"__call__",anchor:"diffusers.PaintByExamplePipeline.__call__",parameters:[{name:"example_image",val:": typing.Union[torch.Tensor, PIL.Image.Image]"},{name:"image",val:": typing.Union[torch.Tensor, PIL.Image.Image]"},{name:"mask_image",val:": typing.Union[torch.Tensor, PIL.Image.Image]"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 5.0"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.Tensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Optional[typing.Callable[[int, int, torch.Tensor], NoneType]] = None"},{name:"callback_steps",val:": int = 1"}],parametersDescription:[{anchor:"diffusers.PaintByExamplePipeline.__call__.example_image",description:`<strong>example_image</strong> (<code>torch.Tensor</code> or <code>PIL.Image.Image</code> or <code>List[PIL.Image.Image]</code>) — | |
| An example image to guide image generation.`,name:"example_image"},{anchor:"diffusers.PaintByExamplePipeline.__call__.image",description:`<strong>image</strong> (<code>torch.Tensor</code> or <code>PIL.Image.Image</code> or <code>List[PIL.Image.Image]</code>) — | |
| <code>Image</code> or tensor representing an image batch to be inpainted (parts of the image are masked out with | |
| <code>mask_image</code> and repainted according to <code>prompt</code>).`,name:"image"},{anchor:"diffusers.PaintByExamplePipeline.__call__.mask_image",description:`<strong>mask_image</strong> (<code>torch.Tensor</code> or <code>PIL.Image.Image</code> or <code>List[PIL.Image.Image]</code>) — | |
| <code>Image</code> 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 tensor, it should contain one color channel (L) instead of 3, so the | |
| expected shape would be <code>(B, H, W, 1)</code>.`,name:"mask_image"},{anchor:"diffusers.PaintByExamplePipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.unet.config.sample_size * self.vae_scale_factor</code>) — | |
| The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.PaintByExamplePipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.unet.config.sample_size * self.vae_scale_factor</code>) — | |
| The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.PaintByExamplePipeline.__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.PaintByExamplePipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) — | |
| A higher guidance scale value encourages the model to generate images closely linked to the text | |
| <code>prompt</code> at the expense of lower image quality. Guidance scale is enabled when <code>guidance_scale > 1</code>.`,name:"guidance_scale"},{anchor:"diffusers.PaintByExamplePipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) — | |
| The prompt or prompts to guide what to not include in image generation. If not defined, you need to | |
| pass <code>negative_prompt_embeds</code> instead. Ignored when not using guidance (<code>guidance_scale < 1</code>).`,name:"negative_prompt"},{anchor:"diffusers.PaintByExamplePipeline.__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.PaintByExamplePipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) — | |
| Corresponds to parameter eta (η) from the <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">DDIM</a> paper. Only applies | |
| to the <a href="/docs/diffusers/pr_11234/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, and is ignored in other schedulers.`,name:"eta"},{anchor:"diffusers.PaintByExamplePipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) — | |
| A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow"><code>torch.Generator</code></a> to make | |
| generation deterministic.`,name:"generator"},{anchor:"diffusers.PaintByExamplePipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated noisy latents sampled from a Gaussian distribution, to be used as inputs for image | |
| generation. Can be used to tweak the same generation with different prompts. If not provided, a latents | |
| tensor is generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.PaintByExamplePipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"pil"</code>) — | |
| The output format of the generated image. Choose between <code>PIL.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.PaintByExamplePipeline.__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 <a href="/docs/diffusers/pr_11234/en/api/pipelines/stable_diffusion/inpaint#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a | |
| plain tuple.`,name:"return_dict"},{anchor:"diffusers.PaintByExamplePipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) — | |
| A function that calls every <code>callback_steps</code> steps during inference. The function is called with the | |
| following arguments: <code>callback(step: int, timestep: int, latents: torch.Tensor)</code>.`,name:"callback"},{anchor:"diffusers.PaintByExamplePipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — | |
| The frequency at which the <code>callback</code> function is called. If not specified, the callback is called at | |
| every step.`,name:"callback_steps"}],source:"https://github.com/huggingface/diffusers/blob/vr_11234/src/diffusers/pipelines/paint_by_example/pipeline_paint_by_example.py#L400",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>If <code>return_dict</code> is <code>True</code>, <a | |
| href="/docs/diffusers/pr_11234/en/api/pipelines/stable_diffusion/inpaint#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput" | |
| >StableDiffusionPipelineOutput</a> is returned, | |
| otherwise a <code>tuple</code> is returned where the first element is a list with the generated images and the | |
| second element is a list of <code>bool</code>s indicating whether the corresponding generated image contains | |
| “not-safe-for-work” (nsfw) content.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><a | |
| href="/docs/diffusers/pr_11234/en/api/pipelines/stable_diffusion/inpaint#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput" | |
| >StableDiffusionPipelineOutput</a> or <code>tuple</code></p> | |
| `}}),B=new We({props:{anchor:"diffusers.PaintByExamplePipeline.__call__.example",$$slots:{default:[Ze]},$$scope:{ctx:E}}}),Z=new ce({props:{title:"StableDiffusionPipelineOutput",local:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",headingTag:"h2"}}),X=new ye({props:{name:"class diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",parameters:[{name:"images",val:": typing.Union[typing.List[PIL.Image.Image], numpy.ndarray]"},{name:"nsfw_content_detected",val:": typing.Optional[typing.List[bool]]"}],parametersDescription:[{anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput.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>.`,name:"images"},{anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput.nsfw_content_detected",description:`<strong>nsfw_content_detected</strong> (<code>List[bool]</code>) — | |
| List indicating whether the corresponding generated image contains “not-safe-for-work” (nsfw) content or | |
| <code>None</code> if safety checking could not be performed.`,name:"nsfw_content_detected"}],source:"https://github.com/huggingface/diffusers/blob/vr_11234/src/diffusers/pipelines/stable_diffusion/pipeline_output.py#L10"}}),V=new Ue({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/paint_by_example.md"}}),{c(){a=p("meta"),f=i(),l=p("p"),d=i(),_(h.$$.fragment),r=i(),v=p("p"),v.innerHTML=xe,q=i(),j=p("p"),j.textContent=we,Q=i(),S=p("p"),S.innerHTML=Pe,K=i(),C=p("p"),C.innerHTML=Te,ee=i(),_(L.$$.fragment),te=i(),W=p("p"),W.innerHTML=ve,ne=i(),_(J.$$.fragment),ae=i(),_(U.$$.fragment),se=i(),m=p("div"),_(D.$$.fragment),de=i(),_(k.$$.fragment),me=i(),N=p("p"),N.textContent=$e,fe=i(),z=p("p"),z.innerHTML=Ie,ue=i(),$=p("div"),_(G.$$.fragment),ge=i(),R=p("p"),R.textContent=Me,he=i(),_(B.$$.fragment),ie=i(),_(Z.$$.fragment),oe=i(),I=p("div"),_(X.$$.fragment),_e=i(),Y=p("p"),Y.textContent=Ee,le=i(),_(V.$$.fragment),re=i(),A=p("p"),this.h()},l(e){const t=Ce("svelte-u9bgzb",document.head);a=c(t,"META",{name:!0,content:!0}),t.forEach(n),f=o(e),l=c(e,"P",{}),H(l).forEach(n),d=o(e),y(h.$$.fragment,e),r=o(e),v=c(e,"P",{"data-svelte-h":!0}),T(v)!=="svelte-18m3poz"&&(v.innerHTML=xe),q=o(e),j=c(e,"P",{"data-svelte-h":!0}),T(j)!=="svelte-1cwsb16"&&(j.textContent=we),Q=o(e),S=c(e,"P",{"data-svelte-h":!0}),T(S)!=="svelte-cwxbih"&&(S.innerHTML=Pe),K=o(e),C=c(e,"P",{"data-svelte-h":!0}),T(C)!=="svelte-1pp3j5k"&&(C.innerHTML=Te),ee=o(e),y(L.$$.fragment,e),te=o(e),W=c(e,"P",{"data-svelte-h":!0}),T(W)!=="svelte-170d2m8"&&(W.innerHTML=ve),ne=o(e),y(J.$$.fragment,e),ae=o(e),y(U.$$.fragment,e),se=o(e),m=c(e,"DIV",{class:!0});var u=H(m);y(D.$$.fragment,u),de=o(u),y(k.$$.fragment,u),me=o(u),N=c(u,"P",{"data-svelte-h":!0}),T(N)!=="svelte-1xhroxt"&&(N.textContent=$e),fe=o(u),z=c(u,"P",{"data-svelte-h":!0}),T(z)!=="svelte-1k5rinp"&&(z.innerHTML=Ie),ue=o(u),$=c(u,"DIV",{class:!0});var M=H($);y(G.$$.fragment,M),ge=o(M),R=c(M,"P",{"data-svelte-h":!0}),T(R)!=="svelte-50j04k"&&(R.textContent=Me),he=o(M),y(B.$$.fragment,M),M.forEach(n),u.forEach(n),ie=o(e),y(Z.$$.fragment,e),oe=o(e),I=c(e,"DIV",{class:!0});var F=H(I);y(X.$$.fragment,F),_e=o(F),Y=c(F,"P",{"data-svelte-h":!0}),T(Y)!=="svelte-1qpjiuf"&&(Y.textContent=Ee),F.forEach(n),le=o(e),y(V.$$.fragment,e),re=o(e),A=c(e,"P",{}),H(A).forEach(n),this.h()},h(){O(a,"name","hf:doc:metadata"),O(a,"content",Ve),O($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),O(m,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),O(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,t){g(document.head,a),s(e,f,t),s(e,l,t),s(e,d,t),b(h,e,t),s(e,r,t),s(e,v,t),s(e,q,t),s(e,j,t),s(e,Q,t),s(e,S,t),s(e,K,t),s(e,C,t),s(e,ee,t),b(L,e,t),s(e,te,t),s(e,W,t),s(e,ne,t),b(J,e,t),s(e,ae,t),b(U,e,t),s(e,se,t),s(e,m,t),b(D,m,null),g(m,de),b(k,m,null),g(m,me),g(m,N),g(m,fe),g(m,z),g(m,ue),g(m,$),b(G,$,null),g($,ge),g($,R),g($,he),b(B,$,null),s(e,ie,t),b(Z,e,t),s(e,oe,t),s(e,I,t),b(X,I,null),g(I,_e),g(I,Y),s(e,le,t),b(V,e,t),s(e,re,t),s(e,A,t),pe=!0},p(e,[t]){const u={};t&2&&(u.$$scope={dirty:t,ctx:e}),J.$set(u);const M={};t&2&&(M.$$scope={dirty:t,ctx:e}),k.$set(M);const F={};t&2&&(F.$$scope={dirty:t,ctx:e}),B.$set(F)},i(e){pe||(x(h.$$.fragment,e),x(L.$$.fragment,e),x(J.$$.fragment,e),x(U.$$.fragment,e),x(D.$$.fragment,e),x(k.$$.fragment,e),x(G.$$.fragment,e),x(B.$$.fragment,e),x(Z.$$.fragment,e),x(X.$$.fragment,e),x(V.$$.fragment,e),pe=!0)},o(e){w(h.$$.fragment,e),w(L.$$.fragment,e),w(J.$$.fragment,e),w(U.$$.fragment,e),w(D.$$.fragment,e),w(k.$$.fragment,e),w(G.$$.fragment,e),w(B.$$.fragment,e),w(Z.$$.fragment,e),w(X.$$.fragment,e),w(V.$$.fragment,e),pe=!1},d(e){e&&(n(f),n(l),n(d),n(r),n(v),n(q),n(j),n(Q),n(S),n(K),n(C),n(ee),n(te),n(W),n(ne),n(ae),n(se),n(m),n(ie),n(oe),n(I),n(le),n(re),n(A)),n(a),P(h,e),P(L,e),P(J,e),P(U,e),P(D),P(k),P(G),P(B),P(Z,e),P(X),P(V,e)}}}const Ve='{"title":"Paint by Example","local":"paint-by-example","sections":[{"title":"Tips","local":"tips","sections":[],"depth":2},{"title":"PaintByExamplePipeline","local":"diffusers.PaintByExamplePipeline","sections":[],"depth":2},{"title":"StableDiffusionPipelineOutput","local":"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput","sections":[],"depth":2}],"depth":1}';function Fe(E){return Be(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class qe extends je{constructor(a){super(),Se(this,a,Fe,Xe,ke,{})}}export{qe as component}; | |
Xet Storage Details
- Size:
- 27 kB
- Xet hash:
- b584e6b17bb57360a153db554243d0347ab331dee29ebb0d92e44a8ec48c79ac
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.