import{S as r$,i as l$,s as p$,e as s,k as l,w as f,t as o,M as d$,c as i,d as t,m as p,a as r,x as u,h as a,b as d,N as i$,G as e,g as c,y as _,q as h,o as v,B as b,v as m$,L as Ya}from"../../../chunks/vendor-hf-doc-builder.js";import{D as R}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as M}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as U}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ha}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function c$(J){let y,N,S,I,L;return I=new M({props:{code:`from diffusers import IFPipeline, IFSuperResolutionPipeline, DiffusionPipeline
from diffusers.utils import pt_to_pil
import torch

pipe = IFPipeline.from_pretrained("DeepFloyd/IF-I-IF-v1.0", variant="fp16", torch_dtype=torch.float16)
pipe.enable_model_cpu_offload()

prompt = 'a photo of a kangaroo wearing an orange hoodie and blue sunglasses standing in front of the eiffel tower holding a sign that says "very deep learning"'
prompt_embeds, negative_embeds = pipe.encode_prompt(prompt)

image = pipe(prompt_embeds=prompt_embeds, negative_prompt_embeds=negative_embeds, output_type="pt").images

# save intermediate image
pil_image = pt_to_pil(image)
pil_image[0].save("./if_stage_I.png")

super_res_1_pipe = IFSuperResolutionPipeline.from_pretrained(
    "DeepFloyd/IF-II-L-v1.0", text_encoder=None, variant="fp16", torch_dtype=torch.float16
)
super_res_1_pipe.enable_model_cpu_offload()

image = super_res_1_pipe(
    image=image, prompt_embeds=prompt_embeds, negative_prompt_embeds=negative_embeds, output_type="pt"
).images

# save intermediate image
pil_image = pt_to_pil(image)
pil_image[0].save("./if_stage_I.png")

safety_modules = {
    "feature_extractor": pipe.feature_extractor,
    "safety_checker": pipe.safety_checker,
    "watermarker": pipe.watermarker,
}
super_res_2_pipe = DiffusionPipeline.from_pretrained(
    "stabilityai/stable-diffusion-x4-upscaler", **safety_modules, torch_dtype=torch.float16
)
super_res_2_pipe.enable_model_cpu_offload()

image = super_res_2_pipe(
    prompt=prompt,
    image=image,
).images
image[0].save("./if_stage_II.png")`,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-IF-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(){y=s("p"),N=o("Examples:"),S=l(),f(I.$$.fragment)},l(g){y=i(g,"P",{});var O=r(y);N=a(O,"Examples:"),O.forEach(t),S=p(g),u(I.$$.fragment,g)},m(g,O){c(g,y,O),e(y,N),c(g,S,O),_(I,g,O),L=!0},p:Ya,i(g){L||(h(I.$$.fragment,g),L=!0)},o(g){v(I.$$.fragment,g),L=!1},d(g){g&&t(y),g&&t(S),b(I,g)}}}function g$(J){let y,N,S,I,L;return I=new M({props:{code:`from diffusers import IFPipeline, IFSuperResolutionPipeline, DiffusionPipeline
from diffusers.utils import pt_to_pil
import torch

pipe = IFPipeline.from_pretrained("DeepFloyd/IF-I-IF-v1.0", variant="fp16", torch_dtype=torch.float16)
pipe.enable_model_cpu_offload()

prompt = 'a photo of a kangaroo wearing an orange hoodie and blue sunglasses standing in front of the eiffel tower holding a sign that says "very deep learning"'
prompt_embeds, negative_embeds = pipe.encode_prompt(prompt)

image = pipe(prompt_embeds=prompt_embeds, negative_prompt_embeds=negative_embeds, output_type="pt").images

# save intermediate image
pil_image = pt_to_pil(image)
pil_image[0].save("./if_stage_I.png")

super_res_1_pipe = IFSuperResolutionPipeline.from_pretrained(
    "DeepFloyd/IF-II-L-v1.0", text_encoder=None, variant="fp16", torch_dtype=torch.float16
)
super_res_1_pipe.enable_model_cpu_offload()

image = super_res_1_pipe(
    image=image, prompt_embeds=prompt_embeds, negative_prompt_embeds=negative_embeds
).images
image[0].save("./if_stage_II.png")`,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-IF-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(){y=s("p"),N=o("Examples:"),S=l(),f(I.$$.fragment)},l(g){y=i(g,"P",{});var O=r(y);N=a(O,"Examples:"),O.forEach(t),S=p(g),u(I.$$.fragment,g)},m(g,O){c(g,y,O),e(y,N),c(g,S,O),_(I,g,O),L=!0},p:Ya,i(g){L||(h(I.$$.fragment,g),L=!0)},o(g){v(I.$$.fragment,g),L=!1},d(g){g&&t(y),g&&t(S),b(I,g)}}}function f$(J){let y,N,S,I,L;return I=new M({props:{code:`from diffusers import IFImg2ImgPipeline, IFImg2ImgSuperResolutionPipeline, DiffusionPipeline
from diffusers.utils import pt_to_pil
import torch
from PIL import Image
import requests
from io import BytesIO

url = "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg"
response = requests.get(url)
original_image = Image.open(BytesIO(response.content)).convert("RGB")
original_image = original_image.resize((768, 512))

pipe = IFImg2ImgPipeline.from_pretrained(
    "DeepFloyd/IF-I-IF-v1.0",
    variant="fp16",
    torch_dtype=torch.float16,
)
pipe.enable_model_cpu_offload()

prompt = "A fantasy landscape in style minecraft"
prompt_embeds, negative_embeds = pipe.encode_prompt(prompt)

image = pipe(
    image=original_image,
    prompt_embeds=prompt_embeds,
    negative_prompt_embeds=negative_embeds,
    output_type="pt",
).images

# save intermediate image
pil_image = pt_to_pil(image)
pil_image[0].save("./if_stage_I.png")

super_res_1_pipe = IFImg2ImgSuperResolutionPipeline.from_pretrained(
    "DeepFloyd/IF-II-L-v1.0",
    text_encoder=None,
    variant="fp16",
    torch_dtype=torch.float16,
)
super_res_1_pipe.enable_model_cpu_offload()

image = super_res_1_pipe(
    image=image,
    original_image=original_image,
    prompt_embeds=prompt_embeds,
    negative_prompt_embeds=negative_embeds,
).images
image[0].save("./if_stage_II.png")`,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-IF-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(){y=s("p"),N=o("Examples:"),S=l(),f(I.$$.fragment)},l(g){y=i(g,"P",{});var O=r(y);N=a(O,"Examples:"),O.forEach(t),S=p(g),u(I.$$.fragment,g)},m(g,O){c(g,y,O),e(y,N),c(g,S,O),_(I,g,O),L=!0},p:Ya,i(g){L||(h(I.$$.fragment,g),L=!0)},o(g){v(I.$$.fragment,g),L=!1},d(g){g&&t(y),g&&t(S),b(I,g)}}}function u$(J){let y,N,S,I,L;return I=new M({props:{code:`from diffusers import IFImg2ImgPipeline, IFImg2ImgSuperResolutionPipeline, DiffusionPipeline
from diffusers.utils import pt_to_pil
import torch
from PIL import Image
import requests
from io import BytesIO

url = "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg"
response = requests.get(url)
original_image = Image.open(BytesIO(response.content)).convert("RGB")
original_image = original_image.resize((768, 512))

pipe = IFImg2ImgPipeline.from_pretrained(
    "DeepFloyd/IF-I-IF-v1.0",
    variant="fp16",
    torch_dtype=torch.float16,
)
pipe.enable_model_cpu_offload()

prompt = "A fantasy landscape in style minecraft"
prompt_embeds, negative_embeds = pipe.encode_prompt(prompt)

image = pipe(
    image=original_image,
    prompt_embeds=prompt_embeds,
    negative_prompt_embeds=negative_embeds,
    output_type="pt",
).images

# save intermediate image
pil_image = pt_to_pil(image)
pil_image[0].save("./if_stage_I.png")

super_res_1_pipe = IFImg2ImgSuperResolutionPipeline.from_pretrained(
    "DeepFloyd/IF-II-L-v1.0",
    text_encoder=None,
    variant="fp16",
    torch_dtype=torch.float16,
)
super_res_1_pipe.enable_model_cpu_offload()

image = super_res_1_pipe(
    image=image,
    original_image=original_image,
    prompt_embeds=prompt_embeds,
    negative_prompt_embeds=negative_embeds,
).images
image[0].save("./if_stage_II.png")`,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-IF-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(){y=s("p"),N=o("Examples:"),S=l(),f(I.$$.fragment)},l(g){y=i(g,"P",{});var O=r(y);N=a(O,"Examples:"),O.forEach(t),S=p(g),u(I.$$.fragment,g)},m(g,O){c(g,y,O),e(y,N),c(g,S,O),_(I,g,O),L=!0},p:Ya,i(g){L||(h(I.$$.fragment,g),L=!0)},o(g){v(I.$$.fragment,g),L=!1},d(g){g&&t(y),g&&t(S),b(I,g)}}}function _$(J){let y,N,S,I,L;return I=new M({props:{code:`from diffusers import IFInpaintingPipeline, IFInpaintingSuperResolutionPipeline, DiffusionPipeline
from diffusers.utils import pt_to_pil
import torch
from PIL import Image
import requests
from io import BytesIO

url = "https://huggingface.co/datasets/diffusers/docs-images/resolve/main/if/person.png"
response = requests.get(url)
original_image = Image.open(BytesIO(response.content)).convert("RGB")
original_image = original_image

url = "https://huggingface.co/datasets/diffusers/docs-images/resolve/main/if/glasses_mask.png"
response = requests.get(url)
mask_image = Image.open(BytesIO(response.content))
mask_image = mask_image

pipe = IFInpaintingPipeline.from_pretrained(
    "DeepFloyd/IF-I-IF-v1.0", variant="fp16", torch_dtype=torch.float16
)
pipe.enable_model_cpu_offload()

prompt = "blue sunglasses"
prompt_embeds, negative_embeds = pipe.encode_prompt(prompt)

image = pipe(
    image=original_image,
    mask_image=mask_image,
    prompt_embeds=prompt_embeds,
    negative_prompt_embeds=negative_embeds,
    output_type="pt",
).images

# save intermediate image
pil_image = pt_to_pil(image)
pil_image[0].save("./if_stage_I.png")

super_res_1_pipe = IFInpaintingSuperResolutionPipeline.from_pretrained(
    "DeepFloyd/IF-II-L-v1.0", text_encoder=None, variant="fp16", torch_dtype=torch.float16
)
super_res_1_pipe.enable_model_cpu_offload()

image = super_res_1_pipe(
    image=image,
    mask_image=mask_image,
    original_image=original_image,
    prompt_embeds=prompt_embeds,
    negative_prompt_embeds=negative_embeds,
).images
image[0].save("./if_stage_II.png")`,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-IF-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(){y=s("p"),N=o("Examples:"),S=l(),f(I.$$.fragment)},l(g){y=i(g,"P",{});var O=r(y);N=a(O,"Examples:"),O.forEach(t),S=p(g),u(I.$$.fragment,g)},m(g,O){c(g,y,O),e(y,N),c(g,S,O),_(I,g,O),L=!0},p:Ya,i(g){L||(h(I.$$.fragment,g),L=!0)},o(g){v(I.$$.fragment,g),L=!1},d(g){g&&t(y),g&&t(S),b(I,g)}}}function h$(J){let y,N,S,I,L;return I=new M({props:{code:`from diffusers import IFInpaintingPipeline, IFInpaintingSuperResolutionPipeline, DiffusionPipeline
from diffusers.utils import pt_to_pil
import torch
from PIL import Image
import requests
from io import BytesIO

url = "https://huggingface.co/datasets/diffusers/docs-images/resolve/main/if/person.png"
response = requests.get(url)
original_image = Image.open(BytesIO(response.content)).convert("RGB")
original_image = original_image

url = "https://huggingface.co/datasets/diffusers/docs-images/resolve/main/if/glasses_mask.png"
response = requests.get(url)
mask_image = Image.open(BytesIO(response.content))
mask_image = mask_image

pipe = IFInpaintingPipeline.from_pretrained(
    "DeepFloyd/IF-I-IF-v1.0", variant="fp16", torch_dtype=torch.float16
)
pipe.enable_model_cpu_offload()

prompt = "blue sunglasses"

prompt_embeds, negative_embeds = pipe.encode_prompt(prompt)
image = pipe(
    image=original_image,
    mask_image=mask_image,
    prompt_embeds=prompt_embeds,
    negative_prompt_embeds=negative_embeds,
    output_type="pt",
).images

# save intermediate image
pil_image = pt_to_pil(image)
pil_image[0].save("./if_stage_I.png")

super_res_1_pipe = IFInpaintingSuperResolutionPipeline.from_pretrained(
    "DeepFloyd/IF-II-L-v1.0", text_encoder=None, variant="fp16", torch_dtype=torch.float16
)
super_res_1_pipe.enable_model_cpu_offload()

image = super_res_1_pipe(
    image=image,
    mask_image=mask_image,
    original_image=original_image,
    prompt_embeds=prompt_embeds,
    negative_prompt_embeds=negative_embeds,
).images
image[0].save("./if_stage_II.png")`,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-IF-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(){y=s("p"),N=o("Examples:"),S=l(),f(I.$$.fragment)},l(g){y=i(g,"P",{});var O=r(y);N=a(O,"Examples:"),O.forEach(t),S=p(g),u(I.$$.fragment,g)},m(g,O){c(g,y,O),e(y,N),c(g,S,O),_(I,g,O),L=!0},p:Ya,i(g){L||(h(I.$$.fragment,g),L=!0)},o(g){v(I.$$.fragment,g),L=!1},d(g){g&&t(y),g&&t(S),b(I,g)}}}function v$(J){let y,N,S,I,L,g,O,Ja,Zm,Wp,Le,st,Ka,Yt,ec,Qa,tc,Vp,Mo,nc,Hp,ie,Xa,oc,ac,Za,sc,ic,Jt,rc,Kt,lc,pc,Yp,Re,it,es,Qt,dc,ts,mc,Jp,Go,cc,Kp,re,Xt,gc,Zt,fc,uc,_c,rt,hc,en,vc,bc,tn,Ic,yc,Uo,wc,ns,Fc,Qp,nn,Xp,Ao,Pc,Zp,on,ed,lt,Ec,an,$c,jc,td,pt,xc,os,kc,qc,nd,sn,od,Bo,Dc,ad,G,as,zo,Tc,Cc,ss,Wo,Oc,Sc,is,Vo,Lc,Rc,rs,Ho,Nc,Mc,ls,Yo,Gc,Uc,ps,Jo,Ac,sd,Ko,ds,Bc,id,le,rn,ms,cs,zc,Wc,Ne,gs,ln,Vc,Hc,fs,pn,Yc,Jc,us,dn,Kc,Qc,mn,_s,hs,Xc,Zc,cn,vs,gn,eg,tg,bs,fn,ng,og,un,Is,ys,ag,sg,ws,Fs,_n,ig,rd,dt,Ps,rg,lg,hn,Qo,t2,ld,mt,Es,pg,dg,vn,Xo,n2,pd,Me,ct,$s,bn,mg,js,cg,dd,gt,gg,In,fg,ug,md,yn,cd,Ge,ft,xs,wn,_g,ks,hg,gd,pe,vg,Zo,bg,Ig,ea,yg,wg,fd,ae,qs,Fg,Pg,Ds,Eg,$g,ta,jg,xg,ud,Fn,_d,Ue,ut,Ts,Pn,kg,Cs,qg,hd,de,Dg,na,Tg,Cg,oa,Og,Sg,vd,se,Os,Lg,Rg,Ss,Ng,Mg,aa,Gg,Ug,bd,En,Id,Ae,_t,Ls,$n,Ag,Rs,Bg,yd,ht,zg,Ns,Wg,Vg,wd,jn,Fd,Be,vt,Ms,xn,Hg,Gs,Yg,Pd,sa,Jg,Ed,kn,$d,ia,Kg,jd,bt,Qg,Us,Xg,Zg,xd,qn,kd,It,ef,As,tf,nf,qd,Dn,Dd,ra,of,Td,Tn,Cd,me,af,la,Bs,sf,rf,zs,lf,pf,Od,Cn,Sd,ze,yt,Ws,On,df,Vs,mf,Ld,pa,cf,Rd,da,gf,Nd,Sn,Md,ma,ff,Gd,Ln,Ud,ca,uf,Ad,Rn,Bd,ga,_f,zd,Nn,Wd,We,wt,Hs,Mn,hf,Ys,vf,Vd,Ft,Js,Ve,Ks,bf,If,Qs,yf,wf,fa,Ff,Pf,A,He,Xs,Gn,Ef,$f,Zs,ei,jf,xf,ua,kf,qf,Ye,ti,Un,Df,Tf,ni,oi,Cf,Of,_a,Sf,Lf,Je,ai,An,Rf,Nf,si,ii,Mf,Gf,ha,Uf,Af,Ke,ri,Bn,Bf,zf,li,pi,Wf,Vf,va,Hf,Yf,Qe,di,zn,Jf,Kf,mi,ci,Qf,Xf,ba,Zf,eu,Xe,gi,Wn,tu,nu,fi,ui,ou,au,Ia,su,Hd,Ze,Pt,_i,Vn,iu,hi,ru,Yd,B,Hn,lu,ce,Yn,pu,vi,du,mu,Et,cu,$t,Jn,gu,K,fu,bi,uu,_u,Ii,hu,vu,yi,bu,Iu,wi,yu,wu,Fu,jt,Kn,Pu,Qn,Eu,Fi,$u,ju,xu,ge,Xn,ku,Pi,qu,Du,w,Tu,Ei,Cu,Ou,$i,Su,Lu,ji,Ru,Nu,xi,Mu,Gu,ki,Uu,Au,qi,Bu,zu,Di,Wu,Vu,Ti,Hu,Yu,Ci,Ju,Ku,Oi,Qu,Xu,Si,Zu,e_,Li,t_,n_,Ri,o_,a_,Ni,s_,i_,Mi,r_,l_,Gi,p_,d_,Ui,m_,c_,Ai,g_,f_,Bi,u_,__,zi,h_,v_,Wi,b_,I_,Vi,y_,w_,Jd,et,xt,Hi,Zn,F_,Yi,P_,Kd,z,eo,E_,fe,to,$_,Ji,j_,x_,kt,k_,qt,no,q_,Q,D_,Ki,T_,C_,Qi,O_,S_,Xi,L_,R_,Zi,N_,M_,G_,Dt,oo,U_,ao,A_,er,B_,z_,W_,ue,so,V_,tr,H_,Y_,F,J_,nr,K_,Q_,or,X_,Z_,ar,eh,th,sr,nh,oh,ir,ah,sh,rr,ih,rh,lr,lh,ph,pr,dh,mh,dr,ch,gh,mr,fh,uh,cr,_h,hh,gr,vh,bh,fr,Ih,yh,ur,wh,Fh,_r,Ph,Eh,hr,$h,jh,vr,xh,kh,br,qh,Dh,Ir,Th,Ch,yr,Oh,Sh,wr,Lh,Rh,Fr,Nh,Mh,Qd,tt,Tt,Pr,io,Gh,Er,Uh,Xd,W,ro,Ah,_e,lo,Bh,$r,zh,Wh,Ct,Vh,Ot,po,Hh,X,Yh,jr,Jh,Kh,xr,Qh,Xh,kr,Zh,ev,qr,tv,nv,ov,St,mo,av,co,sv,Dr,iv,rv,lv,he,go,pv,Tr,dv,mv,P,cv,Cr,gv,fv,Or,uv,_v,Sr,hv,vv,Lr,bv,Iv,Rr,yv,wv,Nr,Fv,Pv,Mr,Ev,$v,Gr,jv,xv,Ur,kv,qv,Ar,Dv,Tv,Br,Cv,Ov,zr,Sv,Lv,Wr,Rv,Nv,Vr,Mv,Gv,Hr,Uv,Av,Yr,Bv,zv,Jr,Wv,Vv,Kr,Hv,Yv,Qr,Jv,Kv,Xr,Qv,Xv,Zr,Zv,eb,el,tb,nb,Zd,nt,Lt,tl,fo,ob,nl,ab,em,V,uo,sb,ve,_o,ib,ol,rb,lb,Rt,pb,Nt,ho,db,Z,mb,al,cb,gb,sl,fb,ub,il,_b,hb,rl,vb,bb,Ib,Mt,vo,yb,bo,wb,ll,Fb,Pb,Eb,be,Io,$b,pl,jb,xb,E,kb,dl,qb,Db,ml,Tb,Cb,cl,Ob,Sb,gl,Lb,Rb,fl,Nb,Mb,ul,Gb,Ub,_l,Ab,Bb,hl,zb,Wb,vl,Vb,Hb,bl,Yb,Jb,Il,Kb,Qb,yl,Xb,Zb,wl,eI,tI,Fl,nI,oI,Pl,aI,sI,El,iI,rI,$l,lI,pI,jl,dI,mI,xl,cI,gI,kl,fI,uI,ql,_I,hI,Dl,vI,bI,tm,ot,Gt,Tl,yo,II,Cl,yI,nm,H,wo,wI,Ie,Fo,FI,Ol,PI,EI,Ut,$I,At,Po,jI,ee,xI,Sl,kI,qI,Ll,DI,TI,Rl,CI,OI,Nl,SI,LI,RI,Bt,Eo,NI,$o,MI,Ml,GI,UI,AI,ye,jo,BI,Gl,zI,WI,$,VI,Ul,HI,YI,Al,JI,KI,Bl,QI,XI,zl,ZI,e1,Wl,t1,n1,Vl,o1,a1,Hl,s1,i1,Yl,r1,l1,Jl,p1,d1,Kl,m1,c1,Ql,g1,f1,Xl,u1,_1,Zl,h1,v1,ep,b1,I1,tp,y1,w1,np,F1,P1,op,E1,$1,ap,j1,x1,sp,k1,q1,ip,D1,T1,rp,C1,O1,lp,S1,L1,om,at,zt,pp,xo,R1,dp,N1,am,Y,ko,M1,we,qo,G1,mp,U1,A1,Wt,B1,Vt,Do,z1,te,W1,cp,V1,H1,gp,Y1,J1,fp,K1,Q1,up,X1,Z1,ey,Ht,To,ty,Co,ny,_p,oy,ay,sy,Fe,Oo,iy,hp,ry,ly,j,py,vp,dy,my,bp,cy,gy,Ip,fy,uy,yp,_y,hy,wp,vy,by,Fp,Iy,yy,Pp,wy,Fy,Ep,Py,Ey,$p,$y,jy,jp,xy,ky,xp,qy,Dy,kp,Ty,Cy,qp,Oy,Sy,Dp,Ly,Ry,Tp,Ny,My,Cp,Gy,Uy,Op,Ay,By,Sp,zy,Wy,Lp,Vy,Hy,Rp,Yy,Jy,Np,Ky,Qy,Mp,Xy,Zy,sm;return g=new U({}),Yt=new U({}),Qt=new U({}),nn=new M({props:{code:"pip install huggingface_hub --upgrade",highlighted:"pip install huggingface_hub --upgrade"}}),on=new M({props:{code:`from huggingface_hub import login

login()`,highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> login

login()`}}),sn=new M({props:{code:"pip install diffusers accelerate transformers safetensors",highlighted:"pip install diffusers accelerate transformers safetensors"}}),bn=new U({}),yn=new M({props:{code:`from diffusers import DiffusionPipeline
from diffusers.utils import pt_to_pil
import torch

# stage 1
stage_1 = DiffusionPipeline.from_pretrained("DeepFloyd/IF-I-IF-v1.0", variant="fp16", torch_dtype=torch.float16)
stage_1.enable_model_cpu_offload()

# stage 2
stage_2 = DiffusionPipeline.from_pretrained(
    "DeepFloyd/IF-II-L-v1.0", text_encoder=None, variant="fp16", torch_dtype=torch.float16
)
stage_2.enable_model_cpu_offload()

# stage 3
safety_modules = {
    "feature_extractor": stage_1.feature_extractor,
    "safety_checker": stage_1.safety_checker,
    "watermarker": stage_1.watermarker,
}
stage_3 = DiffusionPipeline.from_pretrained(
    "stabilityai/stable-diffusion-x4-upscaler", **safety_modules, torch_dtype=torch.float16
)
stage_3.enable_model_cpu_offload()

prompt = 'a photo of a kangaroo wearing an orange hoodie and blue sunglasses standing in front of the eiffel tower holding a sign that says "very deep learning"'
generator = torch.manual_seed(1)

# text embeds
prompt_embeds, negative_embeds = stage_1.encode_prompt(prompt)

# stage 1
image = stage_1(
    prompt_embeds=prompt_embeds, negative_prompt_embeds=negative_embeds, generator=generator, output_type="pt"
).images
pt_to_pil(image)[0].save("./if_stage_I.png")

# stage 2
image = stage_2(
    image=image,
    prompt_embeds=prompt_embeds,
    negative_prompt_embeds=negative_embeds,
    generator=generator,
    output_type="pt",
).images
pt_to_pil(image)[0].save("./if_stage_II.png")

# stage 3
image = stage_3(prompt=prompt, image=image, noise_level=100, generator=generator).images
image[0].save("./if_stage_III.png")`,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-IF-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 U({}),Fn=new M({props:{code:`from diffusers import IFImg2ImgPipeline, IFImg2ImgSuperResolutionPipeline, DiffusionPipeline
from diffusers.utils import pt_to_pil

import torch

from PIL import Image
import requests
from io import BytesIO

# download image
url = "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg"
response = requests.get(url)
original_image = Image.open(BytesIO(response.content)).convert("RGB")
original_image = original_image.resize((768, 512))

# stage 1
stage_1 = IFImg2ImgPipeline.from_pretrained("DeepFloyd/IF-I-IF-v1.0", variant="fp16", torch_dtype=torch.float16)
stage_1.enable_model_cpu_offload()

# stage 2
stage_2 = IFImg2ImgSuperResolutionPipeline.from_pretrained(
    "DeepFloyd/IF-II-L-v1.0", text_encoder=None, variant="fp16", torch_dtype=torch.float16
)
stage_2.enable_model_cpu_offload()

# stage 3
safety_modules = {
    "feature_extractor": stage_1.feature_extractor,
    "safety_checker": stage_1.safety_checker,
    "watermarker": stage_1.watermarker,
}
stage_3 = DiffusionPipeline.from_pretrained(
    "stabilityai/stable-diffusion-x4-upscaler", **safety_modules, torch_dtype=torch.float16
)
stage_3.enable_model_cpu_offload()

prompt = "A fantasy landscape in style minecraft"
generator = torch.manual_seed(1)

# text embeds
prompt_embeds, negative_embeds = stage_1.encode_prompt(prompt)

# stage 1
image = stage_1(
    image=original_image,
    prompt_embeds=prompt_embeds,
    negative_prompt_embeds=negative_embeds,
    generator=generator,
    output_type="pt",
).images
pt_to_pil(image)[0].save("./if_stage_I.png")

# stage 2
image = stage_2(
    image=image,
    original_image=original_image,
    prompt_embeds=prompt_embeds,
    negative_prompt_embeds=negative_embeds,
    generator=generator,
    output_type="pt",
).images
pt_to_pil(image)[0].save("./if_stage_II.png")

# stage 3
image = stage_3(prompt=prompt, image=image, generator=generator, noise_level=100).images
image[0].save("./if_stage_III.png")`,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-IF-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>)`}}),Pn=new U({}),En=new M({props:{code:`from diffusers import IFInpaintingPipeline, IFInpaintingSuperResolutionPipeline, DiffusionPipeline
from diffusers.utils import pt_to_pil
import torch

from PIL import Image
import requests
from io import BytesIO

# download image
url = "https://huggingface.co/datasets/diffusers/docs-images/resolve/main/if/person.png"
response = requests.get(url)
original_image = Image.open(BytesIO(response.content)).convert("RGB")
original_image = original_image

# download mask
url = "https://huggingface.co/datasets/diffusers/docs-images/resolve/main/if/glasses_mask.png"
response = requests.get(url)
mask_image = Image.open(BytesIO(response.content))
mask_image = mask_image

# stage 1
stage_1 = IFInpaintingPipeline.from_pretrained("DeepFloyd/IF-I-IF-v1.0", variant="fp16", torch_dtype=torch.float16)
stage_1.enable_model_cpu_offload()

# stage 2
stage_2 = IFInpaintingSuperResolutionPipeline.from_pretrained(
    "DeepFloyd/IF-II-L-v1.0", text_encoder=None, variant="fp16", torch_dtype=torch.float16
)
stage_2.enable_model_cpu_offload()

# stage 3
safety_modules = {
    "feature_extractor": stage_1.feature_extractor,
    "safety_checker": stage_1.safety_checker,
    "watermarker": stage_1.watermarker,
}
stage_3 = DiffusionPipeline.from_pretrained(
    "stabilityai/stable-diffusion-x4-upscaler", **safety_modules, torch_dtype=torch.float16
)
stage_3.enable_model_cpu_offload()

prompt = "blue sunglasses"
generator = torch.manual_seed(1)

# text embeds
prompt_embeds, negative_embeds = stage_1.encode_prompt(prompt)

# stage 1
image = stage_1(
    image=original_image,
    mask_image=mask_image,
    prompt_embeds=prompt_embeds,
    negative_prompt_embeds=negative_embeds,
    generator=generator,
    output_type="pt",
).images
pt_to_pil(image)[0].save("./if_stage_I.png")

# stage 2
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="pt",
).images
pt_to_pil(image)[0].save("./if_stage_II.png")

# stage 3
image = stage_3(prompt=prompt, image=image, generator=generator, noise_level=100).images
image[0].save("./if_stage_III.png")`,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-IF-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>)`}}),$n=new U({}),jn=new M({props:{code:`from diffusers import IFPipeline, IFSuperResolutionPipeline

pipe_1 = IFPipeline.from_pretrained("DeepFloyd/IF-I-IF-v1.0")
pipe_2 = IFSuperResolutionPipeline.from_pretrained("DeepFloyd/IF-II-L-v1.0")


from diffusers import IFImg2ImgPipeline, IFImg2ImgSuperResolutionPipeline

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


from diffusers import IFInpaintingPipeline, IFInpaintingSuperResolutionPipeline

pipe_1 = IFInpaintingPipeline(**pipe_1.components)
pipe_2 = IFInpaintingSuperResolutionPipeline(**pipe_2.components)`,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-IF-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)`}}),xn=new U({}),kn=new M({props:{code:`pipe = DiffusionPipeline.from_pretrained("DeepFloyd/IF-I-IF-v1.0", variant="fp16", torch_dtype=torch.float16)
pipe.to("cuda")`,highlighted:`pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;DeepFloyd/IF-I-IF-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>)`}}),qn=new M({props:{code:'pipe("<prompt>", num_inference_steps=30)',highlighted:'pipe(<span class="hljs-string">&quot;&lt;prompt&gt;&quot;</span>, num_inference_steps=<span class="hljs-number">30</span>)'}}),Dn=new M({props:{code:`from diffusers.pipelines.deepfloyd_if import fast27_timesteps

pipe("<prompt>", timesteps=fast27_timesteps)`,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)`}}),Tn=new M({props:{code:`pipe = IFImg2ImgPipeline.from_pretrained("DeepFloyd/IF-I-IF-v1.0", variant="fp16", torch_dtype=torch.float16)
pipe.to("cuda")

image = pipe(image=image, prompt="<prompt>", strength=0.3).images`,highlighted:`pipe = IFImg2ImgPipeline.from_pretrained(<span class="hljs-string">&quot;DeepFloyd/IF-I-IF-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`}}),Cn=new M({props:{code:`import torch

pipe = DiffusionPipeline.from_pretrained("DeepFloyd/IF-I-IF-v1.0", variant="fp16", torch_dtype=torch.float16)
pipe.to("cuda")

pipe.text_encoder = torch.compile(pipe.text_encoder)
pipe.unet = torch.compile(pipe.unet)`,highlighted:`<span class="hljs-keyword">import</span> torch

pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;DeepFloyd/IF-I-IF-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)`}}),On=new U({}),Sn=new M({props:{code:`pipe = DiffusionPipeline.from_pretrained("DeepFloyd/IF-I-IF-v1.0", variant="fp16", torch_dtype=torch.float16)
pipe.enable_model_cpu_offload()`,highlighted:`pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;DeepFloyd/IF-I-IF-v1.0&quot;</span>, variant=<span class="hljs-string">&quot;fp16&quot;</span>, torch_dtype=torch.float16)
pipe.enable_model_cpu_offload()`}}),Ln=new M({props:{code:`pipe = DiffusionPipeline.from_pretrained("DeepFloyd/IF-I-IF-v1.0", variant="fp16", torch_dtype=torch.float16)
pipe.enable_sequential_cpu_offload()`,highlighted:`pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;DeepFloyd/IF-I-IF-v1.0&quot;</span>, variant=<span class="hljs-string">&quot;fp16&quot;</span>, torch_dtype=torch.float16)
pipe.enable_sequential_cpu_offload()`}}),Rn=new M({props:{code:`from transformers import T5EncoderModel

text_encoder = T5EncoderModel.from_pretrained(
    "DeepFloyd/IF-I-IF-v1.0", subfolder="text_encoder", device_map="auto", load_in_8bit=True, variant="8bit"
)

from diffusers import DiffusionPipeline

pipe = DiffusionPipeline.from_pretrained(
    "DeepFloyd/IF-I-IF-v1.0",
    text_encoder=text_encoder,  # pass the previously instantiated 8bit text encoder
    unet=None,
    device_map="auto",
)

prompt_embeds, negative_embeds = pipe.encode_prompt("<prompt>")`,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-IF-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-IF-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>)`}}),Nn=new M({props:{code:`from diffusers import IFPipeline, IFSuperResolutionPipeline
import torch
import gc
from transformers import T5EncoderModel
from diffusers.utils import pt_to_pil

text_encoder = T5EncoderModel.from_pretrained(
    "DeepFloyd/IF-I-IF-v1.0", subfolder="text_encoder", device_map="auto", load_in_8bit=True, variant="8bit"
)

# text to image

pipe = DiffusionPipeline.from_pretrained(
    "DeepFloyd/IF-I-IF-v1.0",
    text_encoder=text_encoder,  # pass the previously instantiated 8bit text encoder
    unet=None,
    device_map="auto",
)

prompt = 'a photo of a kangaroo wearing an orange hoodie and blue sunglasses standing in front of the eiffel tower holding a sign that says "very deep learning"'
prompt_embeds, negative_embeds = pipe.encode_prompt(prompt)

# Remove the pipeline so we can re-load the pipeline with the unet
del text_encoder
del pipe
gc.collect()
torch.cuda.empty_cache()

pipe = IFPipeline.from_pretrained(
    "DeepFloyd/IF-I-IF-v1.0", text_encoder=None, variant="fp16", torch_dtype=torch.float16, device_map="auto"
)

generator = torch.Generator().manual_seed(0)
image = pipe(
    prompt_embeds=prompt_embeds,
    negative_prompt_embeds=negative_embeds,
    output_type="pt",
    generator=generator,
).images

pt_to_pil(image)[0].save("./if_stage_I.png")

# Remove the pipeline so we can load the super-resolution pipeline
del pipe
gc.collect()
torch.cuda.empty_cache()

# First super resolution

pipe = IFSuperResolutionPipeline.from_pretrained(
    "DeepFloyd/IF-II-L-v1.0", text_encoder=None, variant="fp16", torch_dtype=torch.float16, device_map="auto"
)

generator = torch.Generator().manual_seed(0)
image = pipe(
    image=image,
    prompt_embeds=prompt_embeds,
    negative_prompt_embeds=negative_embeds,
    output_type="pt",
    generator=generator,
).images

pt_to_pil(image)[0].save("./if_stage_II.png")`,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-IF-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-IF-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-IF-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>)`}}),Mn=new U({}),Vn=new U({}),Hn=new R({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.16.0/src/diffusers/pipelines/deepfloyd_if/pipeline_if.py#L88"}}),Yn=new R({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.16.0/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.16.0/src/diffusers/pipelines/deepfloyd_if/pipeline_if.py#L624",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>
`}}),Et=new Ha({props:{anchor:"diffusers.IFPipeline.__call__.example",$$slots:{default:[c$]},$$scope:{ctx:J}}}),Jn=new R({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.16.0/src/diffusers/pipelines/deepfloyd_if/pipeline_if.py#L170"}}),Kn=new R({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.16.0/src/diffusers/pipelines/deepfloyd_if/pipeline_if.py#L146"}}),Xn=new R({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.16.0/src/diffusers/pipelines/deepfloyd_if/pipeline_if.py#L244"}}),Zn=new U({}),eo=new R({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.16.0/src/diffusers/pipelines/deepfloyd_if/pipeline_if_superresolution.py#L73"}}),to=new R({props:{name:"__call__",anchor:"diffusers.IFSuperResolutionPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = 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__.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.16.0/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.16.0/src/diffusers/pipelines/deepfloyd_if/pipeline_if_superresolution.py#L693",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>
`}}),kt=new Ha({props:{anchor:"diffusers.IFSuperResolutionPipeline.__call__.example",$$slots:{default:[g$]},$$scope:{ctx:J}}}),no=new R({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.16.0/src/diffusers/pipelines/deepfloyd_if/pipeline_if_superresolution.py#L165"}}),oo=new R({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.16.0/src/diffusers/pipelines/deepfloyd_if/pipeline_if_superresolution.py#L140"}}),so=new R({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.16.0/src/diffusers/pipelines/deepfloyd_if/pipeline_if_superresolution.py#L380"}}),io=new U({}),ro=new R({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.16.0/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img.py#L112"}}),lo=new R({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.16.0/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.16.0/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img.py#L739",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>
`}}),Ct=new Ha({props:{anchor:"diffusers.IFImg2ImgPipeline.__call__.example",$$slots:{default:[f$]},$$scope:{ctx:J}}}),po=new R({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.16.0/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img.py#L196"}}),mo=new R({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.16.0/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img.py#L171"}}),go=new R({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.16.0/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img.py#L271"}}),fo=new U({}),uo=new R({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.16.0/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img_superresolution.py#L115"}}),_o=new R({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.16.0/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.16.0/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img_superresolution.py#L821",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 Ha({props:{anchor:"diffusers.IFImg2ImgSuperResolutionPipeline.__call__.example",$$slots:{default:[u$]},$$scope:{ctx:J}}}),ho=new R({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.16.0/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img_superresolution.py#L207"}}),vo=new R({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.16.0/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img_superresolution.py#L182"}}),Io=new R({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.16.0/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img_superresolution.py#L422"}}),yo=new U({}),wo=new R({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.16.0/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting.py#L115"}}),Fo=new R({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.16.0/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.16.0/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting.py#L831",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>
`}}),Ut=new Ha({props:{anchor:"diffusers.IFInpaintingPipeline.__call__.example",$$slots:{default:[_$]},$$scope:{ctx:J}}}),Po=new R({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.16.0/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting.py#L199"}}),Eo=new R({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.16.0/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting.py#L174"}}),jo=new R({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.16.0/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting.py#L274"}}),xo=new U({}),ko=new R({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.16.0/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting_superresolution.py#L117"}}),qo=new R({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.16.0/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.16.0/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting_superresolution.py#L909",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 Ha({props:{anchor:"diffusers.IFInpaintingSuperResolutionPipeline.__call__.example",$$slots:{default:[h$]},$$scope:{ctx:J}}}),Do=new R({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.16.0/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting_superresolution.py#L209"}}),To=new R({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.16.0/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting_superresolution.py#L184"}}),Oo=new R({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.16.0/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting_superresolution.py#L424"}}),{c(){y=s("meta"),N=l(),S=s("h1"),I=s("a"),L=s("span"),f(g.$$.fragment),O=l(),Ja=s("span"),Zm=o("IF"),Wp=l(),Le=s("h2"),st=s("a"),Ka=s("span"),f(Yt.$$.fragment),ec=l(),Qa=s("span"),tc=o("Overview"),Vp=l(),Mo=s("p"),nc=o(`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:`),Hp=l(),ie=s("ul"),Xa=s("li"),oc=o("Stage 1: a base model that generates 64x64 px image based on text prompt,"),ac=l(),Za=s("li"),sc=o("Stage 2: a 64x64 px => 256x256 px super-resolution model, and a"),ic=l(),Jt=s("li"),rc=o(`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 `),Kt=s("a"),lc=o("Stability\u2019s x4 Upscaling model"),pc=o(`.
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.`),Yp=l(),Re=s("h2"),it=s("a"),es=s("span"),f(Qt.$$.fragment),dc=l(),ts=s("span"),mc=o("Usage"),Jp=l(),Go=s("p"),cc=o("Before you can use IF, you need to accept its usage conditions. To do so:"),Kp=l(),re=s("ol"),Xt=s("li"),gc=o("Make sure to have a "),Zt=s("a"),fc=o("Hugging Face account"),uc=o(" and be loggin in"),_c=l(),rt=s("li"),hc=o("Accept the license on the model card of "),en=s("a"),vc=o("DeepFloyd/IF-I-IF-v1.0"),bc=o(" and "),tn=s("a"),Ic=o("DeepFloyd/IF-II-L-v1.0"),yc=l(),Uo=s("li"),wc=o("Make sure to login locally. Install "),ns=s("code"),Fc=o("huggingface_hub"),Qp=l(),f(nn.$$.fragment),Xp=l(),Ao=s("p"),Pc=o("run the login function in a Python shell"),Zp=l(),f(on.$$.fragment),ed=l(),lt=s("p"),Ec=o("and enter your "),an=s("a"),$c=o("Hugging Face Hub access token"),jc=o("."),td=l(),pt=s("p"),xc=o("Next we install "),os=s("code"),kc=o("diffusers"),qc=o(" and dependencies:"),nd=l(),f(sn.$$.fragment),od=l(),Bo=s("p"),Dc=o("The following sections give more in-detail examples of how to use IF. Specifically:"),ad=l(),G=s("ul"),as=s("li"),zo=s("a"),Tc=o("Text-to-Image Generation"),Cc=l(),ss=s("li"),Wo=s("a"),Oc=o("Image-to-Image Generation"),Sc=l(),is=s("li"),Vo=s("a"),Lc=o("Inpainting"),Rc=l(),rs=s("li"),Ho=s("a"),Nc=o("Reusing model weights"),Mc=l(),ls=s("li"),Yo=s("a"),Gc=o("Speed optimization"),Uc=l(),ps=s("li"),Jo=s("a"),Ac=o("Memory optimization"),sd=l(),Ko=s("p"),ds=s("strong"),Bc=o("Available checkpoints"),id=l(),le=s("ul"),rn=s("li"),ms=s("p"),cs=s("em"),zc=o("Stage-1"),Wc=l(),Ne=s("ul"),gs=s("li"),ln=s("a"),Vc=o("DeepFloyd/IF-I-IF-v1.0"),Hc=l(),fs=s("li"),pn=s("a"),Yc=o("DeepFloyd/IF-I-L-v1.0"),Jc=l(),us=s("li"),dn=s("a"),Kc=o("DeepFloyd/IF-I-M-v1.0"),Qc=l(),mn=s("li"),_s=s("p"),hs=s("em"),Xc=o("Stage-2"),Zc=l(),cn=s("ul"),vs=s("li"),gn=s("a"),eg=o("DeepFloyd/IF-II-L-v1.0"),tg=l(),bs=s("li"),fn=s("a"),ng=o("DeepFloyd/IF-II-M-v1.0"),og=l(),un=s("li"),Is=s("p"),ys=s("em"),ag=o("Stage-3"),sg=l(),ws=s("ul"),Fs=s("li"),_n=s("a"),ig=o("stabilityai/stable-diffusion-x4-upscaler"),rd=l(),dt=s("p"),Ps=s("strong"),rg=o("Demo"),lg=l(),hn=s("a"),Qo=s("img"),ld=l(),mt=s("p"),Es=s("strong"),pg=o("Google Colab"),dg=l(),vn=s("a"),Xo=s("img"),pd=l(),Me=s("h3"),ct=s("a"),$s=s("span"),f(bn.$$.fragment),mg=l(),js=s("span"),cg=o("Text-to-Image Generation"),dd=l(),gt=s("p"),gg=o("By default diffusers makes use of "),In=s("a"),fg=o("model cpu offloading"),ug=o(`
to run the whole IF pipeline with as little as 14 GB of VRAM.`),md=l(),f(yn.$$.fragment),cd=l(),Ge=s("h3"),ft=s("a"),xs=s("span"),f(wn.$$.fragment),_g=l(),ks=s("span"),hg=o("Text Guided Image-to-Image Generation"),gd=l(),pe=s("p"),vg=o(`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 `),Zo=s("a"),bg=o("IFInpaintingPipeline"),Ig=o(" and "),ea=s("a"),yg=o("IFInpaintingSuperResolutionPipeline"),wg=o(" pipelines."),fd=l(),ae=s("p"),qs=s("strong"),Fg=o("Note"),Pg=o(`: 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 `),Ds=s("code"),Eg=o("~DiffusionPipeline.components()"),$g=o(" function as explained "),ta=s("a"),jg=o("here"),xg=o("."),ud=l(),f(Fn.$$.fragment),_d=l(),Ue=s("h3"),ut=s("a"),Ts=s("span"),f(Pn.$$.fragment),kg=l(),Cs=s("span"),qg=o("Text Guided Inpainting Generation"),hd=l(),de=s("p"),Dg=o(`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 `),na=s("a"),Tg=o("IFInpaintingPipeline"),Cg=o(" and "),oa=s("a"),Og=o("IFInpaintingSuperResolutionPipeline"),Sg=o(" pipelines."),vd=l(),se=s("p"),Os=s("strong"),Lg=o("Note"),Rg=o(`: 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 `),Ss=s("code"),Ng=o("~DiffusionPipeline.components()"),Mg=o(" function as explained "),aa=s("a"),Gg=o("here"),Ug=o("."),bd=l(),f(En.$$.fragment),Id=l(),Ae=s("h3"),_t=s("a"),Ls=s("span"),f($n.$$.fragment),Ag=l(),Rs=s("span"),Bg=o("Converting between different pipelines"),yd=l(),ht=s("p"),zg=o("In addition to being loaded with "),Ns=s("code"),Wg=o("from_pretrained"),Vg=o(", Pipelines can also be loaded directly from each other."),wd=l(),f(jn.$$.fragment),Fd=l(),Be=s("h3"),vt=s("a"),Ms=s("span"),f(xn.$$.fragment),Hg=l(),Gs=s("span"),Yg=o("Optimizing for speed"),Pd=l(),sa=s("p"),Jg=o("The simplest optimization to run IF faster is to move all model components to the GPU."),Ed=l(),f(kn.$$.fragment),$d=l(),ia=s("p"),Kg=o("You can also run the diffusion process for a shorter number of timesteps."),jd=l(),bt=s("p"),Qg=o("This can either be done with the "),Us=s("code"),Xg=o("num_inference_steps"),Zg=o(" argument"),xd=l(),f(qn.$$.fragment),kd=l(),It=s("p"),ef=o("Or with the "),As=s("code"),tf=o("timesteps"),nf=o(" argument"),qd=l(),f(Dn.$$.fragment),Dd=l(),ra=s("p"),of=o(`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.`),Td=l(),f(Tn.$$.fragment),Cd=l(),me=s("p"),af=o("You can also use "),la=s("a"),Bs=s("code"),sf=o("torch.compile"),rf=o(". Note that we have not exhaustively tested "),zs=s("code"),lf=o("torch.compile"),pf=o(`
with IF and it might not give expected results.`),Od=l(),f(Cn.$$.fragment),Sd=l(),ze=s("h3"),yt=s("a"),Ws=s("span"),f(On.$$.fragment),df=l(),Vs=s("span"),mf=o("Optimizing for memory"),Ld=l(),pa=s("p"),cf=o("When optimizing for GPU memory, we can use the standard diffusers cpu offloading APIs."),Rd=l(),da=s("p"),gf=o("Either the model based CPU offloading,"),Nd=l(),f(Sn.$$.fragment),Md=l(),ma=s("p"),ff=o("or the more aggressive layer based CPU offloading."),Gd=l(),f(Ln.$$.fragment),Ud=l(),ca=s("p"),uf=o("Additionally, T5 can be loaded in 8bit precision"),Ad=l(),f(Rn.$$.fragment),Bd=l(),ga=s("p"),_f=o(`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.`),zd=l(),f(Nn.$$.fragment),Wd=l(),We=s("h2"),wt=s("a"),Hs=s("span"),f(Mn.$$.fragment),hf=l(),Ys=s("span"),vf=o("Available Pipelines:"),Vd=l(),Ft=s("table"),Js=s("thead"),Ve=s("tr"),Ks=s("th"),bf=o("Pipeline"),If=l(),Qs=s("th"),yf=o("Tasks"),wf=l(),fa=s("th"),Ff=o("Colab"),Pf=l(),A=s("tbody"),He=s("tr"),Xs=s("td"),Gn=s("a"),Ef=o("pipeline_if.py"),$f=l(),Zs=s("td"),ei=s("em"),jf=o("Text-to-Image Generation"),xf=l(),ua=s("td"),kf=o("-"),qf=l(),Ye=s("tr"),ti=s("td"),Un=s("a"),Df=o("pipeline_if_superresolution.py"),Tf=l(),ni=s("td"),oi=s("em"),Cf=o("Text-to-Image Generation"),Of=l(),_a=s("td"),Sf=o("-"),Lf=l(),Je=s("tr"),ai=s("td"),An=s("a"),Rf=o("pipeline_if_img2img.py"),Nf=l(),si=s("td"),ii=s("em"),Mf=o("Image-to-Image Generation"),Gf=l(),ha=s("td"),Uf=o("-"),Af=l(),Ke=s("tr"),ri=s("td"),Bn=s("a"),Bf=o("pipeline_if_img2img_superresolution.py"),zf=l(),li=s("td"),pi=s("em"),Wf=o("Image-to-Image Generation"),Vf=l(),va=s("td"),Hf=o("-"),Yf=l(),Qe=s("tr"),di=s("td"),zn=s("a"),Jf=o("pipeline_if_inpainting.py"),Kf=l(),mi=s("td"),ci=s("em"),Qf=o("Image-to-Image Generation"),Xf=l(),ba=s("td"),Zf=o("-"),eu=l(),Xe=s("tr"),gi=s("td"),Wn=s("a"),tu=o("pipeline_if_inpainting_superresolution.py"),nu=l(),fi=s("td"),ui=s("em"),ou=o("Image-to-Image Generation"),au=l(),Ia=s("td"),su=o("-"),Hd=l(),Ze=s("h2"),Pt=s("a"),_i=s("span"),f(Vn.$$.fragment),iu=l(),hi=s("span"),ru=o("IFPipeline"),Yd=l(),B=s("div"),f(Hn.$$.fragment),lu=l(),ce=s("div"),f(Yn.$$.fragment),pu=l(),vi=s("p"),du=o("Function invoked when calling the pipeline for generation."),mu=l(),f(Et.$$.fragment),cu=l(),$t=s("div"),f(Jn.$$.fragment),gu=l(),K=s("p"),fu=o(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),bi=s("code"),uu=o("enable_sequential_cpu_offload"),_u=o(", this method moves one whole model at a time to the GPU when its "),Ii=s("code"),hu=o("forward"),vu=o(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),yi=s("code"),bu=o("enable_sequential_cpu_offload"),Iu=o(", but performance is much better due to the iterative execution of the "),wi=s("code"),yu=o("unet"),wu=o("."),Fu=l(),jt=s("div"),f(Kn.$$.fragment),Pu=l(),Qn=s("p"),Eu=o(`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=s("code"),$u=o("torch.device('meta') and loaded to GPU only when their specific submodule has its "),ju=o("forward` method called."),xu=l(),ge=s("div"),f(Xn.$$.fragment),ku=l(),Pi=s("p"),qu=o("Encodes the prompt into text encoder hidden states."),Du=l(),w=s("p"),Tu=o("device: ("),Ei=s("code"),Cu=o("torch.device"),Ou=o(", "),$i=s("em"),Su=o("optional"),Lu=o(`):
torch device to place the resulting embeddings on
num_images_per_prompt (`),ji=s("code"),Ru=o("int"),Nu=o(", "),xi=s("em"),Mu=o("optional"),Gu=o(`, defaults to 1):
number of images that should be generated per prompt
do_classifier_free_guidance (`),ki=s("code"),Uu=o("bool"),Au=o(", "),qi=s("em"),Bu=o("optional"),zu=o(", defaults to "),Di=s("code"),Wu=o("True"),Vu=o(`):
whether to use classifier free guidance or not
negative_prompt (`),Ti=s("code"),Hu=o("str"),Yu=o(" or "),Ci=s("code"),Ju=o("List[str]"),Ku=o(", "),Oi=s("em"),Qu=o("optional"),Xu=o(`):
The prompt or prompts not to guide the image generation. If not defined, one has to pass
`),Si=s("code"),Zu=o("negative_prompt_embeds"),e_=o(". instead. If not defined, one has to pass "),Li=s("code"),t_=o("negative_prompt_embeds"),n_=o(`. instead.
Ignored when not using guidance (i.e., ignored if `),Ri=s("code"),o_=o("guidance_scale"),a_=o(" is less than "),Ni=s("code"),s_=o("1"),i_=o(`).
prompt_embeds (`),Mi=s("code"),r_=o("torch.FloatTensor"),l_=o(", "),Gi=s("em"),p_=o("optional"),d_=o(`):
Pre-generated text embeddings. Can be used to easily tweak text inputs, `),Ui=s("em"),m_=o("e.g."),c_=o(` prompt weighting. If not
provided, text embeddings will be generated from `),Ai=s("code"),g_=o("prompt"),f_=o(` input argument.
negative_prompt_embeds (`),Bi=s("code"),u_=o("torch.FloatTensor"),__=o(", "),zi=s("em"),h_=o("optional"),v_=o(`):
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, `),Wi=s("em"),b_=o("e.g."),I_=o(` prompt
weighting. If not provided, negative_prompt_embeds will be generated from `),Vi=s("code"),y_=o("negative_prompt"),w_=o(` input
argument.`),Jd=l(),et=s("h2"),xt=s("a"),Hi=s("span"),f(Zn.$$.fragment),F_=l(),Yi=s("span"),P_=o("IFSuperResolutionPipeline"),Kd=l(),z=s("div"),f(eo.$$.fragment),E_=l(),fe=s("div"),f(to.$$.fragment),$_=l(),Ji=s("p"),j_=o("Function invoked when calling the pipeline for generation."),x_=l(),f(kt.$$.fragment),k_=l(),qt=s("div"),f(no.$$.fragment),q_=l(),Q=s("p"),D_=o(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Ki=s("code"),T_=o("enable_sequential_cpu_offload"),C_=o(", this method moves one whole model at a time to the GPU when its "),Qi=s("code"),O_=o("forward"),S_=o(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Xi=s("code"),L_=o("enable_sequential_cpu_offload"),R_=o(", but performance is much better due to the iterative execution of the "),Zi=s("code"),N_=o("unet"),M_=o("."),G_=l(),Dt=s("div"),f(oo.$$.fragment),U_=l(),ao=s("p"),A_=o(`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 `),er=s("code"),B_=o("torch.device('meta') and loaded to GPU only when their specific submodule has its "),z_=o("forward` method called."),W_=l(),ue=s("div"),f(so.$$.fragment),V_=l(),tr=s("p"),H_=o("Encodes the prompt into text encoder hidden states."),Y_=l(),F=s("p"),J_=o("device: ("),nr=s("code"),K_=o("torch.device"),Q_=o(", "),or=s("em"),X_=o("optional"),Z_=o(`):
torch device to place the resulting embeddings on
num_images_per_prompt (`),ar=s("code"),eh=o("int"),th=o(", "),sr=s("em"),nh=o("optional"),oh=o(`, defaults to 1):
number of images that should be generated per prompt
do_classifier_free_guidance (`),ir=s("code"),ah=o("bool"),sh=o(", "),rr=s("em"),ih=o("optional"),rh=o(", defaults to "),lr=s("code"),lh=o("True"),ph=o(`):
whether to use classifier free guidance or not
negative_prompt (`),pr=s("code"),dh=o("str"),mh=o(" or "),dr=s("code"),ch=o("List[str]"),gh=o(", "),mr=s("em"),fh=o("optional"),uh=o(`):
The prompt or prompts not to guide the image generation. If not defined, one has to pass
`),cr=s("code"),_h=o("negative_prompt_embeds"),hh=o(". instead. If not defined, one has to pass "),gr=s("code"),vh=o("negative_prompt_embeds"),bh=o(`. instead.
Ignored when not using guidance (i.e., ignored if `),fr=s("code"),Ih=o("guidance_scale"),yh=o(" is less than "),ur=s("code"),wh=o("1"),Fh=o(`).
prompt_embeds (`),_r=s("code"),Ph=o("torch.FloatTensor"),Eh=o(", "),hr=s("em"),$h=o("optional"),jh=o(`):
Pre-generated text embeddings. Can be used to easily tweak text inputs, `),vr=s("em"),xh=o("e.g."),kh=o(` prompt weighting. If not
provided, text embeddings will be generated from `),br=s("code"),qh=o("prompt"),Dh=o(` input argument.
negative_prompt_embeds (`),Ir=s("code"),Th=o("torch.FloatTensor"),Ch=o(", "),yr=s("em"),Oh=o("optional"),Sh=o(`):
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, `),wr=s("em"),Lh=o("e.g."),Rh=o(` prompt
weighting. If not provided, negative_prompt_embeds will be generated from `),Fr=s("code"),Nh=o("negative_prompt"),Mh=o(` input
argument.`),Qd=l(),tt=s("h2"),Tt=s("a"),Pr=s("span"),f(io.$$.fragment),Gh=l(),Er=s("span"),Uh=o("IFImg2ImgPipeline"),Xd=l(),W=s("div"),f(ro.$$.fragment),Ah=l(),_e=s("div"),f(lo.$$.fragment),Bh=l(),$r=s("p"),zh=o("Function invoked when calling the pipeline for generation."),Wh=l(),f(Ct.$$.fragment),Vh=l(),Ot=s("div"),f(po.$$.fragment),Hh=l(),X=s("p"),Yh=o(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),jr=s("code"),Jh=o("enable_sequential_cpu_offload"),Kh=o(", this method moves one whole model at a time to the GPU when its "),xr=s("code"),Qh=o("forward"),Xh=o(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),kr=s("code"),Zh=o("enable_sequential_cpu_offload"),ev=o(", but performance is much better due to the iterative execution of the "),qr=s("code"),tv=o("unet"),nv=o("."),ov=l(),St=s("div"),f(mo.$$.fragment),av=l(),co=s("p"),sv=o(`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 `),Dr=s("code"),iv=o("torch.device('meta') and loaded to GPU only when their specific submodule has its "),rv=o("forward` method called."),lv=l(),he=s("div"),f(go.$$.fragment),pv=l(),Tr=s("p"),dv=o("Encodes the prompt into text encoder hidden states."),mv=l(),P=s("p"),cv=o("device: ("),Cr=s("code"),gv=o("torch.device"),fv=o(", "),Or=s("em"),uv=o("optional"),_v=o(`):
torch device to place the resulting embeddings on
num_images_per_prompt (`),Sr=s("code"),hv=o("int"),vv=o(", "),Lr=s("em"),bv=o("optional"),Iv=o(`, defaults to 1):
number of images that should be generated per prompt
do_classifier_free_guidance (`),Rr=s("code"),yv=o("bool"),wv=o(", "),Nr=s("em"),Fv=o("optional"),Pv=o(", defaults to "),Mr=s("code"),Ev=o("True"),$v=o(`):
whether to use classifier free guidance or not
negative_prompt (`),Gr=s("code"),jv=o("str"),xv=o(" or "),Ur=s("code"),kv=o("List[str]"),qv=o(", "),Ar=s("em"),Dv=o("optional"),Tv=o(`):
The prompt or prompts not to guide the image generation. If not defined, one has to pass
`),Br=s("code"),Cv=o("negative_prompt_embeds"),Ov=o(". instead. If not defined, one has to pass "),zr=s("code"),Sv=o("negative_prompt_embeds"),Lv=o(`. instead.
Ignored when not using guidance (i.e., ignored if `),Wr=s("code"),Rv=o("guidance_scale"),Nv=o(" is less than "),Vr=s("code"),Mv=o("1"),Gv=o(`).
prompt_embeds (`),Hr=s("code"),Uv=o("torch.FloatTensor"),Av=o(", "),Yr=s("em"),Bv=o("optional"),zv=o(`):
Pre-generated text embeddings. Can be used to easily tweak text inputs, `),Jr=s("em"),Wv=o("e.g."),Vv=o(` prompt weighting. If not
provided, text embeddings will be generated from `),Kr=s("code"),Hv=o("prompt"),Yv=o(` input argument.
negative_prompt_embeds (`),Qr=s("code"),Jv=o("torch.FloatTensor"),Kv=o(", "),Xr=s("em"),Qv=o("optional"),Xv=o(`):
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, `),Zr=s("em"),Zv=o("e.g."),eb=o(` prompt
weighting. If not provided, negative_prompt_embeds will be generated from `),el=s("code"),tb=o("negative_prompt"),nb=o(` input
argument.`),Zd=l(),nt=s("h2"),Lt=s("a"),tl=s("span"),f(fo.$$.fragment),ob=l(),nl=s("span"),ab=o("IFImg2ImgSuperResolutionPipeline"),em=l(),V=s("div"),f(uo.$$.fragment),sb=l(),ve=s("div"),f(_o.$$.fragment),ib=l(),ol=s("p"),rb=o("Function invoked when calling the pipeline for generation."),lb=l(),f(Rt.$$.fragment),pb=l(),Nt=s("div"),f(ho.$$.fragment),db=l(),Z=s("p"),mb=o(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),al=s("code"),cb=o("enable_sequential_cpu_offload"),gb=o(", this method moves one whole model at a time to the GPU when its "),sl=s("code"),fb=o("forward"),ub=o(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),il=s("code"),_b=o("enable_sequential_cpu_offload"),hb=o(", but performance is much better due to the iterative execution of the "),rl=s("code"),vb=o("unet"),bb=o("."),Ib=l(),Mt=s("div"),f(vo.$$.fragment),yb=l(),bo=s("p"),wb=o(`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 `),ll=s("code"),Fb=o("torch.device('meta') and loaded to GPU only when their specific submodule has its "),Pb=o("forward` method called."),Eb=l(),be=s("div"),f(Io.$$.fragment),$b=l(),pl=s("p"),jb=o("Encodes the prompt into text encoder hidden states."),xb=l(),E=s("p"),kb=o("device: ("),dl=s("code"),qb=o("torch.device"),Db=o(", "),ml=s("em"),Tb=o("optional"),Cb=o(`):
torch device to place the resulting embeddings on
num_images_per_prompt (`),cl=s("code"),Ob=o("int"),Sb=o(", "),gl=s("em"),Lb=o("optional"),Rb=o(`, defaults to 1):
number of images that should be generated per prompt
do_classifier_free_guidance (`),fl=s("code"),Nb=o("bool"),Mb=o(", "),ul=s("em"),Gb=o("optional"),Ub=o(", defaults to "),_l=s("code"),Ab=o("True"),Bb=o(`):
whether to use classifier free guidance or not
negative_prompt (`),hl=s("code"),zb=o("str"),Wb=o(" or "),vl=s("code"),Vb=o("List[str]"),Hb=o(", "),bl=s("em"),Yb=o("optional"),Jb=o(`):
The prompt or prompts not to guide the image generation. If not defined, one has to pass
`),Il=s("code"),Kb=o("negative_prompt_embeds"),Qb=o(". instead. If not defined, one has to pass "),yl=s("code"),Xb=o("negative_prompt_embeds"),Zb=o(`. instead.
Ignored when not using guidance (i.e., ignored if `),wl=s("code"),eI=o("guidance_scale"),tI=o(" is less than "),Fl=s("code"),nI=o("1"),oI=o(`).
prompt_embeds (`),Pl=s("code"),aI=o("torch.FloatTensor"),sI=o(", "),El=s("em"),iI=o("optional"),rI=o(`):
Pre-generated text embeddings. Can be used to easily tweak text inputs, `),$l=s("em"),lI=o("e.g."),pI=o(` prompt weighting. If not
provided, text embeddings will be generated from `),jl=s("code"),dI=o("prompt"),mI=o(` input argument.
negative_prompt_embeds (`),xl=s("code"),cI=o("torch.FloatTensor"),gI=o(", "),kl=s("em"),fI=o("optional"),uI=o(`):
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, `),ql=s("em"),_I=o("e.g."),hI=o(` prompt
weighting. If not provided, negative_prompt_embeds will be generated from `),Dl=s("code"),vI=o("negative_prompt"),bI=o(` input
argument.`),tm=l(),ot=s("h2"),Gt=s("a"),Tl=s("span"),f(yo.$$.fragment),II=l(),Cl=s("span"),yI=o("IFInpaintingPipeline"),nm=l(),H=s("div"),f(wo.$$.fragment),wI=l(),Ie=s("div"),f(Fo.$$.fragment),FI=l(),Ol=s("p"),PI=o("Function invoked when calling the pipeline for generation."),EI=l(),f(Ut.$$.fragment),$I=l(),At=s("div"),f(Po.$$.fragment),jI=l(),ee=s("p"),xI=o(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Sl=s("code"),kI=o("enable_sequential_cpu_offload"),qI=o(", this method moves one whole model at a time to the GPU when its "),Ll=s("code"),DI=o("forward"),TI=o(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Rl=s("code"),CI=o("enable_sequential_cpu_offload"),OI=o(", but performance is much better due to the iterative execution of the "),Nl=s("code"),SI=o("unet"),LI=o("."),RI=l(),Bt=s("div"),f(Eo.$$.fragment),NI=l(),$o=s("p"),MI=o(`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 `),Ml=s("code"),GI=o("torch.device('meta') and loaded to GPU only when their specific submodule has its "),UI=o("forward` method called."),AI=l(),ye=s("div"),f(jo.$$.fragment),BI=l(),Gl=s("p"),zI=o("Encodes the prompt into text encoder hidden states."),WI=l(),$=s("p"),VI=o("device: ("),Ul=s("code"),HI=o("torch.device"),YI=o(", "),Al=s("em"),JI=o("optional"),KI=o(`):
torch device to place the resulting embeddings on
num_images_per_prompt (`),Bl=s("code"),QI=o("int"),XI=o(", "),zl=s("em"),ZI=o("optional"),e1=o(`, defaults to 1):
number of images that should be generated per prompt
do_classifier_free_guidance (`),Wl=s("code"),t1=o("bool"),n1=o(", "),Vl=s("em"),o1=o("optional"),a1=o(", defaults to "),Hl=s("code"),s1=o("True"),i1=o(`):
whether to use classifier free guidance or not
negative_prompt (`),Yl=s("code"),r1=o("str"),l1=o(" or "),Jl=s("code"),p1=o("List[str]"),d1=o(", "),Kl=s("em"),m1=o("optional"),c1=o(`):
The prompt or prompts not to guide the image generation. If not defined, one has to pass
`),Ql=s("code"),g1=o("negative_prompt_embeds"),f1=o(". instead. If not defined, one has to pass "),Xl=s("code"),u1=o("negative_prompt_embeds"),_1=o(`. instead.
Ignored when not using guidance (i.e., ignored if `),Zl=s("code"),h1=o("guidance_scale"),v1=o(" is less than "),ep=s("code"),b1=o("1"),I1=o(`).
prompt_embeds (`),tp=s("code"),y1=o("torch.FloatTensor"),w1=o(", "),np=s("em"),F1=o("optional"),P1=o(`):
Pre-generated text embeddings. Can be used to easily tweak text inputs, `),op=s("em"),E1=o("e.g."),$1=o(` prompt weighting. If not
provided, text embeddings will be generated from `),ap=s("code"),j1=o("prompt"),x1=o(` input argument.
negative_prompt_embeds (`),sp=s("code"),k1=o("torch.FloatTensor"),q1=o(", "),ip=s("em"),D1=o("optional"),T1=o(`):
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, `),rp=s("em"),C1=o("e.g."),O1=o(` prompt
weighting. If not provided, negative_prompt_embeds will be generated from `),lp=s("code"),S1=o("negative_prompt"),L1=o(` input
argument.`),om=l(),at=s("h2"),zt=s("a"),pp=s("span"),f(xo.$$.fragment),R1=l(),dp=s("span"),N1=o("IFInpaintingSuperResolutionPipeline"),am=l(),Y=s("div"),f(ko.$$.fragment),M1=l(),we=s("div"),f(qo.$$.fragment),G1=l(),mp=s("p"),U1=o("Function invoked when calling the pipeline for generation."),A1=l(),f(Wt.$$.fragment),B1=l(),Vt=s("div"),f(Do.$$.fragment),z1=l(),te=s("p"),W1=o(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),cp=s("code"),V1=o("enable_sequential_cpu_offload"),H1=o(", this method moves one whole model at a time to the GPU when its "),gp=s("code"),Y1=o("forward"),J1=o(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),fp=s("code"),K1=o("enable_sequential_cpu_offload"),Q1=o(", but performance is much better due to the iterative execution of the "),up=s("code"),X1=o("unet"),Z1=o("."),ey=l(),Ht=s("div"),f(To.$$.fragment),ty=l(),Co=s("p"),ny=o(`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 `),_p=s("code"),oy=o("torch.device('meta') and loaded to GPU only when their specific submodule has its "),ay=o("forward` method called."),sy=l(),Fe=s("div"),f(Oo.$$.fragment),iy=l(),hp=s("p"),ry=o("Encodes the prompt into text encoder hidden states."),ly=l(),j=s("p"),py=o("device: ("),vp=s("code"),dy=o("torch.device"),my=o(", "),bp=s("em"),cy=o("optional"),gy=o(`):
torch device to place the resulting embeddings on
num_images_per_prompt (`),Ip=s("code"),fy=o("int"),uy=o(", "),yp=s("em"),_y=o("optional"),hy=o(`, defaults to 1):
number of images that should be generated per prompt
do_classifier_free_guidance (`),wp=s("code"),vy=o("bool"),by=o(", "),Fp=s("em"),Iy=o("optional"),yy=o(", defaults to "),Pp=s("code"),wy=o("True"),Fy=o(`):
whether to use classifier free guidance or not
negative_prompt (`),Ep=s("code"),Py=o("str"),Ey=o(" or "),$p=s("code"),$y=o("List[str]"),jy=o(", "),jp=s("em"),xy=o("optional"),ky=o(`):
The prompt or prompts not to guide the image generation. If not defined, one has to pass
`),xp=s("code"),qy=o("negative_prompt_embeds"),Dy=o(". instead. If not defined, one has to pass "),kp=s("code"),Ty=o("negative_prompt_embeds"),Cy=o(`. instead.
Ignored when not using guidance (i.e., ignored if `),qp=s("code"),Oy=o("guidance_scale"),Sy=o(" is less than "),Dp=s("code"),Ly=o("1"),Ry=o(`).
prompt_embeds (`),Tp=s("code"),Ny=o("torch.FloatTensor"),My=o(", "),Cp=s("em"),Gy=o("optional"),Uy=o(`):
Pre-generated text embeddings. Can be used to easily tweak text inputs, `),Op=s("em"),Ay=o("e.g."),By=o(` prompt weighting. If not
provided, text embeddings will be generated from `),Sp=s("code"),zy=o("prompt"),Wy=o(` input argument.
negative_prompt_embeds (`),Lp=s("code"),Vy=o("torch.FloatTensor"),Hy=o(", "),Rp=s("em"),Yy=o("optional"),Jy=o(`):
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, `),Np=s("em"),Ky=o("e.g."),Qy=o(` prompt
weighting. If not provided, negative_prompt_embeds will be generated from `),Mp=s("code"),Xy=o("negative_prompt"),Zy=o(` input
argument.`),this.h()},l(n){const m=d$('[data-svelte="svelte-1phssyn"]',document.head);y=i(m,"META",{name:!0,content:!0}),m.forEach(t),N=p(n),S=i(n,"H1",{class:!0});var So=r(S);I=i(So,"A",{id:!0,class:!0,href:!0});var Gp=r(I);L=i(Gp,"SPAN",{});var Up=r(L);u(g.$$.fragment,Up),Up.forEach(t),Gp.forEach(t),O=p(So),Ja=i(So,"SPAN",{});var Ap=r(Ja);Zm=a(Ap,"IF"),Ap.forEach(t),So.forEach(t),Wp=p(n),Le=i(n,"H2",{class:!0});var Lo=r(Le);st=i(Lo,"A",{id:!0,class:!0,href:!0});var Bp=r(st);Ka=i(Bp,"SPAN",{});var o2=r(Ka);u(Yt.$$.fragment,o2),o2.forEach(t),Bp.forEach(t),ec=p(Lo),Qa=i(Lo,"SPAN",{});var a2=r(Qa);tc=a(a2,"Overview"),a2.forEach(t),Lo.forEach(t),Vp=p(n),Mo=i(n,"P",{});var s2=r(Mo);nc=a(s2,`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:`),s2.forEach(t),Hp=p(n),ie=i(n,"UL",{});var ya=r(ie);Xa=i(ya,"LI",{});var i2=r(Xa);oc=a(i2,"Stage 1: a base model that generates 64x64 px image based on text prompt,"),i2.forEach(t),ac=p(ya),Za=i(ya,"LI",{});var r2=r(Za);sc=a(r2,"Stage 2: a 64x64 px => 256x256 px super-resolution model, and a"),r2.forEach(t),ic=p(ya),Jt=i(ya,"LI",{});var im=r(Jt);rc=a(im,`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 `),Kt=i(im,"A",{href:!0,rel:!0});var l2=r(Kt);lc=a(l2,"Stability\u2019s x4 Upscaling model"),l2.forEach(t),pc=a(im,`.
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.`),im.forEach(t),ya.forEach(t),Yp=p(n),Re=i(n,"H2",{class:!0});var rm=r(Re);it=i(rm,"A",{id:!0,class:!0,href:!0});var p2=r(it);es=i(p2,"SPAN",{});var d2=r(es);u(Qt.$$.fragment,d2),d2.forEach(t),p2.forEach(t),dc=p(rm),ts=i(rm,"SPAN",{});var m2=r(ts);mc=a(m2,"Usage"),m2.forEach(t),rm.forEach(t),Jp=p(n),Go=i(n,"P",{});var c2=r(Go);cc=a(c2,"Before you can use IF, you need to accept its usage conditions. To do so:"),c2.forEach(t),Kp=p(n),re=i(n,"OL",{});var wa=r(re);Xt=i(wa,"LI",{});var lm=r(Xt);gc=a(lm,"Make sure to have a "),Zt=i(lm,"A",{href:!0,rel:!0});var g2=r(Zt);fc=a(g2,"Hugging Face account"),g2.forEach(t),uc=a(lm," and be loggin in"),lm.forEach(t),_c=p(wa),rt=i(wa,"LI",{});var zp=r(rt);hc=a(zp,"Accept the license on the model card of "),en=i(zp,"A",{href:!0,rel:!0});var f2=r(en);vc=a(f2,"DeepFloyd/IF-I-IF-v1.0"),f2.forEach(t),bc=a(zp," and "),tn=i(zp,"A",{href:!0,rel:!0});var u2=r(tn);Ic=a(u2,"DeepFloyd/IF-II-L-v1.0"),u2.forEach(t),zp.forEach(t),yc=p(wa),Uo=i(wa,"LI",{});var e2=r(Uo);wc=a(e2,"Make sure to login locally. Install "),ns=i(e2,"CODE",{});var _2=r(ns);Fc=a(_2,"huggingface_hub"),_2.forEach(t),e2.forEach(t),wa.forEach(t),Qp=p(n),u(nn.$$.fragment,n),Xp=p(n),Ao=i(n,"P",{});var h2=r(Ao);Pc=a(h2,"run the login function in a Python shell"),h2.forEach(t),Zp=p(n),u(on.$$.fragment,n),ed=p(n),lt=i(n,"P",{});var pm=r(lt);Ec=a(pm,"and enter your "),an=i(pm,"A",{href:!0,rel:!0});var v2=r(an);$c=a(v2,"Hugging Face Hub access token"),v2.forEach(t),jc=a(pm,"."),pm.forEach(t),td=p(n),pt=i(n,"P",{});var dm=r(pt);xc=a(dm,"Next we install "),os=i(dm,"CODE",{});var b2=r(os);kc=a(b2,"diffusers"),b2.forEach(t),qc=a(dm," and dependencies:"),dm.forEach(t),nd=p(n),u(sn.$$.fragment,n),od=p(n),Bo=i(n,"P",{});var I2=r(Bo);Dc=a(I2,"The following sections give more in-detail examples of how to use IF. Specifically:"),I2.forEach(t),ad=p(n),G=i(n,"UL",{});var ne=r(G);as=i(ne,"LI",{});var y2=r(as);zo=i(y2,"A",{href:!0});var w2=r(zo);Tc=a(w2,"Text-to-Image Generation"),w2.forEach(t),y2.forEach(t),Cc=p(ne),ss=i(ne,"LI",{});var F2=r(ss);Wo=i(F2,"A",{href:!0});var P2=r(Wo);Oc=a(P2,"Image-to-Image Generation"),P2.forEach(t),F2.forEach(t),Sc=p(ne),is=i(ne,"LI",{});var E2=r(is);Vo=i(E2,"A",{href:!0});var $2=r(Vo);Lc=a($2,"Inpainting"),$2.forEach(t),E2.forEach(t),Rc=p(ne),rs=i(ne,"LI",{});var j2=r(rs);Ho=i(j2,"A",{href:!0});var x2=r(Ho);Nc=a(x2,"Reusing model weights"),x2.forEach(t),j2.forEach(t),Mc=p(ne),ls=i(ne,"LI",{});var k2=r(ls);Yo=i(k2,"A",{href:!0});var q2=r(Yo);Gc=a(q2,"Speed optimization"),q2.forEach(t),k2.forEach(t),Uc=p(ne),ps=i(ne,"LI",{});var D2=r(ps);Jo=i(D2,"A",{href:!0});var T2=r(Jo);Ac=a(T2,"Memory optimization"),T2.forEach(t),D2.forEach(t),ne.forEach(t),sd=p(n),Ko=i(n,"P",{});var C2=r(Ko);ds=i(C2,"STRONG",{});var O2=r(ds);Bc=a(O2,"Available checkpoints"),O2.forEach(t),C2.forEach(t),id=p(n),le=i(n,"UL",{});var Fa=r(le);rn=i(Fa,"LI",{});var mm=r(rn);ms=i(mm,"P",{});var S2=r(ms);cs=i(S2,"EM",{});var L2=r(cs);zc=a(L2,"Stage-1"),L2.forEach(t),S2.forEach(t),Wc=p(mm),Ne=i(mm,"UL",{});var Pa=r(Ne);gs=i(Pa,"LI",{});var R2=r(gs);ln=i(R2,"A",{href:!0,rel:!0});var N2=r(ln);Vc=a(N2,"DeepFloyd/IF-I-IF-v1.0"),N2.forEach(t),R2.forEach(t),Hc=p(Pa),fs=i(Pa,"LI",{});var M2=r(fs);pn=i(M2,"A",{href:!0,rel:!0});var G2=r(pn);Yc=a(G2,"DeepFloyd/IF-I-L-v1.0"),G2.forEach(t),M2.forEach(t),Jc=p(Pa),us=i(Pa,"LI",{});var U2=r(us);dn=i(U2,"A",{href:!0,rel:!0});var A2=r(dn);Kc=a(A2,"DeepFloyd/IF-I-M-v1.0"),A2.forEach(t),U2.forEach(t),Pa.forEach(t),mm.forEach(t),Qc=p(Fa),mn=i(Fa,"LI",{});var cm=r(mn);_s=i(cm,"P",{});var B2=r(_s);hs=i(B2,"EM",{});var z2=r(hs);Xc=a(z2,"Stage-2"),z2.forEach(t),B2.forEach(t),Zc=p(cm),cn=i(cm,"UL",{});var gm=r(cn);vs=i(gm,"LI",{});var W2=r(vs);gn=i(W2,"A",{href:!0,rel:!0});var V2=r(gn);eg=a(V2,"DeepFloyd/IF-II-L-v1.0"),V2.forEach(t),W2.forEach(t),tg=p(gm),bs=i(gm,"LI",{});var H2=r(bs);fn=i(H2,"A",{href:!0,rel:!0});var Y2=r(fn);ng=a(Y2,"DeepFloyd/IF-II-M-v1.0"),Y2.forEach(t),H2.forEach(t),gm.forEach(t),cm.forEach(t),og=p(Fa),un=i(Fa,"LI",{});var fm=r(un);Is=i(fm,"P",{});var J2=r(Is);ys=i(J2,"EM",{});var K2=r(ys);ag=a(K2,"Stage-3"),K2.forEach(t),J2.forEach(t),sg=p(fm),ws=i(fm,"UL",{});var Q2=r(ws);Fs=i(Q2,"LI",{});var X2=r(Fs);_n=i(X2,"A",{href:!0,rel:!0});var Z2=r(_n);ig=a(Z2,"stabilityai/stable-diffusion-x4-upscaler"),Z2.forEach(t),X2.forEach(t),Q2.forEach(t),fm.forEach(t),Fa.forEach(t),rd=p(n),dt=i(n,"P",{});var um=r(dt);Ps=i(um,"STRONG",{});var ew=r(Ps);rg=a(ew,"Demo"),ew.forEach(t),lg=p(um),hn=i(um,"A",{href:!0,rel:!0});var tw=r(hn);Qo=i(tw,"IMG",{src:!0,alt:!0}),tw.forEach(t),um.forEach(t),ld=p(n),mt=i(n,"P",{});var _m=r(mt);Es=i(_m,"STRONG",{});var nw=r(Es);pg=a(nw,"Google Colab"),nw.forEach(t),dg=p(_m),vn=i(_m,"A",{href:!0,rel:!0});var ow=r(vn);Xo=i(ow,"IMG",{src:!0,alt:!0}),ow.forEach(t),_m.forEach(t),pd=p(n),Me=i(n,"H3",{class:!0});var hm=r(Me);ct=i(hm,"A",{id:!0,class:!0,href:!0});var aw=r(ct);$s=i(aw,"SPAN",{});var sw=r($s);u(bn.$$.fragment,sw),sw.forEach(t),aw.forEach(t),mg=p(hm),js=i(hm,"SPAN",{});var iw=r(js);cg=a(iw,"Text-to-Image Generation"),iw.forEach(t),hm.forEach(t),dd=p(n),gt=i(n,"P",{});var vm=r(gt);gg=a(vm,"By default diffusers makes use of "),In=i(vm,"A",{href:!0,rel:!0});var rw=r(In);fg=a(rw,"model cpu offloading"),rw.forEach(t),ug=a(vm,`
to run the whole IF pipeline with as little as 14 GB of VRAM.`),vm.forEach(t),md=p(n),u(yn.$$.fragment,n),cd=p(n),Ge=i(n,"H3",{class:!0});var bm=r(Ge);ft=i(bm,"A",{id:!0,class:!0,href:!0});var lw=r(ft);xs=i(lw,"SPAN",{});var pw=r(xs);u(wn.$$.fragment,pw),pw.forEach(t),lw.forEach(t),_g=p(bm),ks=i(bm,"SPAN",{});var dw=r(ks);hg=a(dw,"Text Guided Image-to-Image Generation"),dw.forEach(t),bm.forEach(t),gd=p(n),pe=i(n,"P",{});var Ea=r(pe);vg=a(Ea,`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 `),Zo=i(Ea,"A",{href:!0});var mw=r(Zo);bg=a(mw,"IFInpaintingPipeline"),mw.forEach(t),Ig=a(Ea," and "),ea=i(Ea,"A",{href:!0});var cw=r(ea);yg=a(cw,"IFInpaintingSuperResolutionPipeline"),cw.forEach(t),wg=a(Ea," pipelines."),Ea.forEach(t),fd=p(n),ae=i(n,"P",{});var Ro=r(ae);qs=i(Ro,"STRONG",{});var gw=r(qs);Fg=a(gw,"Note"),gw.forEach(t),Pg=a(Ro,`: 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 `),Ds=i(Ro,"CODE",{});var fw=r(Ds);Eg=a(fw,"~DiffusionPipeline.components()"),fw.forEach(t),$g=a(Ro," function as explained "),ta=i(Ro,"A",{href:!0});var uw=r(ta);jg=a(uw,"here"),uw.forEach(t),xg=a(Ro,"."),Ro.forEach(t),ud=p(n),u(Fn.$$.fragment,n),_d=p(n),Ue=i(n,"H3",{class:!0});var Im=r(Ue);ut=i(Im,"A",{id:!0,class:!0,href:!0});var _w=r(ut);Ts=i(_w,"SPAN",{});var hw=r(Ts);u(Pn.$$.fragment,hw),hw.forEach(t),_w.forEach(t),kg=p(Im),Cs=i(Im,"SPAN",{});var vw=r(Cs);qg=a(vw,"Text Guided Inpainting Generation"),vw.forEach(t),Im.forEach(t),hd=p(n),de=i(n,"P",{});var $a=r(de);Dg=a($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 `),na=i($a,"A",{href:!0});var bw=r(na);Tg=a(bw,"IFInpaintingPipeline"),bw.forEach(t),Cg=a($a," and "),oa=i($a,"A",{href:!0});var Iw=r(oa);Og=a(Iw,"IFInpaintingSuperResolutionPipeline"),Iw.forEach(t),Sg=a($a," pipelines."),$a.forEach(t),vd=p(n),se=i(n,"P",{});var No=r(se);Os=i(No,"STRONG",{});var yw=r(Os);Lg=a(yw,"Note"),yw.forEach(t),Rg=a(No,`: 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 `),Ss=i(No,"CODE",{});var ww=r(Ss);Ng=a(ww,"~DiffusionPipeline.components()"),ww.forEach(t),Mg=a(No," function as explained "),aa=i(No,"A",{href:!0});var Fw=r(aa);Gg=a(Fw,"here"),Fw.forEach(t),Ug=a(No,"."),No.forEach(t),bd=p(n),u(En.$$.fragment,n),Id=p(n),Ae=i(n,"H3",{class:!0});var ym=r(Ae);_t=i(ym,"A",{id:!0,class:!0,href:!0});var Pw=r(_t);Ls=i(Pw,"SPAN",{});var Ew=r(Ls);u($n.$$.fragment,Ew),Ew.forEach(t),Pw.forEach(t),Ag=p(ym),Rs=i(ym,"SPAN",{});var $w=r(Rs);Bg=a($w,"Converting between different pipelines"),$w.forEach(t),ym.forEach(t),yd=p(n),ht=i(n,"P",{});var wm=r(ht);zg=a(wm,"In addition to being loaded with "),Ns=i(wm,"CODE",{});var jw=r(Ns);Wg=a(jw,"from_pretrained"),jw.forEach(t),Vg=a(wm,", Pipelines can also be loaded directly from each other."),wm.forEach(t),wd=p(n),u(jn.$$.fragment,n),Fd=p(n),Be=i(n,"H3",{class:!0});var Fm=r(Be);vt=i(Fm,"A",{id:!0,class:!0,href:!0});var xw=r(vt);Ms=i(xw,"SPAN",{});var kw=r(Ms);u(xn.$$.fragment,kw),kw.forEach(t),xw.forEach(t),Hg=p(Fm),Gs=i(Fm,"SPAN",{});var qw=r(Gs);Yg=a(qw,"Optimizing for speed"),qw.forEach(t),Fm.forEach(t),Pd=p(n),sa=i(n,"P",{});var Dw=r(sa);Jg=a(Dw,"The simplest optimization to run IF faster is to move all model components to the GPU."),Dw.forEach(t),Ed=p(n),u(kn.$$.fragment,n),$d=p(n),ia=i(n,"P",{});var Tw=r(ia);Kg=a(Tw,"You can also run the diffusion process for a shorter number of timesteps."),Tw.forEach(t),jd=p(n),bt=i(n,"P",{});var Pm=r(bt);Qg=a(Pm,"This can either be done with the "),Us=i(Pm,"CODE",{});var Cw=r(Us);Xg=a(Cw,"num_inference_steps"),Cw.forEach(t),Zg=a(Pm," argument"),Pm.forEach(t),xd=p(n),u(qn.$$.fragment,n),kd=p(n),It=i(n,"P",{});var Em=r(It);ef=a(Em,"Or with the "),As=i(Em,"CODE",{});var Ow=r(As);tf=a(Ow,"timesteps"),Ow.forEach(t),nf=a(Em," argument"),Em.forEach(t),qd=p(n),u(Dn.$$.fragment,n),Dd=p(n),ra=i(n,"P",{});var Sw=r(ra);of=a(Sw,`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.`),Sw.forEach(t),Td=p(n),u(Tn.$$.fragment,n),Cd=p(n),me=i(n,"P",{});var ja=r(me);af=a(ja,"You can also use "),la=i(ja,"A",{href:!0});var Lw=r(la);Bs=i(Lw,"CODE",{});var Rw=r(Bs);sf=a(Rw,"torch.compile"),Rw.forEach(t),Lw.forEach(t),rf=a(ja,". Note that we have not exhaustively tested "),zs=i(ja,"CODE",{});var Nw=r(zs);lf=a(Nw,"torch.compile"),Nw.forEach(t),pf=a(ja,`
with IF and it might not give expected results.`),ja.forEach(t),Od=p(n),u(Cn.$$.fragment,n),Sd=p(n),ze=i(n,"H3",{class:!0});var $m=r(ze);yt=i($m,"A",{id:!0,class:!0,href:!0});var Mw=r(yt);Ws=i(Mw,"SPAN",{});var Gw=r(Ws);u(On.$$.fragment,Gw),Gw.forEach(t),Mw.forEach(t),df=p($m),Vs=i($m,"SPAN",{});var Uw=r(Vs);mf=a(Uw,"Optimizing for memory"),Uw.forEach(t),$m.forEach(t),Ld=p(n),pa=i(n,"P",{});var Aw=r(pa);cf=a(Aw,"When optimizing for GPU memory, we can use the standard diffusers cpu offloading APIs."),Aw.forEach(t),Rd=p(n),da=i(n,"P",{});var Bw=r(da);gf=a(Bw,"Either the model based CPU offloading,"),Bw.forEach(t),Nd=p(n),u(Sn.$$.fragment,n),Md=p(n),ma=i(n,"P",{});var zw=r(ma);ff=a(zw,"or the more aggressive layer based CPU offloading."),zw.forEach(t),Gd=p(n),u(Ln.$$.fragment,n),Ud=p(n),ca=i(n,"P",{});var Ww=r(ca);uf=a(Ww,"Additionally, T5 can be loaded in 8bit precision"),Ww.forEach(t),Ad=p(n),u(Rn.$$.fragment,n),Bd=p(n),ga=i(n,"P",{});var Vw=r(ga);_f=a(Vw,`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.`),Vw.forEach(t),zd=p(n),u(Nn.$$.fragment,n),Wd=p(n),We=i(n,"H2",{class:!0});var jm=r(We);wt=i(jm,"A",{id:!0,class:!0,href:!0});var Hw=r(wt);Hs=i(Hw,"SPAN",{});var Yw=r(Hs);u(Mn.$$.fragment,Yw),Yw.forEach(t),Hw.forEach(t),hf=p(jm),Ys=i(jm,"SPAN",{});var Jw=r(Ys);vf=a(Jw,"Available Pipelines:"),Jw.forEach(t),jm.forEach(t),Vd=p(n),Ft=i(n,"TABLE",{});var xm=r(Ft);Js=i(xm,"THEAD",{});var Kw=r(Js);Ve=i(Kw,"TR",{});var xa=r(Ve);Ks=i(xa,"TH",{});var Qw=r(Ks);bf=a(Qw,"Pipeline"),Qw.forEach(t),If=p(xa),Qs=i(xa,"TH",{});var Xw=r(Qs);yf=a(Xw,"Tasks"),Xw.forEach(t),wf=p(xa),fa=i(xa,"TH",{align:!0});var Zw=r(fa);Ff=a(Zw,"Colab"),Zw.forEach(t),xa.forEach(t),Kw.forEach(t),Pf=p(xm),A=i(xm,"TBODY",{});var oe=r(A);He=i(oe,"TR",{});var ka=r(He);Xs=i(ka,"TD",{});var e0=r(Xs);Gn=i(e0,"A",{href:!0,rel:!0});var t0=r(Gn);Ef=a(t0,"pipeline_if.py"),t0.forEach(t),e0.forEach(t),$f=p(ka),Zs=i(ka,"TD",{});var n0=r(Zs);ei=i(n0,"EM",{});var o0=r(ei);jf=a(o0,"Text-to-Image Generation"),o0.forEach(t),n0.forEach(t),xf=p(ka),ua=i(ka,"TD",{align:!0});var a0=r(ua);kf=a(a0,"-"),a0.forEach(t),ka.forEach(t),qf=p(oe),Ye=i(oe,"TR",{});var qa=r(Ye);ti=i(qa,"TD",{});var s0=r(ti);Un=i(s0,"A",{href:!0,rel:!0});var i0=r(Un);Df=a(i0,"pipeline_if_superresolution.py"),i0.forEach(t),s0.forEach(t),Tf=p(qa),ni=i(qa,"TD",{});var r0=r(ni);oi=i(r0,"EM",{});var l0=r(oi);Cf=a(l0,"Text-to-Image Generation"),l0.forEach(t),r0.forEach(t),Of=p(qa),_a=i(qa,"TD",{align:!0});var p0=r(_a);Sf=a(p0,"-"),p0.forEach(t),qa.forEach(t),Lf=p(oe),Je=i(oe,"TR",{});var Da=r(Je);ai=i(Da,"TD",{});var d0=r(ai);An=i(d0,"A",{href:!0,rel:!0});var m0=r(An);Rf=a(m0,"pipeline_if_img2img.py"),m0.forEach(t),d0.forEach(t),Nf=p(Da),si=i(Da,"TD",{});var c0=r(si);ii=i(c0,"EM",{});var g0=r(ii);Mf=a(g0,"Image-to-Image Generation"),g0.forEach(t),c0.forEach(t),Gf=p(Da),ha=i(Da,"TD",{align:!0});var f0=r(ha);Uf=a(f0,"-"),f0.forEach(t),Da.forEach(t),Af=p(oe),Ke=i(oe,"TR",{});var Ta=r(Ke);ri=i(Ta,"TD",{});var u0=r(ri);Bn=i(u0,"A",{href:!0,rel:!0});var _0=r(Bn);Bf=a(_0,"pipeline_if_img2img_superresolution.py"),_0.forEach(t),u0.forEach(t),zf=p(Ta),li=i(Ta,"TD",{});var h0=r(li);pi=i(h0,"EM",{});var v0=r(pi);Wf=a(v0,"Image-to-Image Generation"),v0.forEach(t),h0.forEach(t),Vf=p(Ta),va=i(Ta,"TD",{align:!0});var b0=r(va);Hf=a(b0,"-"),b0.forEach(t),Ta.forEach(t),Yf=p(oe),Qe=i(oe,"TR",{});var Ca=r(Qe);di=i(Ca,"TD",{});var I0=r(di);zn=i(I0,"A",{href:!0,rel:!0});var y0=r(zn);Jf=a(y0,"pipeline_if_inpainting.py"),y0.forEach(t),I0.forEach(t),Kf=p(Ca),mi=i(Ca,"TD",{});var w0=r(mi);ci=i(w0,"EM",{});var F0=r(ci);Qf=a(F0,"Image-to-Image Generation"),F0.forEach(t),w0.forEach(t),Xf=p(Ca),ba=i(Ca,"TD",{align:!0});var P0=r(ba);Zf=a(P0,"-"),P0.forEach(t),Ca.forEach(t),eu=p(oe),Xe=i(oe,"TR",{});var Oa=r(Xe);gi=i(Oa,"TD",{});var E0=r(gi);Wn=i(E0,"A",{href:!0,rel:!0});var $0=r(Wn);tu=a($0,"pipeline_if_inpainting_superresolution.py"),$0.forEach(t),E0.forEach(t),nu=p(Oa),fi=i(Oa,"TD",{});var j0=r(fi);ui=i(j0,"EM",{});var x0=r(ui);ou=a(x0,"Image-to-Image Generation"),x0.forEach(t),j0.forEach(t),au=p(Oa),Ia=i(Oa,"TD",{align:!0});var k0=r(Ia);su=a(k0,"-"),k0.forEach(t),Oa.forEach(t),oe.forEach(t),xm.forEach(t),Hd=p(n),Ze=i(n,"H2",{class:!0});var km=r(Ze);Pt=i(km,"A",{id:!0,class:!0,href:!0});var q0=r(Pt);_i=i(q0,"SPAN",{});var D0=r(_i);u(Vn.$$.fragment,D0),D0.forEach(t),q0.forEach(t),iu=p(km),hi=i(km,"SPAN",{});var T0=r(hi);ru=a(T0,"IFPipeline"),T0.forEach(t),km.forEach(t),Yd=p(n),B=i(n,"DIV",{class:!0});var Pe=r(B);u(Hn.$$.fragment,Pe),lu=p(Pe),ce=i(Pe,"DIV",{class:!0});var Sa=r(ce);u(Yn.$$.fragment,Sa),pu=p(Sa),vi=i(Sa,"P",{});var C0=r(vi);du=a(C0,"Function invoked when calling the pipeline for generation."),C0.forEach(t),mu=p(Sa),u(Et.$$.fragment,Sa),Sa.forEach(t),cu=p(Pe),$t=i(Pe,"DIV",{class:!0});var qm=r($t);u(Jn.$$.fragment,qm),gu=p(qm),K=i(qm,"P",{});var Ee=r(K);fu=a(Ee,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),bi=i(Ee,"CODE",{});var O0=r(bi);uu=a(O0,"enable_sequential_cpu_offload"),O0.forEach(t),_u=a(Ee,", this method moves one whole model at a time to the GPU when its "),Ii=i(Ee,"CODE",{});var S0=r(Ii);hu=a(S0,"forward"),S0.forEach(t),vu=a(Ee,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),yi=i(Ee,"CODE",{});var L0=r(yi);bu=a(L0,"enable_sequential_cpu_offload"),L0.forEach(t),Iu=a(Ee,", but performance is much better due to the iterative execution of the "),wi=i(Ee,"CODE",{});var R0=r(wi);yu=a(R0,"unet"),R0.forEach(t),wu=a(Ee,"."),Ee.forEach(t),qm.forEach(t),Fu=p(Pe),jt=i(Pe,"DIV",{class:!0});var Dm=r(jt);u(Kn.$$.fragment,Dm),Pu=p(Dm),Qn=i(Dm,"P",{});var Tm=r(Qn);Eu=a(Tm,`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=i(Tm,"CODE",{});var N0=r(Fi);$u=a(N0,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),N0.forEach(t),ju=a(Tm,"forward` method called."),Tm.forEach(t),Dm.forEach(t),xu=p(Pe),ge=i(Pe,"DIV",{class:!0});var La=r(ge);u(Xn.$$.fragment,La),ku=p(La),Pi=i(La,"P",{});var M0=r(Pi);qu=a(M0,"Encodes the prompt into text encoder hidden states."),M0.forEach(t),Du=p(La),w=i(La,"P",{});var x=r(w);Tu=a(x,"device: ("),Ei=i(x,"CODE",{});var G0=r(Ei);Cu=a(G0,"torch.device"),G0.forEach(t),Ou=a(x,", "),$i=i(x,"EM",{});var U0=r($i);Su=a(U0,"optional"),U0.forEach(t),Lu=a(x,`):
torch device to place the resulting embeddings on
num_images_per_prompt (`),ji=i(x,"CODE",{});var A0=r(ji);Ru=a(A0,"int"),A0.forEach(t),Nu=a(x,", "),xi=i(x,"EM",{});var B0=r(xi);Mu=a(B0,"optional"),B0.forEach(t),Gu=a(x,`, defaults to 1):
number of images that should be generated per prompt
do_classifier_free_guidance (`),ki=i(x,"CODE",{});var z0=r(ki);Uu=a(z0,"bool"),z0.forEach(t),Au=a(x,", "),qi=i(x,"EM",{});var W0=r(qi);Bu=a(W0,"optional"),W0.forEach(t),zu=a(x,", defaults to "),Di=i(x,"CODE",{});var V0=r(Di);Wu=a(V0,"True"),V0.forEach(t),Vu=a(x,`):
whether to use classifier free guidance or not
negative_prompt (`),Ti=i(x,"CODE",{});var H0=r(Ti);Hu=a(H0,"str"),H0.forEach(t),Yu=a(x," or "),Ci=i(x,"CODE",{});var Y0=r(Ci);Ju=a(Y0,"List[str]"),Y0.forEach(t),Ku=a(x,", "),Oi=i(x,"EM",{});var J0=r(Oi);Qu=a(J0,"optional"),J0.forEach(t),Xu=a(x,`):
The prompt or prompts not to guide the image generation. If not defined, one has to pass
`),Si=i(x,"CODE",{});var K0=r(Si);Zu=a(K0,"negative_prompt_embeds"),K0.forEach(t),e_=a(x,". instead. If not defined, one has to pass "),Li=i(x,"CODE",{});var Q0=r(Li);t_=a(Q0,"negative_prompt_embeds"),Q0.forEach(t),n_=a(x,`. instead.
Ignored when not using guidance (i.e., ignored if `),Ri=i(x,"CODE",{});var X0=r(Ri);o_=a(X0,"guidance_scale"),X0.forEach(t),a_=a(x," is less than "),Ni=i(x,"CODE",{});var Z0=r(Ni);s_=a(Z0,"1"),Z0.forEach(t),i_=a(x,`).
prompt_embeds (`),Mi=i(x,"CODE",{});var eF=r(Mi);r_=a(eF,"torch.FloatTensor"),eF.forEach(t),l_=a(x,", "),Gi=i(x,"EM",{});var tF=r(Gi);p_=a(tF,"optional"),tF.forEach(t),d_=a(x,`):
Pre-generated text embeddings. Can be used to easily tweak text inputs, `),Ui=i(x,"EM",{});var nF=r(Ui);m_=a(nF,"e.g."),nF.forEach(t),c_=a(x,` prompt weighting. If not
provided, text embeddings will be generated from `),Ai=i(x,"CODE",{});var oF=r(Ai);g_=a(oF,"prompt"),oF.forEach(t),f_=a(x,` input argument.
negative_prompt_embeds (`),Bi=i(x,"CODE",{});var aF=r(Bi);u_=a(aF,"torch.FloatTensor"),aF.forEach(t),__=a(x,", "),zi=i(x,"EM",{});var sF=r(zi);h_=a(sF,"optional"),sF.forEach(t),v_=a(x,`):
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, `),Wi=i(x,"EM",{});var iF=r(Wi);b_=a(iF,"e.g."),iF.forEach(t),I_=a(x,` prompt
weighting. If not provided, negative_prompt_embeds will be generated from `),Vi=i(x,"CODE",{});var rF=r(Vi);y_=a(rF,"negative_prompt"),rF.forEach(t),w_=a(x,` input
argument.`),x.forEach(t),La.forEach(t),Pe.forEach(t),Jd=p(n),et=i(n,"H2",{class:!0});var Cm=r(et);xt=i(Cm,"A",{id:!0,class:!0,href:!0});var lF=r(xt);Hi=i(lF,"SPAN",{});var pF=r(Hi);u(Zn.$$.fragment,pF),pF.forEach(t),lF.forEach(t),F_=p(Cm),Yi=i(Cm,"SPAN",{});var dF=r(Yi);P_=a(dF,"IFSuperResolutionPipeline"),dF.forEach(t),Cm.forEach(t),Kd=p(n),z=i(n,"DIV",{class:!0});var $e=r(z);u(eo.$$.fragment,$e),E_=p($e),fe=i($e,"DIV",{class:!0});var Ra=r(fe);u(to.$$.fragment,Ra),$_=p(Ra),Ji=i(Ra,"P",{});var mF=r(Ji);j_=a(mF,"Function invoked when calling the pipeline for generation."),mF.forEach(t),x_=p(Ra),u(kt.$$.fragment,Ra),Ra.forEach(t),k_=p($e),qt=i($e,"DIV",{class:!0});var Om=r(qt);u(no.$$.fragment,Om),q_=p(Om),Q=i(Om,"P",{});var je=r(Q);D_=a(je,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Ki=i(je,"CODE",{});var cF=r(Ki);T_=a(cF,"enable_sequential_cpu_offload"),cF.forEach(t),C_=a(je,", this method moves one whole model at a time to the GPU when its "),Qi=i(je,"CODE",{});var gF=r(Qi);O_=a(gF,"forward"),gF.forEach(t),S_=a(je,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Xi=i(je,"CODE",{});var fF=r(Xi);L_=a(fF,"enable_sequential_cpu_offload"),fF.forEach(t),R_=a(je,", but performance is much better due to the iterative execution of the "),Zi=i(je,"CODE",{});var uF=r(Zi);N_=a(uF,"unet"),uF.forEach(t),M_=a(je,"."),je.forEach(t),Om.forEach(t),G_=p($e),Dt=i($e,"DIV",{class:!0});var Sm=r(Dt);u(oo.$$.fragment,Sm),U_=p(Sm),ao=i(Sm,"P",{});var Lm=r(ao);A_=a(Lm,`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 `),er=i(Lm,"CODE",{});var _F=r(er);B_=a(_F,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),_F.forEach(t),z_=a(Lm,"forward` method called."),Lm.forEach(t),Sm.forEach(t),W_=p($e),ue=i($e,"DIV",{class:!0});var Na=r(ue);u(so.$$.fragment,Na),V_=p(Na),tr=i(Na,"P",{});var hF=r(tr);H_=a(hF,"Encodes the prompt into text encoder hidden states."),hF.forEach(t),Y_=p(Na),F=i(Na,"P",{});var k=r(F);J_=a(k,"device: ("),nr=i(k,"CODE",{});var vF=r(nr);K_=a(vF,"torch.device"),vF.forEach(t),Q_=a(k,", "),or=i(k,"EM",{});var bF=r(or);X_=a(bF,"optional"),bF.forEach(t),Z_=a(k,`):
torch device to place the resulting embeddings on
num_images_per_prompt (`),ar=i(k,"CODE",{});var IF=r(ar);eh=a(IF,"int"),IF.forEach(t),th=a(k,", "),sr=i(k,"EM",{});var yF=r(sr);nh=a(yF,"optional"),yF.forEach(t),oh=a(k,`, defaults to 1):
number of images that should be generated per prompt
do_classifier_free_guidance (`),ir=i(k,"CODE",{});var wF=r(ir);ah=a(wF,"bool"),wF.forEach(t),sh=a(k,", "),rr=i(k,"EM",{});var FF=r(rr);ih=a(FF,"optional"),FF.forEach(t),rh=a(k,", defaults to "),lr=i(k,"CODE",{});var PF=r(lr);lh=a(PF,"True"),PF.forEach(t),ph=a(k,`):
whether to use classifier free guidance or not
negative_prompt (`),pr=i(k,"CODE",{});var EF=r(pr);dh=a(EF,"str"),EF.forEach(t),mh=a(k," or "),dr=i(k,"CODE",{});var $F=r(dr);ch=a($F,"List[str]"),$F.forEach(t),gh=a(k,", "),mr=i(k,"EM",{});var jF=r(mr);fh=a(jF,"optional"),jF.forEach(t),uh=a(k,`):
The prompt or prompts not to guide the image generation. If not defined, one has to pass
`),cr=i(k,"CODE",{});var xF=r(cr);_h=a(xF,"negative_prompt_embeds"),xF.forEach(t),hh=a(k,". instead. If not defined, one has to pass "),gr=i(k,"CODE",{});var kF=r(gr);vh=a(kF,"negative_prompt_embeds"),kF.forEach(t),bh=a(k,`. instead.
Ignored when not using guidance (i.e., ignored if `),fr=i(k,"CODE",{});var qF=r(fr);Ih=a(qF,"guidance_scale"),qF.forEach(t),yh=a(k," is less than "),ur=i(k,"CODE",{});var DF=r(ur);wh=a(DF,"1"),DF.forEach(t),Fh=a(k,`).
prompt_embeds (`),_r=i(k,"CODE",{});var TF=r(_r);Ph=a(TF,"torch.FloatTensor"),TF.forEach(t),Eh=a(k,", "),hr=i(k,"EM",{});var CF=r(hr);$h=a(CF,"optional"),CF.forEach(t),jh=a(k,`):
Pre-generated text embeddings. Can be used to easily tweak text inputs, `),vr=i(k,"EM",{});var OF=r(vr);xh=a(OF,"e.g."),OF.forEach(t),kh=a(k,` prompt weighting. If not
provided, text embeddings will be generated from `),br=i(k,"CODE",{});var SF=r(br);qh=a(SF,"prompt"),SF.forEach(t),Dh=a(k,` input argument.
negative_prompt_embeds (`),Ir=i(k,"CODE",{});var LF=r(Ir);Th=a(LF,"torch.FloatTensor"),LF.forEach(t),Ch=a(k,", "),yr=i(k,"EM",{});var RF=r(yr);Oh=a(RF,"optional"),RF.forEach(t),Sh=a(k,`):
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, `),wr=i(k,"EM",{});var NF=r(wr);Lh=a(NF,"e.g."),NF.forEach(t),Rh=a(k,` prompt
weighting. If not provided, negative_prompt_embeds will be generated from `),Fr=i(k,"CODE",{});var MF=r(Fr);Nh=a(MF,"negative_prompt"),MF.forEach(t),Mh=a(k,` input
argument.`),k.forEach(t),Na.forEach(t),$e.forEach(t),Qd=p(n),tt=i(n,"H2",{class:!0});var Rm=r(tt);Tt=i(Rm,"A",{id:!0,class:!0,href:!0});var GF=r(Tt);Pr=i(GF,"SPAN",{});var UF=r(Pr);u(io.$$.fragment,UF),UF.forEach(t),GF.forEach(t),Gh=p(Rm),Er=i(Rm,"SPAN",{});var AF=r(Er);Uh=a(AF,"IFImg2ImgPipeline"),AF.forEach(t),Rm.forEach(t),Xd=p(n),W=i(n,"DIV",{class:!0});var xe=r(W);u(ro.$$.fragment,xe),Ah=p(xe),_e=i(xe,"DIV",{class:!0});var Ma=r(_e);u(lo.$$.fragment,Ma),Bh=p(Ma),$r=i(Ma,"P",{});var BF=r($r);zh=a(BF,"Function invoked when calling the pipeline for generation."),BF.forEach(t),Wh=p(Ma),u(Ct.$$.fragment,Ma),Ma.forEach(t),Vh=p(xe),Ot=i(xe,"DIV",{class:!0});var Nm=r(Ot);u(po.$$.fragment,Nm),Hh=p(Nm),X=i(Nm,"P",{});var ke=r(X);Yh=a(ke,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),jr=i(ke,"CODE",{});var zF=r(jr);Jh=a(zF,"enable_sequential_cpu_offload"),zF.forEach(t),Kh=a(ke,", this method moves one whole model at a time to the GPU when its "),xr=i(ke,"CODE",{});var WF=r(xr);Qh=a(WF,"forward"),WF.forEach(t),Xh=a(ke,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),kr=i(ke,"CODE",{});var VF=r(kr);Zh=a(VF,"enable_sequential_cpu_offload"),VF.forEach(t),ev=a(ke,", but performance is much better due to the iterative execution of the "),qr=i(ke,"CODE",{});var HF=r(qr);tv=a(HF,"unet"),HF.forEach(t),nv=a(ke,"."),ke.forEach(t),Nm.forEach(t),ov=p(xe),St=i(xe,"DIV",{class:!0});var Mm=r(St);u(mo.$$.fragment,Mm),av=p(Mm),co=i(Mm,"P",{});var Gm=r(co);sv=a(Gm,`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 `),Dr=i(Gm,"CODE",{});var YF=r(Dr);iv=a(YF,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),YF.forEach(t),rv=a(Gm,"forward` method called."),Gm.forEach(t),Mm.forEach(t),lv=p(xe),he=i(xe,"DIV",{class:!0});var Ga=r(he);u(go.$$.fragment,Ga),pv=p(Ga),Tr=i(Ga,"P",{});var JF=r(Tr);dv=a(JF,"Encodes the prompt into text encoder hidden states."),JF.forEach(t),mv=p(Ga),P=i(Ga,"P",{});var q=r(P);cv=a(q,"device: ("),Cr=i(q,"CODE",{});var KF=r(Cr);gv=a(KF,"torch.device"),KF.forEach(t),fv=a(q,", "),Or=i(q,"EM",{});var QF=r(Or);uv=a(QF,"optional"),QF.forEach(t),_v=a(q,`):
torch device to place the resulting embeddings on
num_images_per_prompt (`),Sr=i(q,"CODE",{});var XF=r(Sr);hv=a(XF,"int"),XF.forEach(t),vv=a(q,", "),Lr=i(q,"EM",{});var ZF=r(Lr);bv=a(ZF,"optional"),ZF.forEach(t),Iv=a(q,`, defaults to 1):
number of images that should be generated per prompt
do_classifier_free_guidance (`),Rr=i(q,"CODE",{});var eP=r(Rr);yv=a(eP,"bool"),eP.forEach(t),wv=a(q,", "),Nr=i(q,"EM",{});var tP=r(Nr);Fv=a(tP,"optional"),tP.forEach(t),Pv=a(q,", defaults to "),Mr=i(q,"CODE",{});var nP=r(Mr);Ev=a(nP,"True"),nP.forEach(t),$v=a(q,`):
whether to use classifier free guidance or not
negative_prompt (`),Gr=i(q,"CODE",{});var oP=r(Gr);jv=a(oP,"str"),oP.forEach(t),xv=a(q," or "),Ur=i(q,"CODE",{});var aP=r(Ur);kv=a(aP,"List[str]"),aP.forEach(t),qv=a(q,", "),Ar=i(q,"EM",{});var sP=r(Ar);Dv=a(sP,"optional"),sP.forEach(t),Tv=a(q,`):
The prompt or prompts not to guide the image generation. If not defined, one has to pass
`),Br=i(q,"CODE",{});var iP=r(Br);Cv=a(iP,"negative_prompt_embeds"),iP.forEach(t),Ov=a(q,". instead. If not defined, one has to pass "),zr=i(q,"CODE",{});var rP=r(zr);Sv=a(rP,"negative_prompt_embeds"),rP.forEach(t),Lv=a(q,`. instead.
Ignored when not using guidance (i.e., ignored if `),Wr=i(q,"CODE",{});var lP=r(Wr);Rv=a(lP,"guidance_scale"),lP.forEach(t),Nv=a(q," is less than "),Vr=i(q,"CODE",{});var pP=r(Vr);Mv=a(pP,"1"),pP.forEach(t),Gv=a(q,`).
prompt_embeds (`),Hr=i(q,"CODE",{});var dP=r(Hr);Uv=a(dP,"torch.FloatTensor"),dP.forEach(t),Av=a(q,", "),Yr=i(q,"EM",{});var mP=r(Yr);Bv=a(mP,"optional"),mP.forEach(t),zv=a(q,`):
Pre-generated text embeddings. Can be used to easily tweak text inputs, `),Jr=i(q,"EM",{});var cP=r(Jr);Wv=a(cP,"e.g."),cP.forEach(t),Vv=a(q,` prompt weighting. If not
provided, text embeddings will be generated from `),Kr=i(q,"CODE",{});var gP=r(Kr);Hv=a(gP,"prompt"),gP.forEach(t),Yv=a(q,` input argument.
negative_prompt_embeds (`),Qr=i(q,"CODE",{});var fP=r(Qr);Jv=a(fP,"torch.FloatTensor"),fP.forEach(t),Kv=a(q,", "),Xr=i(q,"EM",{});var uP=r(Xr);Qv=a(uP,"optional"),uP.forEach(t),Xv=a(q,`):
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, `),Zr=i(q,"EM",{});var _P=r(Zr);Zv=a(_P,"e.g."),_P.forEach(t),eb=a(q,` prompt
weighting. If not provided, negative_prompt_embeds will be generated from `),el=i(q,"CODE",{});var hP=r(el);tb=a(hP,"negative_prompt"),hP.forEach(t),nb=a(q,` input
argument.`),q.forEach(t),Ga.forEach(t),xe.forEach(t),Zd=p(n),nt=i(n,"H2",{class:!0});var Um=r(nt);Lt=i(Um,"A",{id:!0,class:!0,href:!0});var vP=r(Lt);tl=i(vP,"SPAN",{});var bP=r(tl);u(fo.$$.fragment,bP),bP.forEach(t),vP.forEach(t),ob=p(Um),nl=i(Um,"SPAN",{});var IP=r(nl);ab=a(IP,"IFImg2ImgSuperResolutionPipeline"),IP.forEach(t),Um.forEach(t),em=p(n),V=i(n,"DIV",{class:!0});var qe=r(V);u(uo.$$.fragment,qe),sb=p(qe),ve=i(qe,"DIV",{class:!0});var Ua=r(ve);u(_o.$$.fragment,Ua),ib=p(Ua),ol=i(Ua,"P",{});var yP=r(ol);rb=a(yP,"Function invoked when calling the pipeline for generation."),yP.forEach(t),lb=p(Ua),u(Rt.$$.fragment,Ua),Ua.forEach(t),pb=p(qe),Nt=i(qe,"DIV",{class:!0});var Am=r(Nt);u(ho.$$.fragment,Am),db=p(Am),Z=i(Am,"P",{});var De=r(Z);mb=a(De,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),al=i(De,"CODE",{});var wP=r(al);cb=a(wP,"enable_sequential_cpu_offload"),wP.forEach(t),gb=a(De,", this method moves one whole model at a time to the GPU when its "),sl=i(De,"CODE",{});var FP=r(sl);fb=a(FP,"forward"),FP.forEach(t),ub=a(De,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),il=i(De,"CODE",{});var PP=r(il);_b=a(PP,"enable_sequential_cpu_offload"),PP.forEach(t),hb=a(De,", but performance is much better due to the iterative execution of the "),rl=i(De,"CODE",{});var EP=r(rl);vb=a(EP,"unet"),EP.forEach(t),bb=a(De,"."),De.forEach(t),Am.forEach(t),Ib=p(qe),Mt=i(qe,"DIV",{class:!0});var Bm=r(Mt);u(vo.$$.fragment,Bm),yb=p(Bm),bo=i(Bm,"P",{});var zm=r(bo);wb=a(zm,`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 `),ll=i(zm,"CODE",{});var $P=r(ll);Fb=a($P,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),$P.forEach(t),Pb=a(zm,"forward` method called."),zm.forEach(t),Bm.forEach(t),Eb=p(qe),be=i(qe,"DIV",{class:!0});var Aa=r(be);u(Io.$$.fragment,Aa),$b=p(Aa),pl=i(Aa,"P",{});var jP=r(pl);jb=a(jP,"Encodes the prompt into text encoder hidden states."),jP.forEach(t),xb=p(Aa),E=i(Aa,"P",{});var D=r(E);kb=a(D,"device: ("),dl=i(D,"CODE",{});var xP=r(dl);qb=a(xP,"torch.device"),xP.forEach(t),Db=a(D,", "),ml=i(D,"EM",{});var kP=r(ml);Tb=a(kP,"optional"),kP.forEach(t),Cb=a(D,`):
torch device to place the resulting embeddings on
num_images_per_prompt (`),cl=i(D,"CODE",{});var qP=r(cl);Ob=a(qP,"int"),qP.forEach(t),Sb=a(D,", "),gl=i(D,"EM",{});var DP=r(gl);Lb=a(DP,"optional"),DP.forEach(t),Rb=a(D,`, defaults to 1):
number of images that should be generated per prompt
do_classifier_free_guidance (`),fl=i(D,"CODE",{});var TP=r(fl);Nb=a(TP,"bool"),TP.forEach(t),Mb=a(D,", "),ul=i(D,"EM",{});var CP=r(ul);Gb=a(CP,"optional"),CP.forEach(t),Ub=a(D,", defaults to "),_l=i(D,"CODE",{});var OP=r(_l);Ab=a(OP,"True"),OP.forEach(t),Bb=a(D,`):
whether to use classifier free guidance or not
negative_prompt (`),hl=i(D,"CODE",{});var SP=r(hl);zb=a(SP,"str"),SP.forEach(t),Wb=a(D," or "),vl=i(D,"CODE",{});var LP=r(vl);Vb=a(LP,"List[str]"),LP.forEach(t),Hb=a(D,", "),bl=i(D,"EM",{});var RP=r(bl);Yb=a(RP,"optional"),RP.forEach(t),Jb=a(D,`):
The prompt or prompts not to guide the image generation. If not defined, one has to pass
`),Il=i(D,"CODE",{});var NP=r(Il);Kb=a(NP,"negative_prompt_embeds"),NP.forEach(t),Qb=a(D,". instead. If not defined, one has to pass "),yl=i(D,"CODE",{});var MP=r(yl);Xb=a(MP,"negative_prompt_embeds"),MP.forEach(t),Zb=a(D,`. instead.
Ignored when not using guidance (i.e., ignored if `),wl=i(D,"CODE",{});var GP=r(wl);eI=a(GP,"guidance_scale"),GP.forEach(t),tI=a(D," is less than "),Fl=i(D,"CODE",{});var UP=r(Fl);nI=a(UP,"1"),UP.forEach(t),oI=a(D,`).
prompt_embeds (`),Pl=i(D,"CODE",{});var AP=r(Pl);aI=a(AP,"torch.FloatTensor"),AP.forEach(t),sI=a(D,", "),El=i(D,"EM",{});var BP=r(El);iI=a(BP,"optional"),BP.forEach(t),rI=a(D,`):
Pre-generated text embeddings. Can be used to easily tweak text inputs, `),$l=i(D,"EM",{});var zP=r($l);lI=a(zP,"e.g."),zP.forEach(t),pI=a(D,` prompt weighting. If not
provided, text embeddings will be generated from `),jl=i(D,"CODE",{});var WP=r(jl);dI=a(WP,"prompt"),WP.forEach(t),mI=a(D,` input argument.
negative_prompt_embeds (`),xl=i(D,"CODE",{});var VP=r(xl);cI=a(VP,"torch.FloatTensor"),VP.forEach(t),gI=a(D,", "),kl=i(D,"EM",{});var HP=r(kl);fI=a(HP,"optional"),HP.forEach(t),uI=a(D,`):
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, `),ql=i(D,"EM",{});var YP=r(ql);_I=a(YP,"e.g."),YP.forEach(t),hI=a(D,` prompt
weighting. If not provided, negative_prompt_embeds will be generated from `),Dl=i(D,"CODE",{});var JP=r(Dl);vI=a(JP,"negative_prompt"),JP.forEach(t),bI=a(D,` input
argument.`),D.forEach(t),Aa.forEach(t),qe.forEach(t),tm=p(n),ot=i(n,"H2",{class:!0});var Wm=r(ot);Gt=i(Wm,"A",{id:!0,class:!0,href:!0});var KP=r(Gt);Tl=i(KP,"SPAN",{});var QP=r(Tl);u(yo.$$.fragment,QP),QP.forEach(t),KP.forEach(t),II=p(Wm),Cl=i(Wm,"SPAN",{});var XP=r(Cl);yI=a(XP,"IFInpaintingPipeline"),XP.forEach(t),Wm.forEach(t),nm=p(n),H=i(n,"DIV",{class:!0});var Te=r(H);u(wo.$$.fragment,Te),wI=p(Te),Ie=i(Te,"DIV",{class:!0});var Ba=r(Ie);u(Fo.$$.fragment,Ba),FI=p(Ba),Ol=i(Ba,"P",{});var ZP=r(Ol);PI=a(ZP,"Function invoked when calling the pipeline for generation."),ZP.forEach(t),EI=p(Ba),u(Ut.$$.fragment,Ba),Ba.forEach(t),$I=p(Te),At=i(Te,"DIV",{class:!0});var Vm=r(At);u(Po.$$.fragment,Vm),jI=p(Vm),ee=i(Vm,"P",{});var Ce=r(ee);xI=a(Ce,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Sl=i(Ce,"CODE",{});var eE=r(Sl);kI=a(eE,"enable_sequential_cpu_offload"),eE.forEach(t),qI=a(Ce,", this method moves one whole model at a time to the GPU when its "),Ll=i(Ce,"CODE",{});var tE=r(Ll);DI=a(tE,"forward"),tE.forEach(t),TI=a(Ce,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Rl=i(Ce,"CODE",{});var nE=r(Rl);CI=a(nE,"enable_sequential_cpu_offload"),nE.forEach(t),OI=a(Ce,", but performance is much better due to the iterative execution of the "),Nl=i(Ce,"CODE",{});var oE=r(Nl);SI=a(oE,"unet"),oE.forEach(t),LI=a(Ce,"."),Ce.forEach(t),Vm.forEach(t),RI=p(Te),Bt=i(Te,"DIV",{class:!0});var Hm=r(Bt);u(Eo.$$.fragment,Hm),NI=p(Hm),$o=i(Hm,"P",{});var Ym=r($o);MI=a(Ym,`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 `),Ml=i(Ym,"CODE",{});var aE=r(Ml);GI=a(aE,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),aE.forEach(t),UI=a(Ym,"forward` method called."),Ym.forEach(t),Hm.forEach(t),AI=p(Te),ye=i(Te,"DIV",{class:!0});var za=r(ye);u(jo.$$.fragment,za),BI=p(za),Gl=i(za,"P",{});var sE=r(Gl);zI=a(sE,"Encodes the prompt into text encoder hidden states."),sE.forEach(t),WI=p(za),$=i(za,"P",{});var T=r($);VI=a(T,"device: ("),Ul=i(T,"CODE",{});var iE=r(Ul);HI=a(iE,"torch.device"),iE.forEach(t),YI=a(T,", "),Al=i(T,"EM",{});var rE=r(Al);JI=a(rE,"optional"),rE.forEach(t),KI=a(T,`):
torch device to place the resulting embeddings on
num_images_per_prompt (`),Bl=i(T,"CODE",{});var lE=r(Bl);QI=a(lE,"int"),lE.forEach(t),XI=a(T,", "),zl=i(T,"EM",{});var pE=r(zl);ZI=a(pE,"optional"),pE.forEach(t),e1=a(T,`, defaults to 1):
number of images that should be generated per prompt
do_classifier_free_guidance (`),Wl=i(T,"CODE",{});var dE=r(Wl);t1=a(dE,"bool"),dE.forEach(t),n1=a(T,", "),Vl=i(T,"EM",{});var mE=r(Vl);o1=a(mE,"optional"),mE.forEach(t),a1=a(T,", defaults to "),Hl=i(T,"CODE",{});var cE=r(Hl);s1=a(cE,"True"),cE.forEach(t),i1=a(T,`):
whether to use classifier free guidance or not
negative_prompt (`),Yl=i(T,"CODE",{});var gE=r(Yl);r1=a(gE,"str"),gE.forEach(t),l1=a(T," or "),Jl=i(T,"CODE",{});var fE=r(Jl);p1=a(fE,"List[str]"),fE.forEach(t),d1=a(T,", "),Kl=i(T,"EM",{});var uE=r(Kl);m1=a(uE,"optional"),uE.forEach(t),c1=a(T,`):
The prompt or prompts not to guide the image generation. If not defined, one has to pass
`),Ql=i(T,"CODE",{});var _E=r(Ql);g1=a(_E,"negative_prompt_embeds"),_E.forEach(t),f1=a(T,". instead. If not defined, one has to pass "),Xl=i(T,"CODE",{});var hE=r(Xl);u1=a(hE,"negative_prompt_embeds"),hE.forEach(t),_1=a(T,`. instead.
Ignored when not using guidance (i.e., ignored if `),Zl=i(T,"CODE",{});var vE=r(Zl);h1=a(vE,"guidance_scale"),vE.forEach(t),v1=a(T," is less than "),ep=i(T,"CODE",{});var bE=r(ep);b1=a(bE,"1"),bE.forEach(t),I1=a(T,`).
prompt_embeds (`),tp=i(T,"CODE",{});var IE=r(tp);y1=a(IE,"torch.FloatTensor"),IE.forEach(t),w1=a(T,", "),np=i(T,"EM",{});var yE=r(np);F1=a(yE,"optional"),yE.forEach(t),P1=a(T,`):
Pre-generated text embeddings. Can be used to easily tweak text inputs, `),op=i(T,"EM",{});var wE=r(op);E1=a(wE,"e.g."),wE.forEach(t),$1=a(T,` prompt weighting. If not
provided, text embeddings will be generated from `),ap=i(T,"CODE",{});var FE=r(ap);j1=a(FE,"prompt"),FE.forEach(t),x1=a(T,` input argument.
negative_prompt_embeds (`),sp=i(T,"CODE",{});var PE=r(sp);k1=a(PE,"torch.FloatTensor"),PE.forEach(t),q1=a(T,", "),ip=i(T,"EM",{});var EE=r(ip);D1=a(EE,"optional"),EE.forEach(t),T1=a(T,`):
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, `),rp=i(T,"EM",{});var $E=r(rp);C1=a($E,"e.g."),$E.forEach(t),O1=a(T,` prompt
weighting. If not provided, negative_prompt_embeds will be generated from `),lp=i(T,"CODE",{});var jE=r(lp);S1=a(jE,"negative_prompt"),jE.forEach(t),L1=a(T,` input
argument.`),T.forEach(t),za.forEach(t),Te.forEach(t),om=p(n),at=i(n,"H2",{class:!0});var Jm=r(at);zt=i(Jm,"A",{id:!0,class:!0,href:!0});var xE=r(zt);pp=i(xE,"SPAN",{});var kE=r(pp);u(xo.$$.fragment,kE),kE.forEach(t),xE.forEach(t),R1=p(Jm),dp=i(Jm,"SPAN",{});var qE=r(dp);N1=a(qE,"IFInpaintingSuperResolutionPipeline"),qE.forEach(t),Jm.forEach(t),am=p(n),Y=i(n,"DIV",{class:!0});var Oe=r(Y);u(ko.$$.fragment,Oe),M1=p(Oe),we=i(Oe,"DIV",{class:!0});var Wa=r(we);u(qo.$$.fragment,Wa),G1=p(Wa),mp=i(Wa,"P",{});var DE=r(mp);U1=a(DE,"Function invoked when calling the pipeline for generation."),DE.forEach(t),A1=p(Wa),u(Wt.$$.fragment,Wa),Wa.forEach(t),B1=p(Oe),Vt=i(Oe,"DIV",{class:!0});var Km=r(Vt);u(Do.$$.fragment,Km),z1=p(Km),te=i(Km,"P",{});var Se=r(te);W1=a(Se,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),cp=i(Se,"CODE",{});var TE=r(cp);V1=a(TE,"enable_sequential_cpu_offload"),TE.forEach(t),H1=a(Se,", this method moves one whole model at a time to the GPU when its "),gp=i(Se,"CODE",{});var CE=r(gp);Y1=a(CE,"forward"),CE.forEach(t),J1=a(Se,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),fp=i(Se,"CODE",{});var OE=r(fp);K1=a(OE,"enable_sequential_cpu_offload"),OE.forEach(t),Q1=a(Se,", but performance is much better due to the iterative execution of the "),up=i(Se,"CODE",{});var SE=r(up);X1=a(SE,"unet"),SE.forEach(t),Z1=a(Se,"."),Se.forEach(t),Km.forEach(t),ey=p(Oe),Ht=i(Oe,"DIV",{class:!0});var Qm=r(Ht);u(To.$$.fragment,Qm),ty=p(Qm),Co=i(Qm,"P",{});var Xm=r(Co);ny=a(Xm,`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 `),_p=i(Xm,"CODE",{});var LE=r(_p);oy=a(LE,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),LE.forEach(t),ay=a(Xm,"forward` method called."),Xm.forEach(t),Qm.forEach(t),sy=p(Oe),Fe=i(Oe,"DIV",{class:!0});var Va=r(Fe);u(Oo.$$.fragment,Va),iy=p(Va),hp=i(Va,"P",{});var RE=r(hp);ry=a(RE,"Encodes the prompt into text encoder hidden states."),RE.forEach(t),ly=p(Va),j=i(Va,"P",{});var C=r(j);py=a(C,"device: ("),vp=i(C,"CODE",{});var NE=r(vp);dy=a(NE,"torch.device"),NE.forEach(t),my=a(C,", "),bp=i(C,"EM",{});var ME=r(bp);cy=a(ME,"optional"),ME.forEach(t),gy=a(C,`):
torch device to place the resulting embeddings on
num_images_per_prompt (`),Ip=i(C,"CODE",{});var GE=r(Ip);fy=a(GE,"int"),GE.forEach(t),uy=a(C,", "),yp=i(C,"EM",{});var UE=r(yp);_y=a(UE,"optional"),UE.forEach(t),hy=a(C,`, defaults to 1):
number of images that should be generated per prompt
do_classifier_free_guidance (`),wp=i(C,"CODE",{});var AE=r(wp);vy=a(AE,"bool"),AE.forEach(t),by=a(C,", "),Fp=i(C,"EM",{});var BE=r(Fp);Iy=a(BE,"optional"),BE.forEach(t),yy=a(C,", defaults to "),Pp=i(C,"CODE",{});var zE=r(Pp);wy=a(zE,"True"),zE.forEach(t),Fy=a(C,`):
whether to use classifier free guidance or not
negative_prompt (`),Ep=i(C,"CODE",{});var WE=r(Ep);Py=a(WE,"str"),WE.forEach(t),Ey=a(C," or "),$p=i(C,"CODE",{});var VE=r($p);$y=a(VE,"List[str]"),VE.forEach(t),jy=a(C,", "),jp=i(C,"EM",{});var HE=r(jp);xy=a(HE,"optional"),HE.forEach(t),ky=a(C,`):
The prompt or prompts not to guide the image generation. If not defined, one has to pass
`),xp=i(C,"CODE",{});var YE=r(xp);qy=a(YE,"negative_prompt_embeds"),YE.forEach(t),Dy=a(C,". instead. If not defined, one has to pass "),kp=i(C,"CODE",{});var JE=r(kp);Ty=a(JE,"negative_prompt_embeds"),JE.forEach(t),Cy=a(C,`. instead.
Ignored when not using guidance (i.e., ignored if `),qp=i(C,"CODE",{});var KE=r(qp);Oy=a(KE,"guidance_scale"),KE.forEach(t),Sy=a(C," is less than "),Dp=i(C,"CODE",{});var QE=r(Dp);Ly=a(QE,"1"),QE.forEach(t),Ry=a(C,`).
prompt_embeds (`),Tp=i(C,"CODE",{});var XE=r(Tp);Ny=a(XE,"torch.FloatTensor"),XE.forEach(t),My=a(C,", "),Cp=i(C,"EM",{});var ZE=r(Cp);Gy=a(ZE,"optional"),ZE.forEach(t),Uy=a(C,`):
Pre-generated text embeddings. Can be used to easily tweak text inputs, `),Op=i(C,"EM",{});var e$=r(Op);Ay=a(e$,"e.g."),e$.forEach(t),By=a(C,` prompt weighting. If not
provided, text embeddings will be generated from `),Sp=i(C,"CODE",{});var t$=r(Sp);zy=a(t$,"prompt"),t$.forEach(t),Wy=a(C,` input argument.
negative_prompt_embeds (`),Lp=i(C,"CODE",{});var n$=r(Lp);Vy=a(n$,"torch.FloatTensor"),n$.forEach(t),Hy=a(C,", "),Rp=i(C,"EM",{});var o$=r(Rp);Yy=a(o$,"optional"),o$.forEach(t),Jy=a(C,`):
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, `),Np=i(C,"EM",{});var a$=r(Np);Ky=a(a$,"e.g."),a$.forEach(t),Qy=a(C,` prompt
weighting. If not provided, negative_prompt_embeds will be generated from `),Mp=i(C,"CODE",{});var s$=r(Mp);Xy=a(s$,"negative_prompt"),s$.forEach(t),Zy=a(C,` input
argument.`),C.forEach(t),Va.forEach(t),Oe.forEach(t),this.h()},h(){d(y,"name","hf:doc:metadata"),d(y,"content",JSON.stringify(b$)),d(I,"id","if"),d(I,"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(I,"href","#if"),d(S,"class","relative group"),d(st,"id","overview"),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","#overview"),d(Le,"class","relative group"),d(Kt,"href","https://huggingface.co/stabilityai/stable-diffusion-x4-upscaler"),d(Kt,"rel","nofollow"),d(it,"id","usage"),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","#usage"),d(Re,"class","relative group"),d(Zt,"href","https://huggingface.co/join"),d(Zt,"rel","nofollow"),d(en,"href","https://huggingface.co/DeepFloyd/IF-I-IF-v1.0"),d(en,"rel","nofollow"),d(tn,"href","https://huggingface.co/DeepFloyd/IF-II-L-v1.0"),d(tn,"rel","nofollow"),d(an,"href","https://huggingface.co/docs/hub/security-tokens#what-are-user-access-tokens"),d(an,"rel","nofollow"),d(zo,"href","#text-to-image-generation"),d(Wo,"href","#text-guided-image-to-image-generation"),d(Vo,"href","#text-guided-inpainting-generation"),d(Ho,"href","#converting-between-different-pipelines"),d(Yo,"href","#optimizing-for-speed"),d(Jo,"href","#optimizing-for-memory"),d(ln,"href","https://huggingface.co/DeepFloyd/IF-I-IF-v1.0"),d(ln,"rel","nofollow"),d(pn,"href","https://huggingface.co/DeepFloyd/IF-I-L-v1.0"),d(pn,"rel","nofollow"),d(dn,"href","https://huggingface.co/DeepFloyd/IF-I-M-v1.0"),d(dn,"rel","nofollow"),d(gn,"href","https://huggingface.co/DeepFloyd/IF-II-L-v1.0"),d(gn,"rel","nofollow"),d(fn,"href","https://huggingface.co/DeepFloyd/IF-II-M-v1.0"),d(fn,"rel","nofollow"),d(_n,"href","https://huggingface.co/stabilityai/stable-diffusion-x4-upscaler"),d(_n,"rel","nofollow"),i$(Qo.src,t2="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||d(Qo,"src",t2),d(Qo,"alt","Hugging Face Spaces"),d(hn,"href","https://huggingface.co/spaces/DeepFloyd/IF"),d(hn,"rel","nofollow"),i$(Xo.src,n2="https://colab.research.google.com/assets/colab-badge.svg")||d(Xo,"src",n2),d(Xo,"alt","Open In Colab"),d(vn,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/deepfloyd_if_free_tier_google_colab.ipynb"),d(vn,"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(Me,"class","relative group"),d(In,"href","https://huggingface.co/docs/diffusers/optimization/fp16#model-offloading-for-fast-inference-and-memory-savings"),d(In,"rel","nofollow"),d(ft,"id","text-guided-imagetoimage-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-imagetoimage-generation"),d(Ge,"class","relative group"),d(Zo,"href","/docs/diffusers/v0.16.0/en/api/pipelines/if#diffusers.IFInpaintingPipeline"),d(ea,"href","/docs/diffusers/v0.16.0/en/api/pipelines/if#diffusers.IFInpaintingSuperResolutionPipeline"),d(ta,"href","#converting-between-different-pipelines"),d(ut,"id","text-guided-inpainting-generation"),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","#text-guided-inpainting-generation"),d(Ue,"class","relative group"),d(na,"href","/docs/diffusers/v0.16.0/en/api/pipelines/if#diffusers.IFInpaintingPipeline"),d(oa,"href","/docs/diffusers/v0.16.0/en/api/pipelines/if#diffusers.IFInpaintingSuperResolutionPipeline"),d(aa,"href","#converting-between-different-pipelines"),d(_t,"id","converting-between-different-pipelines"),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","#converting-between-different-pipelines"),d(Ae,"class","relative group"),d(vt,"id","optimizing-for-speed"),d(vt,"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(vt,"href","#optimizing-for-speed"),d(Be,"class","relative group"),d(la,"href","../../optimization/torch2.0"),d(yt,"id","optimizing-for-memory"),d(yt,"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(yt,"href","#optimizing-for-memory"),d(ze,"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(We,"class","relative group"),d(fa,"align","center"),d(Gn,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/deepfloyd_if/pipeline_if.py"),d(Gn,"rel","nofollow"),d(ua,"align","center"),d(Un,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/deepfloyd_if/pipeline_if.py"),d(Un,"rel","nofollow"),d(_a,"align","center"),d(An,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img.py"),d(An,"rel","nofollow"),d(ha,"align","center"),d(Bn,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img_superresolution.py"),d(Bn,"rel","nofollow"),d(va,"align","center"),d(zn,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting.py"),d(zn,"rel","nofollow"),d(ba,"align","center"),d(Wn,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting_superresolution.py"),d(Wn,"rel","nofollow"),d(Ia,"align","center"),d(Pt,"id","diffusers.IFPipeline"),d(Pt,"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(Pt,"href","#diffusers.IFPipeline"),d(Ze,"class","relative group"),d(ce,"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(jt,"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(B,"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,"id","diffusers.IFSuperResolutionPipeline"),d(xt,"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(xt,"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(qt,"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(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(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(Tt,"id","diffusers.IFImg2ImgPipeline"),d(Tt,"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(Tt,"href","#diffusers.IFImg2ImgPipeline"),d(tt,"class","relative group"),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(Ot,"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,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Lt,"id","diffusers.IFImg2ImgSuperResolutionPipeline"),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","#diffusers.IFImg2ImgSuperResolutionPipeline"),d(nt,"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(Nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Mt,"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(V,"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,"id","diffusers.IFInpaintingPipeline"),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","#diffusers.IFInpaintingPipeline"),d(ot,"class","relative group"),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(At,"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,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(H,"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.IFInpaintingSuperResolutionPipeline"),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.IFInpaintingSuperResolutionPipeline"),d(at,"class","relative group"),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(Vt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(Y,"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,m){e(document.head,y),c(n,N,m),c(n,S,m),e(S,I),e(I,L),_(g,L,null),e(S,O),e(S,Ja),e(Ja,Zm),c(n,Wp,m),c(n,Le,m),e(Le,st),e(st,Ka),_(Yt,Ka,null),e(Le,ec),e(Le,Qa),e(Qa,tc),c(n,Vp,m),c(n,Mo,m),e(Mo,nc),c(n,Hp,m),c(n,ie,m),e(ie,Xa),e(Xa,oc),e(ie,ac),e(ie,Za),e(Za,sc),e(ie,ic),e(ie,Jt),e(Jt,rc),e(Jt,Kt),e(Kt,lc),e(Jt,pc),c(n,Yp,m),c(n,Re,m),e(Re,it),e(it,es),_(Qt,es,null),e(Re,dc),e(Re,ts),e(ts,mc),c(n,Jp,m),c(n,Go,m),e(Go,cc),c(n,Kp,m),c(n,re,m),e(re,Xt),e(Xt,gc),e(Xt,Zt),e(Zt,fc),e(Xt,uc),e(re,_c),e(re,rt),e(rt,hc),e(rt,en),e(en,vc),e(rt,bc),e(rt,tn),e(tn,Ic),e(re,yc),e(re,Uo),e(Uo,wc),e(Uo,ns),e(ns,Fc),c(n,Qp,m),_(nn,n,m),c(n,Xp,m),c(n,Ao,m),e(Ao,Pc),c(n,Zp,m),_(on,n,m),c(n,ed,m),c(n,lt,m),e(lt,Ec),e(lt,an),e(an,$c),e(lt,jc),c(n,td,m),c(n,pt,m),e(pt,xc),e(pt,os),e(os,kc),e(pt,qc),c(n,nd,m),_(sn,n,m),c(n,od,m),c(n,Bo,m),e(Bo,Dc),c(n,ad,m),c(n,G,m),e(G,as),e(as,zo),e(zo,Tc),e(G,Cc),e(G,ss),e(ss,Wo),e(Wo,Oc),e(G,Sc),e(G,is),e(is,Vo),e(Vo,Lc),e(G,Rc),e(G,rs),e(rs,Ho),e(Ho,Nc),e(G,Mc),e(G,ls),e(ls,Yo),e(Yo,Gc),e(G,Uc),e(G,ps),e(ps,Jo),e(Jo,Ac),c(n,sd,m),c(n,Ko,m),e(Ko,ds),e(ds,Bc),c(n,id,m),c(n,le,m),e(le,rn),e(rn,ms),e(ms,cs),e(cs,zc),e(rn,Wc),e(rn,Ne),e(Ne,gs),e(gs,ln),e(ln,Vc),e(Ne,Hc),e(Ne,fs),e(fs,pn),e(pn,Yc),e(Ne,Jc),e(Ne,us),e(us,dn),e(dn,Kc),e(le,Qc),e(le,mn),e(mn,_s),e(_s,hs),e(hs,Xc),e(mn,Zc),e(mn,cn),e(cn,vs),e(vs,gn),e(gn,eg),e(cn,tg),e(cn,bs),e(bs,fn),e(fn,ng),e(le,og),e(le,un),e(un,Is),e(Is,ys),e(ys,ag),e(un,sg),e(un,ws),e(ws,Fs),e(Fs,_n),e(_n,ig),c(n,rd,m),c(n,dt,m),e(dt,Ps),e(Ps,rg),e(dt,lg),e(dt,hn),e(hn,Qo),c(n,ld,m),c(n,mt,m),e(mt,Es),e(Es,pg),e(mt,dg),e(mt,vn),e(vn,Xo),c(n,pd,m),c(n,Me,m),e(Me,ct),e(ct,$s),_(bn,$s,null),e(Me,mg),e(Me,js),e(js,cg),c(n,dd,m),c(n,gt,m),e(gt,gg),e(gt,In),e(In,fg),e(gt,ug),c(n,md,m),_(yn,n,m),c(n,cd,m),c(n,Ge,m),e(Ge,ft),e(ft,xs),_(wn,xs,null),e(Ge,_g),e(Ge,ks),e(ks,hg),c(n,gd,m),c(n,pe,m),e(pe,vg),e(pe,Zo),e(Zo,bg),e(pe,Ig),e(pe,ea),e(ea,yg),e(pe,wg),c(n,fd,m),c(n,ae,m),e(ae,qs),e(qs,Fg),e(ae,Pg),e(ae,Ds),e(Ds,Eg),e(ae,$g),e(ae,ta),e(ta,jg),e(ae,xg),c(n,ud,m),_(Fn,n,m),c(n,_d,m),c(n,Ue,m),e(Ue,ut),e(ut,Ts),_(Pn,Ts,null),e(Ue,kg),e(Ue,Cs),e(Cs,qg),c(n,hd,m),c(n,de,m),e(de,Dg),e(de,na),e(na,Tg),e(de,Cg),e(de,oa),e(oa,Og),e(de,Sg),c(n,vd,m),c(n,se,m),e(se,Os),e(Os,Lg),e(se,Rg),e(se,Ss),e(Ss,Ng),e(se,Mg),e(se,aa),e(aa,Gg),e(se,Ug),c(n,bd,m),_(En,n,m),c(n,Id,m),c(n,Ae,m),e(Ae,_t),e(_t,Ls),_($n,Ls,null),e(Ae,Ag),e(Ae,Rs),e(Rs,Bg),c(n,yd,m),c(n,ht,m),e(ht,zg),e(ht,Ns),e(Ns,Wg),e(ht,Vg),c(n,wd,m),_(jn,n,m),c(n,Fd,m),c(n,Be,m),e(Be,vt),e(vt,Ms),_(xn,Ms,null),e(Be,Hg),e(Be,Gs),e(Gs,Yg),c(n,Pd,m),c(n,sa,m),e(sa,Jg),c(n,Ed,m),_(kn,n,m),c(n,$d,m),c(n,ia,m),e(ia,Kg),c(n,jd,m),c(n,bt,m),e(bt,Qg),e(bt,Us),e(Us,Xg),e(bt,Zg),c(n,xd,m),_(qn,n,m),c(n,kd,m),c(n,It,m),e(It,ef),e(It,As),e(As,tf),e(It,nf),c(n,qd,m),_(Dn,n,m),c(n,Dd,m),c(n,ra,m),e(ra,of),c(n,Td,m),_(Tn,n,m),c(n,Cd,m),c(n,me,m),e(me,af),e(me,la),e(la,Bs),e(Bs,sf),e(me,rf),e(me,zs),e(zs,lf),e(me,pf),c(n,Od,m),_(Cn,n,m),c(n,Sd,m),c(n,ze,m),e(ze,yt),e(yt,Ws),_(On,Ws,null),e(ze,df),e(ze,Vs),e(Vs,mf),c(n,Ld,m),c(n,pa,m),e(pa,cf),c(n,Rd,m),c(n,da,m),e(da,gf),c(n,Nd,m),_(Sn,n,m),c(n,Md,m),c(n,ma,m),e(ma,ff),c(n,Gd,m),_(Ln,n,m),c(n,Ud,m),c(n,ca,m),e(ca,uf),c(n,Ad,m),_(Rn,n,m),c(n,Bd,m),c(n,ga,m),e(ga,_f),c(n,zd,m),_(Nn,n,m),c(n,Wd,m),c(n,We,m),e(We,wt),e(wt,Hs),_(Mn,Hs,null),e(We,hf),e(We,Ys),e(Ys,vf),c(n,Vd,m),c(n,Ft,m),e(Ft,Js),e(Js,Ve),e(Ve,Ks),e(Ks,bf),e(Ve,If),e(Ve,Qs),e(Qs,yf),e(Ve,wf),e(Ve,fa),e(fa,Ff),e(Ft,Pf),e(Ft,A),e(A,He),e(He,Xs),e(Xs,Gn),e(Gn,Ef),e(He,$f),e(He,Zs),e(Zs,ei),e(ei,jf),e(He,xf),e(He,ua),e(ua,kf),e(A,qf),e(A,Ye),e(Ye,ti),e(ti,Un),e(Un,Df),e(Ye,Tf),e(Ye,ni),e(ni,oi),e(oi,Cf),e(Ye,Of),e(Ye,_a),e(_a,Sf),e(A,Lf),e(A,Je),e(Je,ai),e(ai,An),e(An,Rf),e(Je,Nf),e(Je,si),e(si,ii),e(ii,Mf),e(Je,Gf),e(Je,ha),e(ha,Uf),e(A,Af),e(A,Ke),e(Ke,ri),e(ri,Bn),e(Bn,Bf),e(Ke,zf),e(Ke,li),e(li,pi),e(pi,Wf),e(Ke,Vf),e(Ke,va),e(va,Hf),e(A,Yf),e(A,Qe),e(Qe,di),e(di,zn),e(zn,Jf),e(Qe,Kf),e(Qe,mi),e(mi,ci),e(ci,Qf),e(Qe,Xf),e(Qe,ba),e(ba,Zf),e(A,eu),e(A,Xe),e(Xe,gi),e(gi,Wn),e(Wn,tu),e(Xe,nu),e(Xe,fi),e(fi,ui),e(ui,ou),e(Xe,au),e(Xe,Ia),e(Ia,su),c(n,Hd,m),c(n,Ze,m),e(Ze,Pt),e(Pt,_i),_(Vn,_i,null),e(Ze,iu),e(Ze,hi),e(hi,ru),c(n,Yd,m),c(n,B,m),_(Hn,B,null),e(B,lu),e(B,ce),_(Yn,ce,null),e(ce,pu),e(ce,vi),e(vi,du),e(ce,mu),_(Et,ce,null),e(B,cu),e(B,$t),_(Jn,$t,null),e($t,gu),e($t,K),e(K,fu),e(K,bi),e(bi,uu),e(K,_u),e(K,Ii),e(Ii,hu),e(K,vu),e(K,yi),e(yi,bu),e(K,Iu),e(K,wi),e(wi,yu),e(K,wu),e(B,Fu),e(B,jt),_(Kn,jt,null),e(jt,Pu),e(jt,Qn),e(Qn,Eu),e(Qn,Fi),e(Fi,$u),e(Qn,ju),e(B,xu),e(B,ge),_(Xn,ge,null),e(ge,ku),e(ge,Pi),e(Pi,qu),e(ge,Du),e(ge,w),e(w,Tu),e(w,Ei),e(Ei,Cu),e(w,Ou),e(w,$i),e($i,Su),e(w,Lu),e(w,ji),e(ji,Ru),e(w,Nu),e(w,xi),e(xi,Mu),e(w,Gu),e(w,ki),e(ki,Uu),e(w,Au),e(w,qi),e(qi,Bu),e(w,zu),e(w,Di),e(Di,Wu),e(w,Vu),e(w,Ti),e(Ti,Hu),e(w,Yu),e(w,Ci),e(Ci,Ju),e(w,Ku),e(w,Oi),e(Oi,Qu),e(w,Xu),e(w,Si),e(Si,Zu),e(w,e_),e(w,Li),e(Li,t_),e(w,n_),e(w,Ri),e(Ri,o_),e(w,a_),e(w,Ni),e(Ni,s_),e(w,i_),e(w,Mi),e(Mi,r_),e(w,l_),e(w,Gi),e(Gi,p_),e(w,d_),e(w,Ui),e(Ui,m_),e(w,c_),e(w,Ai),e(Ai,g_),e(w,f_),e(w,Bi),e(Bi,u_),e(w,__),e(w,zi),e(zi,h_),e(w,v_),e(w,Wi),e(Wi,b_),e(w,I_),e(w,Vi),e(Vi,y_),e(w,w_),c(n,Jd,m),c(n,et,m),e(et,xt),e(xt,Hi),_(Zn,Hi,null),e(et,F_),e(et,Yi),e(Yi,P_),c(n,Kd,m),c(n,z,m),_(eo,z,null),e(z,E_),e(z,fe),_(to,fe,null),e(fe,$_),e(fe,Ji),e(Ji,j_),e(fe,x_),_(kt,fe,null),e(z,k_),e(z,qt),_(no,qt,null),e(qt,q_),e(qt,Q),e(Q,D_),e(Q,Ki),e(Ki,T_),e(Q,C_),e(Q,Qi),e(Qi,O_),e(Q,S_),e(Q,Xi),e(Xi,L_),e(Q,R_),e(Q,Zi),e(Zi,N_),e(Q,M_),e(z,G_),e(z,Dt),_(oo,Dt,null),e(Dt,U_),e(Dt,ao),e(ao,A_),e(ao,er),e(er,B_),e(ao,z_),e(z,W_),e(z,ue),_(so,ue,null),e(ue,V_),e(ue,tr),e(tr,H_),e(ue,Y_),e(ue,F),e(F,J_),e(F,nr),e(nr,K_),e(F,Q_),e(F,or),e(or,X_),e(F,Z_),e(F,ar),e(ar,eh),e(F,th),e(F,sr),e(sr,nh),e(F,oh),e(F,ir),e(ir,ah),e(F,sh),e(F,rr),e(rr,ih),e(F,rh),e(F,lr),e(lr,lh),e(F,ph),e(F,pr),e(pr,dh),e(F,mh),e(F,dr),e(dr,ch),e(F,gh),e(F,mr),e(mr,fh),e(F,uh),e(F,cr),e(cr,_h),e(F,hh),e(F,gr),e(gr,vh),e(F,bh),e(F,fr),e(fr,Ih),e(F,yh),e(F,ur),e(ur,wh),e(F,Fh),e(F,_r),e(_r,Ph),e(F,Eh),e(F,hr),e(hr,$h),e(F,jh),e(F,vr),e(vr,xh),e(F,kh),e(F,br),e(br,qh),e(F,Dh),e(F,Ir),e(Ir,Th),e(F,Ch),e(F,yr),e(yr,Oh),e(F,Sh),e(F,wr),e(wr,Lh),e(F,Rh),e(F,Fr),e(Fr,Nh),e(F,Mh),c(n,Qd,m),c(n,tt,m),e(tt,Tt),e(Tt,Pr),_(io,Pr,null),e(tt,Gh),e(tt,Er),e(Er,Uh),c(n,Xd,m),c(n,W,m),_(ro,W,null),e(W,Ah),e(W,_e),_(lo,_e,null),e(_e,Bh),e(_e,$r),e($r,zh),e(_e,Wh),_(Ct,_e,null),e(W,Vh),e(W,Ot),_(po,Ot,null),e(Ot,Hh),e(Ot,X),e(X,Yh),e(X,jr),e(jr,Jh),e(X,Kh),e(X,xr),e(xr,Qh),e(X,Xh),e(X,kr),e(kr,Zh),e(X,ev),e(X,qr),e(qr,tv),e(X,nv),e(W,ov),e(W,St),_(mo,St,null),e(St,av),e(St,co),e(co,sv),e(co,Dr),e(Dr,iv),e(co,rv),e(W,lv),e(W,he),_(go,he,null),e(he,pv),e(he,Tr),e(Tr,dv),e(he,mv),e(he,P),e(P,cv),e(P,Cr),e(Cr,gv),e(P,fv),e(P,Or),e(Or,uv),e(P,_v),e(P,Sr),e(Sr,hv),e(P,vv),e(P,Lr),e(Lr,bv),e(P,Iv),e(P,Rr),e(Rr,yv),e(P,wv),e(P,Nr),e(Nr,Fv),e(P,Pv),e(P,Mr),e(Mr,Ev),e(P,$v),e(P,Gr),e(Gr,jv),e(P,xv),e(P,Ur),e(Ur,kv),e(P,qv),e(P,Ar),e(Ar,Dv),e(P,Tv),e(P,Br),e(Br,Cv),e(P,Ov),e(P,zr),e(zr,Sv),e(P,Lv),e(P,Wr),e(Wr,Rv),e(P,Nv),e(P,Vr),e(Vr,Mv),e(P,Gv),e(P,Hr),e(Hr,Uv),e(P,Av),e(P,Yr),e(Yr,Bv),e(P,zv),e(P,Jr),e(Jr,Wv),e(P,Vv),e(P,Kr),e(Kr,Hv),e(P,Yv),e(P,Qr),e(Qr,Jv),e(P,Kv),e(P,Xr),e(Xr,Qv),e(P,Xv),e(P,Zr),e(Zr,Zv),e(P,eb),e(P,el),e(el,tb),e(P,nb),c(n,Zd,m),c(n,nt,m),e(nt,Lt),e(Lt,tl),_(fo,tl,null),e(nt,ob),e(nt,nl),e(nl,ab),c(n,em,m),c(n,V,m),_(uo,V,null),e(V,sb),e(V,ve),_(_o,ve,null),e(ve,ib),e(ve,ol),e(ol,rb),e(ve,lb),_(Rt,ve,null),e(V,pb),e(V,Nt),_(ho,Nt,null),e(Nt,db),e(Nt,Z),e(Z,mb),e(Z,al),e(al,cb),e(Z,gb),e(Z,sl),e(sl,fb),e(Z,ub),e(Z,il),e(il,_b),e(Z,hb),e(Z,rl),e(rl,vb),e(Z,bb),e(V,Ib),e(V,Mt),_(vo,Mt,null),e(Mt,yb),e(Mt,bo),e(bo,wb),e(bo,ll),e(ll,Fb),e(bo,Pb),e(V,Eb),e(V,be),_(Io,be,null),e(be,$b),e(be,pl),e(pl,jb),e(be,xb),e(be,E),e(E,kb),e(E,dl),e(dl,qb),e(E,Db),e(E,ml),e(ml,Tb),e(E,Cb),e(E,cl),e(cl,Ob),e(E,Sb),e(E,gl),e(gl,Lb),e(E,Rb),e(E,fl),e(fl,Nb),e(E,Mb),e(E,ul),e(ul,Gb),e(E,Ub),e(E,_l),e(_l,Ab),e(E,Bb),e(E,hl),e(hl,zb),e(E,Wb),e(E,vl),e(vl,Vb),e(E,Hb),e(E,bl),e(bl,Yb),e(E,Jb),e(E,Il),e(Il,Kb),e(E,Qb),e(E,yl),e(yl,Xb),e(E,Zb),e(E,wl),e(wl,eI),e(E,tI),e(E,Fl),e(Fl,nI),e(E,oI),e(E,Pl),e(Pl,aI),e(E,sI),e(E,El),e(El,iI),e(E,rI),e(E,$l),e($l,lI),e(E,pI),e(E,jl),e(jl,dI),e(E,mI),e(E,xl),e(xl,cI),e(E,gI),e(E,kl),e(kl,fI),e(E,uI),e(E,ql),e(ql,_I),e(E,hI),e(E,Dl),e(Dl,vI),e(E,bI),c(n,tm,m),c(n,ot,m),e(ot,Gt),e(Gt,Tl),_(yo,Tl,null),e(ot,II),e(ot,Cl),e(Cl,yI),c(n,nm,m),c(n,H,m),_(wo,H,null),e(H,wI),e(H,Ie),_(Fo,Ie,null),e(Ie,FI),e(Ie,Ol),e(Ol,PI),e(Ie,EI),_(Ut,Ie,null),e(H,$I),e(H,At),_(Po,At,null),e(At,jI),e(At,ee),e(ee,xI),e(ee,Sl),e(Sl,kI),e(ee,qI),e(ee,Ll),e(Ll,DI),e(ee,TI),e(ee,Rl),e(Rl,CI),e(ee,OI),e(ee,Nl),e(Nl,SI),e(ee,LI),e(H,RI),e(H,Bt),_(Eo,Bt,null),e(Bt,NI),e(Bt,$o),e($o,MI),e($o,Ml),e(Ml,GI),e($o,UI),e(H,AI),e(H,ye),_(jo,ye,null),e(ye,BI),e(ye,Gl),e(Gl,zI),e(ye,WI),e(ye,$),e($,VI),e($,Ul),e(Ul,HI),e($,YI),e($,Al),e(Al,JI),e($,KI),e($,Bl),e(Bl,QI),e($,XI),e($,zl),e(zl,ZI),e($,e1),e($,Wl),e(Wl,t1),e($,n1),e($,Vl),e(Vl,o1),e($,a1),e($,Hl),e(Hl,s1),e($,i1),e($,Yl),e(Yl,r1),e($,l1),e($,Jl),e(Jl,p1),e($,d1),e($,Kl),e(Kl,m1),e($,c1),e($,Ql),e(Ql,g1),e($,f1),e($,Xl),e(Xl,u1),e($,_1),e($,Zl),e(Zl,h1),e($,v1),e($,ep),e(ep,b1),e($,I1),e($,tp),e(tp,y1),e($,w1),e($,np),e(np,F1),e($,P1),e($,op),e(op,E1),e($,$1),e($,ap),e(ap,j1),e($,x1),e($,sp),e(sp,k1),e($,q1),e($,ip),e(ip,D1),e($,T1),e($,rp),e(rp,C1),e($,O1),e($,lp),e(lp,S1),e($,L1),c(n,om,m),c(n,at,m),e(at,zt),e(zt,pp),_(xo,pp,null),e(at,R1),e(at,dp),e(dp,N1),c(n,am,m),c(n,Y,m),_(ko,Y,null),e(Y,M1),e(Y,we),_(qo,we,null),e(we,G1),e(we,mp),e(mp,U1),e(we,A1),_(Wt,we,null),e(Y,B1),e(Y,Vt),_(Do,Vt,null),e(Vt,z1),e(Vt,te),e(te,W1),e(te,cp),e(cp,V1),e(te,H1),e(te,gp),e(gp,Y1),e(te,J1),e(te,fp),e(fp,K1),e(te,Q1),e(te,up),e(up,X1),e(te,Z1),e(Y,ey),e(Y,Ht),_(To,Ht,null),e(Ht,ty),e(Ht,Co),e(Co,ny),e(Co,_p),e(_p,oy),e(Co,ay),e(Y,sy),e(Y,Fe),_(Oo,Fe,null),e(Fe,iy),e(Fe,hp),e(hp,ry),e(Fe,ly),e(Fe,j),e(j,py),e(j,vp),e(vp,dy),e(j,my),e(j,bp),e(bp,cy),e(j,gy),e(j,Ip),e(Ip,fy),e(j,uy),e(j,yp),e(yp,_y),e(j,hy),e(j,wp),e(wp,vy),e(j,by),e(j,Fp),e(Fp,Iy),e(j,yy),e(j,Pp),e(Pp,wy),e(j,Fy),e(j,Ep),e(Ep,Py),e(j,Ey),e(j,$p),e($p,$y),e(j,jy),e(j,jp),e(jp,xy),e(j,ky),e(j,xp),e(xp,qy),e(j,Dy),e(j,kp),e(kp,Ty),e(j,Cy),e(j,qp),e(qp,Oy),e(j,Sy),e(j,Dp),e(Dp,Ly),e(j,Ry),e(j,Tp),e(Tp,Ny),e(j,My),e(j,Cp),e(Cp,Gy),e(j,Uy),e(j,Op),e(Op,Ay),e(j,By),e(j,Sp),e(Sp,zy),e(j,Wy),e(j,Lp),e(Lp,Vy),e(j,Hy),e(j,Rp),e(Rp,Yy),e(j,Jy),e(j,Np),e(Np,Ky),e(j,Qy),e(j,Mp),e(Mp,Xy),e(j,Zy),sm=!0},p(n,[m]){const So={};m&2&&(So.$$scope={dirty:m,ctx:n}),Et.$set(So);const Gp={};m&2&&(Gp.$$scope={dirty:m,ctx:n}),kt.$set(Gp);const Up={};m&2&&(Up.$$scope={dirty:m,ctx:n}),Ct.$set(Up);const Ap={};m&2&&(Ap.$$scope={dirty:m,ctx:n}),Rt.$set(Ap);const Lo={};m&2&&(Lo.$$scope={dirty:m,ctx:n}),Ut.$set(Lo);const Bp={};m&2&&(Bp.$$scope={dirty:m,ctx:n}),Wt.$set(Bp)},i(n){sm||(h(g.$$.fragment,n),h(Yt.$$.fragment,n),h(Qt.$$.fragment,n),h(nn.$$.fragment,n),h(on.$$.fragment,n),h(sn.$$.fragment,n),h(bn.$$.fragment,n),h(yn.$$.fragment,n),h(wn.$$.fragment,n),h(Fn.$$.fragment,n),h(Pn.$$.fragment,n),h(En.$$.fragment,n),h($n.$$.fragment,n),h(jn.$$.fragment,n),h(xn.$$.fragment,n),h(kn.$$.fragment,n),h(qn.$$.fragment,n),h(Dn.$$.fragment,n),h(Tn.$$.fragment,n),h(Cn.$$.fragment,n),h(On.$$.fragment,n),h(Sn.$$.fragment,n),h(Ln.$$.fragment,n),h(Rn.$$.fragment,n),h(Nn.$$.fragment,n),h(Mn.$$.fragment,n),h(Vn.$$.fragment,n),h(Hn.$$.fragment,n),h(Yn.$$.fragment,n),h(Et.$$.fragment,n),h(Jn.$$.fragment,n),h(Kn.$$.fragment,n),h(Xn.$$.fragment,n),h(Zn.$$.fragment,n),h(eo.$$.fragment,n),h(to.$$.fragment,n),h(kt.$$.fragment,n),h(no.$$.fragment,n),h(oo.$$.fragment,n),h(so.$$.fragment,n),h(io.$$.fragment,n),h(ro.$$.fragment,n),h(lo.$$.fragment,n),h(Ct.$$.fragment,n),h(po.$$.fragment,n),h(mo.$$.fragment,n),h(go.$$.fragment,n),h(fo.$$.fragment,n),h(uo.$$.fragment,n),h(_o.$$.fragment,n),h(Rt.$$.fragment,n),h(ho.$$.fragment,n),h(vo.$$.fragment,n),h(Io.$$.fragment,n),h(yo.$$.fragment,n),h(wo.$$.fragment,n),h(Fo.$$.fragment,n),h(Ut.$$.fragment,n),h(Po.$$.fragment,n),h(Eo.$$.fragment,n),h(jo.$$.fragment,n),h(xo.$$.fragment,n),h(ko.$$.fragment,n),h(qo.$$.fragment,n),h(Wt.$$.fragment,n),h(Do.$$.fragment,n),h(To.$$.fragment,n),h(Oo.$$.fragment,n),sm=!0)},o(n){v(g.$$.fragment,n),v(Yt.$$.fragment,n),v(Qt.$$.fragment,n),v(nn.$$.fragment,n),v(on.$$.fragment,n),v(sn.$$.fragment,n),v(bn.$$.fragment,n),v(yn.$$.fragment,n),v(wn.$$.fragment,n),v(Fn.$$.fragment,n),v(Pn.$$.fragment,n),v(En.$$.fragment,n),v($n.$$.fragment,n),v(jn.$$.fragment,n),v(xn.$$.fragment,n),v(kn.$$.fragment,n),v(qn.$$.fragment,n),v(Dn.$$.fragment,n),v(Tn.$$.fragment,n),v(Cn.$$.fragment,n),v(On.$$.fragment,n),v(Sn.$$.fragment,n),v(Ln.$$.fragment,n),v(Rn.$$.fragment,n),v(Nn.$$.fragment,n),v(Mn.$$.fragment,n),v(Vn.$$.fragment,n),v(Hn.$$.fragment,n),v(Yn.$$.fragment,n),v(Et.$$.fragment,n),v(Jn.$$.fragment,n),v(Kn.$$.fragment,n),v(Xn.$$.fragment,n),v(Zn.$$.fragment,n),v(eo.$$.fragment,n),v(to.$$.fragment,n),v(kt.$$.fragment,n),v(no.$$.fragment,n),v(oo.$$.fragment,n),v(so.$$.fragment,n),v(io.$$.fragment,n),v(ro.$$.fragment,n),v(lo.$$.fragment,n),v(Ct.$$.fragment,n),v(po.$$.fragment,n),v(mo.$$.fragment,n),v(go.$$.fragment,n),v(fo.$$.fragment,n),v(uo.$$.fragment,n),v(_o.$$.fragment,n),v(Rt.$$.fragment,n),v(ho.$$.fragment,n),v(vo.$$.fragment,n),v(Io.$$.fragment,n),v(yo.$$.fragment,n),v(wo.$$.fragment,n),v(Fo.$$.fragment,n),v(Ut.$$.fragment,n),v(Po.$$.fragment,n),v(Eo.$$.fragment,n),v(jo.$$.fragment,n),v(xo.$$.fragment,n),v(ko.$$.fragment,n),v(qo.$$.fragment,n),v(Wt.$$.fragment,n),v(Do.$$.fragment,n),v(To.$$.fragment,n),v(Oo.$$.fragment,n),sm=!1},d(n){t(y),n&&t(N),n&&t(S),b(g),n&&t(Wp),n&&t(Le),b(Yt),n&&t(Vp),n&&t(Mo),n&&t(Hp),n&&t(ie),n&&t(Yp),n&&t(Re),b(Qt),n&&t(Jp),n&&t(Go),n&&t(Kp),n&&t(re),n&&t(Qp),b(nn,n),n&&t(Xp),n&&t(Ao),n&&t(Zp),b(on,n),n&&t(ed),n&&t(lt),n&&t(td),n&&t(pt),n&&t(nd),b(sn,n),n&&t(od),n&&t(Bo),n&&t(ad),n&&t(G),n&&t(sd),n&&t(Ko),n&&t(id),n&&t(le),n&&t(rd),n&&t(dt),n&&t(ld),n&&t(mt),n&&t(pd),n&&t(Me),b(bn),n&&t(dd),n&&t(gt),n&&t(md),b(yn,n),n&&t(cd),n&&t(Ge),b(wn),n&&t(gd),n&&t(pe),n&&t(fd),n&&t(ae),n&&t(ud),b(Fn,n),n&&t(_d),n&&t(Ue),b(Pn),n&&t(hd),n&&t(de),n&&t(vd),n&&t(se),n&&t(bd),b(En,n),n&&t(Id),n&&t(Ae),b($n),n&&t(yd),n&&t(ht),n&&t(wd),b(jn,n),n&&t(Fd),n&&t(Be),b(xn),n&&t(Pd),n&&t(sa),n&&t(Ed),b(kn,n),n&&t($d),n&&t(ia),n&&t(jd),n&&t(bt),n&&t(xd),b(qn,n),n&&t(kd),n&&t(It),n&&t(qd),b(Dn,n),n&&t(Dd),n&&t(ra),n&&t(Td),b(Tn,n),n&&t(Cd),n&&t(me),n&&t(Od),b(Cn,n),n&&t(Sd),n&&t(ze),b(On),n&&t(Ld),n&&t(pa),n&&t(Rd),n&&t(da),n&&t(Nd),b(Sn,n),n&&t(Md),n&&t(ma),n&&t(Gd),b(Ln,n),n&&t(Ud),n&&t(ca),n&&t(Ad),b(Rn,n),n&&t(Bd),n&&t(ga),n&&t(zd),b(Nn,n),n&&t(Wd),n&&t(We),b(Mn),n&&t(Vd),n&&t(Ft),n&&t(Hd),n&&t(Ze),b(Vn),n&&t(Yd),n&&t(B),b(Hn),b(Yn),b(Et),b(Jn),b(Kn),b(Xn),n&&t(Jd),n&&t(et),b(Zn),n&&t(Kd),n&&t(z),b(eo),b(to),b(kt),b(no),b(oo),b(so),n&&t(Qd),n&&t(tt),b(io),n&&t(Xd),n&&t(W),b(ro),b(lo),b(Ct),b(po),b(mo),b(go),n&&t(Zd),n&&t(nt),b(fo),n&&t(em),n&&t(V),b(uo),b(_o),b(Rt),b(ho),b(vo),b(Io),n&&t(tm),n&&t(ot),b(yo),n&&t(nm),n&&t(H),b(wo),b(Fo),b(Ut),b(Po),b(Eo),b(jo),n&&t(om),n&&t(at),b(xo),n&&t(am),n&&t(Y),b(ko),b(qo),b(Wt),b(Do),b(To),b(Oo)}}}const b$={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 I$(J){return m$(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class $$ extends r${constructor(y){super();l$(this,y,I$,v$,p$,{})}}export{$$ as default,b$ as metadata};
