import{S as sZ,i as oZ,s as lZ,e as o,k as r,w as f,t as a,M as iZ,c as l,d as t,m as p,a as i,x as u,h as s,b as d,N as aZ,G as e,g as m,y as h,q as _,o as y,B as b,v as rZ,L as Ds}from"../../../chunks/vendor-hf-doc-builder.js";import{D as X}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as S}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as $}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ys}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function pZ(q){let w,x,C,M,R;return M=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMElGUGlwZWxpbmUlMkMlMjBJRlN1cGVyUmVzb2x1dGlvblBpcGVsaW5lJTJDJTIwRGlmZnVzaW9uUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwcHRfdG9fcGlsJTBBaW1wb3J0JTIwdG9yY2glMEElMEFwaXBlJTIwJTNEJTIwSUZQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyRGVlcEZsb3lkJTJGSUYtSS1YTC12MS4wJTIyJTJDJTIwdmFyaWFudCUzRCUyMmZwMTYlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpJTBBcGlwZS5lbmFibGVfbW9kZWxfY3B1X29mZmxvYWQoKSUwQSUwQXByb21wdCUyMCUzRCUyMCdhJTIwcGhvdG8lMjBvZiUyMGElMjBrYW5nYXJvbyUyMHdlYXJpbmclMjBhbiUyMG9yYW5nZSUyMGhvb2RpZSUyMGFuZCUyMGJsdWUlMjBzdW5nbGFzc2VzJTIwc3RhbmRpbmclMjBpbiUyMGZyb250JTIwb2YlMjB0aGUlMjBlaWZmZWwlMjB0b3dlciUyMGhvbGRpbmclMjBhJTIwc2lnbiUyMHRoYXQlMjBzYXlzJTIwJTIydmVyeSUyMGRlZXAlMjBsZWFybmluZyUyMiclMEFw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XZlJTIwaW50ZXJtZWRpYXRlJTIwaW1hZ2UlMEFwaWxfaW1hZ2UlMjAlM0QlMjBwdF90b19waWwoaW1hZ2UpJTBBcGlsX2ltYWdlJTVCMCU1RC5zYXZlKCUyMi4lMkZpZl9zdGFnZV9JLnBuZyUyMiklMEElMEFzYWZldHlfbW9kdWxlcyUyMCUzRCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMmZlYXR1cmVfZXh0cmFjdG9yJTIyJTNBJTIwcGlwZS5mZWF0dXJlX2V4dHJhY3RvciUyQyUwQSUyMCUyMCUyMCUyMCUyMnNhZmV0eV9jaGVja2VyJTIyJTNBJTIwcGlwZS5zYWZldHlfY2hlY2tlciUyQyUwQSUyMCUyMCUyMCUyMCUyMndhdGVybWFya2VyJTIyJTNBJTIwcGlwZS53YXRlcm1hcmtlciUyQyUwQSU3RCUwQXN1cGVyX3Jlc18yX3BpcGUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLXg0LXVwc2NhbGVyJTIyJTJDJTIwKipzYWZldHlfbW9kdWxlcyUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUwQSklMEFzdXBlcl9yZXNfMl9waXBlLmVuYWJsZV9tb2RlbF9jcHVfb2ZmbG9hZCgpJTBBJTBBaW1hZ2UlMjAlM0QlMjBzdXBlcl9yZXNfMl9waXBlKCUwQSUyMCUyMCUyMCUyMHByb21wdCUzRHByb21wdCUyQyUwQSUyMCUyMCUyMCUyMGltYWdlJTNEaW1hZ2UlMkMlMEEpLmltYWdlcyUwQWltYWdlJTVCMCU1RC5zYXZlKCUyMi4lMkZpZl9zdGFnZV9JSS5wbmclMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> IFPipeline, IFSuperResolutionPipeline, DiffusionPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> pt_to_pil
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = IFPipeline.from_pretrained(<span class="hljs-string">&quot;DeepFloyd/IF-I-XL-v1.0&quot;</span>, variant=<span class="hljs-string">&quot;fp16&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_model_cpu_offload()

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&#x27;a photo of a kangaroo wearing an orange hoodie and blue sunglasses standing in front of the eiffel tower holding a sign that says &quot;very deep learning&quot;&#x27;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt_embeds, negative_embeds = pipe.encode_prompt(prompt)

<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt_embeds=prompt_embeds, negative_prompt_embeds=negative_embeds, output_type=<span class="hljs-string">&quot;pt&quot;</span>).images

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># save intermediate image</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pil_image = pt_to_pil(image)
<span class="hljs-meta">&gt;&gt;&gt; </span>pil_image[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;./if_stage_I.png&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>super_res_1_pipe = IFSuperResolutionPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;DeepFloyd/IF-II-L-v1.0&quot;</span>, text_encoder=<span class="hljs-literal">None</span>, variant=<span class="hljs-string">&quot;fp16&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>super_res_1_pipe.enable_model_cpu_offload()

<span class="hljs-meta">&gt;&gt;&gt; </span>image = super_res_1_pipe(
<span class="hljs-meta">... </span>    image=image, prompt_embeds=prompt_embeds, negative_prompt_embeds=negative_embeds, output_type=<span class="hljs-string">&quot;pt&quot;</span>
<span class="hljs-meta">... </span>).images

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># save intermediate image</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pil_image = pt_to_pil(image)
<span class="hljs-meta">&gt;&gt;&gt; </span>pil_image[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;./if_stage_I.png&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>safety_modules = {
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;feature_extractor&quot;</span>: pipe.feature_extractor,
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;safety_checker&quot;</span>: pipe.safety_checker,
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;watermarker&quot;</span>: pipe.watermarker,
<span class="hljs-meta">... </span>}
<span class="hljs-meta">&gt;&gt;&gt; </span>super_res_2_pipe = DiffusionPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;stabilityai/stable-diffusion-x4-upscaler&quot;</span>, **safety_modules, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>super_res_2_pipe.enable_model_cpu_offload()

<span class="hljs-meta">&gt;&gt;&gt; </span>image = super_res_2_pipe(
<span class="hljs-meta">... </span>    prompt=prompt,
<span class="hljs-meta">... </span>    image=image,
<span class="hljs-meta">... </span>).images
<span class="hljs-meta">&gt;&gt;&gt; </span>image[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;./if_stage_II.png&quot;</span>)`}}),{c(){w=o("p"),x=a("Examples:"),C=r(),f(M.$$.fragment)},l(g){w=l(g,"P",{});var G=i(w);x=s(G,"Examples:"),G.forEach(t),C=p(g),u(M.$$.fragment,g)},m(g,G){m(g,w,G),e(w,x),m(g,C,G),h(M,g,G),R=!0},p:Ds,i(g){R||(_(M.$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ZW1iZWRzJTJDJTIwb3V0cHV0X3R5cGUlM0QlMjJwdCUyMikuaW1hZ2VzJTBBJTBBJTIzJTIwc2F2ZSUyMGludGVybWVkaWF0ZSUyMGltYWdlJTBBcGlsX2ltYWdlJTIwJTNEJTIwcHRfdG9fcGlsKGltYWdlKSUwQXBpbF9pbWFnZSU1QjAlNUQuc2F2ZSglMjIuJTJGaWZfc3RhZ2VfSS5wbmclMjIpJTBBJTBBc3VwZXJfcmVzXzFfcGlwZSUyMCUzRCUyMElGU3VwZXJSZXNvbHV0aW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMkRlZXBGbG95ZCUyRklGLUlJLUwtdjEuMCUyMiUyQyUyMHRleHRfZW5jb2RlciUzRE5vbmUlMkMlMjB2YXJpYW50JTNEJTIyZnAxNiUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUwQSklMEFzdXBlcl9yZXNfMV9waXBlLmVuYWJsZV9tb2RlbF9jcHVfb2ZmbG9hZCgpJTBBJTBBaW1hZ2UlMjAlM0QlMjBzdXBlcl9yZXNfMV9waXBlKCUwQSUyMCUyMCUyMCUyMGltYWdlJTNEaW1hZ2UlMkMlMjBwcm9tcHRfZW1iZWRzJTNEcHJvbXB0X2VtYmVkcyUyQyUyMG5lZ2F0aXZlX3Byb21wdF9lbWJlZHMlM0RuZWdhdGl2ZV9lbWJlZHMlMEEpLmltYWdlcyUwQWltYWdlJTVCMCU1RC5zYXZlKCUyMi4lMkZpZl9zdGFnZV9JSS5wbmclMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> IFPipeline, IFSuperResolutionPipeline, DiffusionPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> pt_to_pil
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = IFPipeline.from_pretrained(<span class="hljs-string">&quot;DeepFloyd/IF-I-XL-v1.0&quot;</span>, variant=<span class="hljs-string">&quot;fp16&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_model_cpu_offload()

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&#x27;a photo of a kangaroo wearing an orange hoodie and blue sunglasses standing in front of the eiffel tower holding a sign that says &quot;very deep learning&quot;&#x27;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt_embeds, negative_embeds = pipe.encode_prompt(prompt)

<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt_embeds=prompt_embeds, negative_prompt_embeds=negative_embeds, output_type=<span class="hljs-string">&quot;pt&quot;</span>).images

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># save intermediate image</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pil_image = pt_to_pil(image)
<span class="hljs-meta">&gt;&gt;&gt; </span>pil_image[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;./if_stage_I.png&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>super_res_1_pipe = IFSuperResolutionPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;DeepFloyd/IF-II-L-v1.0&quot;</span>, text_encoder=<span class="hljs-literal">None</span>, variant=<span class="hljs-string">&quot;fp16&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>super_res_1_pipe.enable_model_cpu_offload()

<span class="hljs-meta">&gt;&gt;&gt; </span>image = super_res_1_pipe(
<span class="hljs-meta">... </span>    image=image, prompt_embeds=prompt_embeds, negative_prompt_embeds=negative_embeds
<span class="hljs-meta">... </span>).images
<span class="hljs-meta">&gt;&gt;&gt; </span>image[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;./if_stage_II.png&quot;</span>)`}}),{c(){w=o("p"),x=a("Examples:"),C=r(),f(M.$$.fragment)},l(g){w=l(g,"P",{});var G=i(w);x=s(G,"Examples:"),G.forEach(t),C=p(g),u(M.$$.fragment,g)},m(g,G){m(g,w,G),e(w,x),m(g,C,G),h(M,g,G),R=!0},p:Ds,i(g){R||(_(M.$$.fragment,g),R=!0)},o(g){y(M.$$.fragment,g),R=!1},d(g){g&&t(w),g&&t(C),b(M,g)}}}function cZ(q){let w,x,C,M,R;return M=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMElGSW1nMkltZ1BpcGVsaW5lJTJDJTIwSUZJbWcySW1nU3VwZXJSZXNvbHV0aW9uUGlwZWxpbmUlMkMlMjBEaWZmdXNpb25QaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBwdF90b19waWwlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWltcG9ydCUyMHJlcXVlc3RzJTBBZnJvbSUyMGlvJTIwaW1wb3J0JTIwQnl0ZXNJTyUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSUyRkNvbXBWaXMlMkZzdGFibGUtZGlmZnVzaW9uJTJGbWFpbiUyRmFzc2V0cyUyRnN0YWJsZS1zYW1wbGVzJTJGaW1nMmltZyUyRnNrZXRjaC1tb3VudGFpbnMtaW5wdXQuanBnJTIyJTBBcmVzcG9uc2UlMjAlM0QlMjByZXF1ZXN0cy5nZXQodXJsKSUwQW9yaWdpbmFsX2ltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihCeXRlc0lPKHJlc3BvbnNlLmNvbnRlbnQpKS5jb252ZXJ0KCUyMlJHQiUyMiklMEFvcmlnaW5hbF9pbWFnZSUyMCUzRCUyMG9yaWdpbmFsX2ltY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XBlclJlc29sdXRpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyRGVlcEZsb3lkJTJGSUYtSUktTC12MS4wJTIyJTJDJTBBJTIwJTIwJTIwJTIwdGV4dF9lbmNvZGVyJTNETm9uZSUyQyUwQSUyMCUyMCUyMCUyMHZhcmlhbnQlM0QlMjJmcDE2JTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBKSUwQXN1cGVyX3Jlc18xX3BpcGUuZW5hYmxlX21vZGVsX2NwdV9vZmZsb2FkKCklMEElMEFpbWFnZSUyMCUzRCUyMHN1cGVyX3Jlc18xX3BpcGUoJTBBJTIwJTIwJTIwJTIwaW1hZ2UlM0RpbWFnZSUyQyUwQSUyMCUyMCUyMCUyMG9yaWdpbmFsX2ltYWdlJTNEb3JpZ2luYWxfaW1hZ2UlMkMlMEElMjAlMjAlMjAlMjBwcm9tcHRfZW1iZWRzJTNEcHJvbXB0X2VtYmVkcyUyQyUwQSUyMCUyMCUyMCUyMG5lZ2F0aXZlX3Byb21wdF9lbWJlZHMlM0RuZWdhdGl2ZV9lbWJlZHMlMkMlMEEpLmltYWdlcyUwQWltYWdlJTVCMCU1RC5zYXZlKCUyMi4lMkZpZl9zdGFnZV9JSS5wbmclMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> IFImg2ImgPipeline, IFImg2ImgSuperResolutionPipeline, DiffusionPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> pt_to_pil
<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">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>response = requests.get(url)
<span class="hljs-meta">&gt;&gt;&gt; </span>original_image = Image.<span class="hljs-built_in">open</span>(BytesIO(response.content)).convert(<span class="hljs-string">&quot;RGB&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>original_image = original_image.resize((<span class="hljs-number">768</span>, <span class="hljs-number">512</span>))

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = IFImg2ImgPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;DeepFloyd/IF-I-XL-v1.0&quot;</span>,
<span class="hljs-meta">... </span>    variant=<span class="hljs-string">&quot;fp16&quot;</span>,
<span class="hljs-meta">... </span>    torch_dtype=torch.float16,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_model_cpu_offload()

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;A fantasy landscape in style minecraft&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt_embeds, negative_embeds = pipe.encode_prompt(prompt)

<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(
<span class="hljs-meta">... </span>    image=original_image,
<span class="hljs-meta">... </span>    prompt_embeds=prompt_embeds,
<span class="hljs-meta">... </span>    negative_prompt_embeds=negative_embeds,
<span class="hljs-meta">... </span>    output_type=<span class="hljs-string">&quot;pt&quot;</span>,
<span class="hljs-meta">... </span>).images

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># save intermediate image</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pil_image = pt_to_pil(image)
<span class="hljs-meta">&gt;&gt;&gt; </span>pil_image[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;./if_stage_I.png&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>super_res_1_pipe = IFImg2ImgSuperResolutionPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;DeepFloyd/IF-II-L-v1.0&quot;</span>,
<span class="hljs-meta">... </span>    text_encoder=<span class="hljs-literal">None</span>,
<span class="hljs-meta">... </span>    variant=<span class="hljs-string">&quot;fp16&quot;</span>,
<span class="hljs-meta">... </span>    torch_dtype=torch.float16,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>super_res_1_pipe.enable_model_cpu_offload()

<span class="hljs-meta">&gt;&gt;&gt; </span>image = super_res_1_pipe(
<span class="hljs-meta">... </span>    image=image,
<span class="hljs-meta">... </span>    original_image=original_image,
<span class="hljs-meta">... </span>    prompt_embeds=prompt_embeds,
<span class="hljs-meta">... </span>    negative_prompt_embeds=negative_embeds,
<span class="hljs-meta">... </span>).images
<span class="hljs-meta">&gt;&gt;&gt; </span>image[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;./if_stage_II.png&quot;</span>)`}}),{c(){w=o("p"),x=a("Examples:"),C=r(),f(M.$$.fragment)},l(g){w=l(g,"P",{});var G=i(w);x=s(G,"Examples:"),G.forEach(t),C=p(g),u(M.$$.fragment,g)},m(g,G){m(g,w,G),e(w,x),m(g,C,G),h(M,g,G),R=!0},p:Ds,i(g){R||(_(M.$$.fragment,g),R=!0)},o(g){y(M.$$.fragment,g),R=!1},d(g){g&&t(w),g&&t(C),b(M,g)}}}function mZ(q){let w,x,C,M,R;return M=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMElGSW1nMkltZ1BpcGVsaW5lJTJDJTIwSUZJbWcySW1nU3VwZXJSZXNvbHV0aW9uUGlwZWxpbmUlMkMlMjBEaWZmdXNpb25QaXBlbGluZSUwQW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wQSUyMCUyMCUyMCUyMG9yaWdpbmFsX2ltYWdlJTNEb3JpZ2luYWxfaW1hZ2UlMkMlMEElMjAlMjAlMjAlMjBwcm9tcHRfZW1iZWRzJTNEcHJvbXB0X2VtYmVkcyUyQyUwQSUyMCUyMCUyMCUyMG5lZ2F0aXZlX3Byb21wdF9lbWJlZHMlM0RuZWdhdGl2ZV9lbWJlZHMlMkMlMEEpLmltYWdlcyUwQWltYWdlJTVCMCU1RC5zYXZlKCUyMi4lMkZpZl9zdGFnZV9JSS5wbmclMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> IFImg2ImgPipeline, IFImg2ImgSuperResolutionPipeline, DiffusionPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> pt_to_pil
<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">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>response = requests.get(url)
<span class="hljs-meta">&gt;&gt;&gt; </span>original_image = Image.<span class="hljs-built_in">open</span>(BytesIO(response.content)).convert(<span class="hljs-string">&quot;RGB&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>original_image = original_image.resize((<span class="hljs-number">768</span>, <span class="hljs-number">512</span>))

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = IFImg2ImgPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;DeepFloyd/IF-I-XL-v1.0&quot;</span>,
<span class="hljs-meta">... </span>    variant=<span class="hljs-string">&quot;fp16&quot;</span>,
<span class="hljs-meta">... </span>    torch_dtype=torch.float16,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_model_cpu_offload()

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;A fantasy landscape in style minecraft&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt_embeds, negative_embeds = pipe.encode_prompt(prompt)

<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(
<span class="hljs-meta">... </span>    image=original_image,
<span class="hljs-meta">... </span>    prompt_embeds=prompt_embeds,
<span class="hljs-meta">... </span>    negative_prompt_embeds=negative_embeds,
<span class="hljs-meta">... </span>    output_type=<span class="hljs-string">&quot;pt&quot;</span>,
<span class="hljs-meta">... </span>).images

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># save intermediate image</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pil_image = pt_to_pil(image)
<span class="hljs-meta">&gt;&gt;&gt; </span>pil_image[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;./if_stage_I.png&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>super_res_1_pipe = IFImg2ImgSuperResolutionPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;DeepFloyd/IF-II-L-v1.0&quot;</span>,
<span class="hljs-meta">... </span>    text_encoder=<span class="hljs-literal">None</span>,
<span class="hljs-meta">... </span>    variant=<span class="hljs-string">&quot;fp16&quot;</span>,
<span class="hljs-meta">... </span>    torch_dtype=torch.float16,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>super_res_1_pipe.enable_model_cpu_offload()

<span class="hljs-meta">&gt;&gt;&gt; </span>image = super_res_1_pipe(
<span class="hljs-meta">... </span>    image=image,
<span class="hljs-meta">... </span>    original_image=original_image,
<span class="hljs-meta">... </span>    prompt_embeds=prompt_embeds,
<span class="hljs-meta">... </span>    negative_prompt_embeds=negative_embeds,
<span class="hljs-meta">... </span>).images
<span class="hljs-meta">&gt;&gt;&gt; </span>image[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;./if_stage_II.png&quot;</span>)`}}),{c(){w=o("p"),x=a("Examples:"),C=r(),f(M.$$.fragment)},l(g){w=l(g,"P",{});var G=i(w);x=s(G,"Examples:"),G.forEach(t),C=p(g),u(M.$$.fragment,g)},m(g,G){m(g,w,G),e(w,x),m(g,C,G),h(M,g,G),R=!0},p:Ds,i(g){R||(_(M.$$.fragment,g),R=!0)},o(g){y(M.$$.fragment,g),R=!1},d(g){g&&t(w),g&&t(C),b(M,g)}}}function gZ(q){let w,x,C,M,R;return M=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMElGSW5wYWludGluZ1BpcGVsaW5lJTJDJTIwSUZJbnBhaW50aW5nU3VwZXJSZXNvbHV0aW9uUGlwZWxpbmUlMkMlMjBEaWZmdXNpb25QaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBwdF90b19waWwlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWltcG9ydCUyMHJlcXVlc3RzJTBBZnJvbSUyMGlvJTIwaW1wb3J0JTIwQnl0ZXNJTyUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmRpZmZ1c2VycyUyRmRvY3MtaW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMkZpZiUyRnBlcnNvbi5wbmclMjIlMEFyZXNwb25zZSUyMCUzRCUyMHJlcXVlc3RzLmdldCh1cmwpJTBBb3JpZ2luYWxfaW1hZ2U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ZHMlM0RuZWdhdGl2ZV9lbWJlZHMlMkMlMEEpLmltYWdlcyUwQWltYWdlJTVCMCU1RC5zYXZlKCUyMi4lMkZpZl9zdGFnZV9JSS5wbmclMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> IFInpaintingPipeline, IFInpaintingSuperResolutionPipeline, DiffusionPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> pt_to_pil
<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">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;https://huggingface.co/datasets/diffusers/docs-images/resolve/main/if/person.png&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>response = requests.get(url)
<span class="hljs-meta">&gt;&gt;&gt; </span>original_image = Image.<span class="hljs-built_in">open</span>(BytesIO(response.content)).convert(<span class="hljs-string">&quot;RGB&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>original_image = original_image

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;https://huggingface.co/datasets/diffusers/docs-images/resolve/main/if/glasses_mask.png&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>response = requests.get(url)
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_image = Image.<span class="hljs-built_in">open</span>(BytesIO(response.content))
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_image = mask_image

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = IFInpaintingPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;DeepFloyd/IF-I-XL-v1.0&quot;</span>, variant=<span class="hljs-string">&quot;fp16&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_model_cpu_offload()

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;blue sunglasses&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt_embeds, negative_embeds = pipe.encode_prompt(prompt)

<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(
<span class="hljs-meta">... </span>    image=original_image,
<span class="hljs-meta">... </span>    mask_image=mask_image,
<span class="hljs-meta">... </span>    prompt_embeds=prompt_embeds,
<span class="hljs-meta">... </span>    negative_prompt_embeds=negative_embeds,
<span class="hljs-meta">... </span>    output_type=<span class="hljs-string">&quot;pt&quot;</span>,
<span class="hljs-meta">... </span>).images

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># save intermediate image</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pil_image = pt_to_pil(image)
<span class="hljs-meta">&gt;&gt;&gt; </span>pil_image[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;./if_stage_I.png&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>super_res_1_pipe = IFInpaintingSuperResolutionPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;DeepFloyd/IF-II-L-v1.0&quot;</span>, text_encoder=<span class="hljs-literal">None</span>, variant=<span class="hljs-string">&quot;fp16&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>super_res_1_pipe.enable_model_cpu_offload()

<span class="hljs-meta">&gt;&gt;&gt; </span>image = super_res_1_pipe(
<span class="hljs-meta">... </span>    image=image,
<span class="hljs-meta">... </span>    mask_image=mask_image,
<span class="hljs-meta">... </span>    original_image=original_image,
<span class="hljs-meta">... </span>    prompt_embeds=prompt_embeds,
<span class="hljs-meta">... </span>    negative_prompt_embeds=negative_embeds,
<span class="hljs-meta">... </span>).images
<span class="hljs-meta">&gt;&gt;&gt; </span>image[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;./if_stage_II.png&quot;</span>)`}}),{c(){w=o("p"),x=a("Examples:"),C=r(),f(M.$$.fragment)},l(g){w=l(g,"P",{});var G=i(w);x=s(G,"Examples:"),G.forEach(t),C=p(g),u(M.$$.fragment,g)},m(g,G){m(g,w,G),e(w,x),m(g,C,G),h(M,g,G),R=!0},p:Ds,i(g){R||(_(M.$$.fragment,g),R=!0)},o(g){y(M.$$.fragment,g),R=!1},d(g){g&&t(w),g&&t(C),b(M,g)}}}function fZ(q){let w,x,C,M,R;return M=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMElGSW5wYWludGluZ1BpcGVsaW5lJTJDJTIwSUZJbnBhaW50aW5nU3VwZXJSZXNvbHV0aW9uUGlwZWxpbmUlMkMlMjBEaWZmdXNpb25QaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBwdF90b19waWwlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWltcG9ydCUyMHJlcXVlc3RzJTBBZnJvbSUyMGlvJTIwaW1wb3J0JTIwQnl0ZXNJTyUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmRpZmZ1c2VycyUyRmRvY3MtaW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMkZpZiUyRnBlcnNvbi5wbmclMjIlMEFyZXNwb25zZSUyMCUzRCUyMHJlcXVlc3RzLmdldCh1cmwpJTBBb3JpZ2luYWxfaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKEJ5dGVzSU8ocmVzcG9uc2U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WltYWdlJTVCMCU1RC5zYXZlKCUyMi4lMkZpZl9zdGFnZV9JSS5wbmclMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> IFInpaintingPipeline, IFInpaintingSuperResolutionPipeline, DiffusionPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> pt_to_pil
<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">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;https://huggingface.co/datasets/diffusers/docs-images/resolve/main/if/person.png&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>response = requests.get(url)
<span class="hljs-meta">&gt;&gt;&gt; </span>original_image = Image.<span class="hljs-built_in">open</span>(BytesIO(response.content)).convert(<span class="hljs-string">&quot;RGB&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>original_image = original_image

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;https://huggingface.co/datasets/diffusers/docs-images/resolve/main/if/glasses_mask.png&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>response = requests.get(url)
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_image = Image.<span class="hljs-built_in">open</span>(BytesIO(response.content))
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_image = mask_image

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = IFInpaintingPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;DeepFloyd/IF-I-XL-v1.0&quot;</span>, variant=<span class="hljs-string">&quot;fp16&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_model_cpu_offload()

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;blue sunglasses&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt_embeds, negative_embeds = pipe.encode_prompt(prompt)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(
<span class="hljs-meta">... </span>    image=original_image,
<span class="hljs-meta">... </span>    mask_image=mask_image,
<span class="hljs-meta">... </span>    prompt_embeds=prompt_embeds,
<span class="hljs-meta">... </span>    negative_prompt_embeds=negative_embeds,
<span class="hljs-meta">... </span>    output_type=<span class="hljs-string">&quot;pt&quot;</span>,
<span class="hljs-meta">... </span>).images

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># save intermediate image</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pil_image = pt_to_pil(image)
<span class="hljs-meta">&gt;&gt;&gt; </span>pil_image[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;./if_stage_I.png&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>super_res_1_pipe = IFInpaintingSuperResolutionPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;DeepFloyd/IF-II-L-v1.0&quot;</span>, text_encoder=<span class="hljs-literal">None</span>, variant=<span class="hljs-string">&quot;fp16&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>super_res_1_pipe.enable_model_cpu_offload()

<span class="hljs-meta">&gt;&gt;&gt; </span>image = super_res_1_pipe(
<span class="hljs-meta">... </span>    image=image,
<span class="hljs-meta">... </span>    mask_image=mask_image,
<span class="hljs-meta">... </span>    original_image=original_image,
<span class="hljs-meta">... </span>    prompt_embeds=prompt_embeds,
<span class="hljs-meta">... </span>    negative_prompt_embeds=negative_embeds,
<span class="hljs-meta">... </span>).images
<span class="hljs-meta">&gt;&gt;&gt; </span>image[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;./if_stage_II.png&quot;</span>)`}}),{c(){w=o("p"),x=a("Examples:"),C=r(),f(M.$$.fragment)},l(g){w=l(g,"P",{});var G=i(w);x=s(G,"Examples:"),G.forEach(t),C=p(g),u(M.$$.fragment,g)},m(g,G){m(g,w,G),e(w,x),m(g,C,G),h(M,g,G),R=!0},p:Ds,i(g){R||(_(M.$$.fragment,g),R=!0)},o(g){y(M.$$.fragment,g),R=!1},d(g){g&&t(w),g&&t(C),b(M,g)}}}function uZ(q){let w,x,C,M,R,g,G,zs,Oc,Np,Re,ot,Hs,zt,Kc,qs,em,Qp,Xa,tm,Yp,le,Ls,nm,am,As,sm,om,Ht,lm,qt,im,rm,Dp,Xe,lt,Os,Lt,pm,Ks,dm,zp,xa,cm,Hp,ie,At,mm,Ot,gm,fm,um,Kt,hm,en,_m,ym,bm,Sa,Mm,eo,wm,qp,tn,Lp,Va,vm,Ap,nn,Op,it,Im,an,Jm,Um,Kp,rt,Tm,to,Zm,jm,ed,sn,td,$a,Em,nd,V,no,Pa,Fm,Bm,ao,Na,Wm,km,so,Qa,Gm,Cm,oo,Ya,Rm,Xm,lo,Da,xm,Sm,io,za,Vm,ad,Ha,ro,$m,sd,re,on,po,co,Pm,Nm,xe,mo,ln,Qm,Ym,go,rn,Dm,zm,fo,pn,Hm,qm,dn,uo,ho,Lm,Am,cn,_o,mn,Om,Km,yo,gn,eg,tg,fn,bo,Mo,ng,ag,wo,vo,un,sg,od,pt,Io,og,lg,hn,qa,Kv,ld,dt,Jo,ig,rg,_n,La,eI,id,Se,ct,Uo,yn,pg,To,dg,rd,mt,cg,bn,mg,gg,pd,Mn,dd,Ve,gt,Zo,wn,fg,jo,ug,cd,pe,hg,Aa,_g,yg,Oa,bg,Mg,md,se,Eo,wg,vg,Fo,Ig,Jg,Ka,Ug,Tg,gd,vn,fd,$e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,Nv,Cp,Qv,Yv,Rp,Dv,zv,Xp,Hv,qv,xp,Lv,Av,ac;return g=new $({}),zt=new $({}),Lt=new $({}),tn=new S({props:{code:"cGlwJTIwaW5zdGFsbCUyMGh1Z2dpbmdmYWNlX2h1YiUyMC0tdXBncmFkZQ==",highlighted:"pip install huggingface_hub --upgrade"}}),nn=new S({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGxvZ2luJTBBJTBBbG9naW4oKQ==",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> login

login()`}}),sn=new S({props:{code:"cGlwJTIwaW5zdGFsbCUyMGRpZmZ1c2VycyUyMGFjY2VsZXJhdGUlMjB0cmFuc2Zvcm1lcnMlMjBzYWZldGVuc29ycw==",highlighted:"pip install diffusers accelerate transformers safetensors"}}),yn=new $({}),Mn=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMHB0X3RvX3BpbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBJTIzJTIwc3RhZ2UlMjAxJTBBc3RhZ2VfMSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJEZWVwRmxveWQlMkZJRi1JLVhMLXYxLjAlMjIlMkMlMjB2YXJpYW50JTNEJTIyZnAxNiUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFzdGFnZV8xLmVuYWJsZV9tb2RlbF9jcHVfb2ZmbG9hZCgpJTBBJTBBJTIzJTIwc3RhZ2UlMjAyJTBBc3RhZ2VfMiUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJEZWVwRmxveWQlMkZJRi1JSS1MLXYxLjAlMjIl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YWdlJTIwMyUwQWltYWdlJTIwJTNEJTIwc3RhZ2VfMyhwcm9tcHQlM0Rwcm9tcHQlMkMlMjBpbWFnZSUzRGltYWdlJTJDJTIwbm9pc2VfbGV2ZWwlM0QxMDAlMkMlMjBnZW5lcmF0b3IlM0RnZW5lcmF0b3IpLmltYWdlcyUwQWltYWdlJTVCMCU1RC5zYXZlKCUyMi4lMkZpZl9zdGFnZV9JSUkucG5nJTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> pt_to_pil
<span class="hljs-keyword">import</span> torch

<span class="hljs-comment"># stage 1</span>
stage_1 = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;DeepFloyd/IF-I-XL-v1.0&quot;</span>, variant=<span class="hljs-string">&quot;fp16&quot;</span>, torch_dtype=torch.float16)
stage_1.enable_model_cpu_offload()

<span class="hljs-comment"># stage 2</span>
stage_2 = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;DeepFloyd/IF-II-L-v1.0&quot;</span>, text_encoder=<span class="hljs-literal">None</span>, variant=<span class="hljs-string">&quot;fp16&quot;</span>, torch_dtype=torch.float16
)
stage_2.enable_model_cpu_offload()

<span class="hljs-comment"># stage 3</span>
safety_modules = {
    <span class="hljs-string">&quot;feature_extractor&quot;</span>: stage_1.feature_extractor,
    <span class="hljs-string">&quot;safety_checker&quot;</span>: stage_1.safety_checker,
    <span class="hljs-string">&quot;watermarker&quot;</span>: stage_1.watermarker,
}
stage_3 = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-x4-upscaler&quot;</span>, **safety_modules, torch_dtype=torch.float16
)
stage_3.enable_model_cpu_offload()

prompt = <span class="hljs-string">&#x27;a photo of a kangaroo wearing an orange hoodie and blue sunglasses standing in front of the eiffel tower holding a sign that says &quot;very deep learning&quot;&#x27;</span>
generator = torch.manual_seed(<span class="hljs-number">1</span>)

<span class="hljs-comment"># text embeds</span>
prompt_embeds, negative_embeds = stage_1.encode_prompt(prompt)

<span class="hljs-comment"># stage 1</span>
image = stage_1(
    prompt_embeds=prompt_embeds, negative_prompt_embeds=negative_embeds, generator=generator, output_type=<span class="hljs-string">&quot;pt&quot;</span>
).images
pt_to_pil(image)[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;./if_stage_I.png&quot;</span>)

<span class="hljs-comment"># stage 2</span>
image = stage_2(
    image=image,
    prompt_embeds=prompt_embeds,
    negative_prompt_embeds=negative_embeds,
    generator=generator,
    output_type=<span class="hljs-string">&quot;pt&quot;</span>,
).images
pt_to_pil(image)[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;./if_stage_II.png&quot;</span>)

<span class="hljs-comment"># stage 3</span>
image = stage_3(prompt=prompt, image=image, noise_level=<span class="hljs-number">100</span>, generator=generator).images
image[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;./if_stage_III.png&quot;</span>)`}}),wn=new $({}),vn=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMElGSW1nMkltZ1BpcGVsaW5lJTJDJTIwSUZJbWcySW1nU3VwZXJSZXNvbHV0aW9uUGlwZWxpbmUlMkMlMjBEaWZmdXNpb25QaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBwdF90b19waWwlMEElMEFpbXBvcnQlMjB0b3JjaCUwQSUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWltcG9ydCUyMHJlcXVlc3RzJTBBZnJvbSUyMGlvJTIwaW1wb3J0JTIwQnl0ZXNJTyUwQSUwQSUyMyUyMGRvd25sb2FkJTIwaW1hZ2UlMEF1cmwlMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRnJhdy5naXRodWJ1c2VyY29udGVudC5jb20lMkZDb21wVmlzJTJGc3RhYmxlLWRpZmZ1c2lvbiUyRm1haW4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X2VtYmVkcyUyQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRGdlbmVyYXRvciUyQyUwQSUyMCUyMCUyMCUyMG91dHB1dF90eXBlJTNEJTIycHQlMjIlMkMlMEEpLmltYWdlcyUwQXB0X3RvX3BpbChpbWFnZSklNUIwJTVELnNhdmUoJTIyLiUyRmlmX3N0YWdlX0kucG5nJTIyKSUwQSUwQSUyMyUyMHN0YWdlJTIwMiUwQWltYWdlJTIwJTNEJTIwc3RhZ2VfMiglMEElMjAlMjAlMjAlMjBpbWFnZSUzRGltYWdlJTJDJTBBJTIwJTIwJTIwJTIwb3JpZ2luYWxfaW1hZ2UlM0RvcmlnaW5hbF9pbWFnZSUyQyUwQSUyMCUyMCUyMCUyMHByb21wdF9lbWJlZHMlM0Rwcm9tcHRfZW1iZWRzJTJDJTBBJTIwJTIwJTIwJTIwbmVnYXRpdmVfcHJvbXB0X2VtYmVkcyUzRG5lZ2F0aXZlX2VtYmVkcyUyQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRGdlbmVyYXRvciUyQyUwQSUyMCUyMCUyMCUyMG91dHB1dF90eXBlJTNEJTIycHQlMjIlMkMlMEEpLmltYWdlcyUwQXB0X3RvX3BpbChpbWFnZSklNUIwJTVELnNhdmUoJTIyLiUyRmlmX3N0YWdlX0lJLnBuZyUyMiklMEElMEElMjMlMjBzdGFnZSUyMDMlMEFpbWFnZSUyMCUzRCUyMHN0YWdlXzMocHJvbXB0JTNEcHJvbXB0JTJDJTIwaW1hZ2UlM0RpbWFnZSUyQyUyMGdlbmVyYXRvciUzRGdlbmVyYXRvciUyQyUyMG5vaXNlX2xldmVsJTNEMTAwKS5pbWFnZXMlMEFpbWFnZSU1QjAlNUQuc2F2ZSglMjIuJTJGaWZfc3RhZ2VfSUlJLnBuZyUyMik=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> IFImg2ImgPipeline, IFImg2ImgSuperResolutionPipeline, DiffusionPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> pt_to_pil

