FirebaseAI Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
ImagenSafetySettings
@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
public struct ImagenSafetySettings
Settings for controlling the aggressiveness of filtering out sensitive content.
See the Responsible AI and usage
guidelines
for more details.
-
Initializes safety settings for the Imagen model.
Parameters
safetyFilterLevel
|
A filter level controlling how aggressively to filter out sensitive
content from generated images.
|
personFilterLevel
|
A filter level controlling whether generation of images containing
people or faces is allowed.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-05-20 UTC.
[null,null,["Last updated 2025-05-20 UTC."],[],[],null,["# FirebaseAI Framework Reference\n\nImagenSafetySettings\n====================\n\n @available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)\n public struct ImagenSafetySettings\n\nSettings for controlling the aggressiveness of filtering out sensitive content.\n\nSee the [Responsible AI and usage\nguidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#config-safety-filters)\nfor more details.\n- `\n ``\n ``\n `\n\n ### [init(safetyFilterLevel:personFilterLevel:)](#/s:10FirebaseAI20ImagenSafetySettingsV17safetyFilterLevel06persongH0AcA0cdgH0VSg_AA0c6PersongH0VSgtcfc)\n\n `\n ` \n Initializes safety settings for the Imagen model. \n\n #### Declaration\n\n Swift \n\n public init(safetyFilterLevel: ../Structs/ImagenSafetyFilterLevel.html? = nil,\n personFilterLevel: ../Structs/ImagenPersonFilterLevel.html? = nil)\n\n #### Parameters\n\n |---------------------------|----------------------------------------------------------------------------------------------------|\n | ` `*safetyFilterLevel*` ` | A filter level controlling how aggressively to filter out sensitive content from generated images. |\n | ` `*personFilterLevel*` ` | A filter level controlling whether generation of images containing people or faces is allowed. |"]]