FirebaseAILogic Framework Reference

ImagenSafetySettings

@available(*, deprecated, message: "All Imagen models are deprecated and will shut down as early as June 2026. As a replacement, you can migrate your apps to use Gemini Image models (the \"Nano Banana\" models﹚.")
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.

    Declaration

    Swift

    public init(safetyFilterLevel: ImagenSafetyFilterLevel? = nil,
                personFilterLevel: ImagenPersonFilterLevel? = nil)

    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.