<span class="hljs-keyword">import</span> torch

<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-keyword">import</span> requests
<span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO

<span class="hljs-comment"># download image</span>
url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg&quot;</span>
response = requests.get(url)
original_image = Image.<span class="hljs-built_in">open</span>(BytesIO(response.content)).convert(<span class="hljs-string">&quot;RGB&quot;</span>)
original_image = original_image.resize((<span class="hljs-number">768</span>, <span class="hljs-number">512</span>))

<span class="hljs-comment"># stage 1</span>
stage_1 = IFImg2ImgPipeline.from_pretrained(<span class="hljs-string">&quot;DeepFloyd/IF-I-XL-v1.0&quot;</span>, variant=<span class="hljs-string">&quot;fp16&quot;</span>, torch_dtype=torch.float16)
stage_1.enable_model_cpu_offload()

<span class="hljs-comment"># stage 2</span>
stage_2 = IFImg2ImgSuperResolutionPipeline.from_pretrained(
    <span class="hljs-string">&quot;DeepFloyd/IF-II-L-v1.0&quot;</span>, text_encoder=<span class="hljs-literal">None</span>, variant=<span class="hljs-string">&quot;fp16&quot;</span>, torch_dtype=torch.float16
)
stage_2.enable_model_cpu_offload()

<span class="hljs-comment"># stage 3</span>
safety_modules = {
    <span class="hljs-string">&quot;feature_extractor&quot;</span>: stage_1.feature_extractor,
    <span class="hljs-string">&quot;safety_checker&quot;</span>: stage_1.safety_checker,
    <span class="hljs-string">&quot;watermarker&quot;</span>: stage_1.watermarker,
}
stage_3 = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-x4-upscaler&quot;</span>, **safety_modules, torch_dtype=torch.float16
)
stage_3.enable_model_cpu_offload()

prompt = <span class="hljs-string">&quot;A fantasy landscape in style minecraft&quot;</span>
generator = torch.manual_seed(<span class="hljs-number">1</span>)

<span class="hljs-comment"># text embeds</span>
prompt_embeds, negative_embeds = stage_1.encode_prompt(prompt)

<span class="hljs-comment"># stage 1</span>
image = stage_1(
    image=original_image,
    prompt_embeds=prompt_embeds,
    negative_prompt_embeds=negative_embeds,
    generator=generator,
    output_type=<span class="hljs-string">&quot;pt&quot;</span>,
).images
pt_to_pil(image)[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;./if_stage_I.png&quot;</span>)

<span class="hljs-comment"># stage 2</span>
image = stage_2(
    image=image,
    original_image=original_image,
    prompt_embeds=prompt_embeds,
    negative_prompt_embeds=negative_embeds,
    generator=generator,
    output_type=<span class="hljs-string">&quot;pt&quot;</span>,
).images
pt_to_pil(image)[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;./if_stage_II.png&quot;</span>)

<span class="hljs-comment"># stage 3</span>
image = stage_3(prompt=prompt, image=image, generator=generator, noise_level=<span class="hljs-number">100</span>).images
image[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;./if_stage_III.png&quot;</span>)`}}),In=new $({}),Jn=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMElGSW5wYWludGluZ1BpcGVsaW5lJTJDJTIwSUZJbnBhaW50aW5nU3VwZXJSZXNvbHV0aW9uUGlwZWxpbmUlMkMlMjBEaWZmdXNpb25QaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBwdF90b19waWwlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWltcG9ydCUyMHJlcXVlc3RzJTBBZnJvbSUyMGlvJTIwaW1wb3J0JTIwQnl0ZXNJTyUwQSUwQSUyMyUyMGRvd25sb2FkJTIwaW1hZ2UlMEF1cmwlMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNldHMlMkZkaWZmdXNlcnMlMkZkb2N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XB0X3RvX3BpbChpbWFnZSklNUIwJTVELnNhdmUoJTIyLiUyRmlmX3N0YWdlX0lJLnBuZyUyMiklMEElMEElMjMlMjBzdGFnZSUyMDMlMEFpbWFnZSUyMCUzRCUyMHN0YWdlXzMocHJvbXB0JTNEcHJvbXB0JTJDJTIwaW1hZ2UlM0RpbWFnZSUyQyUyMGdlbmVyYXRvciUzRGdlbmVyYXRvciUyQyUyMG5vaXNlX2xldmVsJTNEMTAwKS5pbWFnZXMlMEFpbWFnZSU1QjAlNUQuc2F2ZSglMjIuJTJGaWZfc3RhZ2VfSUlJLnBuZyUyMik=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> IFInpaintingPipeline, IFInpaintingSuperResolutionPipeline, DiffusionPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> pt_to_pil
<span class="hljs-keyword">import</span> torch

<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-keyword">import</span> requests
<span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO

<span class="hljs-comment"># download image</span>
url = <span class="hljs-string">&quot;https://huggingface.co/datasets/diffusers/docs-images/resolve/main/if/person.png&quot;</span>
response = requests.get(url)
original_image = Image.<span class="hljs-built_in">open</span>(BytesIO(response.content)).convert(<span class="hljs-string">&quot;RGB&quot;</span>)
original_image = original_image

<span class="hljs-comment"># download mask</span>
url = <span class="hljs-string">&quot;https://huggingface.co/datasets/diffusers/docs-images/resolve/main/if/glasses_mask.png&quot;</span>
response = requests.get(url)
mask_image = Image.<span class="hljs-built_in">open</span>(BytesIO(response.content))
mask_image = mask_image

<span class="hljs-comment"># stage 1</span>
stage_1 = IFInpaintingPipeline.from_pretrained(<span class="hljs-string">&quot;DeepFloyd/IF-I-XL-v1.0&quot;</span>, variant=<span class="hljs-string">&quot;fp16&quot;</span>, torch_dtype=torch.float16)
stage_1.enable_model_cpu_offload()

<span class="hljs-comment"># stage 2</span>
stage_2 = IFInpaintingSuperResolutionPipeline.from_pretrained(
    <span class="hljs-string">&quot;DeepFloyd/IF-II-L-v1.0&quot;</span>, text_encoder=<span class="hljs-literal">None</span>, variant=<span class="hljs-string">&quot;fp16&quot;</span>, torch_dtype=torch.float16
)
stage_2.enable_model_cpu_offload()

<span class="hljs-comment"># stage 3</span>
safety_modules = {
    <span class="hljs-string">&quot;feature_extractor&quot;</span>: stage_1.feature_extractor,
    <span class="hljs-string">&quot;safety_checker&quot;</span>: stage_1.safety_checker,
    <span class="hljs-string">&quot;watermarker&quot;</span>: stage_1.watermarker,
}
stage_3 = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-x4-upscaler&quot;</span>, **safety_modules, torch_dtype=torch.float16
)
stage_3.enable_model_cpu_offload()

prompt = <span class="hljs-string">&quot;blue sunglasses&quot;</span>
generator = torch.manual_seed(<span class="hljs-number">1</span>)

<span class="hljs-comment"># text embeds</span>
prompt_embeds, negative_embeds = stage_1.encode_prompt(prompt)

<span class="hljs-comment"># stage 1</span>
image = stage_1(
    image=original_image,
    mask_image=mask_image,
    prompt_embeds=prompt_embeds,
    negative_prompt_embeds=negative_embeds,
    generator=generator,
    output_type=<span class="hljs-string">&quot;pt&quot;</span>,
).images
pt_to_pil(image)[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;./if_stage_I.png&quot;</span>)

<span class="hljs-comment"># stage 2</span>
image = stage_2(
    image=image,
    original_image=original_image,
    mask_image=mask_image,
    prompt_embeds=prompt_embeds,
    negative_prompt_embeds=negative_embeds,
    generator=generator,
    output_type=<span class="hljs-string">&quot;pt&quot;</span>,
).images
pt_to_pil(image)[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;./if_stage_II.png&quot;</span>)

<span class="hljs-comment"># stage 3</span>
image = stage_3(prompt=prompt, image=image, generator=generator, noise_level=<span class="hljs-number">100</span>).images
image[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;./if_stage_III.png&quot;</span>)`}}),Un=new $({}),Tn=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMElGUGlwZWxpbmUlMkMlMjBJRlN1cGVyUmVzb2x1dGlvblBpcGVsaW5lJTBBJTBBcGlwZV8xJTIwJTNEJTIwSUZQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyRGVlcEZsb3lkJTJGSUYtSS1YTC12MS4wJTIyKSUwQXBpcGVfMiUyMCUzRCUyMElGU3VwZXJSZXNvbHV0aW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMkRlZXBGbG95ZCUyRklGLUlJLUwtdjEuMCUyMiklMEElMEElMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwSUZJbWcySW1nUGlwZWxpbmUlMkMlMjBJRkltZzJJbWdTdXBlclJlc29sdXRpb25QaXBlbGluZSUwQSUwQXBpcGVfMSUyMCUzRCUyMElGSW1nMkltZ1BpcGVsaW5lKCoqcGlwZV8xLmNvbXBvbmVudHMpJTBBcGlwZV8yJTIwJTNEJTIwSUZJbWcySW1nU3VwZXJSZXNvbHV0aW9uUGlwZWxpbmUoKipwaXBlXzIuY29tcG9uZW50cyklMEElMEElMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwSUZJbnBhaW50aW5nUGlwZWxpbmUlMkMlMjBJRklucGFpbnRpbmdTdXBlclJlc29sdXRpb25QaXBlbGluZSUwQSUwQXBpcGVfMSUyMCUzRCUyMElGSW5wYWludGluZ1BpcGVsaW5lKCoqcGlwZV8xLmNvbXBvbmVudHMpJTBBcGlwZV8yJTIwJTNEJTIwSUZJbnBhaW50aW5nU3VwZXJSZXNvbHV0aW9uUGlwZWxpbmUoKipwaXBlXzIuY29tcG9uZW50cyk=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> IFPipeline, IFSuperResolutionPipeline

pipe_1 = IFPipeline.from_pretrained(<span class="hljs-string">&quot;DeepFloyd/IF-I-XL-v1.0&quot;</span>)
pipe_2 = IFSuperResolutionPipeline.from_pretrained(<span class="hljs-string">&quot;DeepFloyd/IF-II-L-v1.0&quot;</span>)


<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> IFImg2ImgPipeline, IFImg2ImgSuperResolutionPipeline

pipe_1 = IFImg2ImgPipeline(**pipe_1.components)
pipe_2 = IFImg2ImgSuperResolutionPipeline(**pipe_2.components)


<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> IFInpaintingPipeline, IFInpaintingSuperResolutionPipeline

pipe_1 = IFInpaintingPipeline(**pipe_1.components)
pipe_2 = IFInpaintingSuperResolutionPipeline(**pipe_2.components)`}}),Zn=new $({}),jn=new S({props:{code:"cGlwZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJEZWVwRmxveWQlMkZJRi1JLVhMLXYxLjAlMjIlMkMlMjB2YXJpYW50JTNEJTIyZnAxNiUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlLnRvKCUyMmN1ZGElMjIp",highlighted:`pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;DeepFloyd/IF-I-XL-v1.0&quot;</span>, variant=<span class="hljs-string">&quot;fp16&quot;</span>, torch_dtype=torch.float16)
pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)`}}),En=new S({props:{code:"cGlwZSglMjIlM0Nwcm9tcHQlM0UlMjIlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMzAp",highlighted:'pipe(<span class="hljs-string">&quot;&lt;prompt&gt;&quot;</span>, num_inference_steps=<span class="hljs-number">30</span>)'}}),Fn=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2Vycy5waXBlbGluZXMuZGVlcGZsb3lkX2lmJTIwaW1wb3J0JTIwZmFzdDI3X3RpbWVzdGVwcyUwQSUwQXBpcGUoJTIyJTNDcHJvbXB0JTNFJTIyJTJDJTIwdGltZXN0ZXBzJTNEZmFzdDI3X3RpbWVzdGVwcyk=",highlighted:`<span class="hljs-keyword">from</span> diffusers.pipelines.deepfloyd_if <span class="hljs-keyword">import</span> fast27_timesteps

pipe(<span class="hljs-string">&quot;&lt;prompt&gt;&quot;</span>, timesteps=fast27_timesteps)`}}),Bn=new S({props:{code:"cGlwZSUyMCUzRCUyMElGSW1nMkltZ1BpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJEZWVwRmxveWQlMkZJRi1JLVhMLXYxLjAlMjIlMkMlMjB2YXJpYW50JTNEJTIyZnAxNiUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlLnRvKCUyMmN1ZGElMjIpJTBBJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKGltYWdlJTNEaW1hZ2UlMkMlMjBwcm9tcHQlM0QlMjIlM0Nwcm9tcHQlM0UlMjIlMkMlMjBzdHJlbmd0aCUzRDAuMykuaW1hZ2Vz",highlighted:`pipe = IFImg2ImgPipeline.from_pretrained(<span class="hljs-string">&quot;DeepFloyd/IF-I-XL-v1.0&quot;</span>, variant=<span class="hljs-string">&quot;fp16&quot;</span>, torch_dtype=torch.float16)
pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

image = pipe(image=image, prompt=<span class="hljs-string">&quot;&lt;prompt&gt;&quot;</span>, strength=<span class="hljs-number">0.3</span>).images`}}),Wn=new S({props:{code:"aW1wb3J0JTIwdG9yY2glMEElMEFwaXBlJTIwJTNEJTIwRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMkRlZXBGbG95ZCUyRklGLUktWEwtdjEuMCUyMiUyQyUyMHZhcmlhbnQlM0QlMjJmcDE2JTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KSUwQXBpcGUudG8oJTIyY3VkYSUyMiklMEElMEFwaXBlLnRleHRfZW5jb2RlciUyMCUzRCUyMHRvcmNoLmNvbXBpbGUocGlwZS50ZXh0X2VuY29kZXIpJTBBcGlwZS51bmV0JTIwJTNEJTIwdG9yY2guY29tcGlsZShwaXBlLnVuZXQp",highlighted:`<span class="hljs-keyword">import</span> torch

pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;DeepFloyd/IF-I-XL-v1.0&quot;</span>, variant=<span class="hljs-string">&quot;fp16&quot;</span>, torch_dtype=torch.float16)
pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

pipe.text_encoder = torch.<span class="hljs-built_in">compile</span>(pipe.text_encoder)
pipe.unet = torch.<span class="hljs-built_in">compile</span>(pipe.unet)`}}),kn=new $({}),Gn=new S({props:{code:"cGlwZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJEZWVwRmxveWQlMkZJRi1JLVhMLXYxLjAlMjIlMkMlMjB2YXJpYW50JTNEJTIyZnAxNiUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlLmVuYWJsZV9tb2RlbF9jcHVfb2ZmbG9hZCgp",highlighted:`pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;DeepFloyd/IF-I-XL-v1.0&quot;</span>, variant=<span class="hljs-string">&quot;fp16&quot;</span>, torch_dtype=torch.float16)
pipe.enable_model_cpu_offload()`}}),Cn=new S({props:{code:"cGlwZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJEZWVwRmxveWQlMkZJRi1JLVhMLXYxLjAlMjIlMkMlMjB2YXJpYW50JTNEJTIyZnAxNiUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlLmVuYWJsZV9zZXF1ZW50aWFsX2NwdV9vZmZsb2FkKCk=",highlighted:`pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;DeepFloyd/IF-I-XL-v1.0&quot;</span>, variant=<span class="hljs-string">&quot;fp16&quot;</span>, torch_dtype=torch.float16)
pipe.enable_sequential_cpu_offload()`}}),Rn=new S({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFQ1RW5jb2Rlck1vZGVsJTBBJTBBdGV4dF9lbmNvZGVyJTIwJTNEJTIwVDVFbmNvZGVyTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMkRlZXBGbG95ZCUyRklGLUktWEwtdjEuMCUyMiUyQyUyMHN1YmZvbGRlciUzRCUyMnRleHRfZW5jb2RlciUyMiUyQyUyMGRldmljZV9tYXAlM0QlMjJhdXRvJTIyJTJDJTIwbG9hZF9pbl84Yml0JTNEVHJ1ZSUyQyUyMHZhcmlhbnQlM0QlMjI4Yml0JTIyJTBBKSUwQSUwQWZyb20lMjBkaWZmdXNlcnMlMjBpbXBvcnQlMjBEaWZmdXNpb25QaXBlbGluZSUwQSUwQXBpcGUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyRGVlcEZsb3lkJTJGSUYtSS1YTC12MS4wJTIyJTJDJTBBJTIwJTIwJTIwJTIwdGV4dF9lbmNvZGVyJTNEdGV4dF9lbmNvZGVyJTJDJTIwJTIwJTIzJTIwcGFzcyUyMHRoZSUyMHByZXZpb3VzbHklMjBpbnN0YW50aWF0ZWQlMjA4Yml0JTIwdGV4dCUyMGVuY29kZXIlMEElMjAlMjAlMjAlMjB1bmV0JTNETm9uZSUyQyUwQSUyMCUyMCUyMCUyMGRldmljZV9tYXAlM0QlMjJhdXRvJTIyJTJDJTBBKSUwQSUwQXByb21wdF9lbWJlZHMlMkMlMjBuZWdhdGl2ZV9lbWJlZHMlMjAlM0QlMjBwaXBlLmVuY29kZV9wcm9tcHQoJTIyJTNDcHJvbXB0JTNFJTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> T5EncoderModel

text_encoder = T5EncoderModel.from_pretrained(
    <span class="hljs-string">&quot;DeepFloyd/IF-I-XL-v1.0&quot;</span>, subfolder=<span class="hljs-string">&quot;text_encoder&quot;</span>, device_map=<span class="hljs-string">&quot;auto&quot;</span>, load_in_8bit=<span class="hljs-literal">True</span>, variant=<span class="hljs-string">&quot;8bit&quot;</span>
)

<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

pipe = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;DeepFloyd/IF-I-XL-v1.0&quot;</span>,
    text_encoder=text_encoder,  <span class="hljs-comment"># pass the previously instantiated 8bit text encoder</span>
    unet=<span class="hljs-literal">None</span>,
    device_map=<span class="hljs-string">&quot;auto&quot;</span>,
)

prompt_embeds, negative_embeds = pipe.encode_prompt(<span class="hljs-string">&quot;&lt;prompt&gt;&quot;</span>)`}}),Xn=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMElGUGlwZWxpbmUlMkMlMjBJRlN1cGVyUmVzb2x1dGlvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjBnYyUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBUNUVuY29kZXJNb2RlbCUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBwdF90b19waWwlMEElMEF0ZXh0X2VuY29kZXIlMjAlM0QlMjBUNUVuY29kZXJNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyRGVlcEZsb3lkJTJGSUYtSS1YTC12MS4wJTIyJTJDJTIwc3ViZm9sZGVyJTNEJTIydGV4dF9lbmNvZGVyJTIyJTJDJTIwZGV2aWNlX21hcCUzRCUyMmF1dG8lMjIlMkMlMjBsb2FkX2luXzhiaXQlM0RUcnVlJTJDJTIwdmFyaWFudCUzRCUyMjhiaXQlM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GluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyRGVlcEZsb3lkJTJGSUYtSUktTC12MS4wJTIyJTJDJTIwdGV4dF9lbmNvZGVyJTNETm9uZSUyQyUyMHZhcmlhbnQlM0QlMjJmcDE2JTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTIwZGV2aWNlX21hcCUzRCUyMmF1dG8lMjIlMEEpJTBBJTBBZ2VuZXJhdG9yJTIwJTNEJTIwdG9yY2guR2VuZXJhdG9yKCkubWFudWFsX3NlZWQoMCklMEFpbWFnZSUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwaW1hZ2UlM0RpbWFnZSUyQyUwQSUyMCUyMCUyMCUyMHByb21wdF9lbWJlZHMlM0Rwcm9tcHRfZW1iZWRzJTJDJTBBJTIwJTIwJTIwJTIwbmVnYXRpdmVfcHJvbXB0X2VtYmVkcyUzRG5lZ2F0aXZlX2VtYmVkcyUyQyUwQSUyMCUyMCUyMCUyMG91dHB1dF90eXBlJTNEJTIycHQlMjIlMkMlMEElMjAlMjAlMjAlMjBnZW5lcmF0b3IlM0RnZW5lcmF0b3IlMkMlMEEpLmltYWdlcyUwQSUwQXB0X3RvX3BpbChpbWFnZSklNUIwJTVELnNhdmUoJTIyLiUyRmlmX3N0YWdlX0lJLnBuZyUyMik=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> IFPipeline, IFSuperResolutionPipeline
<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> gc
<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> pt_to_pil

