diff --git a/ai_diffusion/language/new_language.json.template b/ai_diffusion/language/new_language.json.template index f383d181e..c0e4f02b8 100644 --- a/ai_diffusion/language/new_language.json.template +++ b/ai_diffusion/language/new_language.json.template @@ -183,6 +183,7 @@ "Model Checkpoint": null, "Model to encode and decode images. Commonly affects saturation and sharpness.": null, "NSFW Filter": null, + "NSFW Filter Warning": null, "Name": null, "Negative Prompt": null, "Neutral": null, @@ -318,6 +319,7 @@ "The ControlNet model is not installed": null, "The LoRA '{lora}' used by style '{style}' is not available on the server": null, "The LoRA file is not installed on the server.": null, + "The NSFW filter is a basic tool to exclude explicit content from generated images. It is NOT a guarantee and may not catch all inappropriate content. Please use responsibly and always review the generated images.": null, "The Stable Diffusion checkpoint file": null, "The VAE '{vae}' used by style '{style}' is not available on the server": null, "The active layer does not contain an animation.": null, diff --git a/ai_diffusion/ui/settings.py b/ai_diffusion/ui/settings.py index 06e8752b7..aae04f41e 100644 --- a/ai_diffusion/ui/settings.py +++ b/ai_diffusion/ui/settings.py @@ -16,6 +16,7 @@ QRadioButton, QComboBox, QWidget, + QMessageBox, ) from PyQt5.QtCore import Qt, QMetaObject, QSize, QUrl, pyqtSignal from PyQt5.QtGui import QDesktopServices, QGuiApplication, QCursor @@ -388,9 +389,23 @@ def __init__(self): nsfw_settings = [("Disabled", 0.0), ("Basic", 0.65), ("Strict", 0.8)] self._widgets["nsfw_filter"].set_items(nsfw_settings) + DiffusionSettings._warning_shown = self._warning_shown or settings.nsfw_filter > 0 self._layout.addStretch() + _warning_shown = False + + def _write(self): + if self._widgets["nsfw_filter"].value > 0 and not self._warning_shown: + DiffusionSettings._warning_shown = True + QMessageBox.warning( + self, + _("NSFW Filter Warning"), + _( + "The NSFW filter is a basic tool to exclude explicit content from generated images. It is NOT a guarantee and may not catch all inappropriate content. Please use responsibly and always review the generated images." + ), + ) + class InterfaceSettings(SettingsTab): def __init__(self):