Nodes/ERPK Collection/Gemini Safety Settings
ComfyUI Node

Gemini Safety Settings

The content-filter dial for your calls

By eRepublik-Labs·Created 11 months ago·Updated 21 days ago· 1
Gemini Safety Settings
  • client
  • client
presetbalanced
harassmentmedium
hate_speechmedium
sexually_explicitmedium
dangerous_contentmedium

Gemini ships with content filters built in, and they don't always agree with what a creative workflow is trying to do. This node is the dial: it attaches safety thresholds to the client, and anything that flows through that client runs with your chosen filter level. It's a pass-through node - client in, configured client out - that sits between Gemini API Config and your generation/vision nodes.

By default Gemini's API blocks or throttles requests it judges against four categories - harassment, hate speech, sexually explicit, dangerous content. Depending on what you're making (and whether you're on a free or paid tier), the stock thresholds either protect you or get in the way. This node lets you set the policy once, per client.

Inputs

  • client - required. The GEMINI_API_CLIENT from Gemini API Config (or from a chain of config nodes).
  • preset - balanced default, with strict/permissive presets plus custom.
  • harassment / hate_speech / sexually_explicit / dangerous_content - the per-category thresholds, each defaulting to medium. These only apply when preset is custom - the tooltip is explicit about it. In balanced/strict/permissive modes the presets win and your individual picks are ignored.

Output

One output, client - the same client, now carrying your safety config. Wire it into the next node in the chain. Because it's a pass-through, you can also stack it with Gemini System Instruction in either order; both modify the client and both pass it along.

Install

Part of the ERPK Collection:

cd ComfyUI/custom_nodes
git clone https://github.com/eRepublik-Labs/comfyui-nodes-erpk.git erpk
cd erpk && pip install -r requirements.txt

Restart (or ComfyUI Manager → search erpk), Google AI Studio key in Settings > ERPK > API Keys. Free - it changes the client config; the paid cost is on the generation call downstream.

The thing that trips people is the preset/custom split: they set individual thresholds, leave preset on balanced, and see zero effect. Set preset to custom first - that's the switch that makes the per-category dials live. And a reminder that's worth stating: relaxing filters loosens what Gemini will accept, but a blocking model is a blocking model - permissive settings don't unlock things the API categorically refuses.

CategoryERPK/Gemini

Inputs (6)

NameTypeDefaultDescription
clientGEMINI_API_CLIENTGemini API client to configure
presetoptCOMBObalancedSafety preset or custom configuration
harassmentoptCOMBOmediumThreshold for harassment content (only used if preset=custom)
hate_speechoptCOMBOmediumThreshold for hate speech (only used if preset=custom)
sexually_explicitoptCOMBOmediumThreshold for sexually explicit content (only used if preset=custom)
dangerous_contentoptCOMBOmediumThreshold for dangerous content (only used if preset=custom)

Outputs (1)

NameTypeDescription
clientGEMINI_API_CLIENT