text_encoder = T5EncoderModel.from_pretrained(
    <span class="hljs-string">&quot;DeepFloyd/IF-I-XL-v1.0&quot;</span>, subfolder=<span class="hljs-string">&quot;text_encoder&quot;</span>, device_map=<span class="hljs-string">&quot;auto&quot;</span>, load_in_8bit=<span class="hljs-literal">True</span>, variant=<span class="hljs-string">&quot;8bit&quot;</span>
)

<span class="hljs-comment"># text to image</span>

pipe = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;DeepFloyd/IF-I-XL-v1.0&quot;</span>,
    text_encoder=text_encoder,  <span class="hljs-comment"># pass the previously instantiated 8bit text encoder</span>
    unet=<span class="hljs-literal">None</span>,
    device_map=<span class="hljs-string">&quot;auto&quot;</span>,
)

prompt = <span class="hljs-string">&#x27;a photo of a kangaroo wearing an orange hoodie and blue sunglasses standing in front of the eiffel tower holding a sign that says &quot;very deep learning&quot;&#x27;</span>
prompt_embeds, negative_embeds = pipe.encode_prompt(prompt)

<span class="hljs-comment"># Remove the pipeline so we can re-load the pipeline with the unet</span>
<span class="hljs-keyword">del</span> text_encoder
<span class="hljs-keyword">del</span> pipe
gc.collect()
torch.cuda.empty_cache()

pipe = IFPipeline.from_pretrained(
    <span class="hljs-string">&quot;DeepFloyd/IF-I-XL-v1.0&quot;</span>, text_encoder=<span class="hljs-literal">None</span>, variant=<span class="hljs-string">&quot;fp16&quot;</span>, torch_dtype=torch.float16, device_map=<span class="hljs-string">&quot;auto&quot;</span>
)

generator = torch.Generator().manual_seed(<span class="hljs-number">0</span>)
image = pipe(
    prompt_embeds=prompt_embeds,
    negative_prompt_embeds=negative_embeds,
    output_type=<span class="hljs-string">&quot;pt&quot;</span>,
    generator=generator,
).images

pt_to_pil(image)[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;./if_stage_I.png&quot;</span>)

<span class="hljs-comment"># Remove the pipeline so we can load the super-resolution pipeline</span>
<span class="hljs-keyword">del</span> pipe
gc.collect()
torch.cuda.empty_cache()

<span class="hljs-comment"># First super resolution</span>

pipe = IFSuperResolutionPipeline.from_pretrained(
    <span class="hljs-string">&quot;DeepFloyd/IF-II-L-v1.0&quot;</span>, text_encoder=<span class="hljs-literal">None</span>, variant=<span class="hljs-string">&quot;fp16&quot;</span>, torch_dtype=torch.float16, device_map=<span class="hljs-string">&quot;auto&quot;</span>
)

generator = torch.Generator().manual_seed(<span class="hljs-number">0</span>)
image = pipe(
    image=image,
    prompt_embeds=prompt_embeds,
    negative_prompt_embeds=negative_embeds,
    output_type=<span class="hljs-string">&quot;pt&quot;</span>,
    generator=generator,
).images

