import{s as Ps,o as Bs,n as $s}from"../chunks/scheduler.53228c21.js";import{S as Ws,i as Vs,e as a,s as n,c as d,h as As,a as i,d as o,b as s,f as M,j as h,g as c,k as _,l as t,m as y,n as m,t as g,o as f,p as u}from"../chunks/index.100fac89.js";import{C as Rs}from"../chunks/CopyLLMTxtMenu.4f0519ef.js";import{D as w}from"../chunks/Docstring.d02a9fa5.js";import{C as ks}from"../chunks/CodeBlock.d30a6509.js";import{E as Ds}from"../chunks/ExampleCodeBlock.38517eb4.js";import{H as en,E as zs}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.62dbb7c4.js";function Ys(Be){let v,U="Examples:",J,G,x;return G=new ks({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uR0xJR0VOUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQSUwQSUyMyUyMEluc2VydCUyMG9iamVjdHMlMjBkZXNjcmliZWQlMjBieSUyMHRleHQlMjBhdCUyMHRoZSUyMHJlZ2lvbiUyMGRlZmluZWQlMjBieSUyMGJvdW5kaW5nJTIwYm94ZXMlMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uR0xJR0VOUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMm1hc3RlcmZ1bCUyRmdsaWdlbi0xLTQtaW5wYWludGluZy10ZXh0LWJveCUyMiUyQyUyMHZhcmlhbnQlM0QlMjJmcDE2JTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQXBpcGUlMjAlM0QlMjBwaXBlLnRvKCUyMmN1ZGElMjIpJTBBJTBBaW5wdXRfaW1hZ2UlMjAlM0QlMjBsb2FkX2ltYWdlKCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaGYuY28lMkZkYXRhc2V0cyUyRmh1Z2dpbmdmYWNlJTJGZG9jdW1lbnRhdGlvbi1pbWFnZXMlMkZyZXNvbHZlJTJGbWFpbiUyRmRpZmZ1c2VycyUyRmdsaWdlbiUyRmxpdmluZ3Jvb21fbW9kZXJuLnBuZyUyMiUwQSklMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwYmlydGhkYXklMjBjYWtlJTIyJTBBYm94ZXMlMjAlM0QlMjAlNUIlNUIwLjI2NzYlMkMlMjAwLjYwODglMkMlMjAwLjQ3NzMlMkMlMjAwLjcxODMlNUQlNUQlMEFwaHJhc2VzJTIwJTNEJTIwJTVCJTIyYSUyMGJpcnRoZGF5JTIwY2FrZSUyMiU1RCUwQSUwQWltYWdlcyUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTNEcHJvbXB0JTJDJTBBJTIwJTIwJTIwJTIwZ2xpZ2VuX3BocmFzZXMlM0RwaHJhc2VzJTJDJTBBJTIwJTIwJTIwJTIwZ2xpZ2VuX2lucGFpbnRfaW1hZ2UlM0RpbnB1dF9pbWFnZSUyQyUwQSUyMCUyMCUyMCUyMGdsaWdlbl9ib3hlcyUzRGJveGVzJTJDJTBBJTIwJTIwJTIwJTIwZ2xpZ2VuX3NjaGVkdWxlZF9zYW1wbGluZ19iZXRhJTNEMSUyQyUwQSUyMCUyMCUyMCUyMG91dHB1dF90eXBlJTNEJTIycGlsJTIyJTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDUwJTJDJTBBKS5pbWFnZXMlMEElMEFpbWFnZXMlNUIwJTVELnNhdmUoJTIyLiUyRmdsaWdlbi0xLTQtaW5wYWludGluZy10ZXh0LWJveC5qcGclMjIpJTBBJTBBJTIzJTIwR2VuZXJhdGUlMjBhbiUyMGltYWdlJTIwZGVzY3JpYmVkJTIwYnklMjB0aGUlMjBwcm9tcHQlMjBhbmQlMEElMjMlMjBpbnNlcnQlMjBvYmplY3RzJTIwZGVzY3JpYmVkJTIwYnklMjB0ZXh0JTIwYXQlMjB0aGUlMjByZWdpb24lMjBkZWZpbmVkJTIwYnklMjBib3VuZGluZyUyMGJveGVzJTBBcGlwZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvbkdMSUdFTlBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJtYXN0ZXJmdWwlMkZnbGlnZW4tMS00LWdlbmVyYXRpb24tdGV4dC1ib3glMjIlMkMlMjB2YXJpYW50JTNEJTIyZnAxNiUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUwQSklMEFwaXBlJTIwJTNEJTIwcGlwZS50byglMjJjdWRhJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMmElMjB3YXRlcmZhbGwlMjBhbmQlMjBhJTIwbW9kZXJuJTIwaGlnaCUyMHNwZWVkJTIwdHJhaW4lMjBydW5uaW5nJTIwdGhyb3VnaCUyMHRoZSUyMHR1bm5lbCUyMGluJTIwYSUyMGJlYXV0aWZ1bCUyMGZvcmVzdCUyMHdpdGglMjBmYWxsJTIwZm9saWFnZSUyMiUwQWJveGVzJTIwJTNEJTIwJTVCJTVCMC4xMzg3JTJDJTIwMC4yMDUxJTJDJTIwMC40Mjc3JTJDJTIwMC43MDkwJTVEJTJDJTIwJTVCMC40OTgwJTJDJTIwMC40MzU1JTJDJTIwMC44NTE2JTJDJTIwMC43MjY2JTVEJTVEJTBBcGhyYXNlcyUyMCUzRCUyMCU1QiUyMmElMjB3YXRlcmZhbGwlMjIlMkMlMjAlMjJhJTIwbW9kZXJuJTIwaGlnaCUyMHNwZWVkJTIwdHJhaW4lMjBydW5uaW5nJTIwdGhyb3VnaCUyMHRoZSUyMHR1bm5lbCUyMiU1RCUwQSUwQWltYWdlcyUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTNEcHJvbXB0JTJDJTBBJTIwJTIwJTIwJTIwZ2xpZ2VuX3BocmFzZXMlM0RwaHJhc2VzJTJDJTBBJTIwJTIwJTIwJTIwZ2xpZ2VuX2JveGVzJTNEYm94ZXMlMkMlMEElMjAlMjAlMjAlMjBnbGlnZW5fc2NoZWR1bGVkX3NhbXBsaW5nX2JldGElM0QxJTJDJTBBJTIwJTIwJTIwJTIwb3V0cHV0X3R5cGUlM0QlMjJwaWwlMjIlMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENTAlMkMlMEEpLmltYWdlcyUwQSUwQWltYWdlcyU1QjAlNUQuc2F2ZSglMjIuJTJGZ2xpZ2VuLTEtNC1nZW5lcmF0aW9uLXRleHQtYm94LmpwZyUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionGLIGENPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Insert objects described by text at the region defined by bounding boxes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionGLIGENPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;masterful/gligen-1-4-inpainting-text-box&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 = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>input_image = load_image(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://hf.co/datasets/huggingface/documentation-images/resolve/main/diffusers/gligen/livingroom_modern.png&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;a birthday cake&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>boxes = [[<span class="hljs-number">0.2676</span>, <span class="hljs-number">0.6088</span>, <span class="hljs-number">0.4773</span>, <span class="hljs-number">0.7183</span>]]
<span class="hljs-meta">&gt;&gt;&gt; </span>phrases = [<span class="hljs-string">&quot;a birthday cake&quot;</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>images = pipe(
<span class="hljs-meta">... </span>    prompt=prompt,
<span class="hljs-meta">... </span>    gligen_phrases=phrases,
<span class="hljs-meta">... </span>    gligen_inpaint_image=input_image,
<span class="hljs-meta">... </span>    gligen_boxes=boxes,
<span class="hljs-meta">... </span>    gligen_scheduled_sampling_beta=<span class="hljs-number">1</span>,
<span class="hljs-meta">... </span>    output_type=<span class="hljs-string">&quot;pil&quot;</span>,
<span class="hljs-meta">... </span>    num_inference_steps=<span class="hljs-number">50</span>,
<span class="hljs-meta">... </span>).images

<span class="hljs-meta">&gt;&gt;&gt; </span>images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;./gligen-1-4-inpainting-text-box.jpg&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate an image described by the prompt and</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># insert objects described by text at the region defined by bounding boxes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionGLIGENPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;masterful/gligen-1-4-generation-text-box&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 = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;a waterfall and a modern high speed train running through the tunnel in a beautiful forest with fall foliage&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>boxes = [[<span class="hljs-number">0.1387</span>, <span class="hljs-number">0.2051</span>, <span class="hljs-number">0.4277</span>, <span class="hljs-number">0.7090</span>], [<span class="hljs-number">0.4980</span>, <span class="hljs-number">0.4355</span>, <span class="hljs-number">0.8516</span>, <span class="hljs-number">0.7266</span>]]
<span class="hljs-meta">&gt;&gt;&gt; </span>phrases = [<span class="hljs-string">&quot;a waterfall&quot;</span>, <span class="hljs-string">&quot;a modern high speed train running through the tunnel&quot;</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>images = pipe(
<span class="hljs-meta">... </span>    prompt=prompt,
<span class="hljs-meta">... </span>    gligen_phrases=phrases,
<span class="hljs-meta">... </span>    gligen_boxes=boxes,
<span class="hljs-meta">... </span>    gligen_scheduled_sampling_beta=<span class="hljs-number">1</span>,
<span class="hljs-meta">... </span>    output_type=<span class="hljs-string">&quot;pil&quot;</span>,
<span class="hljs-meta">... </span>    num_inference_steps=<span class="hljs-number">50</span>,
<span class="hljs-meta">... </span>).images

<span class="hljs-meta">&gt;&gt;&gt; </span>images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;./gligen-1-4-generation-text-box.jpg&quot;</span>)`,wrap:!1}}),{c(){v=a("p"),v.textContent=U,J=n(),d(G.$$.fragment)},l(b){v=i(b,"P",{"data-svelte-h":!0}),h(v)!=="svelte-kvfsh7"&&(v.textContent=U),J=s(b),c(G.$$.fragment,b)},m(b,j){y(b,v,j),y(b,J,j),m(G,b,j),x=!0},p:$s,i(b){x||(g(G.$$.fragment,b),x=!0)},o(b){f(G.$$.fragment,b),x=!1},d(b){b&&(o(v),o(J)),u(G,b)}}}function Xs(Be){let v,U="Examples:",J,G,x;return G=new ks({props:{code:" ",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionGLIGENTextImagePipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Insert objects described by image at the region defined by bounding boxes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionGLIGENTextImagePipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;anhnct/Gligen_Inpainting_Text_Image&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>input_image = load_image(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://hf.co/datasets/huggingface/documentation-images/resolve/main/diffusers/gligen/livingroom_modern.png&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;a backpack&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>boxes = [[<span class="hljs-number">0.2676</span>, <span class="hljs-number">0.4088</span>, <span class="hljs-number">0.4773</span>, <span class="hljs-number">0.7183</span>]]
<span class="hljs-meta">&gt;&gt;&gt; </span>phrases = <span class="hljs-literal">None</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>gligen_image = load_image(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/gligen/backpack.jpeg&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>images = pipe(
<span class="hljs-meta">... </span>    prompt=prompt,
<span class="hljs-meta">... </span>    gligen_phrases=phrases,
<span class="hljs-meta">... </span>    gligen_inpaint_image=input_image,
<span class="hljs-meta">... </span>    gligen_boxes=boxes,
<span class="hljs-meta">... </span>    gligen_images=[gligen_image],
<span class="hljs-meta">... </span>    gligen_scheduled_sampling_beta=<span class="hljs-number">1</span>,
<span class="hljs-meta">... </span>    output_type=<span class="hljs-string">&quot;pil&quot;</span>,
<span class="hljs-meta">... </span>    num_inference_steps=<span class="hljs-number">50</span>,
<span class="hljs-meta">... </span>).images

<span class="hljs-meta">&gt;&gt;&gt; </span>images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;./gligen-inpainting-text-image-box.jpg&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate an image described by the prompt and</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># insert objects described by text and image at the region defined by bounding boxes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionGLIGENTextImagePipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;anhnct/Gligen_Text_Image&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;a flower sitting on the beach&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>boxes = [[<span class="hljs-number">0.0</span>, <span class="hljs-number">0.09</span>, <span class="hljs-number">0.53</span>, <span class="hljs-number">0.76</span>]]
<span class="hljs-meta">&gt;&gt;&gt; </span>phrases = [<span class="hljs-string">&quot;flower&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>gligen_image = load_image(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/gligen/pexels-pixabay-60597.jpg&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>images = pipe(
<span class="hljs-meta">... </span>    prompt=prompt,
<span class="hljs-meta">... </span>    gligen_phrases=phrases,
<span class="hljs-meta">... </span>    gligen_images=[gligen_image],
<span class="hljs-meta">... </span>    gligen_boxes=boxes,
<span class="hljs-meta">... </span>    gligen_scheduled_sampling_beta=<span class="hljs-number">1</span>,
<span class="hljs-meta">... </span>    output_type=<span class="hljs-string">&quot;pil&quot;</span>,
<span class="hljs-meta">... </span>    num_inference_steps=<span class="hljs-number">50</span>,
<span class="hljs-meta">... </span>).images

<span class="hljs-meta">&gt;&gt;&gt; </span>images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;./gligen-generation-text-image-box.jpg&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate an image described by the prompt and</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># transfer style described by image at the region defined by bounding boxes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionGLIGENTextImagePipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;anhnct/Gligen_Text_Image&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;a dragon flying on the sky&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>boxes = [[<span class="hljs-number">0.4</span>, <span class="hljs-number">0.2</span>, <span class="hljs-number">1.0</span>, <span class="hljs-number">0.8</span>], [<span class="hljs-number">0.0</span>, <span class="hljs-number">1.0</span>, <span class="hljs-number">0.0</span>, <span class="hljs-number">1.0</span>]]  <span class="hljs-comment"># Set \`[0.0, 1.0, 0.0, 1.0]\` for the style</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>gligen_image = load_image(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/landscape.png&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>gligen_placeholder = load_image(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/landscape.png&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>images = pipe(
<span class="hljs-meta">... </span>    prompt=prompt,
<span class="hljs-meta">... </span>    gligen_phrases=[
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;dragon&quot;</span>,
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;placeholder&quot;</span>,
<span class="hljs-meta">... </span>    ],  <span class="hljs-comment"># Can use any text instead of \`placeholder\` token, because we will use mask here</span>
<span class="hljs-meta">... </span>    gligen_images=[
<span class="hljs-meta">... </span>        gligen_placeholder,
<span class="hljs-meta">... </span>        gligen_image,
<span class="hljs-meta">... </span>    ],  <span class="hljs-comment"># Can use any image in gligen_placeholder, because we will use mask here</span>
<span class="hljs-meta">... </span>    input_phrases_mask=[<span class="hljs-number">1</span>, <span class="hljs-number">0</span>],  <span class="hljs-comment"># Set 0 for the placeholder token</span>
<span class="hljs-meta">... </span>    input_images_mask=[<span class="hljs-number">0</span>, <span class="hljs-number">1</span>],  <span class="hljs-comment"># Set 0 for the placeholder image</span>
<span class="hljs-meta">... </span>    gligen_boxes=boxes,
<span class="hljs-meta">... </span>    gligen_scheduled_sampling_beta=<span class="hljs-number">1</span>,
<span class="hljs-meta">... </span>    output_type=<span class="hljs-string">&quot;pil&quot;</span>,
<span class="hljs-meta">... </span>    num_inference_steps=<span class="hljs-number">50</span>,
<span class="hljs-meta">... </span>).images

<span class="hljs-meta">&gt;&gt;&gt; </span>images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;./gligen-generation-text-image-box-style-transfer.jpg&quot;</span>)`,wrap:!1}}),{c(){v=a("p"),v.textContent=U,J=n(),d(G.$$.fragment)},l(b){v=i(b,"P",{"data-svelte-h":!0}),h(v)!=="svelte-kvfsh7"&&(v.textContent=U),J=s(b),c(G.$$.fragment,b)},m(b,j){y(b,v,j),y(b,J,j),m(G,b,j),x=!0},p:$s,i(b){x||(g(G.$$.fragment,b),x=!0)},o(b){f(G.$$.fragment,b),x=!1},d(b){b&&(o(v),o(J)),u(G,b)}}}function Qs(Be){let v,U,J,G,x,b="<p>This pipeline is deprecated but it can still be used. However, we won’t test the pipeline anymore and won’t accept any changes to it. If you run into any issues, reinstall the last Diffusers version that supported this model.</p>",j,ne,yt,se,Mt,ae,ts='The GLIGEN model was created by researchers and engineers from <a href="https://github.com/gligen/GLIGEN" rel="nofollow">University of Wisconsin-Madison, Columbia University, and Microsoft</a>. The <a href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/gligen#diffusers.StableDiffusionGLIGENPipeline">StableDiffusionGLIGENPipeline</a> and <a href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/gligen#diffusers.StableDiffusionGLIGENTextImagePipeline">StableDiffusionGLIGENTextImagePipeline</a> can generate photorealistic images conditioned on grounding inputs. Along with text and bounding boxes with <a href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/gligen#diffusers.StableDiffusionGLIGENPipeline">StableDiffusionGLIGENPipeline</a>, if input images are given, <a href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/gligen#diffusers.StableDiffusionGLIGENTextImagePipeline">StableDiffusionGLIGENTextImagePipeline</a> can insert objects described by text at the region defined by bounding boxes. Otherwise, it’ll generate an image described by the caption/prompt and insert objects described by text at the region defined by bounding boxes. It’s trained on COCO2014D and COCO2014CD datasets, and the model uses a frozen CLIP ViT-L/14 text encoder to condition itself on grounding inputs.',It,ie,ns='The abstract from the <a href="https://huggingface.co/papers/2301.07093" rel="nofollow">paper</a> is:',wt,oe,ss="<em>Large-scale text-to-image diffusion models have made amazing advances. However, the status quo is to use text input alone, which can impede controllability. In this work, we propose GLIGEN, Grounded-Language-to-Image Generation, a novel approach that builds upon and extends the functionality of existing pre-trained text-to-image diffusion models by enabling them to also be conditioned on grounding inputs. To preserve the vast concept knowledge of the pre-trained model, we freeze all of its weights and inject the grounding information into new trainable layers via a gated mechanism. Our model achieves open-world grounded text2img generation with caption and bounding box condition inputs, and the grounding ability generalizes well to novel spatial configurations and concepts. GLIGEN’s zeroshot performance on COCO and LVIS outperforms existing supervised layout-to-image baselines by a large margin.</em>",Tt,Z,as='<p>Make sure to check out the Stable Diffusion <a href="https://huggingface.co/docs/diffusers/en/api/pipelines/stable_diffusion/overview#tips" rel="nofollow">Tips</a> section to learn how to explore the tradeoff between scheduler speed and quality and how to reuse pipeline components efficiently!</p> <p>If you want to use one of the official checkpoints for a task, explore the <a href="https://huggingface.co/gligen" rel="nofollow">gligen</a> Hub organizations!</p>',vt,le,is='<a href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/gligen#diffusers.StableDiffusionGLIGENPipeline">StableDiffusionGLIGENPipeline</a> was contributed by <a href="https://github.com/nikhil-masterful" rel="nofollow">Nikhil Gajendrakumar</a> and <a href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/gligen#diffusers.StableDiffusionGLIGENTextImagePipeline">StableDiffusionGLIGENTextImagePipeline</a> was contributed by <a href="https://github.com/tuanh123789" rel="nofollow">Nguyễn Công Tú Anh</a>.',Gt,re,xt,I,pe,tn,We,os="Pipeline for text-to-image generation using Stable Diffusion with Grounded-Language-to-Image Generation (GLIGEN).",nn,Ve,ls=`This model inherits from <a href="/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a>. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.).`,sn,L,de,an,Ae,rs="The call function to the pipeline for generation.",on,S,ln,D,ce,rn,Re,ps=`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`,pn,$,me,dn,ze,ds=`Disable sliced VAE decoding. If <code>enable_vae_slicing</code> was previously enabled, this method will go back to
computing decoding in one step.`,cn,k,ge,mn,Ye,cs=`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to
compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow
processing larger images.`,gn,P,fe,fn,Xe,ms=`Disable tiled VAE decoding. If <code>enable_vae_tiling</code> was previously enabled, this method will go back to
computing decoding in one step.`,un,B,ue,hn,Qe,gs=`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to <code>enable_sequential_cpu_offload</code>, this method moves one whole model at a time to the accelerator when its
<code>forward</code> method is called, and the model remains in accelerator until the next model runs. Memory savings are
lower than with <code>enable_sequential_cpu_offload</code>, but performance is much better due to the iterative execution
of the <code>unet</code>.`,bn,He,he,_n,qe,be,yn,W,_e,Mn,Fe,fs="Encodes the prompt into text encoder hidden states.",Jt,ye,jt,l,Me,In,Oe,us="Pipeline for text-to-image generation using Stable Diffusion with Grounded-Language-to-Image Generation (GLIGEN).",wn,Ke,hs=`This model inherits from <a href="/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a>. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.).`,Tn,N,Ie,vn,et,bs="The call function to the pipeline for generation.",Gn,V,xn,A,we,Jn,tt,_s=`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`,jn,R,Te,Un,nt,ys=`Disable sliced VAE decoding. If <code>enable_vae_slicing</code> was previously enabled, this method will go back to
computing decoding in one step.`,Ln,z,ve,Nn,st,Ms=`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to
compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow
processing larger images.`,Cn,Y,Ge,En,at,Is=`Disable tiled VAE decoding. If <code>enable_vae_tiling</code> was previously enabled, this method will go back to
computing decoding in one step.`,Zn,X,xe,Sn,it,ws=`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to <code>enable_sequential_cpu_offload</code>, this method moves one whole model at a time to the accelerator when its
<code>forward</code> method is called, and the model remains in accelerator until the next model runs. Memory savings are
lower than with <code>enable_sequential_cpu_offload</code>, but performance is much better due to the iterative execution
of the <code>unet</code>.`,Dn,ot,Je,$n,lt,je,kn,Q,Ue,Pn,rt,Ts=`Based on the input mask corresponding value <code>0 or 1</code> for each phrases and image, mask the features
corresponding to phrases and images.`,Bn,H,Le,Wn,pt,vs="Crop the input image to the specified dimensions.",Vn,q,Ne,An,dt,Gs=`Create an inpainting mask based on given boxes. This function generates an inpainting mask using the provided
boxes to mark regions that need to be inpainted.`,Rn,F,Ce,zn,ct,xs="Encodes the prompt into text encoder hidden states.",Yn,O,Ee,Xn,mt,Js=`Get image and phrases embedding by using CLIP pretrain model. The image embedding is transformed into the
phrases embedding space through a projection.`,Qn,K,Ze,Hn,gt,js=`Prepare the cross-attention kwargs containing information about the grounded input (boxes, mask, image
embedding, phrases embedding).`,qn,ee,Se,Fn,ft,Us=`Prepare the cross-attention kwargs without information about the grounded input (boxes, mask, image embedding,
phrases embedding) (All are zero tensor).`,On,te,De,Kn,ut,Ls="Crop and resize the image to the target size while keeping the center.",Ut,$e,Lt,C,ke,es,ht,Ns="Output class for Stable Diffusion pipelines.",Nt,Pe,Ct,_t,Et;return ne=new Rs({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),se=new en({props:{title:"GLIGEN (Grounded Language-to-Image Generation)",local:"gligen-grounded-language-to-image-generation",headingTag:"h1"}}),re=new en({props:{title:"StableDiffusionGLIGENPipeline",local:"diffusers.StableDiffusionGLIGENPipeline",headingTag:"h2"}}),pe=new w({props:{name:"class diffusers.StableDiffusionGLIGENPipeline",anchor:"diffusers.StableDiffusionGLIGENPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionGLIGENPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.text_encoder",description:`<strong>text_encoder</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIPTextModel</a>) &#x2014;
Frozen text-encoder (<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>).`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
A <code>UNet2DConditionModel</code> to denoise the encoded image latents.`,name:"unet"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please refer to the <a href="https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5" rel="nofollow">model card</a> for
more details about a model&#x2019;s potential harms.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPImageProcessor" rel="nofollow">CLIPImageProcessor</a>) &#x2014;
A <code>CLIPImageProcessor</code> to extract features from generated images; used as inputs to the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen.py#L111"}}),de=new w({props:{name:"__call__",anchor:"diffusers.StableDiffusionGLIGENPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"gligen_scheduled_sampling_beta",val:": float = 0.3"},{name:"gligen_phrases",val:": typing.List[str] = None"},{name:"gligen_boxes",val:": typing.List[typing.List[float]] = None"},{name:"gligen_inpaint_image",val:": typing.Optional[PIL.Image.Image] = None"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.Tensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Optional[typing.Callable[[int, int, torch.Tensor], NoneType]] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Optional[typing.Dict[str, typing.Any]] = None"},{name:"clip_skip",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionGLIGENPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide image generation. If not defined, you need to pass <code>prompt_embeds</code>.`,name:"prompt"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.unet.config.sample_size * self.vae_scale_factor</code>) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.unet.config.sample_size * self.vae_scale_factor</code>) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.__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.StableDiffusionGLIGENPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
A higher guidance scale value encourages the model to generate images closely linked to the text
<code>prompt</code> at the expense of lower image quality. Guidance scale is enabled when <code>guidance_scale &gt; 1</code>.`,name:"guidance_scale"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.__call__.gligen_phrases",description:`<strong>gligen_phrases</strong> (<code>List[str]</code>) &#x2014;
The phrases to guide what to include in each of the regions defined by the corresponding
<code>gligen_boxes</code>. There should only be one phrase per bounding box.`,name:"gligen_phrases"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.__call__.gligen_boxes",description:`<strong>gligen_boxes</strong> (<code>List[List[float]]</code>) &#x2014;
The bounding boxes that identify rectangular regions of the image that are going to be filled with the
content described by the corresponding <code>gligen_phrases</code>. Each rectangular box is defined as a
<code>List[float]</code> of 4 elements <code>[xmin, ymin, xmax, ymax]</code> where each value is between [0,1].`,name:"gligen_boxes"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.__call__.gligen_inpaint_image",description:`<strong>gligen_inpaint_image</strong> (<code>PIL.Image.Image</code>, <em>optional</em>) &#x2014;
The input image, if provided, is inpainted with objects described by the <code>gligen_boxes</code> and
<code>gligen_phrases</code>. Otherwise, it is treated as a generation task on a blank input image.`,name:"gligen_inpaint_image"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.__call__.gligen_scheduled_sampling_beta",description:`<strong>gligen_scheduled_sampling_beta</strong> (<code>float</code>, defaults to 0.3) &#x2014;
Scheduled Sampling factor from <a href="https://huggingface.co/papers/2301.07093" rel="nofollow">GLIGEN: Open-Set Grounded Text-to-Image
Generation</a>. Scheduled Sampling factor is only varied for
scheduled sampling during inference for improved quality and controllability.`,name:"gligen_scheduled_sampling_beta"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide what to not include in image generation. If not defined, you need to
pass <code>negative_prompt_embeds</code> instead. Ignored when not using guidance (<code>guidance_scale &lt; 1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.__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.StableDiffusionGLIGENPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) from the <a href="https://huggingface.co/papers/2010.02502" rel="nofollow">DDIM</a> paper. Only
applies to the <a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, and is ignored in other schedulers.`,name:"eta"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow"><code>torch.Generator</code></a> to make
generation deterministic.`,name:"generator"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor is generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs (prompt weighting). If not
provided, text embeddings are generated from the <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs (prompt weighting). If
not provided, <code>negative_prompt_embeds</code> are generated from the <code>negative_prompt</code> input argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.__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 generated image. Choose between <code>PIL.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.__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 <a href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/text2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that calls every <code>callback_steps</code> steps during inference. The function is called with the
following arguments: <code>callback(step: int, timestep: int, latents: torch.Tensor)</code>.`,name:"callback"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.__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 is called. If not specified, the callback is called at
every step.`,name:"callback_steps"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.__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 in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow"><code>self.processor</code></a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.__call__.guidance_rescale",description:`<strong>guidance_rescale</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Guidance rescale factor from <a href="https://huggingface.co/papers/2305.08891" rel="nofollow">Common Diffusion Noise Schedules and Sample Steps are
Flawed</a>. Guidance rescale factor should fix overexposure when
using zero terminal SNR.`,name:"guidance_rescale"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.__call__.clip_skip",description:`<strong>clip_skip</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of layers to be skipped from CLIP while computing the prompt embeddings. A value of 1 means that
the output of the pre-final layer will be used for computing the prompt embeddings.`,name:"clip_skip"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen.py#L539",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/text2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> is returned,
otherwise a <code>tuple</code> is returned where the first element is a list with the generated images and the
second element is a list of <code>bool</code>s indicating whether the corresponding generated image contains
“not-safe-for-work” (nsfw) content.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/text2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),S=new Ds({props:{anchor:"diffusers.StableDiffusionGLIGENPipeline.__call__.example",$$slots:{default:[Ys]},$$scope:{ctx:Be}}}),ce=new w({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionGLIGENPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L2180"}}),me=new w({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionGLIGENPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L2193"}}),ge=new w({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionGLIGENPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L2206"}}),fe=new w({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionGLIGENPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L2220"}}),ue=new w({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableDiffusionGLIGENPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:": typing.Optional[int] = None"},{name:"device",val:": typing.Union[torch.device, str] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionGLIGENPipeline.enable_model_cpu_offload.gpu_id",description:`<strong>gpu_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The ID of the accelerator that shall be used in inference. If not specified, it will default to 0.`,name:"gpu_id"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.enable_model_cpu_offload.device",description:`<strong>device</strong> (<code>torch.Device</code> or <code>str</code>, <em>optional</em>, defaults to None) &#x2014;
The PyTorch device type of the accelerator that shall be used in inference. If not specified, it will
automatically detect the available accelerator and use.`,name:"device"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1150"}}),he=new w({props:{name:"prepare_latents",anchor:"diffusers.StableDiffusionGLIGENPipeline.prepare_latents",parameters:[{name:"batch_size",val:""},{name:"num_channels_latents",val:""},{name:"height",val:""},{name:"width",val:""},{name:"dtype",val:""},{name:"device",val:""},{name:"generator",val:""},{name:"latents",val:" = None"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen.py#L490"}}),be=new w({props:{name:"enable_fuser",anchor:"diffusers.StableDiffusionGLIGENPipeline.enable_fuser",parameters:[{name:"enabled",val:" = True"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen.py#L512"}}),_e=new w({props:{name:"encode_prompt",anchor:"diffusers.StableDiffusionGLIGENPipeline.encode_prompt",parameters:[{name:"prompt",val:""},{name:"device",val:""},{name:"num_images_per_prompt",val:""},{name:"do_classifier_free_guidance",val:""},{name:"negative_prompt",val:" = None"},{name:"prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"lora_scale",val:": typing.Optional[float] = None"},{name:"clip_skip",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionGLIGENPipeline.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"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.encode_prompt.device",description:`<strong>device</strong> &#x2014; (<code>torch.device</code>):
torch device`,name:"device"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.encode_prompt.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>) &#x2014;
number of images that should be generated per prompt`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.encode_prompt.do_classifier_free_guidance",description:`<strong>do_classifier_free_guidance</strong> (<code>bool</code>) &#x2014;
whether to use classifier free guidance or not`,name:"do_classifier_free_guidance"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.encode_prompt.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.StableDiffusionGLIGENPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.Tensor</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.StableDiffusionGLIGENPipeline.encode_prompt.lora_scale",description:`<strong>lora_scale</strong> (<code>float</code>, <em>optional</em>) &#x2014;
A LoRA scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded.`,name:"lora_scale"},{anchor:"diffusers.StableDiffusionGLIGENPipeline.encode_prompt.clip_skip",description:`<strong>clip_skip</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of layers to be skipped from CLIP while computing the prompt embeddings. A value of 1 means that
the output of the pre-final layer will be used for computing the prompt embeddings.`,name:"clip_skip"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen.py#L220"}}),ye=new en({props:{title:"StableDiffusionGLIGENTextImagePipeline",local:"diffusers.StableDiffusionGLIGENTextImagePipeline",headingTag:"h2"}}),Me=new w({props:{name:"class diffusers.StableDiffusionGLIGENTextImagePipeline",anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"processor",val:": CLIPProcessor"},{name:"image_encoder",val:": CLIPVisionModelWithProjection"},{name:"image_project",val:": CLIPImageProjection"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.text_encoder",description:`<strong>text_encoder</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIPTextModel</a>) &#x2014;
Frozen text-encoder (<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>).`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.processor",description:`<strong>processor</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPProcessor" rel="nofollow">CLIPProcessor</a>) &#x2014;
A <code>CLIPProcessor</code> to process reference image.`,name:"processor"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.image_encoder",description:`<strong>image_encoder</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPVisionModelWithProjection" rel="nofollow">CLIPVisionModelWithProjection</a>) &#x2014;
Frozen image-encoder (<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>).`,name:"image_encoder"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.image_project",description:`<strong>image_project</strong> (<code>CLIPImageProjection</code>) &#x2014;
A <code>CLIPImageProjection</code> to project image embedding into phrases embedding space.`,name:"image_project"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
A <code>UNet2DConditionModel</code> to denoise the encoded image latents.`,name:"unet"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please refer to the <a href="https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5" rel="nofollow">model card</a> for
more details about a model&#x2019;s potential harms.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPImageProcessor" rel="nofollow">CLIPImageProcessor</a>) &#x2014;
A <code>CLIPImageProcessor</code> to extract features from generated images; used as inputs to the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen_text_image.py#L163"}}),Ie=new w({props:{name:"__call__",anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"gligen_scheduled_sampling_beta",val:": float = 0.3"},{name:"gligen_phrases",val:": typing.List[str] = None"},{name:"gligen_images",val:": typing.List[PIL.Image.Image] = None"},{name:"input_phrases_mask",val:": typing.Union[int, typing.List[int]] = None"},{name:"input_images_mask",val:": typing.Union[int, typing.List[int]] = None"},{name:"gligen_boxes",val:": typing.List[typing.List[float]] = None"},{name:"gligen_inpaint_image",val:": typing.Optional[PIL.Image.Image] = None"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.Tensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Optional[typing.Callable[[int, int, torch.Tensor], NoneType]] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Optional[typing.Dict[str, typing.Any]] = None"},{name:"gligen_normalize_constant",val:": float = 28.7"},{name:"clip_skip",val:": int = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide image generation. If not defined, you need to pass <code>prompt_embeds</code>.`,name:"prompt"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.unet.config.sample_size * self.vae_scale_factor</code>) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.unet.config.sample_size * self.vae_scale_factor</code>) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.__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.StableDiffusionGLIGENTextImagePipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
A higher guidance scale value encourages the model to generate images closely linked to the text
<code>prompt</code> at the expense of lower image quality. Guidance scale is enabled when <code>guidance_scale &gt; 1</code>.`,name:"guidance_scale"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.__call__.gligen_phrases",description:`<strong>gligen_phrases</strong> (<code>List[str]</code>) &#x2014;
The phrases to guide what to include in each of the regions defined by the corresponding
<code>gligen_boxes</code>. There should only be one phrase per bounding box.`,name:"gligen_phrases"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.__call__.gligen_images",description:`<strong>gligen_images</strong> (<code>List[PIL.Image.Image]</code>) &#x2014;
The images to guide what to include in each of the regions defined by the corresponding <code>gligen_boxes</code>.
There should only be one image per bounding box`,name:"gligen_images"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.__call__.input_phrases_mask",description:`<strong>input_phrases_mask</strong> (<code>int</code> or <code>List[int]</code>) &#x2014;
pre phrases mask input defined by the correspongding <code>input_phrases_mask</code>`,name:"input_phrases_mask"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.__call__.input_images_mask",description:`<strong>input_images_mask</strong> (<code>int</code> or <code>List[int]</code>) &#x2014;
pre images mask input defined by the correspongding <code>input_images_mask</code>`,name:"input_images_mask"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.__call__.gligen_boxes",description:`<strong>gligen_boxes</strong> (<code>List[List[float]]</code>) &#x2014;
The bounding boxes that identify rectangular regions of the image that are going to be filled with the
content described by the corresponding <code>gligen_phrases</code>. Each rectangular box is defined as a
<code>List[float]</code> of 4 elements <code>[xmin, ymin, xmax, ymax]</code> where each value is between [0,1].`,name:"gligen_boxes"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.__call__.gligen_inpaint_image",description:`<strong>gligen_inpaint_image</strong> (<code>PIL.Image.Image</code>, <em>optional</em>) &#x2014;
The input image, if provided, is inpainted with objects described by the <code>gligen_boxes</code> and
<code>gligen_phrases</code>. Otherwise, it is treated as a generation task on a blank input image.`,name:"gligen_inpaint_image"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.__call__.gligen_scheduled_sampling_beta",description:`<strong>gligen_scheduled_sampling_beta</strong> (<code>float</code>, defaults to 0.3) &#x2014;
Scheduled Sampling factor from <a href="https://huggingface.co/papers/2301.07093" rel="nofollow">GLIGEN: Open-Set Grounded Text-to-Image
Generation</a>. Scheduled Sampling factor is only varied for
scheduled sampling during inference for improved quality and controllability.`,name:"gligen_scheduled_sampling_beta"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide what to not include in image generation. If not defined, you need to
pass <code>negative_prompt_embeds</code> instead. Ignored when not using guidance (<code>guidance_scale &lt; 1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.__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.StableDiffusionGLIGENTextImagePipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) from the <a href="https://huggingface.co/papers/2010.02502" rel="nofollow">DDIM</a> paper. Only
applies to the <a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, and is ignored in other schedulers.`,name:"eta"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow"><code>torch.Generator</code></a> to make
generation deterministic.`,name:"generator"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor is generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs (prompt weighting). If not
provided, text embeddings are generated from the <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs (prompt weighting). If
not provided, <code>negative_prompt_embeds</code> are generated from the <code>negative_prompt</code> input argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.__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 generated image. Choose between <code>PIL.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.__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 <a href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/text2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that calls every <code>callback_steps</code> steps during inference. The function is called with the
following arguments: <code>callback(step: int, timestep: int, latents: torch.Tensor)</code>.`,name:"callback"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.__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 is called. If not specified, the callback is called at
every step.`,name:"callback_steps"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.__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 in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow"><code>self.processor</code></a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.__call__.gligen_normalize_constant",description:`<strong>gligen_normalize_constant</strong> (<code>float</code>, <em>optional</em>, defaults to 28.7) &#x2014;
The normalize value of the image embedding.`,name:"gligen_normalize_constant"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.__call__.clip_skip",description:`<strong>clip_skip</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of layers to be skipped from CLIP while computing the prompt embeddings. A value of 1 means that
the output of the pre-final layer will be used for computing the prompt embeddings.`,name:"clip_skip"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen_text_image.py#L714",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/text2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> is returned,
otherwise a <code>tuple</code> is returned where the first element is a list with the generated images and the
second element is a list of <code>bool</code>s indicating whether the corresponding generated image contains
“not-safe-for-work” (nsfw) content.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/text2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),V=new Ds({props:{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.__call__.example",$$slots:{default:[Xs]},$$scope:{ctx:Be}}}),we=new w({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L2180"}}),Te=new w({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L2193"}}),ve=new w({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L2206"}}),Ge=new w({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L2220"}}),xe=new w({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:": typing.Optional[int] = None"},{name:"device",val:": typing.Union[torch.device, str] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.enable_model_cpu_offload.gpu_id",description:`<strong>gpu_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The ID of the accelerator that shall be used in inference. If not specified, it will default to 0.`,name:"gpu_id"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.enable_model_cpu_offload.device",description:`<strong>device</strong> (<code>torch.Device</code> or <code>str</code>, <em>optional</em>, defaults to None) &#x2014;
The PyTorch device type of the accelerator that shall be used in inference. If not specified, it will
automatically detect the available accelerator and use.`,name:"device"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1150"}}),Je=new w({props:{name:"prepare_latents",anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.prepare_latents",parameters:[{name:"batch_size",val:""},{name:"num_channels_latents",val:""},{name:"height",val:""},{name:"width",val:""},{name:"dtype",val:""},{name:"device",val:""},{name:"generator",val:""},{name:"latents",val:" = None"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen_text_image.py#L528"}}),je=new w({props:{name:"enable_fuser",anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.enable_fuser",parameters:[{name:"enabled",val:" = True"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen_text_image.py#L550"}}),Ue=new w({props:{name:"complete_mask",anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.complete_mask",parameters:[{name:"has_mask",val:""},{name:"max_objs",val:""},{name:"device",val:""}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen_text_image.py#L587"}}),Le=new w({props:{name:"crop",anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.crop",parameters:[{name:"im",val:""},{name:"new_width",val:""},{name:"new_height",val:""}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen_text_image.py#L567"}}),Ne=new w({props:{name:"draw_inpaint_mask_from_boxes",anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.draw_inpaint_mask_from_boxes",parameters:[{name:"boxes",val:""},{name:"size",val:""}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen_text_image.py#L555"}}),Ce=new w({props:{name:"encode_prompt",anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.encode_prompt",parameters:[{name:"prompt",val:""},{name:"device",val:""},{name:"num_images_per_prompt",val:""},{name:"do_classifier_free_guidance",val:""},{name:"negative_prompt",val:" = None"},{name:"prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"lora_scale",val:": typing.Optional[float] = None"},{name:"clip_skip",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.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"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.encode_prompt.device",description:`<strong>device</strong> &#x2014; (<code>torch.device</code>):
torch device`,name:"device"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.encode_prompt.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>) &#x2014;
number of images that should be generated per prompt`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.encode_prompt.do_classifier_free_guidance",description:`<strong>do_classifier_free_guidance</strong> (<code>bool</code>) &#x2014;
whether to use classifier free guidance or not`,name:"do_classifier_free_guidance"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.encode_prompt.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.StableDiffusionGLIGENTextImagePipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.Tensor</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.StableDiffusionGLIGENTextImagePipeline.encode_prompt.lora_scale",description:`<strong>lora_scale</strong> (<code>float</code>, <em>optional</em>) &#x2014;
A LoRA scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded.`,name:"lora_scale"},{anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.encode_prompt.clip_skip",description:`<strong>clip_skip</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of layers to be skipped from CLIP while computing the prompt embeddings. A value of 1 means that
the output of the pre-final layer will be used for computing the prompt embeddings.`,name:"clip_skip"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen_text_image.py#L251"}}),Ee=new w({props:{name:"get_clip_feature",anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.get_clip_feature",parameters:[{name:"input",val:""},{name:"normalize_constant",val:""},{name:"device",val:""},{name:"is_image",val:" = False"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen_text_image.py#L603"}}),Ze=new w({props:{name:"get_cross_attention_kwargs_with_grounded",anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.get_cross_attention_kwargs_with_grounded",parameters:[{name:"hidden_size",val:""},{name:"gligen_phrases",val:""},{name:"gligen_images",val:""},{name:"gligen_boxes",val:""},{name:"input_phrases_mask",val:""},{name:"input_images_mask",val:""},{name:"repeat_batch",val:""},{name:"normalize_constant",val:""},{name:"max_objs",val:""},{name:"device",val:""}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen_text_image.py#L627"}}),Se=new w({props:{name:"get_cross_attention_kwargs_without_grounded",anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.get_cross_attention_kwargs_without_grounded",parameters:[{name:"hidden_size",val:""},{name:"repeat_batch",val:""},{name:"max_objs",val:""},{name:"device",val:""}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen_text_image.py#L691"}}),De=new w({props:{name:"target_size_center_crop",anchor:"diffusers.StableDiffusionGLIGENTextImagePipeline.target_size_center_crop",parameters:[{name:"im",val:""},{name:"new_hw",val:""}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen_text_image.py#L578"}}),$e=new en({props:{title:"StableDiffusionPipelineOutput",local:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",headingTag:"h2"}}),ke=new w({props:{name:"class diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",parameters:[{name:"images",val:": typing.Union[typing.List[PIL.Image.Image], numpy.ndarray]"},{name:"nsfw_content_detected",val:": typing.Optional[typing.List[bool]]"}],parametersDescription:[{anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput.images",description:`<strong>images</strong> (<code>List[PIL.Image.Image]</code> or <code>np.ndarray</code>) &#x2014;
List of denoised PIL images of length <code>batch_size</code> or NumPy array of shape <code>(batch_size, height, width, num_channels)</code>.`,name:"images"},{anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput.nsfw_content_detected",description:`<strong>nsfw_content_detected</strong> (<code>List[bool]</code>) &#x2014;
List indicating whether the corresponding generated image contains &#x201C;not-safe-for-work&#x201D; (nsfw) content or
<code>None</code> if safety checking could not be performed.`,name:"nsfw_content_detected"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_output.py#L11"}}),Pe=new zs({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/stable_diffusion/gligen.md"}}),{c(){v=a("meta"),U=n(),J=a("p"),G=n(),x=a("blockquote"),x.innerHTML=b,j=n(),d(ne.$$.fragment),yt=n(),d(se.$$.fragment),Mt=n(),ae=a("p"),ae.innerHTML=ts,It=n(),ie=a("p"),ie.innerHTML=ns,wt=n(),oe=a("p"),oe.innerHTML=ss,Tt=n(),Z=a("blockquote"),Z.innerHTML=as,vt=n(),le=a("p"),le.innerHTML=is,Gt=n(),d(re.$$.fragment),xt=n(),I=a("div"),d(pe.$$.fragment),tn=n(),We=a("p"),We.textContent=os,nn=n(),Ve=a("p"),Ve.innerHTML=ls,sn=n(),L=a("div"),d(de.$$.fragment),an=n(),Ae=a("p"),Ae.textContent=rs,on=n(),d(S.$$.fragment),ln=n(),D=a("div"),d(ce.$$.fragment),rn=n(),Re=a("p"),Re.textContent=ps,pn=n(),$=a("div"),d(me.$$.fragment),dn=n(),ze=a("p"),ze.innerHTML=ds,cn=n(),k=a("div"),d(ge.$$.fragment),mn=n(),Ye=a("p"),Ye.textContent=cs,gn=n(),P=a("div"),d(fe.$$.fragment),fn=n(),Xe=a("p"),Xe.innerHTML=ms,un=n(),B=a("div"),d(ue.$$.fragment),hn=n(),Qe=a("p"),Qe.innerHTML=gs,bn=n(),He=a("div"),d(he.$$.fragment),_n=n(),qe=a("div"),d(be.$$.fragment),yn=n(),W=a("div"),d(_e.$$.fragment),Mn=n(),Fe=a("p"),Fe.textContent=fs,Jt=n(),d(ye.$$.fragment),jt=n(),l=a("div"),d(Me.$$.fragment),In=n(),Oe=a("p"),Oe.textContent=us,wn=n(),Ke=a("p"),Ke.innerHTML=hs,Tn=n(),N=a("div"),d(Ie.$$.fragment),vn=n(),et=a("p"),et.textContent=bs,Gn=n(),d(V.$$.fragment),xn=n(),A=a("div"),d(we.$$.fragment),Jn=n(),tt=a("p"),tt.textContent=_s,jn=n(),R=a("div"),d(Te.$$.fragment),Un=n(),nt=a("p"),nt.innerHTML=ys,Ln=n(),z=a("div"),d(ve.$$.fragment),Nn=n(),st=a("p"),st.textContent=Ms,Cn=n(),Y=a("div"),d(Ge.$$.fragment),En=n(),at=a("p"),at.innerHTML=Is,Zn=n(),X=a("div"),d(xe.$$.fragment),Sn=n(),it=a("p"),it.innerHTML=ws,Dn=n(),ot=a("div"),d(Je.$$.fragment),$n=n(),lt=a("div"),d(je.$$.fragment),kn=n(),Q=a("div"),d(Ue.$$.fragment),Pn=n(),rt=a("p"),rt.innerHTML=Ts,Bn=n(),H=a("div"),d(Le.$$.fragment),Wn=n(),pt=a("p"),pt.textContent=vs,Vn=n(),q=a("div"),d(Ne.$$.fragment),An=n(),dt=a("p"),dt.textContent=Gs,Rn=n(),F=a("div"),d(Ce.$$.fragment),zn=n(),ct=a("p"),ct.textContent=xs,Yn=n(),O=a("div"),d(Ee.$$.fragment),Xn=n(),mt=a("p"),mt.textContent=Js,Qn=n(),K=a("div"),d(Ze.$$.fragment),Hn=n(),gt=a("p"),gt.textContent=js,qn=n(),ee=a("div"),d(Se.$$.fragment),Fn=n(),ft=a("p"),ft.textContent=Us,On=n(),te=a("div"),d(De.$$.fragment),Kn=n(),ut=a("p"),ut.textContent=Ls,Ut=n(),d($e.$$.fragment),Lt=n(),C=a("div"),d(ke.$$.fragment),es=n(),ht=a("p"),ht.textContent=Ns,Nt=n(),d(Pe.$$.fragment),Ct=n(),_t=a("p"),this.h()},l(e){const r=As("svelte-u9bgzb",document.head);v=i(r,"META",{name:!0,content:!0}),r.forEach(o),U=s(e),J=i(e,"P",{}),M(J).forEach(o),G=s(e),x=i(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),h(x)!=="svelte-124tjg"&&(x.innerHTML=b),j=s(e),c(ne.$$.fragment,e),yt=s(e),c(se.$$.fragment,e),Mt=s(e),ae=i(e,"P",{"data-svelte-h":!0}),h(ae)!=="svelte-l5ge0a"&&(ae.innerHTML=ts),It=s(e),ie=i(e,"P",{"data-svelte-h":!0}),h(ie)!=="svelte-uh0q2i"&&(ie.innerHTML=ns),wt=s(e),oe=i(e,"P",{"data-svelte-h":!0}),h(oe)!=="svelte-5czwpf"&&(oe.innerHTML=ss),Tt=s(e),Z=i(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),h(Z)!=="svelte-18iu7g2"&&(Z.innerHTML=as),vt=s(e),le=i(e,"P",{"data-svelte-h":!0}),h(le)!=="svelte-43r83w"&&(le.innerHTML=is),Gt=s(e),c(re.$$.fragment,e),xt=s(e),I=i(e,"DIV",{class:!0});var T=M(I);c(pe.$$.fragment,T),tn=s(T),We=i(T,"P",{"data-svelte-h":!0}),h(We)!=="svelte-gowtb8"&&(We.textContent=os),nn=s(T),Ve=i(T,"P",{"data-svelte-h":!0}),h(Ve)!=="svelte-1s3mvdr"&&(Ve.innerHTML=ls),sn=s(T),L=i(T,"DIV",{class:!0});var E=M(L);c(de.$$.fragment,E),an=s(E),Ae=i(E,"P",{"data-svelte-h":!0}),h(Ae)!=="svelte-50j04k"&&(Ae.textContent=rs),on=s(E),c(S.$$.fragment,E),E.forEach(o),ln=s(T),D=i(T,"DIV",{class:!0});var Zt=M(D);c(ce.$$.fragment,Zt),rn=s(Zt),Re=i(Zt,"P",{"data-svelte-h":!0}),h(Re)!=="svelte-14bnrb6"&&(Re.textContent=ps),Zt.forEach(o),pn=s(T),$=i(T,"DIV",{class:!0});var St=M($);c(me.$$.fragment,St),dn=s(St),ze=i(St,"P",{"data-svelte-h":!0}),h(ze)!=="svelte-1s3c06i"&&(ze.innerHTML=ds),St.forEach(o),cn=s(T),k=i(T,"DIV",{class:!0});var Dt=M(k);c(ge.$$.fragment,Dt),mn=s(Dt),Ye=i(Dt,"P",{"data-svelte-h":!0}),h(Ye)!=="svelte-1xwrf7t"&&(Ye.textContent=cs),Dt.forEach(o),gn=s(T),P=i(T,"DIV",{class:!0});var $t=M(P);c(fe.$$.fragment,$t),fn=s($t),Xe=i($t,"P",{"data-svelte-h":!0}),h(Xe)!=="svelte-pkn4ui"&&(Xe.innerHTML=ms),$t.forEach(o),un=s(T),B=i(T,"DIV",{class:!0});var kt=M(B);c(ue.$$.fragment,kt),hn=s(kt),Qe=i(kt,"P",{"data-svelte-h":!0}),h(Qe)!=="svelte-9hgqai"&&(Qe.innerHTML=gs),kt.forEach(o),bn=s(T),He=i(T,"DIV",{class:!0});var Cs=M(He);c(he.$$.fragment,Cs),Cs.forEach(o),_n=s(T),qe=i(T,"DIV",{class:!0});var Es=M(qe);c(be.$$.fragment,Es),Es.forEach(o),yn=s(T),W=i(T,"DIV",{class:!0});var Pt=M(W);c(_e.$$.fragment,Pt),Mn=s(Pt),Fe=i(Pt,"P",{"data-svelte-h":!0}),h(Fe)!=="svelte-16q0ax1"&&(Fe.textContent=fs),Pt.forEach(o),T.forEach(o),Jt=s(e),c(ye.$$.fragment,e),jt=s(e),l=i(e,"DIV",{class:!0});var p=M(l);c(Me.$$.fragment,p),In=s(p),Oe=i(p,"P",{"data-svelte-h":!0}),h(Oe)!=="svelte-gowtb8"&&(Oe.textContent=us),wn=s(p),Ke=i(p,"P",{"data-svelte-h":!0}),h(Ke)!=="svelte-1s3mvdr"&&(Ke.innerHTML=hs),Tn=s(p),N=i(p,"DIV",{class:!0});var bt=M(N);c(Ie.$$.fragment,bt),vn=s(bt),et=i(bt,"P",{"data-svelte-h":!0}),h(et)!=="svelte-50j04k"&&(et.textContent=bs),Gn=s(bt),c(V.$$.fragment,bt),bt.forEach(o),xn=s(p),A=i(p,"DIV",{class:!0});var Bt=M(A);c(we.$$.fragment,Bt),Jn=s(Bt),tt=i(Bt,"P",{"data-svelte-h":!0}),h(tt)!=="svelte-14bnrb6"&&(tt.textContent=_s),Bt.forEach(o),jn=s(p),R=i(p,"DIV",{class:!0});var Wt=M(R);c(Te.$$.fragment,Wt),Un=s(Wt),nt=i(Wt,"P",{"data-svelte-h":!0}),h(nt)!=="svelte-1s3c06i"&&(nt.innerHTML=ys),Wt.forEach(o),Ln=s(p),z=i(p,"DIV",{class:!0});var Vt=M(z);c(ve.$$.fragment,Vt),Nn=s(Vt),st=i(Vt,"P",{"data-svelte-h":!0}),h(st)!=="svelte-1xwrf7t"&&(st.textContent=Ms),Vt.forEach(o),Cn=s(p),Y=i(p,"DIV",{class:!0});var At=M(Y);c(Ge.$$.fragment,At),En=s(At),at=i(At,"P",{"data-svelte-h":!0}),h(at)!=="svelte-pkn4ui"&&(at.innerHTML=Is),At.forEach(o),Zn=s(p),X=i(p,"DIV",{class:!0});var Rt=M(X);c(xe.$$.fragment,Rt),Sn=s(Rt),it=i(Rt,"P",{"data-svelte-h":!0}),h(it)!=="svelte-9hgqai"&&(it.innerHTML=ws),Rt.forEach(o),Dn=s(p),ot=i(p,"DIV",{class:!0});var Zs=M(ot);c(Je.$$.fragment,Zs),Zs.forEach(o),$n=s(p),lt=i(p,"DIV",{class:!0});var Ss=M(lt);c(je.$$.fragment,Ss),Ss.forEach(o),kn=s(p),Q=i(p,"DIV",{class:!0});var zt=M(Q);c(Ue.$$.fragment,zt),Pn=s(zt),rt=i(zt,"P",{"data-svelte-h":!0}),h(rt)!=="svelte-z0y3an"&&(rt.innerHTML=Ts),zt.forEach(o),Bn=s(p),H=i(p,"DIV",{class:!0});var Yt=M(H);c(Le.$$.fragment,Yt),Wn=s(Yt),pt=i(Yt,"P",{"data-svelte-h":!0}),h(pt)!=="svelte-11j7r65"&&(pt.textContent=vs),Yt.forEach(o),Vn=s(p),q=i(p,"DIV",{class:!0});var Xt=M(q);c(Ne.$$.fragment,Xt),An=s(Xt),dt=i(Xt,"P",{"data-svelte-h":!0}),h(dt)!=="svelte-9eocln"&&(dt.textContent=Gs),Xt.forEach(o),Rn=s(p),F=i(p,"DIV",{class:!0});var Qt=M(F);c(Ce.$$.fragment,Qt),zn=s(Qt),ct=i(Qt,"P",{"data-svelte-h":!0}),h(ct)!=="svelte-16q0ax1"&&(ct.textContent=xs),Qt.forEach(o),Yn=s(p),O=i(p,"DIV",{class:!0});var Ht=M(O);c(Ee.$$.fragment,Ht),Xn=s(Ht),mt=i(Ht,"P",{"data-svelte-h":!0}),h(mt)!=="svelte-1hybt25"&&(mt.textContent=Js),Ht.forEach(o),Qn=s(p),K=i(p,"DIV",{class:!0});var qt=M(K);c(Ze.$$.fragment,qt),Hn=s(qt),gt=i(qt,"P",{"data-svelte-h":!0}),h(gt)!=="svelte-1f1gk5j"&&(gt.textContent=js),qt.forEach(o),qn=s(p),ee=i(p,"DIV",{class:!0});var Ft=M(ee);c(Se.$$.fragment,Ft),Fn=s(Ft),ft=i(Ft,"P",{"data-svelte-h":!0}),h(ft)!=="svelte-1tqrrzw"&&(ft.textContent=Us),Ft.forEach(o),On=s(p),te=i(p,"DIV",{class:!0});var Ot=M(te);c(De.$$.fragment,Ot),Kn=s(Ot),ut=i(Ot,"P",{"data-svelte-h":!0}),h(ut)!=="svelte-gczl07"&&(ut.textContent=Ls),Ot.forEach(o),p.forEach(o),Ut=s(e),c($e.$$.fragment,e),Lt=s(e),C=i(e,"DIV",{class:!0});var Kt=M(C);c(ke.$$.fragment,Kt),es=s(Kt),ht=i(Kt,"P",{"data-svelte-h":!0}),h(ht)!=="svelte-1qpjiuf"&&(ht.textContent=Ns),Kt.forEach(o),Nt=s(e),c(Pe.$$.fragment,e),Ct=s(e),_t=i(e,"P",{}),M(_t).forEach(o),this.h()},h(){_(v,"name","hf:doc:metadata"),_(v,"content",Hs),_(x,"class","warning"),_(Z,"class","tip"),_(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(He,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(l,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,r){t(document.head,v),y(e,U,r),y(e,J,r),y(e,G,r),y(e,x,r),y(e,j,r),m(ne,e,r),y(e,yt,r),m(se,e,r),y(e,Mt,r),y(e,ae,r),y(e,It,r),y(e,ie,r),y(e,wt,r),y(e,oe,r),y(e,Tt,r),y(e,Z,r),y(e,vt,r),y(e,le,r),y(e,Gt,r),m(re,e,r),y(e,xt,r),y(e,I,r),m(pe,I,null),t(I,tn),t(I,We),t(I,nn),t(I,Ve),t(I,sn),t(I,L),m(de,L,null),t(L,an),t(L,Ae),t(L,on),m(S,L,null),t(I,ln),t(I,D),m(ce,D,null),t(D,rn),t(D,Re),t(I,pn),t(I,$),m(me,$,null),t($,dn),t($,ze),t(I,cn),t(I,k),m(ge,k,null),t(k,mn),t(k,Ye),t(I,gn),t(I,P),m(fe,P,null),t(P,fn),t(P,Xe),t(I,un),t(I,B),m(ue,B,null),t(B,hn),t(B,Qe),t(I,bn),t(I,He),m(he,He,null),t(I,_n),t(I,qe),m(be,qe,null),t(I,yn),t(I,W),m(_e,W,null),t(W,Mn),t(W,Fe),y(e,Jt,r),m(ye,e,r),y(e,jt,r),y(e,l,r),m(Me,l,null),t(l,In),t(l,Oe),t(l,wn),t(l,Ke),t(l,Tn),t(l,N),m(Ie,N,null),t(N,vn),t(N,et),t(N,Gn),m(V,N,null),t(l,xn),t(l,A),m(we,A,null),t(A,Jn),t(A,tt),t(l,jn),t(l,R),m(Te,R,null),t(R,Un),t(R,nt),t(l,Ln),t(l,z),m(ve,z,null),t(z,Nn),t(z,st),t(l,Cn),t(l,Y),m(Ge,Y,null),t(Y,En),t(Y,at),t(l,Zn),t(l,X),m(xe,X,null),t(X,Sn),t(X,it),t(l,Dn),t(l,ot),m(Je,ot,null),t(l,$n),t(l,lt),m(je,lt,null),t(l,kn),t(l,Q),m(Ue,Q,null),t(Q,Pn),t(Q,rt),t(l,Bn),t(l,H),m(Le,H,null),t(H,Wn),t(H,pt),t(l,Vn),t(l,q),m(Ne,q,null),t(q,An),t(q,dt),t(l,Rn),t(l,F),m(Ce,F,null),t(F,zn),t(F,ct),t(l,Yn),t(l,O),m(Ee,O,null),t(O,Xn),t(O,mt),t(l,Qn),t(l,K),m(Ze,K,null),t(K,Hn),t(K,gt),t(l,qn),t(l,ee),m(Se,ee,null),t(ee,Fn),t(ee,ft),t(l,On),t(l,te),m(De,te,null),t(te,Kn),t(te,ut),y(e,Ut,r),m($e,e,r),y(e,Lt,r),y(e,C,r),m(ke,C,null),t(C,es),t(C,ht),y(e,Nt,r),m(Pe,e,r),y(e,Ct,r),y(e,_t,r),Et=!0},p(e,[r]){const T={};r&2&&(T.$$scope={dirty:r,ctx:e}),S.$set(T);const E={};r&2&&(E.$$scope={dirty:r,ctx:e}),V.$set(E)},i(e){Et||(g(ne.$$.fragment,e),g(se.$$.fragment,e),g(re.$$.fragment,e),g(pe.$$.fragment,e),g(de.$$.fragment,e),g(S.$$.fragment,e),g(ce.$$.fragment,e),g(me.$$.fragment,e),g(ge.$$.fragment,e),g(fe.$$.fragment,e),g(ue.$$.fragment,e),g(he.$$.fragment,e),g(be.$$.fragment,e),g(_e.$$.fragment,e),g(ye.$$.fragment,e),g(Me.$$.fragment,e),g(Ie.$$.fragment,e),g(V.$$.fragment,e),g(we.$$.fragment,e),g(Te.$$.fragment,e),g(ve.$$.fragment,e),g(Ge.$$.fragment,e),g(xe.$$.fragment,e),g(Je.$$.fragment,e),g(je.$$.fragment,e),g(Ue.$$.fragment,e),g(Le.$$.fragment,e),g(Ne.$$.fragment,e),g(Ce.$$.fragment,e),g(Ee.$$.fragment,e),g(Ze.$$.fragment,e),g(Se.$$.fragment,e),g(De.$$.fragment,e),g($e.$$.fragment,e),g(ke.$$.fragment,e),g(Pe.$$.fragment,e),Et=!0)},o(e){f(ne.$$.fragment,e),f(se.$$.fragment,e),f(re.$$.fragment,e),f(pe.$$.fragment,e),f(de.$$.fragment,e),f(S.$$.fragment,e),f(ce.$$.fragment,e),f(me.$$.fragment,e),f(ge.$$.fragment,e),f(fe.$$.fragment,e),f(ue.$$.fragment,e),f(he.$$.fragment,e),f(be.$$.fragment,e),f(_e.$$.fragment,e),f(ye.$$.fragment,e),f(Me.$$.fragment,e),f(Ie.$$.fragment,e),f(V.$$.fragment,e),f(we.$$.fragment,e),f(Te.$$.fragment,e),f(ve.$$.fragment,e),f(Ge.$$.fragment,e),f(xe.$$.fragment,e),f(Je.$$.fragment,e),f(je.$$.fragment,e),f(Ue.$$.fragment,e),f(Le.$$.fragment,e),f(Ne.$$.fragment,e),f(Ce.$$.fragment,e),f(Ee.$$.fragment,e),f(Ze.$$.fragment,e),f(Se.$$.fragment,e),f(De.$$.fragment,e),f($e.$$.fragment,e),f(ke.$$.fragment,e),f(Pe.$$.fragment,e),Et=!1},d(e){e&&(o(U),o(J),o(G),o(x),o(j),o(yt),o(Mt),o(ae),o(It),o(ie),o(wt),o(oe),o(Tt),o(Z),o(vt),o(le),o(Gt),o(xt),o(I),o(Jt),o(jt),o(l),o(Ut),o(Lt),o(C),o(Nt),o(Ct),o(_t)),o(v),u(ne,e),u(se,e),u(re,e),u(pe),u(de),u(S),u(ce),u(me),u(ge),u(fe),u(ue),u(he),u(be),u(_e),u(ye,e),u(Me),u(Ie),u(V),u(we),u(Te),u(ve),u(Ge),u(xe),u(Je),u(je),u(Ue),u(Le),u(Ne),u(Ce),u(Ee),u(Ze),u(Se),u(De),u($e,e),u(ke),u(Pe,e)}}}const Hs='{"title":"GLIGEN (Grounded Language-to-Image Generation)","local":"gligen-grounded-language-to-image-generation","sections":[{"title":"StableDiffusionGLIGENPipeline","local":"diffusers.StableDiffusionGLIGENPipeline","sections":[],"depth":2},{"title":"StableDiffusionGLIGENTextImagePipeline","local":"diffusers.StableDiffusionGLIGENTextImagePipeline","sections":[],"depth":2},{"title":"StableDiffusionPipelineOutput","local":"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput","sections":[],"depth":2}],"depth":1}';function qs(Be){return Bs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class aa extends Ws{constructor(v){super(),Vs(this,v,qs,Qs,Ps,{})}}export{aa as component};
