import{s as We,o as Ve,n as Pe}from"../chunks/scheduler.8c3d61f6.js";import{S as Be,i as Oe,g as p,s,r as c,A as Xe,h as f,f as n,c as o,j as A,u as m,x as S,k as K,y as w,a as i,v as u,d as g,t as _,w as h}from"../chunks/index.da70eac4.js";import{T as Ne}from"../chunks/Tip.1d9b8c37.js";import{D as ye}from"../chunks/Docstring.36ab7a66.js";import{C as De}from"../chunks/CodeBlock.a9c4becf.js";import{E as Ee}from"../chunks/ExampleCodeBlock.a18c7ba7.js";import{H as we,E as He}from"../chunks/getInferenceSnippets.33773fa8.js";function Ye(P){let a,b="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.";return{c(){a=p("p"),a.textContent=b},l(l){a=f(l,"P",{"data-svelte-h":!0}),S(a)!=="svelte-ic4u42"&&(a.textContent=b)},m(l,d){i(l,a,d)},p:Pe,d(l){l&&n(a)}}}function qe(P){let a,b='Make sure to check out the Stable Diffusion <a href="overview#tips">Tips</a> section to learn how to explore the tradeoff between scheduler speed and quality, and how to reuse pipeline components efficiently!';return{c(){a=p("p"),a.innerHTML=b},l(l){a=f(l,"P",{"data-svelte-h":!0}),S(a)!=="svelte-1j961ct"&&(a.innerHTML=b)},m(l,d){i(l,a,d)},p:Pe,d(l){l&&n(a)}}}function Re(P){let a,b="Examples:",l,d,y;return d=new De({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmVTYWZlJTBBZnJvbSUyMGRpZmZ1c2Vycy5waXBlbGluZXMuc3RhYmxlX2RpZmZ1c2lvbl9zYWZlJTIwaW1wb3J0JTIwU2FmZXR5Q29uZmlnJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25QaXBlbGluZVNhZmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMkFJTUwtVFVEQSUyRnN0YWJsZS1kaWZmdXNpb24tc2FmZSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUwQSkudG8oJTIyY3VkYSUyMiklMEFwcm9tcHQlMjAlM0QlMjAlMjJ0aGUlMjBmb3VyJTIwaG9yc2V3b21lbiUyMG9mJTIwdGhlJTIwYXBvY2FseXBzZSUyQyUyMHBhaW50aW5nJTIwYnklMjB0b20lMjBvZiUyMGZpbmxhbmQlMkMlMjBnYXN0b24lMjBidXNzaWVyZSUyQyUyMGNyYWlnJTIwbXVsbGlucyUyQyUyMGouJTIwYy4lMjBsZXllbmRlY2tlciUyMiUwQWltYWdlJTIwJTNEJTIwcGlwZWxpbmUocHJvbXB0JTNEcHJvbXB0JTJDJTIwKipTYWZldHlDb25maWcuTUVESVVNKS5pbWFnZXMlNUIwJTVE",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipelineSafe
<span class="hljs-keyword">from</span> diffusers.pipelines.stable_diffusion_safe <span class="hljs-keyword">import</span> SafetyConfig

pipeline = StableDiffusionPipelineSafe.from_pretrained(
    <span class="hljs-string">&quot;AIML-TUDA/stable-diffusion-safe&quot;</span>, torch_dtype=torch.float16
).to(<span class="hljs-string">&quot;cuda&quot;</span>)
prompt = <span class="hljs-string">&quot;the four horsewomen of the apocalypse, painting by tom of finland, gaston bussiere, craig mullins, j. c. leyendecker&quot;</span>
image = pipeline(prompt=prompt, **SafetyConfig.MEDIUM).images[<span class="hljs-number">0</span>]`,wrap:!1}}),{c(){a=p("p"),a.textContent=b,l=s(),c(d.$$.fragment)},l(r){a=f(r,"P",{"data-svelte-h":!0}),S(a)!=="svelte-kvfsh7"&&(a.textContent=b),l=o(r),m(d.$$.fragment,r)},m(r,$){i(r,a,$),i(r,l,$),u(d,r,$),y=!0},p:Pe,i(r){y||(g(d.$$.fragment,r),y=!0)},o(r){_(d.$$.fragment,r),y=!1},d(r){r&&(n(a),n(l)),h(d,r)}}}function Qe(P){let a,b,l,d,y,r,$,te,k,Ie='Safe Stable Diffusion was proposed in <a href="https://huggingface.co/papers/2211.05105" rel="nofollow">Safe Latent Diffusion: Mitigating Inappropriate Degeneration in Diffusion Models</a> and mitigates inappropriate degeneration from Stable Diffusion models because they’re trained on unfiltered web-crawled datasets. For instance Stable Diffusion may unexpectedly generate nudity, violence, images depicting self-harm, and otherwise offensive content. Safe Stable Diffusion is an extension of Stable Diffusion that drastically reduces this type of content.',ne,J,Ze="The abstract from the paper is:",ae,G,Ue="<em>Text-conditioned image generation models have recently achieved astonishing results in image quality and text alignment and are consequently employed in a fast-growing number of applications. Since they are highly data-driven, relying on billion-sized datasets randomly scraped from the internet, they also suffer, as we demonstrate, from degenerated and biased human behavior. In turn, they may even reinforce such biases. To help combat these undesired side effects, we present safe latent diffusion (SLD). Specifically, to measure the inappropriate degeneration due to unfiltered and imbalanced training sets, we establish a novel image generation test bed-inappropriate image prompts (I2P)-containing dedicated, real-world image-to-text prompts covering concepts such as nudity and violence. As our exhaustive empirical evaluation demonstrates, the introduced SLD removes and suppresses inappropriate image parts during the diffusion process, with no additional training required and no adverse effect on overall image quality or text alignment.</em>",ie,L,se,C,ke='Use the <code>safety_concept</code> property of <a href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/stable_diffusion_safe#diffusers.StableDiffusionPipelineSafe">StableDiffusionPipelineSafe</a> to check and edit the current safety concept:',oe,j,le,N,Je="For each image generation the active concept is also contained in <code>StableDiffusionSafePipelineOutput</code>.",re,W,Ge="There are 4 configurations (<code>SafetyConfig.WEAK</code>, <code>SafetyConfig.MEDIUM</code>, <code>SafetyConfig.STRONG</code>, and <code>SafetyConfig.MAX</code>) that can be applied:",pe,V,fe,I,de,B,ce,T,O,Se,M,X,$e,Q,Le="The call function to the pipeline for generation.",ve,Z,me,E,ue,v,H,Me,F,Ce="Output class for Safe Stable Diffusion pipelines.",Te,U,Y,xe,z,je="Call self as a function.",ge,q,_e,ee,he;return y=new Ne({props:{warning:!0,$$slots:{default:[Ye]},$$scope:{ctx:P}}}),$=new we({props:{title:"Safe Stable Diffusion",local:"safe-stable-diffusion",headingTag:"h1"}}),L=new we({props:{title:"Tips",local:"tips",headingTag:"h2"}}),j=new De({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lU2FmZSUwQSUwQXBpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmVTYWZlLmZyb21fcHJldHJhaW5lZCglMjJBSU1MLVRVREElMkZzdGFibGUtZGlmZnVzaW9uLXNhZmUlMjIpJTBBcGlwZWxpbmUuc2FmZXR5X2NvbmNlcHQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipelineSafe

<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline = StableDiffusionPipelineSafe.from_pretrained(<span class="hljs-string">&quot;AIML-TUDA/stable-diffusion-safe&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline.safety_concept
<span class="hljs-string">&#x27;an image showing hate, harassment, violence, suffering, humiliation, harm, suicide, sexual, nudity, bodily fluids, blood, obscene gestures, illegal activity, drug use, theft, vandalism, weapons, child abuse, brutality, cruelty&#x27;</span>`,wrap:!1}}),V=new De({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lU2FmZSUwQWZyb20lMjBkaWZmdXNlcnMucGlwZWxpbmVzLnN0YWJsZV9kaWZmdXNpb25fc2FmZSUyMGltcG9ydCUyMFNhZmV0eUNvbmZpZyUwQSUwQXBpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmVTYWZlLmZyb21fcHJldHJhaW5lZCglMjJBSU1MLVRVREElMkZzdGFibGUtZGlmZnVzaW9uLXNhZmUlMjIpJTBBcHJvbXB0JTIwJTNEJTIwJTIydGhlJTIwZm91ciUyMGhvcnNld29tZW4lMjBvZiUyMHRoZSUyMGFwb2NhbHlwc2UlMkMlMjBwYWludGluZyUyMGJ5JTIwdG9tJTIwb2YlMjBmaW5sYW5kJTJDJTIwZ2FzdG9uJTIwYnVzc2llcmUlMkMlMjBjcmFpZyUyMG11bGxpbnMlMkMlMjBqLiUyMGMuJTIwbGV5ZW5kZWNrZXIlMjIlMEFvdXQlMjAlM0QlMjBwaXBlbGluZShwcm9tcHQlM0Rwcm9tcHQlMkMlMjAqKlNhZmV0eUNvbmZpZy5NQVgp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipelineSafe
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.pipelines.stable_diffusion_safe <span class="hljs-keyword">import</span> SafetyConfig

<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline = StableDiffusionPipelineSafe.from_pretrained(<span class="hljs-string">&quot;AIML-TUDA/stable-diffusion-safe&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;the four horsewomen of the apocalypse, painting by tom of finland, gaston bussiere, craig mullins, j. c. leyendecker&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>out = pipeline(prompt=prompt, **SafetyConfig.MAX)`,wrap:!1}}),I=new Ne({props:{$$slots:{default:[qe]},$$scope:{ctx:P}}}),B=new we({props:{title:"StableDiffusionPipelineSafe",local:"diffusers.StableDiffusionPipelineSafe",headingTag:"h2"}}),O=new ye({props:{name:"class diffusers.StableDiffusionPipelineSafe",anchor:"diffusers.StableDiffusionPipelineSafe",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:": SafeStableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"image_encoder",val:": typing.Optional[transformers.models.clip.modeling_clip.CLIPVisionModelWithProjection] = None"},{name:"requires_safety_checker",val:": bool = True"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_safe/pipeline_stable_diffusion_safe.py#L32"}}),X=new ye({props:{name:"__call__",anchor:"diffusers.StableDiffusionPipelineSafe.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]]"},{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:"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:"ip_adapter_image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.Tensor], NoneType] = 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:"sld_guidance_scale",val:": typing.Optional[float] = 1000"},{name:"sld_warmup_steps",val:": typing.Optional[int] = 10"},{name:"sld_threshold",val:": typing.Optional[float] = 0.01"},{name:"sld_momentum_scale",val:": typing.Optional[float] = 0.3"},{name:"sld_mom_beta",val:": typing.Optional[float] = 0.4"}],parametersDescription:[{anchor:"diffusers.StableDiffusionPipelineSafe.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
The prompt or prompts to guide image generation. If not defined, you need to pass <code>prompt_embeds</code>.`,name:"prompt"},{anchor:"diffusers.StableDiffusionPipelineSafe.__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.StableDiffusionPipelineSafe.__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.StableDiffusionPipelineSafe.__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.StableDiffusionPipelineSafe.__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.StableDiffusionPipelineSafe.__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.StableDiffusionPipelineSafe.__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.StableDiffusionPipelineSafe.__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.StableDiffusionPipelineSafe.__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.StableDiffusionPipelineSafe.__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.StableDiffusionPipelineSafe.__call__.ip_adapter_image",description:`<strong>ip_adapter_image</strong> &#x2014; (<code>PipelineImageInput</code>, <em>optional</em>):
Optional image input to work with IP Adapters.`,name:"ip_adapter_image"},{anchor:"diffusers.StableDiffusionPipelineSafe.__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.StableDiffusionPipelineSafe.__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/depth2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionPipelineSafe.__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.StableDiffusionPipelineSafe.__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.StableDiffusionPipelineSafe.__call__.sld_guidance_scale",description:`<strong>sld_guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 1000) &#x2014;
If <code>sld_guidance_scale &lt; 1</code>, safety guidance is disabled.`,name:"sld_guidance_scale"},{anchor:"diffusers.StableDiffusionPipelineSafe.__call__.sld_warmup_steps",description:`<strong>sld_warmup_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 10) &#x2014;
Number of warmup steps for safety guidance. SLD is only be applied for diffusion steps greater than
<code>sld_warmup_steps</code>.`,name:"sld_warmup_steps"},{anchor:"diffusers.StableDiffusionPipelineSafe.__call__.sld_threshold",description:`<strong>sld_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.01) &#x2014;
Threshold that separates the hyperplane between appropriate and inappropriate images.`,name:"sld_threshold"},{anchor:"diffusers.StableDiffusionPipelineSafe.__call__.sld_momentum_scale",description:`<strong>sld_momentum_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 0.3) &#x2014;
Scale of the SLD momentum to be added to the safety guidance at each diffusion step. If set to 0.0,
momentum is disabled. Momentum is built up during warmup for diffusion steps smaller than
<code>sld_warmup_steps</code>.`,name:"sld_momentum_scale"},{anchor:"diffusers.StableDiffusionPipelineSafe.__call__.sld_mom_beta",description:`<strong>sld_mom_beta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.4) &#x2014;
Defines how safety guidance momentum builds up. <code>sld_mom_beta</code> indicates how much of the previous
momentum is kept. Momentum is built up during warmup for diffusion steps smaller than
<code>sld_warmup_steps</code>.`,name:"sld_mom_beta"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_safe/pipeline_stable_diffusion_safe.py#L520",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/depth2img#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/depth2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),Z=new Ee({props:{anchor:"diffusers.StableDiffusionPipelineSafe.__call__.example",$$slots:{default:[Re]},$$scope:{ctx:P}}}),E=new we({props:{title:"StableDiffusionSafePipelineOutput",local:"diffusers.pipelines.stable_diffusion_safe.StableDiffusionSafePipelineOutput",headingTag:"h2"}}),H=new ye({props:{name:"class diffusers.pipelines.stable_diffusion_safe.StableDiffusionSafePipelineOutput",anchor:"diffusers.pipelines.stable_diffusion_safe.StableDiffusionSafePipelineOutput",parameters:[{name:"images",val:": typing.Union[typing.List[PIL.Image.Image], numpy.ndarray]"},{name:"nsfw_content_detected",val:": typing.Optional[typing.List[bool]]"},{name:"unsafe_images",val:": typing.Union[typing.List[PIL.Image.Image], numpy.ndarray, NoneType]"},{name:"applied_safety_concept",val:": typing.Optional[str]"}],parametersDescription:[{anchor:"diffusers.pipelines.stable_diffusion_safe.StableDiffusionSafePipelineOutput.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>. PIL images or numpy array present the denoised images of the diffusion pipeline.`,name:"images"},{anchor:"diffusers.pipelines.stable_diffusion_safe.StableDiffusionSafePipelineOutput.nsfw_content_detected",description:`<strong>nsfw_content_detected</strong> (<code>List[bool]</code>) &#x2014;
List of flags denoting whether the corresponding generated image likely represents &#x201C;not-safe-for-work&#x201D;
(nsfw) content, or <code>None</code> if safety checking could not be performed.`,name:"nsfw_content_detected"},{anchor:"diffusers.pipelines.stable_diffusion_safe.StableDiffusionSafePipelineOutput.images",description:`<strong>images</strong> (<code>List[PIL.Image.Image]</code> or <code>np.ndarray</code>) &#x2014;
List of denoised PIL images that were flagged by the safety checker any may contain &#x201C;not-safe-for-work&#x201D;
(nsfw) content, or <code>None</code> if no safety check was performed or no images were flagged.`,name:"images"},{anchor:"diffusers.pipelines.stable_diffusion_safe.StableDiffusionSafePipelineOutput.applied_safety_concept",description:`<strong>applied_safety_concept</strong> (<code>str</code>) &#x2014;
The safety concept that was applied for safety guidance, or <code>None</code> if safety guidance was disabled`,name:"applied_safety_concept"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_safe/pipeline_output.py#L12"}}),Y=new ye({props:{name:"__call__",anchor:"diffusers.pipelines.stable_diffusion_safe.StableDiffusionSafePipelineOutput.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}]}}),q=new He({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/stable_diffusion/stable_diffusion_safe.md"}}),{c(){a=p("meta"),b=s(),l=p("p"),d=s(),c(y.$$.fragment),r=s(),c($.$$.fragment),te=s(),k=p("p"),k.innerHTML=Ie,ne=s(),J=p("p"),J.textContent=Ze,ae=s(),G=p("p"),G.innerHTML=Ue,ie=s(),c(L.$$.fragment),se=s(),C=p("p"),C.innerHTML=ke,oe=s(),c(j.$$.fragment),le=s(),N=p("p"),N.innerHTML=Je,re=s(),W=p("p"),W.innerHTML=Ge,pe=s(),c(V.$$.fragment),fe=s(),c(I.$$.fragment),de=s(),c(B.$$.fragment),ce=s(),T=p("div"),c(O.$$.fragment),Se=s(),M=p("div"),c(X.$$.fragment),$e=s(),Q=p("p"),Q.textContent=Le,ve=s(),c(Z.$$.fragment),me=s(),c(E.$$.fragment),ue=s(),v=p("div"),c(H.$$.fragment),Me=s(),F=p("p"),F.textContent=Ce,Te=s(),U=p("div"),c(Y.$$.fragment),xe=s(),z=p("p"),z.textContent=je,ge=s(),c(q.$$.fragment),_e=s(),ee=p("p"),this.h()},l(e){const t=Xe("svelte-u9bgzb",document.head);a=f(t,"META",{name:!0,content:!0}),t.forEach(n),b=o(e),l=f(e,"P",{}),A(l).forEach(n),d=o(e),m(y.$$.fragment,e),r=o(e),m($.$$.fragment,e),te=o(e),k=f(e,"P",{"data-svelte-h":!0}),S(k)!=="svelte-pduad"&&(k.innerHTML=Ie),ne=o(e),J=f(e,"P",{"data-svelte-h":!0}),S(J)!=="svelte-1cwsb16"&&(J.textContent=Ze),ae=o(e),G=f(e,"P",{"data-svelte-h":!0}),S(G)!=="svelte-esy6y7"&&(G.innerHTML=Ue),ie=o(e),m(L.$$.fragment,e),se=o(e),C=f(e,"P",{"data-svelte-h":!0}),S(C)!=="svelte-ub44xo"&&(C.innerHTML=ke),oe=o(e),m(j.$$.fragment,e),le=o(e),N=f(e,"P",{"data-svelte-h":!0}),S(N)!=="svelte-nz9egq"&&(N.innerHTML=Je),re=o(e),W=f(e,"P",{"data-svelte-h":!0}),S(W)!=="svelte-uk0u6e"&&(W.innerHTML=Ge),pe=o(e),m(V.$$.fragment,e),fe=o(e),m(I.$$.fragment,e),de=o(e),m(B.$$.fragment,e),ce=o(e),T=f(e,"DIV",{class:!0});var R=A(T);m(O.$$.fragment,R),Se=o(R),M=f(R,"DIV",{class:!0});var x=A(M);m(X.$$.fragment,x),$e=o(x),Q=f(x,"P",{"data-svelte-h":!0}),S(Q)!=="svelte-50j04k"&&(Q.textContent=Le),ve=o(x),m(Z.$$.fragment,x),x.forEach(n),R.forEach(n),me=o(e),m(E.$$.fragment,e),ue=o(e),v=f(e,"DIV",{class:!0});var D=A(v);m(H.$$.fragment,D),Me=o(D),F=f(D,"P",{"data-svelte-h":!0}),S(F)!=="svelte-kqc9eg"&&(F.textContent=Ce),Te=o(D),U=f(D,"DIV",{class:!0});var be=A(U);m(Y.$$.fragment,be),xe=o(be),z=f(be,"P",{"data-svelte-h":!0}),S(z)!=="svelte-1eed40t"&&(z.textContent=je),be.forEach(n),D.forEach(n),ge=o(e),m(q.$$.fragment,e),_e=o(e),ee=f(e,"P",{}),A(ee).forEach(n),this.h()},h(){K(a,"name","hf:doc:metadata"),K(a,"content",Fe),K(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),K(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),K(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),K(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,t){w(document.head,a),i(e,b,t),i(e,l,t),i(e,d,t),u(y,e,t),i(e,r,t),u($,e,t),i(e,te,t),i(e,k,t),i(e,ne,t),i(e,J,t),i(e,ae,t),i(e,G,t),i(e,ie,t),u(L,e,t),i(e,se,t),i(e,C,t),i(e,oe,t),u(j,e,t),i(e,le,t),i(e,N,t),i(e,re,t),i(e,W,t),i(e,pe,t),u(V,e,t),i(e,fe,t),u(I,e,t),i(e,de,t),u(B,e,t),i(e,ce,t),i(e,T,t),u(O,T,null),w(T,Se),w(T,M),u(X,M,null),w(M,$e),w(M,Q),w(M,ve),u(Z,M,null),i(e,me,t),u(E,e,t),i(e,ue,t),i(e,v,t),u(H,v,null),w(v,Me),w(v,F),w(v,Te),w(v,U),u(Y,U,null),w(U,xe),w(U,z),i(e,ge,t),u(q,e,t),i(e,_e,t),i(e,ee,t),he=!0},p(e,[t]){const R={};t&2&&(R.$$scope={dirty:t,ctx:e}),y.$set(R);const x={};t&2&&(x.$$scope={dirty:t,ctx:e}),I.$set(x);const D={};t&2&&(D.$$scope={dirty:t,ctx:e}),Z.$set(D)},i(e){he||(g(y.$$.fragment,e),g($.$$.fragment,e),g(L.$$.fragment,e),g(j.$$.fragment,e),g(V.$$.fragment,e),g(I.$$.fragment,e),g(B.$$.fragment,e),g(O.$$.fragment,e),g(X.$$.fragment,e),g(Z.$$.fragment,e),g(E.$$.fragment,e),g(H.$$.fragment,e),g(Y.$$.fragment,e),g(q.$$.fragment,e),he=!0)},o(e){_(y.$$.fragment,e),_($.$$.fragment,e),_(L.$$.fragment,e),_(j.$$.fragment,e),_(V.$$.fragment,e),_(I.$$.fragment,e),_(B.$$.fragment,e),_(O.$$.fragment,e),_(X.$$.fragment,e),_(Z.$$.fragment,e),_(E.$$.fragment,e),_(H.$$.fragment,e),_(Y.$$.fragment,e),_(q.$$.fragment,e),he=!1},d(e){e&&(n(b),n(l),n(d),n(r),n(te),n(k),n(ne),n(J),n(ae),n(G),n(ie),n(se),n(C),n(oe),n(le),n(N),n(re),n(W),n(pe),n(fe),n(de),n(ce),n(T),n(me),n(ue),n(v),n(ge),n(_e),n(ee)),n(a),h(y,e),h($,e),h(L,e),h(j,e),h(V,e),h(I,e),h(B,e),h(O),h(X),h(Z),h(E,e),h(H),h(Y),h(q,e)}}}const Fe='{"title":"Safe Stable Diffusion","local":"safe-stable-diffusion","sections":[{"title":"Tips","local":"tips","sections":[],"depth":2},{"title":"StableDiffusionPipelineSafe","local":"diffusers.StableDiffusionPipelineSafe","sections":[],"depth":2},{"title":"StableDiffusionSafePipelineOutput","local":"diffusers.pipelines.stable_diffusion_safe.StableDiffusionSafePipelineOutput","sections":[],"depth":2}],"depth":1}';function ze(P){return Ve(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class st extends Be{constructor(a){super(),Oe(this,a,ze,Qe,We,{})}}export{st as component};