pt_to_pil(image)[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;./if_stage_II.png&quot;</span>)`}}),xn=new $({}),Yn=new $({}),Dn=new X({props:{name:"class diffusers.IFPipeline",anchor:"diffusers.IFPipeline",parameters:[{name:"tokenizer",val:": T5Tokenizer"},{name:"text_encoder",val:": T5EncoderModel"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": DDPMScheduler"},{name:"safety_checker",val:": typing.Optional[diffusers.pipelines.deepfloyd_if.safety_checker.IFSafetyChecker]"},{name:"feature_extractor",val:": typing.Optional[transformers.models.clip.image_processing_clip.CLIPImageProcessor]"},{name:"watermarker",val:": typing.Optional[diffusers.pipelines.deepfloyd_if.watermark.IFWatermarker]"},{name:"requires_safety_checker",val:": bool = True"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/deepfloyd_if/pipeline_if.py#L89"}}),zn=new X({props:{name:"__call__",anchor:"diffusers.IFPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"num_inference_steps",val:": int = 100"},{name:"timesteps",val:": typing.List[int] = None"},{name:"guidance_scale",val:": float = 7.0"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"clean_caption",val:": bool = True"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"}],parametersDescription:[{anchor:"diffusers.IFPipeline.__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.IFPipeline.__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.IFPipeline.__call__.timesteps",description:`<strong>timesteps</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Custom timesteps to use for the denoising process. If not defined, equal spaced <code>num_inference_steps</code>
timesteps are used. Must be in descending order.`,name:"timesteps"},{anchor:"diffusers.IFPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
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 &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.`,name:"guidance_scale"},{anchor:"diffusers.IFPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.IFPipeline.__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.IFPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.IFPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.IFPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/v0.17.1/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.IFPipeline.__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.IFPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</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.IFPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.IFPipeline.__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.IFPipeline.__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.stable_diffusion.IFPipelineOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.IFPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that will be called every <code>callback_steps</code> steps during inference. The function will be
called with the following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.IFPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be
called at every step.`,name:"callback_steps"},{anchor:"diffusers.IFPipeline.__call__.clean_caption",description:`<strong>clean_caption</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to clean the caption before creating embeddings. Requires <code>beautifulsoup4</code> and <code>ftfy</code> to
be installed. If the dependencies are not installed, the embeddings will be created from the raw
prompt.`,name:"clean_caption"},{anchor:"diffusers.IFPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_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/cross_attention.py" rel="nofollow">diffusers.cross_attention</a>.`,name:"cross_attention_kwargs"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/deepfloyd_if/pipeline_if.py#L625",returnDescription:`
<p><code>~pipelines.stable_diffusion.IFPipelineOutput</code> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) or watermarked content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><code>~pipelines.stable_diffusion.IFPipelineOutput</code> or <code>tuple</code></p>
`}}),Jt=new Ys({props:{anchor:"diffusers.IFPipeline.__call__.example",$$slots:{default:[pZ]},$$scope:{ctx:q}}}),Hn=new X({props:{name:"enable_model_cpu_offload",anchor:"diffusers.IFPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/deepfloyd_if/pipeline_if.py#L171"}}),qn=new X({props:{name:"enable_sequential_cpu_offload",anchor:"diffusers.IFPipeline.enable_sequential_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/deepfloyd_if/pipeline_if.py#L147"}}),An=new X({props:{name:"encode_prompt",anchor:"diffusers.IFPipeline.encode_prompt",parameters:[{name:"prompt",val:""},{name:"do_classifier_free_guidance",val:" = True"},{name:"num_images_per_prompt",val:" = 1"},{name:"device",val:" = None"},{name:"negative_prompt",val:" = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"clean_caption",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.IFPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded`,name:"prompt"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/deepfloyd_if/pipeline_if.py#L245"}}),On=new $({}),Kn=new X({props:{name:"class diffusers.IFSuperResolutionPipeline",anchor:"diffusers.IFSuperResolutionPipeline",parameters:[{name:"tokenizer",val:": T5Tokenizer"},{name:"text_encoder",val:": T5EncoderModel"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": DDPMScheduler"},{name:"image_noising_scheduler",val:": DDPMScheduler"},{name:"safety_checker",val:": typing.Optional[diffusers.pipelines.deepfloyd_if.safety_checker.IFSafetyChecker]"},{name:"feature_extractor",val:": typing.Optional[transformers.models.clip.image_processing_clip.CLIPImageProcessor]"},{name:"watermarker",val:": typing.Optional[diffusers.pipelines.deepfloyd_if.watermark.IFWatermarker]"},{name:"requires_safety_checker",val:": bool = True"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/deepfloyd_if/pipeline_if_superresolution.py#L74"}}),ea=new X({props:{name:"__call__",anchor:"diffusers.IFSuperResolutionPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"height",val:": int = None"},{name:"width",val:": int = None"},{name:"image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.FloatTensor] = None"},{name:"num_inference_steps",val:": int = 50"},{name:"timesteps",val:": typing.List[int] = None"},{name:"guidance_scale",val:": float = 4.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:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"noise_level",val:": int = 250"},{name:"clean_caption",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.IFSuperResolutionPipeline.__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.IFSuperResolutionPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.IFSuperResolutionPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.IFSuperResolutionPipeline.__call__.image",description:`<strong>image</strong> (<code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>torch.FloatTensor</code>) &#x2014;
The image to be upscaled.`,name:"image"},{anchor:"diffusers.IFSuperResolutionPipeline.__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.IFSuperResolutionPipeline.__call__.timesteps",description:`<strong>timesteps</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Custom timesteps to use for the denoising process. If not defined, equal spaced <code>num_inference_steps</code>
timesteps are used. Must be in descending order.`,name:"timesteps"},{anchor:"diffusers.IFSuperResolutionPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
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 &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.`,name:"guidance_scale"},{anchor:"diffusers.IFSuperResolutionPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.IFSuperResolutionPipeline.__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.IFSuperResolutionPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/v0.17.1/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.IFSuperResolutionPipeline.__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.IFSuperResolutionPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</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.IFSuperResolutionPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.IFSuperResolutionPipeline.__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.IFSuperResolutionPipeline.__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.stable_diffusion.IFPipelineOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.IFSuperResolutionPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that will be called every <code>callback_steps</code> steps during inference. The function will be
called with the following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.IFSuperResolutionPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be
called at every step.`,name:"callback_steps"},{anchor:"diffusers.IFSuperResolutionPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_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/cross_attention.py" rel="nofollow">diffusers.cross_attention</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.IFSuperResolutionPipeline.__call__.noise_level",description:`<strong>noise_level</strong> (<code>int</code>, <em>optional</em>, defaults to 250) &#x2014;
The amount of noise to add to the upscaled image. Must be in the range <code>[0, 1000)</code>`,name:"noise_level"},{anchor:"diffusers.IFSuperResolutionPipeline.__call__.clean_caption",description:`<strong>clean_caption</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to clean the caption before creating embeddings. Requires <code>beautifulsoup4</code> and <code>ftfy</code> to
be installed. If the dependencies are not installed, the embeddings will be created from the raw
prompt.`,name:"clean_caption"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/deepfloyd_if/pipeline_if_superresolution.py#L694",returnDescription:`
<p><code>~pipelines.stable_diffusion.IFPipelineOutput</code> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) or watermarked content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><code>~pipelines.stable_diffusion.IFPipelineOutput</code> or <code>tuple</code></p>
`}}),jt=new Ys({props:{anchor:"diffusers.IFSuperResolutionPipeline.__call__.example",$$slots:{default:[dZ]},$$scope:{ctx:q}}}),ta=new X({props:{name:"enable_model_cpu_offload",anchor:"diffusers.IFSuperResolutionPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/deepfloyd_if/pipeline_if_superresolution.py#L166"}}),na=new X({props:{name:"enable_sequential_cpu_offload",anchor:"diffusers.IFSuperResolutionPipeline.enable_sequential_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/deepfloyd_if/pipeline_if_superresolution.py#L141"}}),sa=new X({props:{name:"encode_prompt",anchor:"diffusers.IFSuperResolutionPipeline.encode_prompt",parameters:[{name:"prompt",val:""},{name:"do_classifier_free_guidance",val:" = True"},{name:"num_images_per_prompt",val:" = 1"},{name:"device",val:" = None"},{name:"negative_prompt",val:" = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"clean_caption",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.IFSuperResolutionPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded`,name:"prompt"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/deepfloyd_if/pipeline_if_superresolution.py#L381"}}),oa=new $({}),la=new X({props:{name:"class diffusers.IFImg2ImgPipeline",anchor:"diffusers.IFImg2ImgPipeline",parameters:[{name:"tokenizer",val:": T5Tokenizer"},{name:"text_encoder",val:": T5EncoderModel"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": DDPMScheduler"},{name:"safety_checker",val:": typing.Optional[diffusers.pipelines.deepfloyd_if.safety_checker.IFSafetyChecker]"},{name:"feature_extractor",val:": typing.Optional[transformers.models.clip.image_processing_clip.CLIPImageProcessor]"},{name:"watermarker",val:": typing.Optional[diffusers.pipelines.deepfloyd_if.watermark.IFWatermarker]"},{name:"requires_safety_checker",val:": bool = True"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img.py#L113"}}),ia=new X({props:{name:"__call__",anchor:"diffusers.IFImg2ImgPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"image",val:": typing.Union[PIL.Image.Image, torch.Tensor, numpy.ndarray, typing.List[PIL.Image.Image], typing.List[torch.Tensor], typing.List[numpy.ndarray]] = None"},{name:"strength",val:": float = 0.7"},{name:"num_inference_steps",val:": int = 80"},{name:"timesteps",val:": typing.List[int] = None"},{name:"guidance_scale",val:": float = 10.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:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"clean_caption",val:": bool = True"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"}],parametersDescription:[{anchor:"diffusers.IFImg2ImgPipeline.__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.IFImg2ImgPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code> or <code>PIL.Image.Image</code>) &#x2014;
<code>Image</code>, or tensor representing an image batch, that will be used as the starting point for the
process.`,name:"image"},{anchor:"diffusers.IFImg2ImgPipeline.__call__.strength",description:`<strong>strength</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) &#x2014;
Conceptually, indicates how much to transform the reference <code>image</code>. Must be between 0 and 1. <code>image</code>
will be used as a starting point, adding more noise to it the larger 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 will
be maximum and the denoising process will run for the full number of iterations specified in
<code>num_inference_steps</code>. A value of 1, therefore, essentially ignores <code>image</code>.`,name:"strength"},{anchor:"diffusers.IFImg2ImgPipeline.__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.IFImg2ImgPipeline.__call__.timesteps",description:`<strong>timesteps</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Custom timesteps to use for the denoising process. If not defined, equal spaced <code>num_inference_steps</code>
timesteps are used. Must be in descending order.`,name:"timesteps"},{anchor:"diffusers.IFImg2ImgPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
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 &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.`,name:"guidance_scale"},{anchor:"diffusers.IFImg2ImgPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.IFImg2ImgPipeline.__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.IFImg2ImgPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/v0.17.1/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.IFImg2ImgPipeline.__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.IFImg2ImgPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</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.IFImg2ImgPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.IFImg2ImgPipeline.__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.IFImg2ImgPipeline.__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.stable_diffusion.IFPipelineOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.IFImg2ImgPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that will be called every <code>callback_steps</code> steps during inference. The function will be
called with the following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.IFImg2ImgPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be
called at every step.`,name:"callback_steps"},{anchor:"diffusers.IFImg2ImgPipeline.__call__.clean_caption",description:`<strong>clean_caption</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to clean the caption before creating embeddings. Requires <code>beautifulsoup4</code> and <code>ftfy</code> to
be installed. If the dependencies are not installed, the embeddings will be created from the raw
prompt.`,name:"clean_caption"},{anchor:"diffusers.IFImg2ImgPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_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/cross_attention.py" rel="nofollow">diffusers.cross_attention</a>.`,name:"cross_attention_kwargs"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img.py#L740",returnDescription:`
<p><code>~pipelines.stable_diffusion.IFPipelineOutput</code> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) or watermarked content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><code>~pipelines.stable_diffusion.IFPipelineOutput</code> or <code>tuple</code></p>
`}}),Wt=new Ys({props:{anchor:"diffusers.IFImg2ImgPipeline.__call__.example",$$slots:{default:[cZ]},$$scope:{ctx:q}}}),ra=new X({props:{name:"enable_model_cpu_offload",anchor:"diffusers.IFImg2ImgPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img.py#L197"}}),pa=new X({props:{name:"enable_sequential_cpu_offload",anchor:"diffusers.IFImg2ImgPipeline.enable_sequential_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img.py#L172"}}),ca=new X({props:{name:"encode_prompt",anchor:"diffusers.IFImg2ImgPipeline.encode_prompt",parameters:[{name:"prompt",val:""},{name:"do_classifier_free_guidance",val:" = True"},{name:"num_images_per_prompt",val:" = 1"},{name:"device",val:" = None"},{name:"negative_prompt",val:" = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"clean_caption",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.IFImg2ImgPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded`,name:"prompt"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img.py#L272"}}),ma=new $({}),ga=new X({props:{name:"class diffusers.IFImg2ImgSuperResolutionPipeline",anchor:"diffusers.IFImg2ImgSuperResolutionPipeline",parameters:[{name:"tokenizer",val:": T5Tokenizer"},{name:"text_encoder",val:": T5EncoderModel"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": DDPMScheduler"},{name:"image_noising_scheduler",val:": DDPMScheduler"},{name:"safety_checker",val:": typing.Optional[diffusers.pipelines.deepfloyd_if.safety_checker.IFSafetyChecker]"},{name:"feature_extractor",val:": typing.Optional[transformers.models.clip.image_processing_clip.CLIPImageProcessor]"},{name:"watermarker",val:": typing.Optional[diffusers.pipelines.deepfloyd_if.watermark.IFWatermarker]"},{name:"requires_safety_checker",val:": bool = True"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img_superresolution.py#L116"}}),fa=new X({props:{name:"__call__",anchor:"diffusers.IFImg2ImgSuperResolutionPipeline.__call__",parameters:[{name:"image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.FloatTensor]"},{name:"original_image",val:": typing.Union[PIL.Image.Image, torch.Tensor, numpy.ndarray, typing.List[PIL.Image.Image], typing.List[torch.Tensor], typing.List[numpy.ndarray]] = None"},{name:"strength",val:": float = 0.8"},{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"num_inference_steps",val:": int = 50"},{name:"timesteps",val:": typing.List[int] = None"},{name:"guidance_scale",val:": float = 4.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:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"noise_level",val:": int = 250"},{name:"clean_caption",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.IFImg2ImgSuperResolutionPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code> or <code>PIL.Image.Image</code>) &#x2014;
<code>Image</code>, or tensor representing an image batch, that will be used as the starting point for the
process.`,name:"image"},{anchor:"diffusers.IFImg2ImgSuperResolutionPipeline.__call__.original_image",description:`<strong>original_image</strong> (<code>torch.FloatTensor</code> or <code>PIL.Image.Image</code>) &#x2014;
The original image that <code>image</code> was varied from.`,name:"original_image"},{anchor:"diffusers.IFImg2ImgSuperResolutionPipeline.__call__.strength",description:`<strong>strength</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) &#x2014;
Conceptually, indicates how much to transform the reference <code>image</code>. Must be between 0 and 1. <code>image</code>
will be used as a starting point, adding more noise to it the larger 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 will
be maximum and the denoising process will run for the full number of iterations specified in
<code>num_inference_steps</code>. A value of 1, therefore, essentially ignores <code>image</code>.`,name:"strength"},{anchor:"diffusers.IFImg2ImgSuperResolutionPipeline.__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.IFImg2ImgSuperResolutionPipeline.__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.IFImg2ImgSuperResolutionPipeline.__call__.timesteps",description:`<strong>timesteps</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Custom timesteps to use for the denoising process. If not defined, equal spaced <code>num_inference_steps</code>
timesteps are used. Must be in descending order.`,name:"timesteps"},{anchor:"diffusers.IFImg2ImgSuperResolutionPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
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 &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.`,name:"guidance_scale"},{anchor:"diffusers.IFImg2ImgSuperResolutionPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.IFImg2ImgSuperResolutionPipeline.__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.IFImg2ImgSuperResolutionPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/v0.17.1/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.IFImg2ImgSuperResolutionPipeline.__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.IFImg2ImgSuperResolutionPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</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.IFImg2ImgSuperResolutionPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.IFImg2ImgSuperResolutionPipeline.__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.IFImg2ImgSuperResolutionPipeline.__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.stable_diffusion.IFPipelineOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.IFImg2ImgSuperResolutionPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that will be called every <code>callback_steps</code> steps during inference. The function will be
called with the following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.IFImg2ImgSuperResolutionPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be
called at every step.`,name:"callback_steps"},{anchor:"diffusers.IFImg2ImgSuperResolutionPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_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/cross_attention.py" rel="nofollow">diffusers.cross_attention</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.IFImg2ImgSuperResolutionPipeline.__call__.noise_level",description:`<strong>noise_level</strong> (<code>int</code>, <em>optional</em>, defaults to 250) &#x2014;
The amount of noise to add to the upscaled image. Must be in the range <code>[0, 1000)</code>`,name:"noise_level"},{anchor:"diffusers.IFImg2ImgSuperResolutionPipeline.__call__.clean_caption",description:`<strong>clean_caption</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to clean the caption before creating embeddings. Requires <code>beautifulsoup4</code> and <code>ftfy</code> to
be installed. If the dependencies are not installed, the embeddings will be created from the raw
prompt.`,name:"clean_caption"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img_superresolution.py#L822",returnDescription:`
<p><code>~pipelines.stable_diffusion.IFPipelineOutput</code> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) or watermarked content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><code>~pipelines.stable_diffusion.IFPipelineOutput</code> or <code>tuple</code></p>
`}}),Rt=new Ys({props:{anchor:"diffusers.IFImg2ImgSuperResolutionPipeline.__call__.example",$$slots:{default:[mZ]},$$scope:{ctx:q}}}),ua=new X({props:{name:"enable_model_cpu_offload",anchor:"diffusers.IFImg2ImgSuperResolutionPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img_superresolution.py#L208"}}),ha=new X({props:{name:"enable_sequential_cpu_offload",anchor:"diffusers.IFImg2ImgSuperResolutionPipeline.enable_sequential_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img_superresolution.py#L183"}}),ya=new X({props:{name:"encode_prompt",anchor:"diffusers.IFImg2ImgSuperResolutionPipeline.encode_prompt",parameters:[{name:"prompt",val:""},{name:"do_classifier_free_guidance",val:" = True"},{name:"num_images_per_prompt",val:" = 1"},{name:"device",val:" = None"},{name:"negative_prompt",val:" = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"clean_caption",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.IFImg2ImgSuperResolutionPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded`,name:"prompt"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img_superresolution.py#L423"}}),ba=new $({}),Ma=new X({props:{name:"class diffusers.IFInpaintingPipeline",anchor:"diffusers.IFInpaintingPipeline",parameters:[{name:"tokenizer",val:": T5Tokenizer"},{name:"text_encoder",val:": T5EncoderModel"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": DDPMScheduler"},{name:"safety_checker",val:": typing.Optional[diffusers.pipelines.deepfloyd_if.safety_checker.IFSafetyChecker]"},{name:"feature_extractor",val:": typing.Optional[transformers.models.clip.image_processing_clip.CLIPImageProcessor]"},{name:"watermarker",val:": typing.Optional[diffusers.pipelines.deepfloyd_if.watermark.IFWatermarker]"},{name:"requires_safety_checker",val:": bool = True"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting.py#L116"}}),wa=new X({props:{name:"__call__",anchor:"diffusers.IFInpaintingPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"image",val:": typing.Union[PIL.Image.Image, torch.Tensor, numpy.ndarray, typing.List[PIL.Image.Image], typing.List[torch.Tensor], typing.List[numpy.ndarray]] = None"},{name:"mask_image",val:": typing.Union[PIL.Image.Image, torch.Tensor, numpy.ndarray, typing.List[PIL.Image.Image], typing.List[torch.Tensor], typing.List[numpy.ndarray]] = None"},{name:"strength",val:": float = 1.0"},{name:"num_inference_steps",val:": int = 50"},{name:"timesteps",val:": typing.List[int] = None"},{name:"guidance_scale",val:": float = 7.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:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"clean_caption",val:": bool = True"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"}],parametersDescription:[{anchor:"diffusers.IFInpaintingPipeline.__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.IFInpaintingPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code> or <code>PIL.Image.Image</code>) &#x2014;
<code>Image</code>, or tensor representing an image batch, that will be used as the starting point for the
process.`,name:"image"},{anchor:"diffusers.IFInpaintingPipeline.__call__.mask_image",description:`<strong>mask_image</strong> (<code>PIL.Image.Image</code>) &#x2014;
<code>Image</code>, or tensor representing an image batch, to mask <code>image</code>. White pixels in the mask will be
repainted, while black pixels will be preserved. If <code>mask_image</code> is a PIL image, it will be converted
to a single channel (luminance) before use. If it&#x2019;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.IFInpaintingPipeline.__call__.strength",description:`<strong>strength</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) &#x2014;
Conceptually, indicates how much to transform the reference <code>image</code>. Must be between 0 and 1. <code>image</code>
will be used as a starting point, adding more noise to it the larger 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 will
be maximum and the denoising process will run for the full number of iterations specified in
<code>num_inference_steps</code>. A value of 1, therefore, essentially ignores <code>image</code>.`,name:"strength"},{anchor:"diffusers.IFInpaintingPipeline.__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.IFInpaintingPipeline.__call__.timesteps",description:`<strong>timesteps</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Custom timesteps to use for the denoising process. If not defined, equal spaced <code>num_inference_steps</code>
timesteps are used. Must be in descending order.`,name:"timesteps"},{anchor:"diffusers.IFInpaintingPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
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 &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.`,name:"guidance_scale"},{anchor:"diffusers.IFInpaintingPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.IFInpaintingPipeline.__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.IFInpaintingPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/v0.17.1/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.IFInpaintingPipeline.__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.IFInpaintingPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</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.IFInpaintingPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.IFInpaintingPipeline.__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.IFInpaintingPipeline.__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.stable_diffusion.IFPipelineOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.IFInpaintingPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that will be called every <code>callback_steps</code> steps during inference. The function will be
called with the following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.IFInpaintingPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be
called at every step.`,name:"callback_steps"},{anchor:"diffusers.IFInpaintingPipeline.__call__.clean_caption",description:`<strong>clean_caption</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to clean the caption before creating embeddings. Requires <code>beautifulsoup4</code> and <code>ftfy</code> to
be installed. If the dependencies are not installed, the embeddings will be created from the raw
prompt.`,name:"clean_caption"},{anchor:"diffusers.IFInpaintingPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_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/cross_attention.py" rel="nofollow">diffusers.cross_attention</a>.`,name:"cross_attention_kwargs"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting.py#L832",returnDescription:`
<p><code>~pipelines.stable_diffusion.IFPipelineOutput</code> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) or watermarked content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><code>~pipelines.stable_diffusion.IFPipelineOutput</code> or <code>tuple</code></p>
`}}),Vt=new Ys({props:{anchor:"diffusers.IFInpaintingPipeline.__call__.example",$$slots:{default:[gZ]},$$scope:{ctx:q}}}),va=new X({props:{name:"enable_model_cpu_offload",anchor:"diffusers.IFInpaintingPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting.py#L200"}}),Ia=new X({props:{name:"enable_sequential_cpu_offload",anchor:"diffusers.IFInpaintingPipeline.enable_sequential_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting.py#L175"}}),Ua=new X({props:{name:"encode_prompt",anchor:"diffusers.IFInpaintingPipeline.encode_prompt",parameters:[{name:"prompt",val:""},{name:"do_classifier_free_guidance",val:" = True"},{name:"num_images_per_prompt",val:" = 1"},{name:"device",val:" = None"},{name:"negative_prompt",val:" = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"clean_caption",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.IFInpaintingPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded`,name:"prompt"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting.py#L275"}}),Ta=new $({}),Za=new X({props:{name:"class diffusers.IFInpaintingSuperResolutionPipeline",anchor:"diffusers.IFInpaintingSuperResolutionPipeline",parameters:[{name:"tokenizer",val:": T5Tokenizer"},{name:"text_encoder",val:": T5EncoderModel"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": DDPMScheduler"},{name:"image_noising_scheduler",val:": DDPMScheduler"},{name:"safety_checker",val:": typing.Optional[diffusers.pipelines.deepfloyd_if.safety_checker.IFSafetyChecker]"},{name:"feature_extractor",val:": typing.Optional[transformers.models.clip.image_processing_clip.CLIPImageProcessor]"},{name:"watermarker",val:": typing.Optional[diffusers.pipelines.deepfloyd_if.watermark.IFWatermarker]"},{name:"requires_safety_checker",val:": bool = True"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting_superresolution.py#L118"}}),ja=new X({props:{name:"__call__",anchor:"diffusers.IFInpaintingSuperResolutionPipeline.__call__",parameters:[{name:"image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.FloatTensor]"},{name:"original_image",val:": typing.Union[PIL.Image.Image, torch.Tensor, numpy.ndarray, typing.List[PIL.Image.Image], typing.List[torch.Tensor], typing.List[numpy.ndarray]] = None"},{name:"mask_image",val:": typing.Union[PIL.Image.Image, torch.Tensor, numpy.ndarray, typing.List[PIL.Image.Image], typing.List[torch.Tensor], typing.List[numpy.ndarray]] = None"},{name:"strength",val:": float = 0.8"},{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"num_inference_steps",val:": int = 100"},{name:"timesteps",val:": typing.List[int] = None"},{name:"guidance_scale",val:": float = 4.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:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"noise_level",val:": int = 0"},{name:"clean_caption",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.IFInpaintingSuperResolutionPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code> or <code>PIL.Image.Image</code>) &#x2014;
<code>Image</code>, or tensor representing an image batch, that will be used as the starting point for the
process.`,name:"image"},{anchor:"diffusers.IFInpaintingSuperResolutionPipeline.__call__.original_image",description:`<strong>original_image</strong> (<code>torch.FloatTensor</code> or <code>PIL.Image.Image</code>) &#x2014;
The original image that <code>image</code> was varied from.`,name:"original_image"},{anchor:"diffusers.IFInpaintingSuperResolutionPipeline.__call__.mask_image",description:`<strong>mask_image</strong> (<code>PIL.Image.Image</code>) &#x2014;
<code>Image</code>, or tensor representing an image batch, to mask <code>image</code>. White pixels in the mask will be
repainted, while black pixels will be preserved. If <code>mask_image</code> is a PIL image, it will be converted
to a single channel (luminance) before use. If it&#x2019;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.IFInpaintingSuperResolutionPipeline.__call__.strength",description:`<strong>strength</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) &#x2014;
Conceptually, indicates how much to transform the reference <code>image</code>. Must be between 0 and 1. <code>image</code>
will be used as a starting point, adding more noise to it the larger 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 will
be maximum and the denoising process will run for the full number of iterations specified in
<code>num_inference_steps</code>. A value of 1, therefore, essentially ignores <code>image</code>.`,name:"strength"},{anchor:"diffusers.IFInpaintingSuperResolutionPipeline.__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.IFInpaintingSuperResolutionPipeline.__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.IFInpaintingSuperResolutionPipeline.__call__.timesteps",description:`<strong>timesteps</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Custom timesteps to use for the denoising process. If not defined, equal spaced <code>num_inference_steps</code>
timesteps are used. Must be in descending order.`,name:"timesteps"},{anchor:"diffusers.IFInpaintingSuperResolutionPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
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 &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.`,name:"guidance_scale"},{anchor:"diffusers.IFInpaintingSuperResolutionPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.IFInpaintingSuperResolutionPipeline.__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.IFInpaintingSuperResolutionPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/v0.17.1/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.IFInpaintingSuperResolutionPipeline.__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.IFInpaintingSuperResolutionPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</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.IFInpaintingSuperResolutionPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.IFInpaintingSuperResolutionPipeline.__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.IFInpaintingSuperResolutionPipeline.__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.stable_diffusion.IFPipelineOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.IFInpaintingSuperResolutionPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that will be called every <code>callback_steps</code> steps during inference. The function will be
called with the following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.IFInpaintingSuperResolutionPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be
called at every step.`,name:"callback_steps"},{anchor:"diffusers.IFInpaintingSuperResolutionPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_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/cross_attention.py" rel="nofollow">diffusers.cross_attention</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.IFInpaintingSuperResolutionPipeline.__call__.noise_level",description:`<strong>noise_level</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
The amount of noise to add to the upscaled image. Must be in the range <code>[0, 1000)</code>`,name:"noise_level"},{anchor:"diffusers.IFInpaintingSuperResolutionPipeline.__call__.clean_caption",description:`<strong>clean_caption</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to clean the caption before creating embeddings. Requires <code>beautifulsoup4</code> and <code>ftfy</code> to
be installed. If the dependencies are not installed, the embeddings will be created from the raw
prompt.`,name:"clean_caption"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting_superresolution.py#L910",returnDescription:`
<p><code>~pipelines.stable_diffusion.IFPipelineOutput</code> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) or watermarked content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><code>~pipelines.stable_diffusion.IFPipelineOutput</code> or <code>tuple</code></p>
`}}),Qt=new Ys({props:{anchor:"diffusers.IFInpaintingSuperResolutionPipeline.__call__.example",$$slots:{default:[fZ]},$$scope:{ctx:q}}}),Ea=new X({props:{name:"enable_model_cpu_offload",anchor:"diffusers.IFInpaintingSuperResolutionPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting_superresolution.py#L210"}}),Fa=new X({props:{name:"enable_sequential_cpu_offload",anchor:"diffusers.IFInpaintingSuperResolutionPipeline.enable_sequential_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting_superresolution.py#L185"}}),Wa=new X({props:{name:"encode_prompt",anchor:"diffusers.IFInpaintingSuperResolutionPipeline.encode_prompt",parameters:[{name:"prompt",val:""},{name:"do_classifier_free_guidance",val:" = True"},{name:"num_images_per_prompt",val:" = 1"},{name:"device",val:" = None"},{name:"negative_prompt",val:" = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"clean_caption",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.IFInpaintingSuperResolutionPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded`,name:"prompt"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting_superresolution.py#L425"}}),{c(){w=o("meta"),x=r(),C=o("h1"),M=o("a"),R=o("span"),f(g.$$.fragment),G=r(),zs=o("span"),Oc=a("IF"),Np=r(),Re=o("h2"),ot=o("a"),Hs=o("span"),f(zt.$$.fragment),Kc=r(),qs=o("span"),em=a("Overview"),Qp=r(),Xa=o("p"),tm=a(`DeepFloyd IF is a novel state-of-the-art open-source text-to-image model with a high degree of photorealism and language understanding.
The model is a modular composed of a frozen text encoder and three cascaded pixel diffusion modules:`),Yp=r(),le=o("ul"),Ls=o("li"),nm=a("Stage 1: a base model that generates 64x64 px image based on text prompt,"),am=r(),As=o("li"),sm=a("Stage 2: a 64x64 px => 256x256 px super-resolution model, and a"),om=r(),Ht=o("li"),lm=a(`Stage 3: a 256x256 px => 1024x1024 px super-resolution model
Stage 1 and Stage 2 utilize a frozen text encoder based on the T5 transformer to extract text embeddings,
which are then fed into a UNet architecture enhanced with cross-attention and attention pooling.
Stage 3 is `),qt=o("a"),im=a("Stability\u2019s x4 Upscaling model"),rm=a(`.
The result is a highly efficient model that outperforms current state-of-the-art models, achieving a zero-shot FID score of 6.66 on the COCO dataset.
Our work underscores the potential of larger UNet architectures in the first stage of cascaded diffusion models and depicts a promising future for text-to-image synthesis.`),Dp=r(),Xe=o("h2"),lt=o("a"),Os=o("span"),f(Lt.$$.fragment),pm=r(),Ks=o("span"),dm=a("Usage"),zp=r(),xa=o("p"),cm=a("Before you can use IF, you need to accept its usage conditions. To do so:"),Hp=r(),ie=o("ol"),At=o("li"),mm=a("Make sure to have a "),Ot=o("a"),gm=a("Hugging Face account"),fm=a(" and be logged in"),um=r(),Kt=o("li"),hm=a("Accept the license on the model card of "),en=o("a"),_m=a("DeepFloyd/IF-I-XL-v1.0"),ym=a(". Accepting the license on the stage I model card will auto accept for the other IF models."),bm=r(),Sa=o("li"),Mm=a("Make sure to login locally. Install "),eo=o("code"),wm=a("huggingface_hub"),qp=r(),f(tn.$$.fragment),Lp=r(),Va=o("p"),vm=a("run the login function in a Python shell"),Ap=r(),f(nn.$$.fragment),Op=r(),it=o("p"),Im=a("and enter your "),an=o("a"),Jm=a("Hugging Face Hub access token"),Um=a("."),Kp=r(),rt=o("p"),Tm=a("Next we install "),to=o("code"),Zm=a("diffusers"),jm=a(" and dependencies:"),ed=r(),f(sn.$$.fragment),td=r(),$a=o("p"),Em=a("The following sections give more in-detail examples of how to use IF. Specifically:"),nd=r(),V=o("ul"),no=o("li"),Pa=o("a"),Fm=a("Text-to-Image Generation"),Bm=r(),ao=o("li"),Na=o("a"),Wm=a("Image-to-Image Generation"),km=r(),so=o("li"),Qa=o("a"),Gm=a("Inpainting"),Cm=r(),oo=o("li"),Ya=o("a"),Rm=a("Reusing model weights"),Xm=r(),lo=o("li"),Da=o("a"),xm=a("Speed optimization"),Sm=r(),io=o("li"),za=o("a"),Vm=a("Memory optimization"),ad=r(),Ha=o("p"),ro=o("strong"),$m=a("Available checkpoints"),sd=r(),re=o("ul"),on=o("li"),po=o("p"),co=o("em"),Pm=a("Stage-1"),Nm=r(),xe=o("ul"),mo=o("li"),ln=o("a"),Qm=a("DeepFloyd/IF-I-XL-v1.0"),Ym=r(),go=o("li"),rn=o("a"),Dm=a("DeepFloyd/IF-I-L-v1.0"),zm=r(),fo=o("li"),pn=o("a"),Hm=a("DeepFloyd/IF-I-M-v1.0"),qm=r(),dn=o("li"),uo=o("p"),ho=o("em"),Lm=a("Stage-2"),Am=r(),cn=o("ul"),_o=o("li"),mn=o("a"),Om=a("DeepFloyd/IF-II-L-v1.0"),Km=r(),yo=o("li"),gn=o("a"),eg=a("DeepFloyd/IF-II-M-v1.0"),tg=r(),fn=o("li"),bo=o("p"),Mo=o("em"),ng=a("Stage-3"),ag=r(),wo=o("ul"),vo=o("li"),un=o("a"),sg=a("stabilityai/stable-diffusion-x4-upscaler"),od=r(),pt=o("p"),Io=o("strong"),og=a("Demo"),lg=r(),hn=o("a"),qa=o("img"),ld=r(),dt=o("p"),Jo=o("strong"),ig=a("Google Colab"),rg=r(),_n=o("a"),La=o("img"),id=r(),Se=o("h3"),ct=o("a"),Uo=o("span"),f(yn.$$.fragment),pg=r(),To=o("span"),dg=a("Text-to-Image Generation"),rd=r(),mt=o("p"),cg=a("By default diffusers makes use of "),bn=o("a"),mg=a("model cpu offloading"),gg=a(`
to run the whole IF pipeline with as little as 14 GB of VRAM.`),pd=r(),f(Mn.$$.fragment),dd=r(),Ve=o("h3"),gt=o("a"),Zo=o("span"),f(wn.$$.fragment),fg=r(),jo=o("span"),ug=a("Text Guided Image-to-Image Generation"),cd=r(),pe=o("p"),hg=a(`The same IF model weights can be used for text-guided image-to-image translation or image variation.
In this case just make sure to load the weights using the `),Aa=o("a"),_g=a("IFInpaintingPipeline"),yg=a(" and "),Oa=o("a"),bg=a("IFInpaintingSuperResolutionPipeline"),Mg=a(" pipelines."),md=r(),se=o("p"),Eo=o("strong"),wg=a("Note"),vg=a(`: You can also directly move the weights of the text-to-image pipelines to the image-to-image pipelines
without loading them twice by making use of the `),Fo=o("code"),Ig=a("~DiffusionPipeline.components()"),Jg=a(" function as explained "),Ka=o("a"),Ug=a("here"),Tg=a("."),gd=r(),f(vn.$$.fragment),fd=r(),$e=o("h3"),ft=o("a"),Bo=o("span"),f(In.$$.fragment),Zg=r(),Wo=o("span"),jg=a("Text Guided Inpainting Generation"),ud=r(),de=o("p"),Eg=a(`The same IF model weights can be used for text-guided image-to-image translation or image variation.
In this case just make sure to load the weights using the `),es=o("a"),Fg=a("IFInpaintingPipeline"),Bg=a(" and "),ts=o("a"),Wg=a("IFInpaintingSuperResolutionPipeline"),kg=a(" pipelines."),hd=r(),oe=o("p"),ko=o("strong"),Gg=a("Note"),Cg=a(`: You can also directly move the weights of the text-to-image pipelines to the image-to-image pipelines
without loading them twice by making use of the `),Go=o("code"),Rg=a("~DiffusionPipeline.components()"),Xg=a(" function as explained "),ns=o("a"),xg=a("here"),Sg=a("."),_d=r(),f(Jn.$$.fragment),yd=r(),Pe=o("h3"),ut=o("a"),Co=o("span"),f(Un.$$.fragment),Vg=r(),Ro=o("span"),$g=a("Converting between different pipelines"),bd=r(),ht=o("p"),Pg=a("In addition to being loaded with "),Xo=o("code"),Ng=a("from_pretrained"),Qg=a(", Pipelines can also be loaded directly from each other."),Md=r(),f(Tn.$$.fragment),wd=r(),Ne=o("h3"),_t=o("a"),xo=o("span"),f(Zn.$$.fragment),Yg=r(),So=o("span"),Dg=a("Optimizing for speed"),vd=r(),as=o("p"),zg=a("The simplest optimization to run IF faster is to move all model components to the GPU."),Id=r(),f(jn.$$.fragment),Jd=r(),ss=o("p"),Hg=a("You can also run the diffusion process for a shorter number of timesteps."),Ud=r(),yt=o("p"),qg=a("This can either be done with the "),Vo=o("code"),Lg=a("num_inference_steps"),Ag=a(" argument"),Td=r(),f(En.$$.fragment),Zd=r(),bt=o("p"),Og=a("Or with the "),$o=o("code"),Kg=a("timesteps"),ef=a(" argument"),jd=r(),f(Fn.$$.fragment),Ed=r(),os=o("p"),tf=a(`When doing image variation or inpainting, you can also decrease the number of timesteps
with the strength argument. The strength argument is the amount of noise to add to
the input image which also determines how many steps to run in the denoising process.
A smaller number will vary the image less but run faster.`),Fd=r(),f(Bn.$$.fragment),Bd=r(),ce=o("p"),nf=a("You can also use "),ls=o("a"),Po=o("code"),af=a("torch.compile"),sf=a(". Note that we have not exhaustively tested "),No=o("code"),of=a("torch.compile"),lf=a(`
with IF and it might not give expected results.`),Wd=r(),f(Wn.$$.fragment),kd=r(),Qe=o("h3"),Mt=o("a"),Qo=o("span"),f(kn.$$.fragment),rf=r(),Yo=o("span"),pf=a("Optimizing for memory"),Gd=r(),is=o("p"),df=a("When optimizing for GPU memory, we can use the standard diffusers cpu offloading APIs."),Cd=r(),rs=o("p"),cf=a("Either the model based CPU offloading,"),Rd=r(),f(Gn.$$.fragment),Xd=r(),ps=o("p"),mf=a("or the more aggressive layer based CPU offloading."),xd=r(),f(Cn.$$.fragment),Sd=r(),ds=o("p"),gf=a("Additionally, T5 can be loaded in 8bit precision"),Vd=r(),f(Rn.$$.fragment),$d=r(),cs=o("p"),ff=a(`For CPU RAM constrained machines like google colab free tier where we can\u2019t load all
model components to the CPU at once, we can manually only load the pipeline with
the text encoder or unet when the respective model components are needed.`),Pd=r(),f(Xn.$$.fragment),Nd=r(),Ye=o("h2"),wt=o("a"),Do=o("span"),f(xn.$$.fragment),uf=r(),zo=o("span"),hf=a("Available Pipelines:"),Qd=r(),vt=o("table"),Ho=o("thead"),De=o("tr"),qo=o("th"),_f=a("Pipeline"),yf=r(),Lo=o("th"),bf=a("Tasks"),Mf=r(),ms=o("th"),wf=a("Colab"),vf=r(),P=o("tbody"),ze=o("tr"),Ao=o("td"),Sn=o("a"),If=a("pipeline_if.py"),Jf=r(),Oo=o("td"),Ko=o("em"),Uf=a("Text-to-Image Generation"),Tf=r(),gs=o("td"),Zf=a("-"),jf=r(),He=o("tr"),el=o("td"),Vn=o("a"),Ef=a("pipeline_if_superresolution.py"),Ff=r(),tl=o("td"),nl=o("em"),Bf=a("Text-to-Image Generation"),Wf=r(),fs=o("td"),kf=a("-"),Gf=r(),qe=o("tr"),al=o("td"),$n=o("a"),Cf=a("pipeline_if_img2img.py"),Rf=r(),sl=o("td"),ol=o("em"),Xf=a("Image-to-Image Generation"),xf=r(),us=o("td"),Sf=a("-"),Vf=r(),Le=o("tr"),ll=o("td"),Pn=o("a"),$f=a("pipeline_if_img2img_superresolution.py"),Pf=r(),il=o("td"),rl=o("em"),Nf=a("Image-to-Image Generation"),Qf=r(),hs=o("td"),Yf=a("-"),Df=r(),Ae=o("tr"),pl=o("td"),Nn=o("a"),zf=a("pipeline_if_inpainting.py"),Hf=r(),dl=o("td"),cl=o("em"),qf=a("Image-to-Image Generation"),Lf=r(),_s=o("td"),Af=a("-"),Of=r(),Oe=o("tr"),ml=o("td"),Qn=o("a"),Kf=a("pipeline_if_inpainting_superresolution.py"),eu=r(),gl=o("td"),fl=o("em"),tu=a("Image-to-Image Generation"),nu=r(),ys=o("td"),au=a("-"),Yd=r(),Ke=o("h2"),It=o("a"),ul=o("span"),f(Yn.$$.fragment),su=r(),hl=o("span"),ou=a("IFPipeline"),Dd=r(),N=o("div"),f(Dn.$$.fragment),lu=r(),me=o("div"),f(zn.$$.fragment),iu=r(),_l=o("p"),ru=a("Function invoked when calling the pipeline for generation."),pu=r(),f(Jt.$$.fragment),du=r(),Ut=o("div"),f(Hn.$$.fragment),cu=r(),L=o("p"),mu=a(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),yl=o("code"),gu=a("enable_sequential_cpu_offload"),fu=a(", this method moves one whole model at a time to the GPU when its "),bl=o("code"),uu=a("forward"),hu=a(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Ml=o("code"),_u=a("enable_sequential_cpu_offload"),yu=a(", but performance is much better due to the iterative execution of the "),wl=o("code"),bu=a("unet"),Mu=a("."),wu=r(),Tt=o("div"),f(qn.$$.fragment),vu=r(),Ln=o("p"),Iu=a(`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, the pipeline\u2019s
models have their state dicts saved to CPU and then are moved to a `),vl=o("code"),Ju=a("torch.device('meta') and loaded to GPU only when their specific submodule has its "),Uu=a("forward` method called."),Tu=r(),ge=o("div"),f(An.$$.fragment),Zu=r(),Il=o("p"),ju=a("Encodes the prompt into text encoder hidden states."),Eu=r(),v=o("p"),Fu=a("device: ("),Jl=o("code"),Bu=a("torch.device"),Wu=a(", "),Ul=o("em"),ku=a("optional"),Gu=a(`):
torch device to place the resulting embeddings on
num_images_per_prompt (`),Tl=o("code"),Cu=a("int"),Ru=a(", "),Zl=o("em"),Xu=a("optional"),xu=a(`, defaults to 1):
number of images that should be generated per prompt
do_classifier_free_guidance (`),jl=o("code"),Su=a("bool"),Vu=a(", "),El=o("em"),$u=a("optional"),Pu=a(", defaults to "),Fl=o("code"),Nu=a("True"),Qu=a(`):
whether to use classifier free guidance or not
negative_prompt (`),Bl=o("code"),Yu=a("str"),Du=a(" or "),Wl=o("code"),zu=a("List[str]"),Hu=a(", "),kl=o("em"),qu=a("optional"),Lu=a(`):
The prompt or prompts not to guide the image generation. If not defined, one has to pass
`),Gl=o("code"),Au=a("negative_prompt_embeds"),Ou=a(". instead. If not defined, one has to pass "),Cl=o("code"),Ku=a("negative_prompt_embeds"),eh=a(`. instead.
Ignored when not using guidance (i.e., ignored if `),Rl=o("code"),th=a("guidance_scale"),nh=a(" is less than "),Xl=o("code"),ah=a("1"),sh=a(`).
prompt_embeds (`),xl=o("code"),oh=a("torch.FloatTensor"),lh=a(", "),Sl=o("em"),ih=a("optional"),rh=a(`):
Pre-generated text embeddings. Can be used to easily tweak text inputs, `),Vl=o("em"),ph=a("e.g."),dh=a(` prompt weighting. If not
provided, text embeddings will be generated from `),$l=o("code"),ch=a("prompt"),mh=a(` input argument.
negative_prompt_embeds (`),Pl=o("code"),gh=a("torch.FloatTensor"),fh=a(", "),Nl=o("em"),uh=a("optional"),hh=a(`):
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, `),Ql=o("em"),_h=a("e.g."),yh=a(` prompt
weighting. If not provided, negative_prompt_embeds will be generated from `),Yl=o("code"),bh=a("negative_prompt"),Mh=a(` input
argument.`),zd=r(),et=o("h2"),Zt=o("a"),Dl=o("span"),f(On.$$.fragment),wh=r(),zl=o("span"),vh=a("IFSuperResolutionPipeline"),Hd=r(),Q=o("div"),f(Kn.$$.fragment),Ih=r(),fe=o("div"),f(ea.$$.fragment),Jh=r(),Hl=o("p"),Uh=a("Function invoked when calling the pipeline for generation."),Th=r(),f(jt.$$.fragment),Zh=r(),Et=o("div"),f(ta.$$.fragment),jh=r(),A=o("p"),Eh=a(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),ql=o("code"),Fh=a("enable_sequential_cpu_offload"),Bh=a(", this method moves one whole model at a time to the GPU when its "),Ll=o("code"),Wh=a("forward"),kh=a(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Al=o("code"),Gh=a("enable_sequential_cpu_offload"),Ch=a(", but performance is much better due to the iterative execution of the "),Ol=o("code"),Rh=a("unet"),Xh=a("."),xh=r(),Ft=o("div"),f(na.$$.fragment),Sh=r(),aa=o("p"),Vh=a(`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, the pipeline\u2019s
models have their state dicts saved to CPU and then are moved to a `),Kl=o("code"),$h=a("torch.device('meta') and loaded to GPU only when their specific submodule has its "),Ph=a("forward` method called."),Nh=r(),ue=o("div"),f(sa.$$.fragment),Qh=r(),ei=o("p"),Yh=a("Encodes the prompt into text encoder hidden states."),Dh=r(),I=o("p"),zh=a("device: ("),ti=o("code"),Hh=a("torch.device"),qh=a(", "),ni=o("em"),Lh=a("optional"),Ah=a(`):
torch device to place the resulting embeddings on
num_images_per_prompt (`),ai=o("code"),Oh=a("int"),Kh=a(", "),si=o("em"),e_=a("optional"),t_=a(`, defaults to 1):
number of images that should be generated per prompt
do_classifier_free_guidance (`),oi=o("code"),n_=a("bool"),a_=a(", "),li=o("em"),s_=a("optional"),o_=a(", defaults to "),ii=o("code"),l_=a("True"),i_=a(`):
whether to use classifier free guidance or not
negative_prompt (`),ri=o("code"),r_=a("str"),p_=a(" or "),pi=o("code"),d_=a("List[str]"),c_=a(", "),di=o("em"),m_=a("optional"),g_=a(`):
The prompt or prompts not to guide the image generation. If not defined, one has to pass
`),ci=o("code"),f_=a("negative_prompt_embeds"),u_=a(". instead. If not defined, one has to pass "),mi=o("code"),h_=a("negative_prompt_embeds"),__=a(`. instead.
Ignored when not using guidance (i.e., ignored if `),gi=o("code"),y_=a("guidance_scale"),b_=a(" is less than "),fi=o("code"),M_=a("1"),w_=a(`).
prompt_embeds (`),ui=o("code"),v_=a("torch.FloatTensor"),I_=a(", "),hi=o("em"),J_=a("optional"),U_=a(`):
Pre-generated text embeddings. Can be used to easily tweak text inputs, `),_i=o("em"),T_=a("e.g."),Z_=a(` prompt weighting. If not
provided, text embeddings will be generated from `),yi=o("code"),j_=a("prompt"),E_=a(` input argument.
negative_prompt_embeds (`),bi=o("code"),F_=a("torch.FloatTensor"),B_=a(", "),Mi=o("em"),W_=a("optional"),k_=a(`):
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, `),wi=o("em"),G_=a("e.g."),C_=a(` prompt
weighting. If not provided, negative_prompt_embeds will be generated from `),vi=o("code"),R_=a("negative_prompt"),X_=a(` input
argument.`),qd=r(),tt=o("h2"),Bt=o("a"),Ii=o("span"),f(oa.$$.fragment),x_=r(),Ji=o("span"),S_=a("IFImg2ImgPipeline"),Ld=r(),Y=o("div"),f(la.$$.fragment),V_=r(),he=o("div"),f(ia.$$.fragment),$_=r(),Ui=o("p"),P_=a("Function invoked when calling the pipeline for generation."),N_=r(),f(Wt.$$.fragment),Q_=r(),kt=o("div"),f(ra.$$.fragment),Y_=r(),O=o("p"),D_=a(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Ti=o("code"),z_=a("enable_sequential_cpu_offload"),H_=a(", this method moves one whole model at a time to the GPU when its "),Zi=o("code"),q_=a("forward"),L_=a(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),ji=o("code"),A_=a("enable_sequential_cpu_offload"),O_=a(", but performance is much better due to the iterative execution of the "),Ei=o("code"),K_=a("unet"),ey=a("."),ty=r(),Gt=o("div"),f(pa.$$.fragment),ny=r(),da=o("p"),ay=a(`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, the pipeline\u2019s
models have their state dicts saved to CPU and then are moved to a `),Fi=o("code"),sy=a("torch.device('meta') and loaded to GPU only when their specific submodule has its "),oy=a("forward` method called."),ly=r(),_e=o("div"),f(ca.$$.fragment),iy=r(),Bi=o("p"),ry=a("Encodes the prompt into text encoder hidden states."),py=r(),J=o("p"),dy=a("device: ("),Wi=o("code"),cy=a("torch.device"),my=a(", "),ki=o("em"),gy=a("optional"),fy=a(`):
torch device to place the resulting embeddings on
num_images_per_prompt (`),Gi=o("code"),uy=a("int"),hy=a(", "),Ci=o("em"),_y=a("optional"),yy=a(`, defaults to 1):
number of images that should be generated per prompt
do_classifier_free_guidance (`),Ri=o("code"),by=a("bool"),My=a(", "),Xi=o("em"),wy=a("optional"),vy=a(", defaults to "),xi=o("code"),Iy=a("True"),Jy=a(`):
whether to use classifier free guidance or not
negative_prompt (`),Si=o("code"),Uy=a("str"),Ty=a(" or "),Vi=o("code"),Zy=a("List[str]"),jy=a(", "),$i=o("em"),Ey=a("optional"),Fy=a(`):
The prompt or prompts not to guide the image generation. If not defined, one has to pass
`),Pi=o("code"),By=a("negative_prompt_embeds"),Wy=a(". instead. If not defined, one has to pass "),Ni=o("code"),ky=a("negative_prompt_embeds"),Gy=a(`. instead.
Ignored when not using guidance (i.e., ignored if `),Qi=o("code"),Cy=a("guidance_scale"),Ry=a(" is less than "),Yi=o("code"),Xy=a("1"),xy=a(`).
prompt_embeds (`),Di=o("code"),Sy=a("torch.FloatTensor"),Vy=a(", "),zi=o("em"),$y=a("optional"),Py=a(`):
Pre-generated text embeddings. Can be used to easily tweak text inputs, `),Hi=o("em"),Ny=a("e.g."),Qy=a(` prompt weighting. If not
provided, text embeddings will be generated from `),qi=o("code"),Yy=a("prompt"),Dy=a(` input argument.
negative_prompt_embeds (`),Li=o("code"),zy=a("torch.FloatTensor"),Hy=a(", "),Ai=o("em"),qy=a("optional"),Ly=a(`):
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, `),Oi=o("em"),Ay=a("e.g."),Oy=a(` prompt
weighting. If not provided, negative_prompt_embeds will be generated from `),Ki=o("code"),Ky=a("negative_prompt"),eb=a(` input
argument.`),Ad=r(),nt=o("h2"),Ct=o("a"),er=o("span"),f(ma.$$.fragment),tb=r(),tr=o("span"),nb=a("IFImg2ImgSuperResolutionPipeline"),Od=r(),D=o("div"),f(ga.$$.fragment),ab=r(),ye=o("div"),f(fa.$$.fragment),sb=r(),nr=o("p"),ob=a("Function invoked when calling the pipeline for generation."),lb=r(),f(Rt.$$.fragment),ib=r(),Xt=o("div"),f(ua.$$.fragment),rb=r(),K=o("p"),pb=a(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),ar=o("code"),db=a("enable_sequential_cpu_offload"),cb=a(", this method moves one whole model at a time to the GPU when its "),sr=o("code"),mb=a("forward"),gb=a(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),or=o("code"),fb=a("enable_sequential_cpu_offload"),ub=a(", but performance is much better due to the iterative execution of the "),lr=o("code"),hb=a("unet"),_b=a("."),yb=r(),xt=o("div"),f(ha.$$.fragment),bb=r(),_a=o("p"),Mb=a(`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, the pipeline\u2019s
models have their state dicts saved to CPU and then are moved to a `),ir=o("code"),wb=a("torch.device('meta') and loaded to GPU only when their specific submodule has its "),vb=a("forward` method called."),Ib=r(),be=o("div"),f(ya.$$.fragment),Jb=r(),rr=o("p"),Ub=a("Encodes the prompt into text encoder hidden states."),Tb=r(),U=o("p"),Zb=a("device: ("),pr=o("code"),jb=a("torch.device"),Eb=a(", "),dr=o("em"),Fb=a("optional"),Bb=a(`):
torch device to place the resulting embeddings on
num_images_per_prompt (`),cr=o("code"),Wb=a("int"),kb=a(", "),mr=o("em"),Gb=a("optional"),Cb=a(`, defaults to 1):
number of images that should be generated per prompt
do_classifier_free_guidance (`),gr=o("code"),Rb=a("bool"),Xb=a(", "),fr=o("em"),xb=a("optional"),Sb=a(", defaults to "),ur=o("code"),Vb=a("True"),$b=a(`):
whether to use classifier free guidance or not
negative_prompt (`),hr=o("code"),Pb=a("str"),Nb=a(" or "),_r=o("code"),Qb=a("List[str]"),Yb=a(", "),yr=o("em"),Db=a("optional"),zb=a(`):
The prompt or prompts not to guide the image generation. If not defined, one has to pass
`),br=o("code"),Hb=a("negative_prompt_embeds"),qb=a(". instead. If not defined, one has to pass "),Mr=o("code"),Lb=a("negative_prompt_embeds"),Ab=a(`. instead.
Ignored when not using guidance (i.e., ignored if `),wr=o("code"),Ob=a("guidance_scale"),Kb=a(" is less than "),vr=o("code"),eM=a("1"),tM=a(`).
prompt_embeds (`),Ir=o("code"),nM=a("torch.FloatTensor"),aM=a(", "),Jr=o("em"),sM=a("optional"),oM=a(`):
Pre-generated text embeddings. Can be used to easily tweak text inputs, `),Ur=o("em"),lM=a("e.g."),iM=a(` prompt weighting. If not
provided, text embeddings will be generated from `),Tr=o("code"),rM=a("prompt"),pM=a(` input argument.
negative_prompt_embeds (`),Zr=o("code"),dM=a("torch.FloatTensor"),cM=a(", "),jr=o("em"),mM=a("optional"),gM=a(`):
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, `),Er=o("em"),fM=a("e.g."),uM=a(` prompt
weighting. If not provided, negative_prompt_embeds will be generated from `),Fr=o("code"),hM=a("negative_prompt"),_M=a(` input
argument.`),Kd=r(),at=o("h2"),St=o("a"),Br=o("span"),f(ba.$$.fragment),yM=r(),Wr=o("span"),bM=a("IFInpaintingPipeline"),ec=r(),z=o("div"),f(Ma.$$.fragment),MM=r(),Me=o("div"),f(wa.$$.fragment),wM=r(),kr=o("p"),vM=a("Function invoked when calling the pipeline for generation."),IM=r(),f(Vt.$$.fragment),JM=r(),$t=o("div"),f(va.$$.fragment),UM=r(),ee=o("p"),TM=a(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Gr=o("code"),ZM=a("enable_sequential_cpu_offload"),jM=a(", this method moves one whole model at a time to the GPU when its "),Cr=o("code"),EM=a("forward"),FM=a(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Rr=o("code"),BM=a("enable_sequential_cpu_offload"),WM=a(", but performance is much better due to the iterative execution of the "),Xr=o("code"),kM=a("unet"),GM=a("."),CM=r(),Pt=o("div"),f(Ia.$$.fragment),RM=r(),Ja=o("p"),XM=a(`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, the pipeline\u2019s
models have their state dicts saved to CPU and then are moved to a `),xr=o("code"),xM=a("torch.device('meta') and loaded to GPU only when their specific submodule has its "),SM=a("forward` method called."),VM=r(),we=o("div"),f(Ua.$$.fragment),$M=r(),Sr=o("p"),PM=a("Encodes the prompt into text encoder hidden states."),NM=r(),T=o("p"),QM=a("device: ("),Vr=o("code"),YM=a("torch.device"),DM=a(", "),$r=o("em"),zM=a("optional"),HM=a(`):
torch device to place the resulting embeddings on
num_images_per_prompt (`),Pr=o("code"),qM=a("int"),LM=a(", "),Nr=o("em"),AM=a("optional"),OM=a(`, defaults to 1):
number of images that should be generated per prompt
do_classifier_free_guidance (`),Qr=o("code"),KM=a("bool"),ew=a(", "),Yr=o("em"),tw=a("optional"),nw=a(", defaults to "),Dr=o("code"),aw=a("True"),sw=a(`):
whether to use classifier free guidance or not
negative_prompt (`),zr=o("code"),ow=a("str"),lw=a(" or "),Hr=o("code"),iw=a("List[str]"),rw=a(", "),qr=o("em"),pw=a("optional"),dw=a(`):
The prompt or prompts not to guide the image generation. If not defined, one has to pass
`),Lr=o("code"),cw=a("negative_prompt_embeds"),mw=a(". instead. If not defined, one has to pass "),Ar=o("code"),gw=a("negative_prompt_embeds"),fw=a(`. instead.
Ignored when not using guidance (i.e., ignored if `),Or=o("code"),uw=a("guidance_scale"),hw=a(" is less than "),Kr=o("code"),_w=a("1"),yw=a(`).
prompt_embeds (`),ep=o("code"),bw=a("torch.FloatTensor"),Mw=a(", "),tp=o("em"),ww=a("optional"),vw=a(`):
Pre-generated text embeddings. Can be used to easily tweak text inputs, `),np=o("em"),Iw=a("e.g."),Jw=a(` prompt weighting. If not
provided, text embeddings will be generated from `),ap=o("code"),Uw=a("prompt"),Tw=a(` input argument.
negative_prompt_embeds (`),sp=o("code"),Zw=a("torch.FloatTensor"),jw=a(", "),op=o("em"),Ew=a("optional"),Fw=a(`):
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, `),lp=o("em"),Bw=a("e.g."),Ww=a(` prompt
weighting. If not provided, negative_prompt_embeds will be generated from `),ip=o("code"),kw=a("negative_prompt"),Gw=a(` input
argument.`),tc=r(),st=o("h2"),Nt=o("a"),rp=o("span"),f(Ta.$$.fragment),Cw=r(),pp=o("span"),Rw=a("IFInpaintingSuperResolutionPipeline"),nc=r(),H=o("div"),f(Za.$$.fragment),Xw=r(),ve=o("div"),f(ja.$$.fragment),xw=r(),dp=o("p"),Sw=a("Function invoked when calling the pipeline for generation."),Vw=r(),f(Qt.$$.fragment),$w=r(),Yt=o("div"),f(Ea.$$.fragment),Pw=r(),te=o("p"),Nw=a(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),cp=o("code"),Qw=a("enable_sequential_cpu_offload"),Yw=a(", this method moves one whole model at a time to the GPU when its "),mp=o("code"),Dw=a("forward"),zw=a(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),gp=o("code"),Hw=a("enable_sequential_cpu_offload"),qw=a(", but performance is much better due to the iterative execution of the "),fp=o("code"),Lw=a("unet"),Aw=a("."),Ow=r(),Dt=o("div"),f(Fa.$$.fragment),Kw=r(),Ba=o("p"),ev=a(`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, the pipeline\u2019s
models have their state dicts saved to CPU and then are moved to a `),up=o("code"),tv=a("torch.device('meta') and loaded to GPU only when their specific submodule has its "),nv=a("forward` method called."),av=r(),Ie=o("div"),f(Wa.$$.fragment),sv=r(),hp=o("p"),ov=a("Encodes the prompt into text encoder hidden states."),lv=r(),Z=o("p"),iv=a("device: ("),_p=o("code"),rv=a("torch.device"),pv=a(", "),yp=o("em"),dv=a("optional"),cv=a(`):
torch device to place the resulting embeddings on
num_images_per_prompt (`),bp=o("code"),mv=a("int"),gv=a(", "),Mp=o("em"),fv=a("optional"),uv=a(`, defaults to 1):
number of images that should be generated per prompt
do_classifier_free_guidance (`),wp=o("code"),hv=a("bool"),_v=a(", "),vp=o("em"),yv=a("optional"),bv=a(", defaults to "),Ip=o("code"),Mv=a("True"),wv=a(`):
whether to use classifier free guidance or not
negative_prompt (`),Jp=o("code"),vv=a("str"),Iv=a(" or "),Up=o("code"),Jv=a("List[str]"),Uv=a(", "),Tp=o("em"),Tv=a("optional"),Zv=a(`):
The prompt or prompts not to guide the image generation. If not defined, one has to pass
`),Zp=o("code"),jv=a("negative_prompt_embeds"),Ev=a(". instead. If not defined, one has to pass "),jp=o("code"),Fv=a("negative_prompt_embeds"),Bv=a(`. instead.
Ignored when not using guidance (i.e., ignored if `),Ep=o("code"),Wv=a("guidance_scale"),kv=a(" is less than "),Fp=o("code"),Gv=a("1"),Cv=a(`).
prompt_embeds (`),Bp=o("code"),Rv=a("torch.FloatTensor"),Xv=a(", "),Wp=o("em"),xv=a("optional"),Sv=a(`):
Pre-generated text embeddings. Can be used to easily tweak text inputs, `),kp=o("em"),Vv=a("e.g."),$v=a(` prompt weighting. If not
provided, text embeddings will be generated from `),Gp=o("code"),Pv=a("prompt"),Nv=a(` input argument.
negative_prompt_embeds (`),Cp=o("code"),Qv=a("torch.FloatTensor"),Yv=a(", "),Rp=o("em"),Dv=a("optional"),zv=a(`):
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, `),Xp=o("em"),Hv=a("e.g."),qv=a(` prompt
weighting. If not provided, negative_prompt_embeds will be generated from `),xp=o("code"),Lv=a("negative_prompt"),Av=a(` input
argument.`),this.h()},l(n){const c=iZ('[data-svelte="svelte-1phssyn"]',document.head);w=l(c,"META",{name:!0,content:!0}),c.forEach(t),x=p(n),C=l(n,"H1",{class:!0});var ka=i(C);M=l(ka,"A",{id:!0,class:!0,href:!0});var Sp=i(M);R=l(Sp,"SPAN",{});var Vp=i(R);u(g.$$.fragment,Vp),Vp.forEach(t),Sp.forEach(t),G=p(ka),zs=l(ka,"SPAN",{});var $p=i(zs);Oc=s($p,"IF"),$p.forEach(t),ka.forEach(t),Np=p(n),Re=l(n,"H2",{class:!0});var Ga=i(Re);ot=l(Ga,"A",{id:!0,class:!0,href:!0});var Pp=i(ot);Hs=l(Pp,"SPAN",{});var tI=i(Hs);u(zt.$$.fragment,tI),tI.forEach(t),Pp.forEach(t),Kc=p(Ga),qs=l(Ga,"SPAN",{});var nI=i(qs);em=s(nI,"Overview"),nI.forEach(t),Ga.forEach(t),Qp=p(n),Xa=l(n,"P",{});var aI=i(Xa);tm=s(aI,`DeepFloyd IF is a novel state-of-the-art open-source text-to-image model with a high degree of photorealism and language understanding.
The model is a modular composed of a frozen text encoder and three cascaded pixel diffusion modules:`),aI.forEach(t),Yp=p(n),le=l(n,"UL",{});var bs=i(le);Ls=l(bs,"LI",{});var sI=i(Ls);nm=s(sI,"Stage 1: a base model that generates 64x64 px image based on text prompt,"),sI.forEach(t),am=p(bs),As=l(bs,"LI",{});var oI=i(As);sm=s(oI,"Stage 2: a 64x64 px => 256x256 px super-resolution model, and a"),oI.forEach(t),om=p(bs),Ht=l(bs,"LI",{});var sc=i(Ht);lm=s(sc,`Stage 3: a 256x256 px => 1024x1024 px super-resolution model
Stage 1 and Stage 2 utilize a frozen text encoder based on the T5 transformer to extract text embeddings,
which are then fed into a UNet architecture enhanced with cross-attention and attention pooling.
Stage 3 is `),qt=l(sc,"A",{href:!0,rel:!0});var lI=i(qt);im=s(lI,"Stability\u2019s x4 Upscaling model"),lI.forEach(t),rm=s(sc,`.
The result is a highly efficient model that outperforms current state-of-the-art models, achieving a zero-shot FID score of 6.66 on the COCO dataset.
Our work underscores the potential of larger UNet architectures in the first stage of cascaded diffusion models and depicts a promising future for text-to-image synthesis.`),sc.forEach(t),bs.forEach(t),Dp=p(n),Xe=l(n,"H2",{class:!0});var oc=i(Xe);lt=l(oc,"A",{id:!0,class:!0,href:!0});var iI=i(lt);Os=l(iI,"SPAN",{});var rI=i(Os);u(Lt.$$.fragment,rI),rI.forEach(t),iI.forEach(t),pm=p(oc),Ks=l(oc,"SPAN",{});var pI=i(Ks);dm=s(pI,"Usage"),pI.forEach(t),oc.forEach(t),zp=p(n),xa=l(n,"P",{});var dI=i(xa);cm=s(dI,"Before you can use IF, you need to accept its usage conditions. To do so:"),dI.forEach(t),Hp=p(n),ie=l(n,"OL",{});var Ms=i(ie);At=l(Ms,"LI",{});var lc=i(At);mm=s(lc,"Make sure to have a "),Ot=l(lc,"A",{href:!0,rel:!0});var cI=i(Ot);gm=s(cI,"Hugging Face account"),cI.forEach(t),fm=s(lc," and be logged in"),lc.forEach(t),um=p(Ms),Kt=l(Ms,"LI",{});var ic=i(Kt);hm=s(ic,"Accept the license on the model card of "),en=l(ic,"A",{href:!0,rel:!0});var mI=i(en);_m=s(mI,"DeepFloyd/IF-I-XL-v1.0"),mI.forEach(t),ym=s(ic,". Accepting the license on the stage I model card will auto accept for the other IF models."),ic.forEach(t),bm=p(Ms),Sa=l(Ms,"LI",{});var Ov=i(Sa);Mm=s(Ov,"Make sure to login locally. Install "),eo=l(Ov,"CODE",{});var gI=i(eo);wm=s(gI,"huggingface_hub"),gI.forEach(t),Ov.forEach(t),Ms.forEach(t),qp=p(n),u(tn.$$.fragment,n),Lp=p(n),Va=l(n,"P",{});var fI=i(Va);vm=s(fI,"run the login function in a Python shell"),fI.forEach(t),Ap=p(n),u(nn.$$.fragment,n),Op=p(n),it=l(n,"P",{});var rc=i(it);Im=s(rc,"and enter your "),an=l(rc,"A",{href:!0,rel:!0});var uI=i(an);Jm=s(uI,"Hugging Face Hub access token"),uI.forEach(t),Um=s(rc,"."),rc.forEach(t),Kp=p(n),rt=l(n,"P",{});var pc=i(rt);Tm=s(pc,"Next we install "),to=l(pc,"CODE",{});var hI=i(to);Zm=s(hI,"diffusers"),hI.forEach(t),jm=s(pc," and dependencies:"),pc.forEach(t),ed=p(n),u(sn.$$.fragment,n),td=p(n),$a=l(n,"P",{});var _I=i($a);Em=s(_I,"The following sections give more in-detail examples of how to use IF. Specifically:"),_I.forEach(t),nd=p(n),V=l(n,"UL",{});var ne=i(V);no=l(ne,"LI",{});var yI=i(no);Pa=l(yI,"A",{href:!0});var bI=i(Pa);Fm=s(bI,"Text-to-Image Generation"),bI.forEach(t),yI.forEach(t),Bm=p(ne),ao=l(ne,"LI",{});var MI=i(ao);Na=l(MI,"A",{href:!0});var wI=i(Na);Wm=s(wI,"Image-to-Image Generation"),wI.forEach(t),MI.forEach(t),km=p(ne),so=l(ne,"LI",{});var vI=i(so);Qa=l(vI,"A",{href:!0});var II=i(Qa);Gm=s(II,"Inpainting"),II.forEach(t),vI.forEach(t),Cm=p(ne),oo=l(ne,"LI",{});var JI=i(oo);Ya=l(JI,"A",{href:!0});var UI=i(Ya);Rm=s(UI,"Reusing model weights"),UI.forEach(t),JI.forEach(t),Xm=p(ne),lo=l(ne,"LI",{});var TI=i(lo);Da=l(TI,"A",{href:!0});var ZI=i(Da);xm=s(ZI,"Speed optimization"),ZI.forEach(t),TI.forEach(t),Sm=p(ne),io=l(ne,"LI",{});var jI=i(io);za=l(jI,"A",{href:!0});var EI=i(za);Vm=s(EI,"Memory optimization"),EI.forEach(t),jI.forEach(t),ne.forEach(t),ad=p(n),Ha=l(n,"P",{});var FI=i(Ha);ro=l(FI,"STRONG",{});var BI=i(ro);$m=s(BI,"Available checkpoints"),BI.forEach(t),FI.forEach(t),sd=p(n),re=l(n,"UL",{});var ws=i(re);on=l(ws,"LI",{});var dc=i(on);po=l(dc,"P",{});var WI=i(po);co=l(WI,"EM",{});var kI=i(co);Pm=s(kI,"Stage-1"),kI.forEach(t),WI.forEach(t),Nm=p(dc),xe=l(dc,"UL",{});var vs=i(xe);mo=l(vs,"LI",{});var GI=i(mo);ln=l(GI,"A",{href:!0,rel:!0});var CI=i(ln);Qm=s(CI,"DeepFloyd/IF-I-XL-v1.0"),CI.forEach(t),GI.forEach(t),Ym=p(vs),go=l(vs,"LI",{});var RI=i(go);rn=l(RI,"A",{href:!0,rel:!0});var XI=i(rn);Dm=s(XI,"DeepFloyd/IF-I-L-v1.0"),XI.forEach(t),RI.forEach(t),zm=p(vs),fo=l(vs,"LI",{});var xI=i(fo);pn=l(xI,"A",{href:!0,rel:!0});var SI=i(pn);Hm=s(SI,"DeepFloyd/IF-I-M-v1.0"),SI.forEach(t),xI.forEach(t),vs.forEach(t),dc.forEach(t),qm=p(ws),dn=l(ws,"LI",{});var cc=i(dn);uo=l(cc,"P",{});var VI=i(uo);ho=l(VI,"EM",{});var $I=i(ho);Lm=s($I,"Stage-2"),$I.forEach(t),VI.forEach(t),Am=p(cc),cn=l(cc,"UL",{});var mc=i(cn);_o=l(mc,"LI",{});var PI=i(_o);mn=l(PI,"A",{href:!0,rel:!0});var NI=i(mn);Om=s(NI,"DeepFloyd/IF-II-L-v1.0"),NI.forEach(t),PI.forEach(t),Km=p(mc),yo=l(mc,"LI",{});var QI=i(yo);gn=l(QI,"A",{href:!0,rel:!0});var YI=i(gn);eg=s(YI,"DeepFloyd/IF-II-M-v1.0"),YI.forEach(t),QI.forEach(t),mc.forEach(t),cc.forEach(t),tg=p(ws),fn=l(ws,"LI",{});var gc=i(fn);bo=l(gc,"P",{});var DI=i(bo);Mo=l(DI,"EM",{});var zI=i(Mo);ng=s(zI,"Stage-3"),zI.forEach(t),DI.forEach(t),ag=p(gc),wo=l(gc,"UL",{});var HI=i(wo);vo=l(HI,"LI",{});var qI=i(vo);un=l(qI,"A",{href:!0,rel:!0});var LI=i(un);sg=s(LI,"stabilityai/stable-diffusion-x4-upscaler"),LI.forEach(t),qI.forEach(t),HI.forEach(t),gc.forEach(t),ws.forEach(t),od=p(n),pt=l(n,"P",{});var fc=i(pt);Io=l(fc,"STRONG",{});var AI=i(Io);og=s(AI,"Demo"),AI.forEach(t),lg=p(fc),hn=l(fc,"A",{href:!0,rel:!0});var OI=i(hn);qa=l(OI,"IMG",{src:!0,alt:!0}),OI.forEach(t),fc.forEach(t),ld=p(n),dt=l(n,"P",{});var uc=i(dt);Jo=l(uc,"STRONG",{});var KI=i(Jo);ig=s(KI,"Google Colab"),KI.forEach(t),rg=p(uc),_n=l(uc,"A",{href:!0,rel:!0});var e2=i(_n);La=l(e2,"IMG",{src:!0,alt:!0}),e2.forEach(t),uc.forEach(t),id=p(n),Se=l(n,"H3",{class:!0});var hc=i(Se);ct=l(hc,"A",{id:!0,class:!0,href:!0});var t2=i(ct);Uo=l(t2,"SPAN",{});var n2=i(Uo);u(yn.$$.fragment,n2),n2.forEach(t),t2.forEach(t),pg=p(hc),To=l(hc,"SPAN",{});var a2=i(To);dg=s(a2,"Text-to-Image Generation"),a2.forEach(t),hc.forEach(t),rd=p(n),mt=l(n,"P",{});var _c=i(mt);cg=s(_c,"By default diffusers makes use of "),bn=l(_c,"A",{href:!0,rel:!0});var s2=i(bn);mg=s(s2,"model cpu offloading"),s2.forEach(t),gg=s(_c,`
to run the whole IF pipeline with as little as 14 GB of VRAM.`),_c.forEach(t),pd=p(n),u(Mn.$$.fragment,n),dd=p(n),Ve=l(n,"H3",{class:!0});var yc=i(Ve);gt=l(yc,"A",{id:!0,class:!0,href:!0});var o2=i(gt);Zo=l(o2,"SPAN",{});var l2=i(Zo);u(wn.$$.fragment,l2),l2.forEach(t),o2.forEach(t),fg=p(yc),jo=l(yc,"SPAN",{});var i2=i(jo);ug=s(i2,"Text Guided Image-to-Image Generation"),i2.forEach(t),yc.forEach(t),cd=p(n),pe=l(n,"P",{});var Is=i(pe);hg=s(Is,`The same IF model weights can be used for text-guided image-to-image translation or image variation.
In this case just make sure to load the weights using the `),Aa=l(Is,"A",{href:!0});var r2=i(Aa);_g=s(r2,"IFInpaintingPipeline"),r2.forEach(t),yg=s(Is," and "),Oa=l(Is,"A",{href:!0});var p2=i(Oa);bg=s(p2,"IFInpaintingSuperResolutionPipeline"),p2.forEach(t),Mg=s(Is," pipelines."),Is.forEach(t),md=p(n),se=l(n,"P",{});var Ca=i(se);Eo=l(Ca,"STRONG",{});var d2=i(Eo);wg=s(d2,"Note"),d2.forEach(t),vg=s(Ca,`: You can also directly move the weights of the text-to-image pipelines to the image-to-image pipelines
without loading them twice by making use of the `),Fo=l(Ca,"CODE",{});var c2=i(Fo);Ig=s(c2,"~DiffusionPipeline.components()"),c2.forEach(t),Jg=s(Ca," function as explained "),Ka=l(Ca,"A",{href:!0});var m2=i(Ka);Ug=s(m2,"here"),m2.forEach(t),Tg=s(Ca,"."),Ca.forEach(t),gd=p(n),u(vn.$$.fragment,n),fd=p(n),$e=l(n,"H3",{class:!0});var bc=i($e);ft=l(bc,"A",{id:!0,class:!0,href:!0});var g2=i(ft);Bo=l(g2,"SPAN",{});var f2=i(Bo);u(In.$$.fragment,f2),f2.forEach(t),g2.forEach(t),Zg=p(bc),Wo=l(bc,"SPAN",{});var u2=i(Wo);jg=s(u2,"Text Guided Inpainting Generation"),u2.forEach(t),bc.forEach(t),ud=p(n),de=l(n,"P",{});var Js=i(de);Eg=s(Js,`The same IF model weights can be used for text-guided image-to-image translation or image variation.
In this case just make sure to load the weights using the `),es=l(Js,"A",{href:!0});var h2=i(es);Fg=s(h2,"IFInpaintingPipeline"),h2.forEach(t),Bg=s(Js," and "),ts=l(Js,"A",{href:!0});var _2=i(ts);Wg=s(_2,"IFInpaintingSuperResolutionPipeline"),_2.forEach(t),kg=s(Js," pipelines."),Js.forEach(t),hd=p(n),oe=l(n,"P",{});var Ra=i(oe);ko=l(Ra,"STRONG",{});var y2=i(ko);Gg=s(y2,"Note"),y2.forEach(t),Cg=s(Ra,`: You can also directly move the weights of the text-to-image pipelines to the image-to-image pipelines
without loading them twice by making use of the `),Go=l(Ra,"CODE",{});var b2=i(Go);Rg=s(b2,"~DiffusionPipeline.components()"),b2.forEach(t),Xg=s(Ra," function as explained "),ns=l(Ra,"A",{href:!0});var M2=i(ns);xg=s(M2,"here"),M2.forEach(t),Sg=s(Ra,"."),Ra.forEach(t),_d=p(n),u(Jn.$$.fragment,n),yd=p(n),Pe=l(n,"H3",{class:!0});var Mc=i(Pe);ut=l(Mc,"A",{id:!0,class:!0,href:!0});var w2=i(ut);Co=l(w2,"SPAN",{});var v2=i(Co);u(Un.$$.fragment,v2),v2.forEach(t),w2.forEach(t),Vg=p(Mc),Ro=l(Mc,"SPAN",{});var I2=i(Ro);$g=s(I2,"Converting between different pipelines"),I2.forEach(t),Mc.forEach(t),bd=p(n),ht=l(n,"P",{});var wc=i(ht);Pg=s(wc,"In addition to being loaded with "),Xo=l(wc,"CODE",{});var J2=i(Xo);Ng=s(J2,"from_pretrained"),J2.forEach(t),Qg=s(wc,", Pipelines can also be loaded directly from each other."),wc.forEach(t),Md=p(n),u(Tn.$$.fragment,n),wd=p(n),Ne=l(n,"H3",{class:!0});var vc=i(Ne);_t=l(vc,"A",{id:!0,class:!0,href:!0});var U2=i(_t);xo=l(U2,"SPAN",{});var T2=i(xo);u(Zn.$$.fragment,T2),T2.forEach(t),U2.forEach(t),Yg=p(vc),So=l(vc,"SPAN",{});var Z2=i(So);Dg=s(Z2,"Optimizing for speed"),Z2.forEach(t),vc.forEach(t),vd=p(n),as=l(n,"P",{});var j2=i(as);zg=s(j2,"The simplest optimization to run IF faster is to move all model components to the GPU."),j2.forEach(t),Id=p(n),u(jn.$$.fragment,n),Jd=p(n),ss=l(n,"P",{});var E2=i(ss);Hg=s(E2,"You can also run the diffusion process for a shorter number of timesteps."),E2.forEach(t),Ud=p(n),yt=l(n,"P",{});var Ic=i(yt);qg=s(Ic,"This can either be done with the "),Vo=l(Ic,"CODE",{});var F2=i(Vo);Lg=s(F2,"num_inference_steps"),F2.forEach(t),Ag=s(Ic," argument"),Ic.forEach(t),Td=p(n),u(En.$$.fragment,n),Zd=p(n),bt=l(n,"P",{});var Jc=i(bt);Og=s(Jc,"Or with the "),$o=l(Jc,"CODE",{});var B2=i($o);Kg=s(B2,"timesteps"),B2.forEach(t),ef=s(Jc," argument"),Jc.forEach(t),jd=p(n),u(Fn.$$.fragment,n),Ed=p(n),os=l(n,"P",{});var W2=i(os);tf=s(W2,`When doing image variation or inpainting, you can also decrease the number of timesteps
with the strength argument. The strength argument is the amount of noise to add to
the input image which also determines how many steps to run in the denoising process.
A smaller number will vary the image less but run faster.`),W2.forEach(t),Fd=p(n),u(Bn.$$.fragment,n),Bd=p(n),ce=l(n,"P",{});var Us=i(ce);nf=s(Us,"You can also use "),ls=l(Us,"A",{href:!0});var k2=i(ls);Po=l(k2,"CODE",{});var G2=i(Po);af=s(G2,"torch.compile"),G2.forEach(t),k2.forEach(t),sf=s(Us,". Note that we have not exhaustively tested "),No=l(Us,"CODE",{});var C2=i(No);of=s(C2,"torch.compile"),C2.forEach(t),lf=s(Us,`
with IF and it might not give expected results.`),Us.forEach(t),Wd=p(n),u(Wn.$$.fragment,n),kd=p(n),Qe=l(n,"H3",{class:!0});var Uc=i(Qe);Mt=l(Uc,"A",{id:!0,class:!0,href:!0});var R2=i(Mt);Qo=l(R2,"SPAN",{});var X2=i(Qo);u(kn.$$.fragment,X2),X2.forEach(t),R2.forEach(t),rf=p(Uc),Yo=l(Uc,"SPAN",{});var x2=i(Yo);pf=s(x2,"Optimizing for memory"),x2.forEach(t),Uc.forEach(t),Gd=p(n),is=l(n,"P",{});var S2=i(is);df=s(S2,"When optimizing for GPU memory, we can use the standard diffusers cpu offloading APIs."),S2.forEach(t),Cd=p(n),rs=l(n,"P",{});var V2=i(rs);cf=s(V2,"Either the model based CPU offloading,"),V2.forEach(t),Rd=p(n),u(Gn.$$.fragment,n),Xd=p(n),ps=l(n,"P",{});var $2=i(ps);mf=s($2,"or the more aggressive layer based CPU offloading."),$2.forEach(t),xd=p(n),u(Cn.$$.fragment,n),Sd=p(n),ds=l(n,"P",{});var P2=i(ds);gf=s(P2,"Additionally, T5 can be loaded in 8bit precision"),P2.forEach(t),Vd=p(n),u(Rn.$$.fragment,n),$d=p(n),cs=l(n,"P",{});var N2=i(cs);ff=s(N2,`For CPU RAM constrained machines like google colab free tier where we can\u2019t load all
model components to the CPU at once, we can manually only load the pipeline with
the text encoder or unet when the respective model components are needed.`),N2.forEach(t),Pd=p(n),u(Xn.$$.fragment,n),Nd=p(n),Ye=l(n,"H2",{class:!0});var Tc=i(Ye);wt=l(Tc,"A",{id:!0,class:!0,href:!0});var Q2=i(wt);Do=l(Q2,"SPAN",{});var Y2=i(Do);u(xn.$$.fragment,Y2),Y2.forEach(t),Q2.forEach(t),uf=p(Tc),zo=l(Tc,"SPAN",{});var D2=i(zo);hf=s(D2,"Available Pipelines:"),D2.forEach(t),Tc.forEach(t),Qd=p(n),vt=l(n,"TABLE",{});var Zc=i(vt);Ho=l(Zc,"THEAD",{});var z2=i(Ho);De=l(z2,"TR",{});var Ts=i(De);qo=l(Ts,"TH",{});var H2=i(qo);_f=s(H2,"Pipeline"),H2.forEach(t),yf=p(Ts),Lo=l(Ts,"TH",{});var q2=i(Lo);bf=s(q2,"Tasks"),q2.forEach(t),Mf=p(Ts),ms=l(Ts,"TH",{align:!0});var L2=i(ms);wf=s(L2,"Colab"),L2.forEach(t),Ts.forEach(t),z2.forEach(t),vf=p(Zc),P=l(Zc,"TBODY",{});var ae=i(P);ze=l(ae,"TR",{});var Zs=i(ze);Ao=l(Zs,"TD",{});var A2=i(Ao);Sn=l(A2,"A",{href:!0,rel:!0});var O2=i(Sn);If=s(O2,"pipeline_if.py"),O2.forEach(t),A2.forEach(t),Jf=p(Zs),Oo=l(Zs,"TD",{});var K2=i(Oo);Ko=l(K2,"EM",{});var e1=i(Ko);Uf=s(e1,"Text-to-Image Generation"),e1.forEach(t),K2.forEach(t),Tf=p(Zs),gs=l(Zs,"TD",{align:!0});var t1=i(gs);Zf=s(t1,"-"),t1.forEach(t),Zs.forEach(t),jf=p(ae),He=l(ae,"TR",{});var js=i(He);el=l(js,"TD",{});var n1=i(el);Vn=l(n1,"A",{href:!0,rel:!0});var a1=i(Vn);Ef=s(a1,"pipeline_if_superresolution.py"),a1.forEach(t),n1.forEach(t),Ff=p(js),tl=l(js,"TD",{});var s1=i(tl);nl=l(s1,"EM",{});var o1=i(nl);Bf=s(o1,"Text-to-Image Generation"),o1.forEach(t),s1.forEach(t),Wf=p(js),fs=l(js,"TD",{align:!0});var l1=i(fs);kf=s(l1,"-"),l1.forEach(t),js.forEach(t),Gf=p(ae),qe=l(ae,"TR",{});var Es=i(qe);al=l(Es,"TD",{});var i1=i(al);$n=l(i1,"A",{href:!0,rel:!0});var r1=i($n);Cf=s(r1,"pipeline_if_img2img.py"),r1.forEach(t),i1.forEach(t),Rf=p(Es),sl=l(Es,"TD",{});var p1=i(sl);ol=l(p1,"EM",{});var d1=i(ol);Xf=s(d1,"Image-to-Image Generation"),d1.forEach(t),p1.forEach(t),xf=p(Es),us=l(Es,"TD",{align:!0});var c1=i(us);Sf=s(c1,"-"),c1.forEach(t),Es.forEach(t),Vf=p(ae),Le=l(ae,"TR",{});var Fs=i(Le);ll=l(Fs,"TD",{});var m1=i(ll);Pn=l(m1,"A",{href:!0,rel:!0});var g1=i(Pn);$f=s(g1,"pipeline_if_img2img_superresolution.py"),g1.forEach(t),m1.forEach(t),Pf=p(Fs),il=l(Fs,"TD",{});var f1=i(il);rl=l(f1,"EM",{});var u1=i(rl);Nf=s(u1,"Image-to-Image Generation"),u1.forEach(t),f1.forEach(t),Qf=p(Fs),hs=l(Fs,"TD",{align:!0});var h1=i(hs);Yf=s(h1,"-"),h1.forEach(t),Fs.forEach(t),Df=p(ae),Ae=l(ae,"TR",{});var Bs=i(Ae);pl=l(Bs,"TD",{});var _1=i(pl);Nn=l(_1,"A",{href:!0,rel:!0});var y1=i(Nn);zf=s(y1,"pipeline_if_inpainting.py"),y1.forEach(t),_1.forEach(t),Hf=p(Bs),dl=l(Bs,"TD",{});var b1=i(dl);cl=l(b1,"EM",{});var M1=i(cl);qf=s(M1,"Image-to-Image Generation"),M1.forEach(t),b1.forEach(t),Lf=p(Bs),_s=l(Bs,"TD",{align:!0});var w1=i(_s);Af=s(w1,"-"),w1.forEach(t),Bs.forEach(t),Of=p(ae),Oe=l(ae,"TR",{});var Ws=i(Oe);ml=l(Ws,"TD",{});var v1=i(ml);Qn=l(v1,"A",{href:!0,rel:!0});var I1=i(Qn);Kf=s(I1,"pipeline_if_inpainting_superresolution.py"),I1.forEach(t),v1.forEach(t),eu=p(Ws),gl=l(Ws,"TD",{});var J1=i(gl);fl=l(J1,"EM",{});var U1=i(fl);tu=s(U1,"Image-to-Image Generation"),U1.forEach(t),J1.forEach(t),nu=p(Ws),ys=l(Ws,"TD",{align:!0});var T1=i(ys);au=s(T1,"-"),T1.forEach(t),Ws.forEach(t),ae.forEach(t),Zc.forEach(t),Yd=p(n),Ke=l(n,"H2",{class:!0});var jc=i(Ke);It=l(jc,"A",{id:!0,class:!0,href:!0});var Z1=i(It);ul=l(Z1,"SPAN",{});var j1=i(ul);u(Yn.$$.fragment,j1),j1.forEach(t),Z1.forEach(t),su=p(jc),hl=l(jc,"SPAN",{});var E1=i(hl);ou=s(E1,"IFPipeline"),E1.forEach(t),jc.forEach(t),Dd=p(n),N=l(n,"DIV",{class:!0});var Je=i(N);u(Dn.$$.fragment,Je),lu=p(Je),me=l(Je,"DIV",{class:!0});var ks=i(me);u(zn.$$.fragment,ks),iu=p(ks),_l=l(ks,"P",{});var F1=i(_l);ru=s(F1,"Function invoked when calling the pipeline for generation."),F1.forEach(t),pu=p(ks),u(Jt.$$.fragment,ks),ks.forEach(t),du=p(Je),Ut=l(Je,"DIV",{class:!0});var Ec=i(Ut);u(Hn.$$.fragment,Ec),cu=p(Ec),L=l(Ec,"P",{});var Ue=i(L);mu=s(Ue,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),yl=l(Ue,"CODE",{});var B1=i(yl);gu=s(B1,"enable_sequential_cpu_offload"),B1.forEach(t),fu=s(Ue,", this method moves one whole model at a time to the GPU when its "),bl=l(Ue,"CODE",{});var W1=i(bl);uu=s(W1,"forward"),W1.forEach(t),hu=s(Ue,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Ml=l(Ue,"CODE",{});var k1=i(Ml);_u=s(k1,"enable_sequential_cpu_offload"),k1.forEach(t),yu=s(Ue,", but performance is much better due to the iterative execution of the "),wl=l(Ue,"CODE",{});var G1=i(wl);bu=s(G1,"unet"),G1.forEach(t),Mu=s(Ue,"."),Ue.forEach(t),Ec.forEach(t),wu=p(Je),Tt=l(Je,"DIV",{class:!0});var Fc=i(Tt);u(qn.$$.fragment,Fc),vu=p(Fc),Ln=l(Fc,"P",{});var Bc=i(Ln);Iu=s(Bc,`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, the pipeline\u2019s
models have their state dicts saved to CPU and then are moved to a `),vl=l(Bc,"CODE",{});var C1=i(vl);Ju=s(C1,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),C1.forEach(t),Uu=s(Bc,"forward` method called."),Bc.forEach(t),Fc.forEach(t),Tu=p(Je),ge=l(Je,"DIV",{class:!0});var Gs=i(ge);u(An.$$.fragment,Gs),Zu=p(Gs),Il=l(Gs,"P",{});var R1=i(Il);ju=s(R1,"Encodes the prompt into text encoder hidden states."),R1.forEach(t),Eu=p(Gs),v=l(Gs,"P",{});var j=i(v);Fu=s(j,"device: ("),Jl=l(j,"CODE",{});var X1=i(Jl);Bu=s(X1,"torch.device"),X1.forEach(t),Wu=s(j,", "),Ul=l(j,"EM",{});var x1=i(Ul);ku=s(x1,"optional"),x1.forEach(t),Gu=s(j,`):
torch device to place the resulting embeddings on
num_images_per_prompt (`),Tl=l(j,"CODE",{});var S1=i(Tl);Cu=s(S1,"int"),S1.forEach(t),Ru=s(j,", "),Zl=l(j,"EM",{});var V1=i(Zl);Xu=s(V1,"optional"),V1.forEach(t),xu=s(j,`, defaults to 1):
number of images that should be generated per prompt
do_classifier_free_guidance (`),jl=l(j,"CODE",{});var $1=i(jl);Su=s($1,"bool"),$1.forEach(t),Vu=s(j,", "),El=l(j,"EM",{});var P1=i(El);$u=s(P1,"optional"),P1.forEach(t),Pu=s(j,", defaults to "),Fl=l(j,"CODE",{});var N1=i(Fl);Nu=s(N1,"True"),N1.forEach(t),Qu=s(j,`):
whether to use classifier free guidance or not
negative_prompt (`),Bl=l(j,"CODE",{});var Q1=i(Bl);Yu=s(Q1,"str"),Q1.forEach(t),Du=s(j," or "),Wl=l(j,"CODE",{});var Y1=i(Wl);zu=s(Y1,"List[str]"),Y1.forEach(t),Hu=s(j,", "),kl=l(j,"EM",{});var D1=i(kl);qu=s(D1,"optional"),D1.forEach(t),Lu=s(j,`):
The prompt or prompts not to guide the image generation. If not defined, one has to pass
`),Gl=l(j,"CODE",{});var z1=i(Gl);Au=s(z1,"negative_prompt_embeds"),z1.forEach(t),Ou=s(j,". instead. If not defined, one has to pass "),Cl=l(j,"CODE",{});var H1=i(Cl);Ku=s(H1,"negative_prompt_embeds"),H1.forEach(t),eh=s(j,`. instead.
Ignored when not using guidance (i.e., ignored if `),Rl=l(j,"CODE",{});var q1=i(Rl);th=s(q1,"guidance_scale"),q1.forEach(t),nh=s(j," is less than "),Xl=l(j,"CODE",{});var L1=i(Xl);ah=s(L1,"1"),L1.forEach(t),sh=s(j,`).
prompt_embeds (`),xl=l(j,"CODE",{});var A1=i(xl);oh=s(A1,"torch.FloatTensor"),A1.forEach(t),lh=s(j,", "),Sl=l(j,"EM",{});var O1=i(Sl);ih=s(O1,"optional"),O1.forEach(t),rh=s(j,`):
Pre-generated text embeddings. Can be used to easily tweak text inputs, `),Vl=l(j,"EM",{});var K1=i(Vl);ph=s(K1,"e.g."),K1.forEach(t),dh=s(j,` prompt weighting. If not
provided, text embeddings will be generated from `),$l=l(j,"CODE",{});var eJ=i($l);ch=s(eJ,"prompt"),eJ.forEach(t),mh=s(j,` input argument.
negative_prompt_embeds (`),Pl=l(j,"CODE",{});var tJ=i(Pl);gh=s(tJ,"torch.FloatTensor"),tJ.forEach(t),fh=s(j,", "),Nl=l(j,"EM",{});var nJ=i(Nl);uh=s(nJ,"optional"),nJ.forEach(t),hh=s(j,`):
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, `),Ql=l(j,"EM",{});var aJ=i(Ql);_h=s(aJ,"e.g."),aJ.forEach(t),yh=s(j,` prompt
weighting. If not provided, negative_prompt_embeds will be generated from `),Yl=l(j,"CODE",{});var sJ=i(Yl);bh=s(sJ,"negative_prompt"),sJ.forEach(t),Mh=s(j,` input
argument.`),j.forEach(t),Gs.forEach(t),Je.forEach(t),zd=p(n),et=l(n,"H2",{class:!0});var Wc=i(et);Zt=l(Wc,"A",{id:!0,class:!0,href:!0});var oJ=i(Zt);Dl=l(oJ,"SPAN",{});var lJ=i(Dl);u(On.$$.fragment,lJ),lJ.forEach(t),oJ.forEach(t),wh=p(Wc),zl=l(Wc,"SPAN",{});var iJ=i(zl);vh=s(iJ,"IFSuperResolutionPipeline"),iJ.forEach(t),Wc.forEach(t),Hd=p(n),Q=l(n,"DIV",{class:!0});var Te=i(Q);u(Kn.$$.fragment,Te),Ih=p(Te),fe=l(Te,"DIV",{class:!0});var Cs=i(fe);u(ea.$$.fragment,Cs),Jh=p(Cs),Hl=l(Cs,"P",{});var rJ=i(Hl);Uh=s(rJ,"Function invoked when calling the pipeline for generation."),rJ.forEach(t),Th=p(Cs),u(jt.$$.fragment,Cs),Cs.forEach(t),Zh=p(Te),Et=l(Te,"DIV",{class:!0});var kc=i(Et);u(ta.$$.fragment,kc),jh=p(kc),A=l(kc,"P",{});var Ze=i(A);Eh=s(Ze,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),ql=l(Ze,"CODE",{});var pJ=i(ql);Fh=s(pJ,"enable_sequential_cpu_offload"),pJ.forEach(t),Bh=s(Ze,", this method moves one whole model at a time to the GPU when its "),Ll=l(Ze,"CODE",{});var dJ=i(Ll);Wh=s(dJ,"forward"),dJ.forEach(t),kh=s(Ze,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Al=l(Ze,"CODE",{});var cJ=i(Al);Gh=s(cJ,"enable_sequential_cpu_offload"),cJ.forEach(t),Ch=s(Ze,", but performance is much better due to the iterative execution of the "),Ol=l(Ze,"CODE",{});var mJ=i(Ol);Rh=s(mJ,"unet"),mJ.forEach(t),Xh=s(Ze,"."),Ze.forEach(t),kc.forEach(t),xh=p(Te),Ft=l(Te,"DIV",{class:!0});var Gc=i(Ft);u(na.$$.fragment,Gc),Sh=p(Gc),aa=l(Gc,"P",{});var Cc=i(aa);Vh=s(Cc,`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, the pipeline\u2019s
models have their state dicts saved to CPU and then are moved to a `),Kl=l(Cc,"CODE",{});var gJ=i(Kl);$h=s(gJ,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),gJ.forEach(t),Ph=s(Cc,"forward` method called."),Cc.forEach(t),Gc.forEach(t),Nh=p(Te),ue=l(Te,"DIV",{class:!0});var Rs=i(ue);u(sa.$$.fragment,Rs),Qh=p(Rs),ei=l(Rs,"P",{});var fJ=i(ei);Yh=s(fJ,"Encodes the prompt into text encoder hidden states."),fJ.forEach(t),Dh=p(Rs),I=l(Rs,"P",{});var E=i(I);zh=s(E,"device: ("),ti=l(E,"CODE",{});var uJ=i(ti);Hh=s(uJ,"torch.device"),uJ.forEach(t),qh=s(E,", "),ni=l(E,"EM",{});var hJ=i(ni);Lh=s(hJ,"optional"),hJ.forEach(t),Ah=s(E,`):
torch device to place the resulting embeddings on
num_images_per_prompt (`),ai=l(E,"CODE",{});var _J=i(ai);Oh=s(_J,"int"),_J.forEach(t),Kh=s(E,", "),si=l(E,"EM",{});var yJ=i(si);e_=s(yJ,"optional"),yJ.forEach(t),t_=s(E,`, defaults to 1):
number of images that should be generated per prompt
do_classifier_free_guidance (`),oi=l(E,"CODE",{});var bJ=i(oi);n_=s(bJ,"bool"),bJ.forEach(t),a_=s(E,", "),li=l(E,"EM",{});var MJ=i(li);s_=s(MJ,"optional"),MJ.forEach(t),o_=s(E,", defaults to "),ii=l(E,"CODE",{});var wJ=i(ii);l_=s(wJ,"True"),wJ.forEach(t),i_=s(E,`):
whether to use classifier free guidance or not
negative_prompt (`),ri=l(E,"CODE",{});var vJ=i(ri);r_=s(vJ,"str"),vJ.forEach(t),p_=s(E," or "),pi=l(E,"CODE",{});var IJ=i(pi);d_=s(IJ,"List[str]"),IJ.forEach(t),c_=s(E,", "),di=l(E,"EM",{});var JJ=i(di);m_=s(JJ,"optional"),JJ.forEach(t),g_=s(E,`):
The prompt or prompts not to guide the image generation. If not defined, one has to pass
`),ci=l(E,"CODE",{});var UJ=i(ci);f_=s(UJ,"negative_prompt_embeds"),UJ.forEach(t),u_=s(E,". instead. If not defined, one has to pass "),mi=l(E,"CODE",{});var TJ=i(mi);h_=s(TJ,"negative_prompt_embeds"),TJ.forEach(t),__=s(E,`. instead.
Ignored when not using guidance (i.e., ignored if `),gi=l(E,"CODE",{});var ZJ=i(gi);y_=s(ZJ,"guidance_scale"),ZJ.forEach(t),b_=s(E," is less than "),fi=l(E,"CODE",{});var jJ=i(fi);M_=s(jJ,"1"),jJ.forEach(t),w_=s(E,`).
prompt_embeds (`),ui=l(E,"CODE",{});var EJ=i(ui);v_=s(EJ,"torch.FloatTensor"),EJ.forEach(t),I_=s(E,", "),hi=l(E,"EM",{});var FJ=i(hi);J_=s(FJ,"optional"),FJ.forEach(t),U_=s(E,`):
Pre-generated text embeddings. Can be used to easily tweak text inputs, `),_i=l(E,"EM",{});var BJ=i(_i);T_=s(BJ,"e.g."),BJ.forEach(t),Z_=s(E,` prompt weighting. If not
provided, text embeddings will be generated from `),yi=l(E,"CODE",{});var WJ=i(yi);j_=s(WJ,"prompt"),WJ.forEach(t),E_=s(E,` input argument.
negative_prompt_embeds (`),bi=l(E,"CODE",{});var kJ=i(bi);F_=s(kJ,"torch.FloatTensor"),kJ.forEach(t),B_=s(E,", "),Mi=l(E,"EM",{});var GJ=i(Mi);W_=s(GJ,"optional"),GJ.forEach(t),k_=s(E,`):
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, `),wi=l(E,"EM",{});var CJ=i(wi);G_=s(CJ,"e.g."),CJ.forEach(t),C_=s(E,` prompt
weighting. If not provided, negative_prompt_embeds will be generated from `),vi=l(E,"CODE",{});var RJ=i(vi);R_=s(RJ,"negative_prompt"),RJ.forEach(t),X_=s(E,` input
argument.`),E.forEach(t),Rs.forEach(t),Te.forEach(t),qd=p(n),tt=l(n,"H2",{class:!0});var Rc=i(tt);Bt=l(Rc,"A",{id:!0,class:!0,href:!0});var XJ=i(Bt);Ii=l(XJ,"SPAN",{});var xJ=i(Ii);u(oa.$$.fragment,xJ),xJ.forEach(t),XJ.forEach(t),x_=p(Rc),Ji=l(Rc,"SPAN",{});var SJ=i(Ji);S_=s(SJ,"IFImg2ImgPipeline"),SJ.forEach(t),Rc.forEach(t),Ld=p(n),Y=l(n,"DIV",{class:!0});var je=i(Y);u(la.$$.fragment,je),V_=p(je),he=l(je,"DIV",{class:!0});var Xs=i(he);u(ia.$$.fragment,Xs),$_=p(Xs),Ui=l(Xs,"P",{});var VJ=i(Ui);P_=s(VJ,"Function invoked when calling the pipeline for generation."),VJ.forEach(t),N_=p(Xs),u(Wt.$$.fragment,Xs),Xs.forEach(t),Q_=p(je),kt=l(je,"DIV",{class:!0});var Xc=i(kt);u(ra.$$.fragment,Xc),Y_=p(Xc),O=l(Xc,"P",{});var Ee=i(O);D_=s(Ee,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Ti=l(Ee,"CODE",{});var $J=i(Ti);z_=s($J,"enable_sequential_cpu_offload"),$J.forEach(t),H_=s(Ee,", this method moves one whole model at a time to the GPU when its "),Zi=l(Ee,"CODE",{});var PJ=i(Zi);q_=s(PJ,"forward"),PJ.forEach(t),L_=s(Ee,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),ji=l(Ee,"CODE",{});var NJ=i(ji);A_=s(NJ,"enable_sequential_cpu_offload"),NJ.forEach(t),O_=s(Ee,", but performance is much better due to the iterative execution of the "),Ei=l(Ee,"CODE",{});var QJ=i(Ei);K_=s(QJ,"unet"),QJ.forEach(t),ey=s(Ee,"."),Ee.forEach(t),Xc.forEach(t),ty=p(je),Gt=l(je,"DIV",{class:!0});var xc=i(Gt);u(pa.$$.fragment,xc),ny=p(xc),da=l(xc,"P",{});var Sc=i(da);ay=s(Sc,`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, the pipeline\u2019s
models have their state dicts saved to CPU and then are moved to a `),Fi=l(Sc,"CODE",{});var YJ=i(Fi);sy=s(YJ,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),YJ.forEach(t),oy=s(Sc,"forward` method called."),Sc.forEach(t),xc.forEach(t),ly=p(je),_e=l(je,"DIV",{class:!0});var xs=i(_e);u(ca.$$.fragment,xs),iy=p(xs),Bi=l(xs,"P",{});var DJ=i(Bi);ry=s(DJ,"Encodes the prompt into text encoder hidden states."),DJ.forEach(t),py=p(xs),J=l(xs,"P",{});var F=i(J);dy=s(F,"device: ("),Wi=l(F,"CODE",{});var zJ=i(Wi);cy=s(zJ,"torch.device"),zJ.forEach(t),my=s(F,", "),ki=l(F,"EM",{});var HJ=i(ki);gy=s(HJ,"optional"),HJ.forEach(t),fy=s(F,`):
torch device to place the resulting embeddings on
num_images_per_prompt (`),Gi=l(F,"CODE",{});var qJ=i(Gi);uy=s(qJ,"int"),qJ.forEach(t),hy=s(F,", "),Ci=l(F,"EM",{});var LJ=i(Ci);_y=s(LJ,"optional"),LJ.forEach(t),yy=s(F,`, defaults to 1):
number of images that should be generated per prompt
do_classifier_free_guidance (`),Ri=l(F,"CODE",{});var AJ=i(Ri);by=s(AJ,"bool"),AJ.forEach(t),My=s(F,", "),Xi=l(F,"EM",{});var OJ=i(Xi);wy=s(OJ,"optional"),OJ.forEach(t),vy=s(F,", defaults to "),xi=l(F,"CODE",{});var KJ=i(xi);Iy=s(KJ,"True"),KJ.forEach(t),Jy=s(F,`):
whether to use classifier free guidance or not
negative_prompt (`),Si=l(F,"CODE",{});var eU=i(Si);Uy=s(eU,"str"),eU.forEach(t),Ty=s(F," or "),Vi=l(F,"CODE",{});var tU=i(Vi);Zy=s(tU,"List[str]"),tU.forEach(t),jy=s(F,", "),$i=l(F,"EM",{});var nU=i($i);Ey=s(nU,"optional"),nU.forEach(t),Fy=s(F,`):
The prompt or prompts not to guide the image generation. If not defined, one has to pass
`),Pi=l(F,"CODE",{});var aU=i(Pi);By=s(aU,"negative_prompt_embeds"),aU.forEach(t),Wy=s(F,". instead. If not defined, one has to pass "),Ni=l(F,"CODE",{});var sU=i(Ni);ky=s(sU,"negative_prompt_embeds"),sU.forEach(t),Gy=s(F,`. instead.
Ignored when not using guidance (i.e., ignored if `),Qi=l(F,"CODE",{});var oU=i(Qi);Cy=s(oU,"guidance_scale"),oU.forEach(t),Ry=s(F," is less than "),Yi=l(F,"CODE",{});var lU=i(Yi);Xy=s(lU,"1"),lU.forEach(t),xy=s(F,`).
prompt_embeds (`),Di=l(F,"CODE",{});var iU=i(Di);Sy=s(iU,"torch.FloatTensor"),iU.forEach(t),Vy=s(F,", "),zi=l(F,"EM",{});var rU=i(zi);$y=s(rU,"optional"),rU.forEach(t),Py=s(F,`):
Pre-generated text embeddings. Can be used to easily tweak text inputs, `),Hi=l(F,"EM",{});var pU=i(Hi);Ny=s(pU,"e.g."),pU.forEach(t),Qy=s(F,` prompt weighting. If not
provided, text embeddings will be generated from `),qi=l(F,"CODE",{});var dU=i(qi);Yy=s(dU,"prompt"),dU.forEach(t),Dy=s(F,` input argument.
negative_prompt_embeds (`),Li=l(F,"CODE",{});var cU=i(Li);zy=s(cU,"torch.FloatTensor"),cU.forEach(t),Hy=s(F,", "),Ai=l(F,"EM",{});var mU=i(Ai);qy=s(mU,"optional"),mU.forEach(t),Ly=s(F,`):
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, `),Oi=l(F,"EM",{});var gU=i(Oi);Ay=s(gU,"e.g."),gU.forEach(t),Oy=s(F,` prompt
weighting. If not provided, negative_prompt_embeds will be generated from `),Ki=l(F,"CODE",{});var fU=i(Ki);Ky=s(fU,"negative_prompt"),fU.forEach(t),eb=s(F,` input
argument.`),F.forEach(t),xs.forEach(t),je.forEach(t),Ad=p(n),nt=l(n,"H2",{class:!0});var Vc=i(nt);Ct=l(Vc,"A",{id:!0,class:!0,href:!0});var uU=i(Ct);er=l(uU,"SPAN",{});var hU=i(er);u(ma.$$.fragment,hU),hU.forEach(t),uU.forEach(t),tb=p(Vc),tr=l(Vc,"SPAN",{});var _U=i(tr);nb=s(_U,"IFImg2ImgSuperResolutionPipeline"),_U.forEach(t),Vc.forEach(t),Od=p(n),D=l(n,"DIV",{class:!0});var Fe=i(D);u(ga.$$.fragment,Fe),ab=p(Fe),ye=l(Fe,"DIV",{class:!0});var Ss=i(ye);u(fa.$$.fragment,Ss),sb=p(Ss),nr=l(Ss,"P",{});var yU=i(nr);ob=s(yU,"Function invoked when calling the pipeline for generation."),yU.forEach(t),lb=p(Ss),u(Rt.$$.fragment,Ss),Ss.forEach(t),ib=p(Fe),Xt=l(Fe,"DIV",{class:!0});var $c=i(Xt);u(ua.$$.fragment,$c),rb=p($c),K=l($c,"P",{});var Be=i(K);pb=s(Be,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),ar=l(Be,"CODE",{});var bU=i(ar);db=s(bU,"enable_sequential_cpu_offload"),bU.forEach(t),cb=s(Be,", this method moves one whole model at a time to the GPU when its "),sr=l(Be,"CODE",{});var MU=i(sr);mb=s(MU,"forward"),MU.forEach(t),gb=s(Be,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),or=l(Be,"CODE",{});var wU=i(or);fb=s(wU,"enable_sequential_cpu_offload"),wU.forEach(t),ub=s(Be,", but performance is much better due to the iterative execution of the "),lr=l(Be,"CODE",{});var vU=i(lr);hb=s(vU,"unet"),vU.forEach(t),_b=s(Be,"."),Be.forEach(t),$c.forEach(t),yb=p(Fe),xt=l(Fe,"DIV",{class:!0});var Pc=i(xt);u(ha.$$.fragment,Pc),bb=p(Pc),_a=l(Pc,"P",{});var Nc=i(_a);Mb=s(Nc,`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, the pipeline\u2019s
models have their state dicts saved to CPU and then are moved to a `),ir=l(Nc,"CODE",{});var IU=i(ir);wb=s(IU,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),IU.forEach(t),vb=s(Nc,"forward` method called."),Nc.forEach(t),Pc.forEach(t),Ib=p(Fe),be=l(Fe,"DIV",{class:!0});var Vs=i(be);u(ya.$$.fragment,Vs),Jb=p(Vs),rr=l(Vs,"P",{});var JU=i(rr);Ub=s(JU,"Encodes the prompt into text encoder hidden states."),JU.forEach(t),Tb=p(Vs),U=l(Vs,"P",{});var B=i(U);Zb=s(B,"device: ("),pr=l(B,"CODE",{});var UU=i(pr);jb=s(UU,"torch.device"),UU.forEach(t),Eb=s(B,", "),dr=l(B,"EM",{});var TU=i(dr);Fb=s(TU,"optional"),TU.forEach(t),Bb=s(B,`):
torch device to place the resulting embeddings on
num_images_per_prompt (`),cr=l(B,"CODE",{});var ZU=i(cr);Wb=s(ZU,"int"),ZU.forEach(t),kb=s(B,", "),mr=l(B,"EM",{});var jU=i(mr);Gb=s(jU,"optional"),jU.forEach(t),Cb=s(B,`, defaults to 1):
number of images that should be generated per prompt
do_classifier_free_guidance (`),gr=l(B,"CODE",{});var EU=i(gr);Rb=s(EU,"bool"),EU.forEach(t),Xb=s(B,", "),fr=l(B,"EM",{});var FU=i(fr);xb=s(FU,"optional"),FU.forEach(t),Sb=s(B,", defaults to "),ur=l(B,"CODE",{});var BU=i(ur);Vb=s(BU,"True"),BU.forEach(t),$b=s(B,`):
whether to use classifier free guidance or not
negative_prompt (`),hr=l(B,"CODE",{});var WU=i(hr);Pb=s(WU,"str"),WU.forEach(t),Nb=s(B," or "),_r=l(B,"CODE",{});var kU=i(_r);Qb=s(kU,"List[str]"),kU.forEach(t),Yb=s(B,", "),yr=l(B,"EM",{});var GU=i(yr);Db=s(GU,"optional"),GU.forEach(t),zb=s(B,`):
The prompt or prompts not to guide the image generation. If not defined, one has to pass
`),br=l(B,"CODE",{});var CU=i(br);Hb=s(CU,"negative_prompt_embeds"),CU.forEach(t),qb=s(B,". instead. If not defined, one has to pass "),Mr=l(B,"CODE",{});var RU=i(Mr);Lb=s(RU,"negative_prompt_embeds"),RU.forEach(t),Ab=s(B,`. instead.
Ignored when not using guidance (i.e., ignored if `),wr=l(B,"CODE",{});var XU=i(wr);Ob=s(XU,"guidance_scale"),XU.forEach(t),Kb=s(B," is less than "),vr=l(B,"CODE",{});var xU=i(vr);eM=s(xU,"1"),xU.forEach(t),tM=s(B,`).
prompt_embeds (`),Ir=l(B,"CODE",{});var SU=i(Ir);nM=s(SU,"torch.FloatTensor"),SU.forEach(t),aM=s(B,", "),Jr=l(B,"EM",{});var VU=i(Jr);sM=s(VU,"optional"),VU.forEach(t),oM=s(B,`):
Pre-generated text embeddings. Can be used to easily tweak text inputs, `),Ur=l(B,"EM",{});var $U=i(Ur);lM=s($U,"e.g."),$U.forEach(t),iM=s(B,` prompt weighting. If not
provided, text embeddings will be generated from `),Tr=l(B,"CODE",{});var PU=i(Tr);rM=s(PU,"prompt"),PU.forEach(t),pM=s(B,` input argument.
negative_prompt_embeds (`),Zr=l(B,"CODE",{});var NU=i(Zr);dM=s(NU,"torch.FloatTensor"),NU.forEach(t),cM=s(B,", "),jr=l(B,"EM",{});var QU=i(jr);mM=s(QU,"optional"),QU.forEach(t),gM=s(B,`):
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, `),Er=l(B,"EM",{});var YU=i(Er);fM=s(YU,"e.g."),YU.forEach(t),uM=s(B,` prompt
weighting. If not provided, negative_prompt_embeds will be generated from `),Fr=l(B,"CODE",{});var DU=i(Fr);hM=s(DU,"negative_prompt"),DU.forEach(t),_M=s(B,` input
argument.`),B.forEach(t),Vs.forEach(t),Fe.forEach(t),Kd=p(n),at=l(n,"H2",{class:!0});var Qc=i(at);St=l(Qc,"A",{id:!0,class:!0,href:!0});var zU=i(St);Br=l(zU,"SPAN",{});var HU=i(Br);u(ba.$$.fragment,HU),HU.forEach(t),zU.forEach(t),yM=p(Qc),Wr=l(Qc,"SPAN",{});var qU=i(Wr);bM=s(qU,"IFInpaintingPipeline"),qU.forEach(t),Qc.forEach(t),ec=p(n),z=l(n,"DIV",{class:!0});var We=i(z);u(Ma.$$.fragment,We),MM=p(We),Me=l(We,"DIV",{class:!0});var $s=i(Me);u(wa.$$.fragment,$s),wM=p($s),kr=l($s,"P",{});var LU=i(kr);vM=s(LU,"Function invoked when calling the pipeline for generation."),LU.forEach(t),IM=p($s),u(Vt.$$.fragment,$s),$s.forEach(t),JM=p(We),$t=l(We,"DIV",{class:!0});var Yc=i($t);u(va.$$.fragment,Yc),UM=p(Yc),ee=l(Yc,"P",{});var ke=i(ee);TM=s(ke,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Gr=l(ke,"CODE",{});var AU=i(Gr);ZM=s(AU,"enable_sequential_cpu_offload"),AU.forEach(t),jM=s(ke,", this method moves one whole model at a time to the GPU when its "),Cr=l(ke,"CODE",{});var OU=i(Cr);EM=s(OU,"forward"),OU.forEach(t),FM=s(ke,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Rr=l(ke,"CODE",{});var KU=i(Rr);BM=s(KU,"enable_sequential_cpu_offload"),KU.forEach(t),WM=s(ke,", but performance is much better due to the iterative execution of the "),Xr=l(ke,"CODE",{});var eT=i(Xr);kM=s(eT,"unet"),eT.forEach(t),GM=s(ke,"."),ke.forEach(t),Yc.forEach(t),CM=p(We),Pt=l(We,"DIV",{class:!0});var Dc=i(Pt);u(Ia.$$.fragment,Dc),RM=p(Dc),Ja=l(Dc,"P",{});var zc=i(Ja);XM=s(zc,`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, the pipeline\u2019s
models have their state dicts saved to CPU and then are moved to a `),xr=l(zc,"CODE",{});var tT=i(xr);xM=s(tT,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),tT.forEach(t),SM=s(zc,"forward` method called."),zc.forEach(t),Dc.forEach(t),VM=p(We),we=l(We,"DIV",{class:!0});var Ps=i(we);u(Ua.$$.fragment,Ps),$M=p(Ps),Sr=l(Ps,"P",{});var nT=i(Sr);PM=s(nT,"Encodes the prompt into text encoder hidden states."),nT.forEach(t),NM=p(Ps),T=l(Ps,"P",{});var W=i(T);QM=s(W,"device: ("),Vr=l(W,"CODE",{});var aT=i(Vr);YM=s(aT,"torch.device"),aT.forEach(t),DM=s(W,", "),$r=l(W,"EM",{});var sT=i($r);zM=s(sT,"optional"),sT.forEach(t),HM=s(W,`):
torch device to place the resulting embeddings on
num_images_per_prompt (`),Pr=l(W,"CODE",{});var oT=i(Pr);qM=s(oT,"int"),oT.forEach(t),LM=s(W,", "),Nr=l(W,"EM",{});var lT=i(Nr);AM=s(lT,"optional"),lT.forEach(t),OM=s(W,`, defaults to 1):
number of images that should be generated per prompt
do_classifier_free_guidance (`),Qr=l(W,"CODE",{});var iT=i(Qr);KM=s(iT,"bool"),iT.forEach(t),ew=s(W,", "),Yr=l(W,"EM",{});var rT=i(Yr);tw=s(rT,"optional"),rT.forEach(t),nw=s(W,", defaults to "),Dr=l(W,"CODE",{});var pT=i(Dr);aw=s(pT,"True"),pT.forEach(t),sw=s(W,`):
whether to use classifier free guidance or not
negative_prompt (`),zr=l(W,"CODE",{});var dT=i(zr);ow=s(dT,"str"),dT.forEach(t),lw=s(W," or "),Hr=l(W,"CODE",{});var cT=i(Hr);iw=s(cT,"List[str]"),cT.forEach(t),rw=s(W,", "),qr=l(W,"EM",{});var mT=i(qr);pw=s(mT,"optional"),mT.forEach(t),dw=s(W,`):
The prompt or prompts not to guide the image generation. If not defined, one has to pass
`),Lr=l(W,"CODE",{});var gT=i(Lr);cw=s(gT,"negative_prompt_embeds"),gT.forEach(t),mw=s(W,". instead. If not defined, one has to pass "),Ar=l(W,"CODE",{});var fT=i(Ar);gw=s(fT,"negative_prompt_embeds"),fT.forEach(t),fw=s(W,`. instead.
Ignored when not using guidance (i.e., ignored if `),Or=l(W,"CODE",{});var uT=i(Or);uw=s(uT,"guidance_scale"),uT.forEach(t),hw=s(W," is less than "),Kr=l(W,"CODE",{});var hT=i(Kr);_w=s(hT,"1"),hT.forEach(t),yw=s(W,`).
prompt_embeds (`),ep=l(W,"CODE",{});var _T=i(ep);bw=s(_T,"torch.FloatTensor"),_T.forEach(t),Mw=s(W,", "),tp=l(W,"EM",{});var yT=i(tp);ww=s(yT,"optional"),yT.forEach(t),vw=s(W,`):
Pre-generated text embeddings. Can be used to easily tweak text inputs, `),np=l(W,"EM",{});var bT=i(np);Iw=s(bT,"e.g."),bT.forEach(t),Jw=s(W,` prompt weighting. If not
provided, text embeddings will be generated from `),ap=l(W,"CODE",{});var MT=i(ap);Uw=s(MT,"prompt"),MT.forEach(t),Tw=s(W,` input argument.
negative_prompt_embeds (`),sp=l(W,"CODE",{});var wT=i(sp);Zw=s(wT,"torch.FloatTensor"),wT.forEach(t),jw=s(W,", "),op=l(W,"EM",{});var vT=i(op);Ew=s(vT,"optional"),vT.forEach(t),Fw=s(W,`):
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, `),lp=l(W,"EM",{});var IT=i(lp);Bw=s(IT,"e.g."),IT.forEach(t),Ww=s(W,` prompt
weighting. If not provided, negative_prompt_embeds will be generated from `),ip=l(W,"CODE",{});var JT=i(ip);kw=s(JT,"negative_prompt"),JT.forEach(t),Gw=s(W,` input
argument.`),W.forEach(t),Ps.forEach(t),We.forEach(t),tc=p(n),st=l(n,"H2",{class:!0});var Hc=i(st);Nt=l(Hc,"A",{id:!0,class:!0,href:!0});var UT=i(Nt);rp=l(UT,"SPAN",{});var TT=i(rp);u(Ta.$$.fragment,TT),TT.forEach(t),UT.forEach(t),Cw=p(Hc),pp=l(Hc,"SPAN",{});var ZT=i(pp);Rw=s(ZT,"IFInpaintingSuperResolutionPipeline"),ZT.forEach(t),Hc.forEach(t),nc=p(n),H=l(n,"DIV",{class:!0});var Ge=i(H);u(Za.$$.fragment,Ge),Xw=p(Ge),ve=l(Ge,"DIV",{class:!0});var Ns=i(ve);u(ja.$$.fragment,Ns),xw=p(Ns),dp=l(Ns,"P",{});var jT=i(dp);Sw=s(jT,"Function invoked when calling the pipeline for generation."),jT.forEach(t),Vw=p(Ns),u(Qt.$$.fragment,Ns),Ns.forEach(t),$w=p(Ge),Yt=l(Ge,"DIV",{class:!0});var qc=i(Yt);u(Ea.$$.fragment,qc),Pw=p(qc),te=l(qc,"P",{});var Ce=i(te);Nw=s(Ce,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),cp=l(Ce,"CODE",{});var ET=i(cp);Qw=s(ET,"enable_sequential_cpu_offload"),ET.forEach(t),Yw=s(Ce,", this method moves one whole model at a time to the GPU when its "),mp=l(Ce,"CODE",{});var FT=i(mp);Dw=s(FT,"forward"),FT.forEach(t),zw=s(Ce,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),gp=l(Ce,"CODE",{});var BT=i(gp);Hw=s(BT,"enable_sequential_cpu_offload"),BT.forEach(t),qw=s(Ce,", but performance is much better due to the iterative execution of the "),fp=l(Ce,"CODE",{});var WT=i(fp);Lw=s(WT,"unet"),WT.forEach(t),Aw=s(Ce,"."),Ce.forEach(t),qc.forEach(t),Ow=p(Ge),Dt=l(Ge,"DIV",{class:!0});var Lc=i(Dt);u(Fa.$$.fragment,Lc),Kw=p(Lc),Ba=l(Lc,"P",{});var Ac=i(Ba);ev=s(Ac,`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, the pipeline\u2019s
models have their state dicts saved to CPU and then are moved to a `),up=l(Ac,"CODE",{});var kT=i(up);tv=s(kT,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),kT.forEach(t),nv=s(Ac,"forward` method called."),Ac.forEach(t),Lc.forEach(t),av=p(Ge),Ie=l(Ge,"DIV",{class:!0});var Qs=i(Ie);u(Wa.$$.fragment,Qs),sv=p(Qs),hp=l(Qs,"P",{});var GT=i(hp);ov=s(GT,"Encodes the prompt into text encoder hidden states."),GT.forEach(t),lv=p(Qs),Z=l(Qs,"P",{});var k=i(Z);iv=s(k,"device: ("),_p=l(k,"CODE",{});var CT=i(_p);rv=s(CT,"torch.device"),CT.forEach(t),pv=s(k,", "),yp=l(k,"EM",{});var RT=i(yp);dv=s(RT,"optional"),RT.forEach(t),cv=s(k,`):
torch device to place the resulting embeddings on
num_images_per_prompt (`),bp=l(k,"CODE",{});var XT=i(bp);mv=s(XT,"int"),XT.forEach(t),gv=s(k,", "),Mp=l(k,"EM",{});var xT=i(Mp);fv=s(xT,"optional"),xT.forEach(t),uv=s(k,`, defaults to 1):
number of images that should be generated per prompt
do_classifier_free_guidance (`),wp=l(k,"CODE",{});var ST=i(wp);hv=s(ST,"bool"),ST.forEach(t),_v=s(k,", "),vp=l(k,"EM",{});var VT=i(vp);yv=s(VT,"optional"),VT.forEach(t),bv=s(k,", defaults to "),Ip=l(k,"CODE",{});var $T=i(Ip);Mv=s($T,"True"),$T.forEach(t),wv=s(k,`):
whether to use classifier free guidance or not
negative_prompt (`),Jp=l(k,"CODE",{});var PT=i(Jp);vv=s(PT,"str"),PT.forEach(t),Iv=s(k," or "),Up=l(k,"CODE",{});var NT=i(Up);Jv=s(NT,"List[str]"),NT.forEach(t),Uv=s(k,", "),Tp=l(k,"EM",{});var QT=i(Tp);Tv=s(QT,"optional"),QT.forEach(t),Zv=s(k,`):
The prompt or prompts not to guide the image generation. If not defined, one has to pass
`),Zp=l(k,"CODE",{});var YT=i(Zp);jv=s(YT,"negative_prompt_embeds"),YT.forEach(t),Ev=s(k,". instead. If not defined, one has to pass "),jp=l(k,"CODE",{});var DT=i(jp);Fv=s(DT,"negative_prompt_embeds"),DT.forEach(t),Bv=s(k,`. instead.
Ignored when not using guidance (i.e., ignored if `),Ep=l(k,"CODE",{});var zT=i(Ep);Wv=s(zT,"guidance_scale"),zT.forEach(t),kv=s(k," is less than "),Fp=l(k,"CODE",{});var HT=i(Fp);Gv=s(HT,"1"),HT.forEach(t),Cv=s(k,`).
prompt_embeds (`),Bp=l(k,"CODE",{});var qT=i(Bp);Rv=s(qT,"torch.FloatTensor"),qT.forEach(t),Xv=s(k,", "),Wp=l(k,"EM",{});var LT=i(Wp);xv=s(LT,"optional"),LT.forEach(t),Sv=s(k,`):
Pre-generated text embeddings. Can be used to easily tweak text inputs, `),kp=l(k,"EM",{});var AT=i(kp);Vv=s(AT,"e.g."),AT.forEach(t),$v=s(k,` prompt weighting. If not
provided, text embeddings will be generated from `),Gp=l(k,"CODE",{});var OT=i(Gp);Pv=s(OT,"prompt"),OT.forEach(t),Nv=s(k,` input argument.
negative_prompt_embeds (`),Cp=l(k,"CODE",{});var KT=i(Cp);Qv=s(KT,"torch.FloatTensor"),KT.forEach(t),Yv=s(k,", "),Rp=l(k,"EM",{});var eZ=i(Rp);Dv=s(eZ,"optional"),eZ.forEach(t),zv=s(k,`):
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, `),Xp=l(k,"EM",{});var tZ=i(Xp);Hv=s(tZ,"e.g."),tZ.forEach(t),qv=s(k,` prompt
weighting. If not provided, negative_prompt_embeds will be generated from `),xp=l(k,"CODE",{});var nZ=i(xp);Lv=s(nZ,"negative_prompt"),nZ.forEach(t),Av=s(k,` input
argument.`),k.forEach(t),Qs.forEach(t),Ge.forEach(t),this.h()},h(){d(w,"name","hf:doc:metadata"),d(w,"content",JSON.stringify(hZ)),d(M,"id","if"),d(M,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(M,"href","#if"),d(C,"class","relative group"),d(ot,"id","overview"),d(ot,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ot,"href","#overview"),d(Re,"class","relative group"),d(qt,"href","https://huggingface.co/stabilityai/stable-diffusion-x4-upscaler"),d(qt,"rel","nofollow"),d(lt,"id","usage"),d(lt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(lt,"href","#usage"),d(Xe,"class","relative group"),d(Ot,"href","https://huggingface.co/join"),d(Ot,"rel","nofollow"),d(en,"href","https://huggingface.co/DeepFloyd/IF-I-XL-v1.0"),d(en,"rel","nofollow"),d(an,"href","https://huggingface.co/docs/hub/security-tokens#what-are-user-access-tokens"),d(an,"rel","nofollow"),d(Pa,"href","#text-to-image-generation"),d(Na,"href","#text-guided-image-to-image-generation"),d(Qa,"href","#text-guided-inpainting-generation"),d(Ya,"href","#converting-between-different-pipelines"),d(Da,"href","#optimizing-for-speed"),d(za,"href","#optimizing-for-memory"),d(ln,"href","https://huggingface.co/DeepFloyd/IF-I-XL-v1.0"),d(ln,"rel","nofollow"),d(rn,"href","https://huggingface.co/DeepFloyd/IF-I-L-v1.0"),d(rn,"rel","nofollow"),d(pn,"href","https://huggingface.co/DeepFloyd/IF-I-M-v1.0"),d(pn,"rel","nofollow"),d(mn,"href","https://huggingface.co/DeepFloyd/IF-II-L-v1.0"),d(mn,"rel","nofollow"),d(gn,"href","https://huggingface.co/DeepFloyd/IF-II-M-v1.0"),d(gn,"rel","nofollow"),d(un,"href","https://huggingface.co/stabilityai/stable-diffusion-x4-upscaler"),d(un,"rel","nofollow"),aZ(qa.src,Kv="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||d(qa,"src",Kv),d(qa,"alt","Hugging Face Spaces"),d(hn,"href","https://huggingface.co/spaces/DeepFloyd/IF"),d(hn,"rel","nofollow"),aZ(La.src,eI="https://colab.research.google.com/assets/colab-badge.svg")||d(La,"src",eI),d(La,"alt","Open In Colab"),d(_n,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/deepfloyd_if_free_tier_google_colab.ipynb"),d(_n,"rel","nofollow"),d(ct,"id","texttoimage-generation"),d(ct,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ct,"href","#texttoimage-generation"),d(Se,"class","relative group"),d(bn,"href","https://huggingface.co/docs/diffusers/optimization/fp16#model-offloading-for-fast-inference-and-memory-savings"),d(bn,"rel","nofollow"),d(gt,"id","text-guided-imagetoimage-generation"),d(gt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(gt,"href","#text-guided-imagetoimage-generation"),d(Ve,"class","relative group"),d(Aa,"href","/docs/diffusers/v0.17.1/en/api/pipelines/if#diffusers.IFInpaintingPipeline"),d(Oa,"href","/docs/diffusers/v0.17.1/en/api/pipelines/if#diffusers.IFInpaintingSuperResolutionPipeline"),d(Ka,"href","#converting-between-different-pipelines"),d(ft,"id","text-guided-inpainting-generation"),d(ft,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ft,"href","#text-guided-inpainting-generation"),d($e,"class","relative group"),d(es,"href","/docs/diffusers/v0.17.1/en/api/pipelines/if#diffusers.IFInpaintingPipeline"),d(ts,"href","/docs/diffusers/v0.17.1/en/api/pipelines/if#diffusers.IFInpaintingSuperResolutionPipeline"),d(ns,"href","#converting-between-different-pipelines"),d(ut,"id","converting-between-different-pipelines"),d(ut,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ut,"href","#converting-between-different-pipelines"),d(Pe,"class","relative group"),d(_t,"id","optimizing-for-speed"),d(_t,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(_t,"href","#optimizing-for-speed"),d(Ne,"class","relative group"),d(ls,"href","../../optimization/torch2.0"),d(Mt,"id","optimizing-for-memory"),d(Mt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Mt,"href","#optimizing-for-memory"),d(Qe,"class","relative group"),d(wt,"id","available-pipelines"),d(wt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(wt,"href","#available-pipelines"),d(Ye,"class","relative group"),d(ms,"align","center"),d(Sn,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/deepfloyd_if/pipeline_if.py"),d(Sn,"rel","nofollow"),d(gs,"align","center"),d(Vn,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/deepfloyd_if/pipeline_if.py"),d(Vn,"rel","nofollow"),d(fs,"align","center"),d($n,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img.py"),d($n,"rel","nofollow"),d(us,"align","center"),d(Pn,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img_superresolution.py"),d(Pn,"rel","nofollow"),d(hs,"align","center"),d(Nn,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting.py"),d(Nn,"rel","nofollow"),d(_s,"align","center"),d(Qn,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting_superresolution.py"),d(Qn,"rel","nofollow"),d(ys,"align","center"),d(It,"id","diffusers.IFPipeline"),d(It,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(It,"href","#diffusers.IFPipeline"),d(Ke,"class","relative group"),d(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Zt,"id","diffusers.IFSuperResolutionPipeline"),d(Zt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Zt,"href","#diffusers.IFSuperResolutionPipeline"),d(et,"class","relative group"),d(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Bt,"id","diffusers.IFImg2ImgPipeline"),d(Bt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Bt,"href","#diffusers.IFImg2ImgPipeline"),d(tt,"class","relative group"),d(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(kt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Gt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ct,"id","diffusers.IFImg2ImgSuperResolutionPipeline"),d(Ct,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Ct,"href","#diffusers.IFImg2ImgSuperResolutionPipeline"),d(nt,"class","relative group"),d(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Xt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(xt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(St,"id","diffusers.IFInpaintingPipeline"),d(St,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(St,"href","#diffusers.IFInpaintingPipeline"),d(at,"class","relative group"),d(Me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d($t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(we,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Nt,"id","diffusers.IFInpaintingSuperResolutionPipeline"),d(Nt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Nt,"href","#diffusers.IFInpaintingSuperResolutionPipeline"),d(st,"class","relative group"),d(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Yt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(n,c){e(document.head,w),m(n,x,c),m(n,C,c),e(C,M),e(M,R),h(g,R,null),e(C,G),e(C,zs),e(zs,Oc),m(n,Np,c),m(n,Re,c),e(Re,ot),e(ot,Hs),h(zt,Hs,null),e(Re,Kc),e(Re,qs),e(qs,em),m(n,Qp,c),m(n,Xa,c),e(Xa,tm),m(n,Yp,c),m(n,le,c),e(le,Ls),e(Ls,nm),e(le,am),e(le,As),e(As,sm),e(le,om),e(le,Ht),e(Ht,lm),e(Ht,qt),e(qt,im),e(Ht,rm),m(n,Dp,c),m(n,Xe,c),e(Xe,lt),e(lt,Os),h(Lt,Os,null),e(Xe,pm),e(Xe,Ks),e(Ks,dm),m(n,zp,c),m(n,xa,c),e(xa,cm),m(n,Hp,c),m(n,ie,c),e(ie,At),e(At,mm),e(At,Ot),e(Ot,gm),e(At,fm),e(ie,um),e(ie,Kt),e(Kt,hm),e(Kt,en),e(en,_m),e(Kt,ym),e(ie,bm),e(ie,Sa),e(Sa,Mm),e(Sa,eo),e(eo,wm),m(n,qp,c),h(tn,n,c),m(n,Lp,c),m(n,Va,c),e(Va,vm),m(n,Ap,c),h(nn,n,c),m(n,Op,c),m(n,it,c),e(it,Im),e(it,an),e(an,Jm),e(it,Um),m(n,Kp,c),m(n,rt,c),e(rt,Tm),e(rt,to),e(to,Zm),e(rt,jm),m(n,ed,c),h(sn,n,c),m(n,td,c),m(n,$a,c),e($a,Em),m(n,nd,c),m(n,V,c),e(V,no),e(no,Pa),e(Pa,Fm),e(V,Bm),e(V,ao),e(ao,Na),e(Na,Wm),e(V,km),e(V,so),e(so,Qa),e(Qa,Gm),e(V,Cm),e(V,oo),e(oo,Ya),e(Ya,Rm),e(V,Xm),e(V,lo),e(lo,Da),e(Da,xm),e(V,Sm),e(V,io),e(io,za),e(za,Vm),m(n,ad,c),m(n,Ha,c),e(Ha,ro),e(ro,$m),m(n,sd,c),m(n,re,c),e(re,on),e(on,po),e(po,co),e(co,Pm),e(on,Nm),e(on,xe),e(xe,mo),e(mo,ln),e(ln,Qm),e(xe,Ym),e(xe,go),e(go,rn),e(rn,Dm),e(xe,zm),e(xe,fo),e(fo,pn),e(pn,Hm),e(re,qm),e(re,dn),e(dn,uo),e(uo,ho),e(ho,Lm),e(dn,Am),e(dn,cn),e(cn,_o),e(_o,mn),e(mn,Om),e(cn,Km),e(cn,yo),e(yo,gn),e(gn,eg),e(re,tg),e(re,fn),e(fn,bo),e(bo,Mo),e(Mo,ng),e(fn,ag),e(fn,wo),e(wo,vo),e(vo,un),e(un,sg),m(n,od,c),m(n,pt,c),e(pt,Io),e(Io,og),e(pt,lg),e(pt,hn),e(hn,qa),m(n,ld,c),m(n,dt,c),e(dt,Jo),e(Jo,ig),e(dt,rg),e(dt,_n),e(_n,La),m(n,id,c),m(n,Se,c),e(Se,ct),e(ct,Uo),h(yn,Uo,null),e(Se,pg),e(Se,To),e(To,dg),m(n,rd,c),m(n,mt,c),e(mt,cg),e(mt,bn),e(bn,mg),e(mt,gg),m(n,pd,c),h(Mn,n,c),m(n,dd,c),m(n,Ve,c),e(Ve,gt),e(gt,Zo),h(wn,Zo,null),e(Ve,fg),e(Ve,jo),e(jo,ug),m(n,cd,c),m(n,pe,c),e(pe,hg),e(pe,Aa),e(Aa,_g),e(pe,yg),e(pe,Oa),e(Oa,bg),e(pe,Mg),m(n,md,c),m(n,se,c),e(se,Eo),e(Eo,wg),e(se,vg),e(se,Fo),e(Fo,Ig),e(se,Jg),e(se,Ka),e(Ka,Ug),e(se,Tg),m(n,gd,c),h(vn,n,c),m(n,fd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e(Et,jh),e(Et,A),e(A,Eh),e(A,ql),e(ql,Fh),e(A,Bh),e(A,Ll),e(Ll,Wh),e(A,kh),e(A,Al),e(Al,Gh),e(A,Ch),e(A,Ol),e(Ol,Rh),e(A,Xh),e(Q,xh),e(Q,Ft),h(na,Ft,null),e(Ft,Sh),e(Ft,aa),e(aa,Vh),e(aa,Kl),e(Kl,$h),e(aa,Ph),e(Q,Nh),e(Q,ue),h(sa,ue,null),e(ue,Qh),e(ue,ei),e(ei,Yh),e(ue,Dh),e(ue,I),e(I,zh),e(I,ti),e(ti,Hh),e(I,qh),e(I,ni),e(ni,Lh),e(I,Ah),e(I,ai),e(ai,Oh),e(I,Kh),e(I,si),e(si,e_),e(I,t_),e(I,oi),e(oi,n_),e(I,a_),e(I,li),e(li,s_),e(I,o_),e(I,ii),e(ii,l_),e(I,i_),e(I,ri),e(ri,r_),e(I,p_),e(I,pi),e(pi,d_),e(I,c_),e(I,di),e(di,m_),e(I,g_),e(I,ci),e(ci,f_),e(I,u_),e(I,mi),e(mi,h_),e(I,__),e(I,gi),e(gi,y_),e(I,b_),e(I,fi),e(fi,M_),e(I,w_),e(I,ui),e(ui,v_),e(I,I_),e(I,hi),e(hi,J_),e(I,U_),e(I,_i),e(_i,T_),e(I,Z_),e(I,yi),e(yi,j_),e(I,E_),e(I,bi),e(bi,F_),e(I,B_),e(I,Mi),e(Mi,W_),e(I,k_),e(I,wi),e(wi,G_),e(I,C_),e(I,vi),e(vi,R_),e(I,X_),m(n,qd,c),m(n,tt,c),e(tt,Bt),e(Bt,Ii),h(oa,Ii,null),e(tt,x_),e(tt,Ji),e(Ji,S_),m(n,Ld,c),m(n,Y,c),h(la,Y,null),e(Y,V_),e(Y,he),h(ia,he,null),e(he,$_),e(he,Ui),e(Ui,P_),e(he,N_),h(Wt,he,null),e(Y,Q_),e(Y,kt),h(ra,kt,null),e(kt,Y_),e(kt,O),e(O,D_),e(O,Ti),e(Ti,z_),e(O,H_),e(O,Zi),e(Zi,q_),e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,_b),e(D,yb),e(D,xt),h(ha,xt,null),e(xt,bb),e(xt,_a),e(_a,Mb),e(_a,ir),e(ir,wb),e(_a,vb),e(D,Ib),e(D,be),h(ya,be,null),e(be,Jb),e(be,rr),e(rr,Ub),e(be,Tb),e(be,U),e(U,Zb),e(U,pr),e(pr,jb),e(U,Eb),e(U,dr),e(dr,Fb),e(U,Bb),e(U,cr),e(cr,Wb),e(U,kb),e(U,mr),e(mr,Gb),e(U,Cb),e(U,gr),e(gr,Rb),e(U,Xb),e(U,fr),e(fr,xb),e(U,Sb),e(U,ur),e(ur,Vb),e(U,$b),e(U,hr),e(hr,Pb),e(U,Nb),e(U,_r),e(_r,Qb),e(U,Yb),e(U,yr),e(yr,Db),e(U,zb),e(U,br),e(br,Hb),e(U,qb),e(U,Mr),e(Mr,Lb),e(U,Ab),e(U,wr),e(wr,Ob),e(U,Kb),e(U,vr),e(vr,eM),e(U,tM),e(U,Ir),e(Ir,nM),e(U,aM),e(U,Jr),e(Jr,sM),e(U,oM),e(U,Ur),e(Ur,lM),e(U,iM),e(U,Tr),e(Tr,rM),e(U,pM),e(U,Zr),e(Zr,dM),e(U,cM),e(U,jr),e(jr,mM),e(U,gM),e(U,Er),e(Er,fM),e(U,uM),e(U,Fr),e(Fr,hM),e(U,_M),m(n,Kd,c),m(n,at,c),e(at,St),e(St,Br),h(ba,Br,null),e(at,yM),e(at,Wr),e(Wr,bM),m(n,ec,c),m(n,z,c),h(Ma,z,null),e(z,MM),e(z,Me),h(wa,Me,null),e(Me,wM),e(Me,kr),e(kr,vM),e(Me,IM),h(Vt,Me,null),e(z,JM),e(z,$t),h(va,$t,null),e($t,UM),e($t,ee),e(ee,TM),e(ee,Gr),e(Gr,ZM),e(ee,jM),e(ee,Cr),e(Cr,EM),e(ee,FM),e(ee,Rr),e(Rr,BM),e(ee,WM),e(ee,Xr),e(Xr,kM),e(ee,GM),e(z,CM),e(z,Pt),h(Ia,Pt,null),e(Pt,RM),e(Pt,Ja),e(Ja,XM),e(Ja,xr),e(xr,xM),e(Ja,SM),e(z,VM),e(z,we),h(Ua,we,null),e(we,$M),e(we,Sr),e(Sr,PM),e(we,NM),e(we,T),e(T,QM),e(T,Vr),e(Vr,YM),e(T,DM),e(T,$r),e($r,zM),e(T,HM),e(T,Pr),e(Pr,qM),e(T,LM),e(T,Nr),e(Nr,AM),e(T,OM),e(T,Qr),e(Qr,KM),e(T,ew),e(T,Yr),e(Yr,tw),e(T,nw),e(T,Dr),e(Dr,aw),e(T,sw),e(T,zr),e(zr,ow),e(T,lw),e(T,Hr),e(Hr,iw),e(T,rw),e(T,qr),e(qr,pw),e(T,dw),e(T,Lr),e(Lr,cw),e(T,mw),e(T,Ar),e(Ar,gw),e(T,fw),e(T,Or),e(Or,uw),e(T,hw),e(T,Kr),e(Kr,_w),e(T,yw),e(T,ep),e(ep,bw),e(T,Mw),e(T,tp),e(tp,ww),e(T,vw),e(T,np),e(np,Iw),e(T,Jw),e(T,ap),e(ap,Uw),e(T,Tw),e(T,sp),e(sp,Zw),e(T,jw),e(T,op),e(op,Ew),e(T,Fw),e(T,lp),e(lp,Bw),e(T,Ww),e(T,ip),e(ip,kw),e(T,Gw),m(n,tc,c),m(n,st,c),e(st,Nt),e(Nt,rp),h(Ta,rp,null),e(st,Cw),e(st,pp),e(pp,Rw),m(n,nc,c),m(n,H,c),h(Za,H,null),e(H,Xw),e(H,ve),h(ja,ve,null),e(ve,xw),e(ve,dp),e(dp,Sw),e(ve,Vw),h(Qt,ve,null),e(H,$w),e(H,Yt),h(Ea,Yt,null),e(Yt,Pw),e(Yt,te),e(te,Nw),e(te,cp),e(cp,Qw),e(te,Yw),e(te,mp),e(mp,Dw),e(te,zw),e(te,gp),e(gp,Hw),e(te,qw),e(te,fp),e(fp,Lw),e(te,Aw),e(H,Ow),e(H,Dt),h(Fa,Dt,null),e(Dt,Kw),e(Dt,Ba),e(Ba,ev),e(Ba,up),e(up,tv),e(Ba,nv),e(H,av),e(H,Ie),h(Wa,Ie,null),e(Ie,sv),e(Ie,hp),e(hp,ov),e(Ie,lv),e(Ie,Z),e(Z,iv),e(Z,_p),e(_p,rv),e(Z,pv),e(Z,yp),e(yp,dv),e(Z,cv),e(Z,bp),e(bp,mv),e(Z,gv),e(Z,Mp),e(Mp,fv),e(Z,uv),e(Z,wp),e(wp,hv),e(Z,_v),e(Z,vp),e(vp,yv),e(Z,bv),e(Z,Ip),e(Ip,Mv),e(Z,wv),e(Z,Jp),e(Jp,vv),e(Z,Iv),e(Z,Up),e(Up,Jv),e(Z,Uv),e(Z,Tp),e(Tp,Tv),e(Z,Zv),e(Z,Zp),e(Zp,jv),e(Z,Ev),e(Z,jp),e(jp,Fv),e(Z,Bv),e(Z,Ep),e(Ep,Wv),e(Z,kv),e(Z,Fp),e(Fp,Gv),e(Z,Cv),e(Z,Bp),e(Bp,Rv),e(Z,Xv),e(Z,Wp),e(Wp,xv),e(Z,Sv),e(Z,kp),e(kp,Vv),e(Z,$v),e(Z,Gp),e(Gp,Pv),e(Z,Nv),e(Z,Cp),e(Cp,Qv),e(Z,Yv),e(Z,Rp),e(Rp,Dv),e(Z,zv),e(Z,Xp),e(Xp,Hv),e(Z,qv),e(Z,xp),e(xp,Lv),e(Z,Av),ac=!0},p(n,[c]){const ka={};c&2&&(ka.$$scope={dirty:c,ctx:n}),Jt.$set(ka);const Sp={};c&2&&(Sp.$$scope={dirty:c,ctx:n}),jt.$set(Sp);const Vp={};c&2&&(Vp.$$scope={dirty:c,ctx:n}),Wt.$set(Vp);const $p={};c&2&&($p.$$scope={dirty:c,ctx:n}),Rt.$set($p);const Ga={};c&2&&(Ga.$$scope={dirty:c,ctx:n}),Vt.$set(Ga);const Pp={};c&2&&(Pp.$$scope={dirty:c,ctx:n}),Qt.$set(Pp)},i(n){ac||(_(g.$$.fragment,n),_(zt.$$.fragment,n),_(Lt.$$.fragment,n),_(tn.$$.fragment,n),_(nn.$$.fragment,n),_(sn.$$.fragment,n),_(yn.$$.fragment,n),_(Mn.$$.fragment,n),_(wn.$$.fragment,n),_(vn.$$.fragment,n),_(In.$$.fragment,n),_(Jn.$$.fragment,n),_(Un.$$.fragment,n),_(Tn.$$.fragment,n),_(Zn.$$.fragment,n),_(jn.$$.fragment,n),_(En.$$.fragment,n),_(Fn.$$.fragment,n),_(Bn.$$.fragment,n),_(Wn.$$.fragment,n),_(kn.$$.fragment,n),_(Gn.$$.fragment,n),_(Cn.$$.fragment,n),_(Rn.$$.fragment,n),_(Xn.$$.fragment,n),_(xn.$$.fragment,n),_(Yn.$$.fragment,n),_(Dn.$$.fragment,n),_(zn.$$.fragment,n),_(Jt.$$.fragment,n),_(Hn.$$.fragment,n),_(qn.$$.fragment,n),_(An.$$.fragment,n),_(On.$$.fragment,n),_(Kn.$$.fragment,n),_(ea.$$.fragment,n),_(jt.$$.fragment,n),_(ta.$$.fragment,n),_(na.$$.fragment,n),_(sa.$$.fragment,n),_(oa.$$.fragment,n),_(la.$$.fragment,n),_(ia.$$.fragment,n),_(Wt.$$.fragment,n),_(ra.$$.fragment,n),_(pa.$$.fragment,n),_(ca.$$.fragment,n),_(ma.$$.fragment,n),_(ga.$$.fragment,n),_(fa.$$.fragment,n),_(Rt.$$.fragment,n),_(ua.$$.fragment,n),_(ha.$$.fragment,n),_(ya.$$.fragment,n),_(ba.$$.fragment,n),_(Ma.$$.fragment,n),_(wa.$$.fragment,n),_(Vt.$$.fragment,n),_(va.$$.fragment,n),_(Ia.$$.fragment,n),_(Ua.$$.fragment,n),_(Ta.$$.fragment,n),_(Za.$$.fragment,n),_(ja.$$.fragment,n),_(Qt.$$.fragment,n),_(Ea.$$.fragment,n),_(Fa.$$.fragment,n),_(Wa.$$.fragment,n),ac=!0)},o(n){y(g.$$.fragment,n),y(zt.$$.fragment,n),y(Lt.$$.fragment,n),y(tn.$$.fragment,n),y(nn.$$.fragment,n),y(sn.$$.fragment,n),y(yn.$$.fragment,n),y(Mn.$$.fragment,n),y(wn.$$.fragment,n),y(vn.$$.fragment,n),y(In.$$.fragment,n),y(Jn.$$.fragment,n),y(Un.$$.fragment,n),y(Tn.$$.fragment,n),y(Zn.$$.fragment,n),y(jn.$$.fragment,n),y(En.$$.fragment,n),y(Fn.$$.fragment,n),y(Bn.$$.fragment,n),y(Wn.$$.fragment,n),y(kn.$$.fragment,n),y(Gn.$$.fragment,n),y(Cn.$$.fragment,n),y(Rn.$$.fragment,n),y(Xn.$$.fragment,n),y(xn.$$.fragment,n),y(Yn.$$.fragment,n),y(Dn.$$.fragment,n),y(zn.$$.fragment,n),y(Jt.$$.fragment,n),y(Hn.$$.fragment,n),y(qn.$$.fragment,n),y(An.$$.fragment,n),y(On.$$.fragment,n),y(Kn.$$.fragment,n),y(ea.$$.fragment,n),y(jt.$$.fragment,n),y(ta.$$.fragment,n),y(na.$$.fragment,n),y(sa.$$.fragment,n),y(oa.$$.fragment,n),y(la.$$.fragment,n),y(ia.$$.fragment,n),y(Wt.$$.fragment,n),y(ra.$$.fragment,n),y(pa.$$.fragment,n),y(ca.$$.fragment,n),y(ma.$$.fragment,n),y(ga.$$.fragment,n),y(fa.$$.fragment,n),y(Rt.$$.fragment,n),y(ua.$$.fragment,n),y(ha.$$.fragment,n),y(ya.$$.fragment,n),y(ba.$$.fragment,n),y(Ma.$$.fragment,n),y(wa.$$.fragment,n),y(Vt.$$.fragment,n),y(va.$$.fragment,n),y(Ia.$$.fragment,n),y(Ua.$$.fragment,n),y(Ta.$$.fragment,n),y(Za.$$.fragment,n),y(ja.$$.fragment,n),y(Qt.$$.fragment,n),y(Ea.$$.fragment,n),y(Fa.$$.fragment,n),y(Wa.$$.fragment,n),ac=!1},d(n){t(w),n&&t(x),n&&t(C),b(g),n&&t(Np),n&&t(Re),b(zt),n&&t(Qp),n&&t(Xa),n&&t(Yp),n&&t(le),n&&t(Dp),n&&t(Xe),b(Lt),n&&t(zp),n&&t(xa),n&&t(Hp),n&&t(ie),n&&t(qp),b(tn,n),n&&t(Lp),n&&t(Va),n&&t(Ap),b(nn,n),n&&t(Op),n&&t(it),n&&t(Kp),n&&t(rt),n&&t(ed),b(sn,n),n&&t(td),n&&t($a),n&&t(nd),n&&t(V),n&&t(ad),n&&t(Ha),n&&t(sd),n&&t(re),n&&t(od),n&&t(pt),n&&t(ld),n&&t(dt),n&&t(id),n&&t(Se),b(yn),n&&t(rd),n&&t(mt),n&&t(pd),b(Mn,n),n&&t(dd),n&&t(Ve),b(wn),n&&t(cd),n&&t(pe),n&&t(md),n&&t(se),n&&t(gd),b(vn,n),n&&t(fd),n&&t($e),b(In),n&&t(ud),n&&t(de),n&&t(hd),n&&t(oe),n&&t(_d),b(Jn,n),n&&t(yd),n&&t(Pe),b(Un),n&&t(bd),n&&t(ht),n&&t(Md),b(Tn,n),n&&t(wd),n&&t(Ne),b(Zn),n&&t(vd),n&&t(as),n&&t(Id),b(jn,n),n&&t(Jd),n&&t(ss),n&&t(Ud),n&&t(yt),n&&t(Td),b(En,n),n&&t(Zd),n&&t(bt),n&&t(jd),b(Fn,n),n&&t(Ed),n&&t(os),n&&t(Fd),b(Bn,n),n&&t(Bd),n&&t(ce),n&&t(Wd),b(Wn,n),n&&t(kd),n&&t(Qe),b(kn),n&&t(Gd),n&&t(is),n&&t(Cd),n&&t(rs),n&&t(Rd),b(Gn,n),n&&t(Xd),n&&t(ps),n&&t(xd),b(Cn,n),n&&t(Sd),n&&t(ds),n&&t(Vd),b(Rn,n),n&&t($d),n&&t(cs),n&&t(Pd),b(Xn,n),n&&t(Nd),n&&t(Ye),b(xn),n&&t(Qd),n&&t(vt),n&&t(Yd),n&&t(Ke),b(Yn),n&&t(Dd),n&&t(N),b(Dn),b(zn),b(Jt),b(Hn),b(qn),b(An),n&&t(zd),n&&t(et),b(On),n&&t(Hd),n&&t(Q),b(Kn),b(ea),b(jt),b(ta),b(na),b(sa),n&&t(qd),n&&t(tt),b(oa),n&&t(Ld),n&&t(Y),b(la),b(ia),b(Wt),b(ra),b(pa),b(ca),n&&t(Ad),n&&t(nt),b(ma),n&&t(Od),n&&t(D),b(ga),b(fa),b(Rt),b(ua),b(ha),b(ya),n&&t(Kd),n&&t(at),b(ba),n&&t(ec),n&&t(z),b(Ma),b(wa),b(Vt),b(va),b(Ia),b(Ua),n&&t(tc),n&&t(st),b(Ta),n&&t(nc),n&&t(H),b(Za),b(ja),b(Qt),b(Ea),b(Fa),b(Wa)}}}const hZ={local:"if",sections:[{local:"overview",title:"Overview"},{local:"usage",sections:[{local:"texttoimage-generation",title:"Text-to-Image Generation"},{local:"text-guided-imagetoimage-generation",title:"Text Guided Image-to-Image Generation"},{local:"text-guided-inpainting-generation",title:"Text Guided Inpainting Generation"},{local:"converting-between-different-pipelines",title:"Converting between different pipelines"},{local:"optimizing-for-speed",title:"Optimizing for speed"},{local:"optimizing-for-memory",title:"Optimizing for memory"}],title:"Usage"},{local:"available-pipelines",title:"Available Pipelines:"},{local:"diffusers.IFPipeline",title:"IFPipeline"},{local:"diffusers.IFSuperResolutionPipeline",title:"IFSuperResolutionPipeline"},{local:"diffusers.IFImg2ImgPipeline",title:"IFImg2ImgPipeline"},{local:"diffusers.IFImg2ImgSuperResolutionPipeline",title:"IFImg2ImgSuperResolutionPipeline"},{local:"diffusers.IFInpaintingPipeline",title:"IFInpaintingPipeline"},{local:"diffusers.IFInpaintingSuperResolutionPipeline",title:"IFInpaintingSuperResolutionPipeline"}],title:"IF"};function _Z(q){return rZ(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class IZ extends sZ{constructor(w){super();oZ(this,w,_Z,uZ,lZ,{})}}export{IZ as default,hZ as metadata};
