cloudflare / cloudflare/developer-platform
Workers AI: need opt-out for NSFW content filter on image generation models
- Dominant language
- No language data
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
The NSFW content filter on Flux image models (flux-1-schnell, flux-2-klein-4b, flux-2-klein-9b) has aggressive false positives that make these models unusable for production workloads.
**The problem**: single words like "hamburger", portrait descriptions like "a man in his late 50s wearing a suit", and other completely benign prompts trigger error 3030 (`AiError: Input prompt contains NSFW content`). There is no parameter to disable or tune the filter sensitivity.
I'm using `@cf/black-forest-labs/flux-2-klein-9b` for generating logo text via img2img. Completely innocuous brand names get flagged with no recourse. Adding more context to prompts helps sometimes but is not reliable. This makes Workers AI image generation impossible to depend on for any user-facing feature.
Your own SDK tests acknowledge this. From https://github.com/cloudflare/ai/pull/396:
> Flux 1 Schnell content filter has intermittent false positives on innocuous prompts. We changed the test prompt but it still occasionally triggers via the binding path.
The Cloudflare community thread has been open since Oct 2024 with many reports and no resolution: https://community.cloudflare.com/t/image-rendering-issue-with-flux-api-nsfw-warning/729440
**Request**: add an optional parameter (e.g. `skip_content_filter: true` or `content_filter: "off"`) to image generation models so developers can opt out of the filter when their use case doesn't require it.
Contributor guide
Assessment
This issue has not been assessed yet.