Google Imagen: Add personGeneration setting to config.yaml

2b7003a6da2d43e5198b5d0f175519ecc1e1afbe

Cohee <18619528+Cohee1207@users.noreply.github.com>

2 files changed, +7 -1Ignore whitespace
default/config.yaml+4 -0
@@ -287,6 +287,10 @@ claude:
287287gemini:
288288 # API endpoint version ("v1beta" or "v1alpha")
289289 apiVersion: 'v1beta'
290+ # https://ai.google.dev/gemini-api/docs/imagen#imagen-configuration
291+ image:
292+ # Leave empty to use the API-default value.
293+ personGeneration: 'allow_adult'
290294# -- SERVER PLUGIN CONFIGURATION --
291295enableServerPlugins: false
292296# Attempt to automatically update server plugins on startup
src/endpoints/google.js+3 -1
@@ -438,6 +438,8 @@ router.post('/generate-image', async (request, response) => {
438438 const isVertex = request.body.api === 'vertexai';
439439 // Is it even worth it?
440440 const isDeprecated = model.startsWith('imagegeneration');
441+ // Get person generation setting from config
442+ const personGeneration = getConfigValue('gemini.image.personGeneration', 'allow_adult');
441443
442444 const requestBody = {
443445 instances: [{
@@ -449,7 +451,7 @@ router.post('/generate-image', async (request, response) => {
449451 enhancePrompt: isVertex ? Boolean(request.body.enhance ?? false) : undefined,
450452 negativePrompt: isVertex ? (request.body.negative_prompt || undefined) : undefined,
451453 aspectRatio: String(request.body.aspect_ratio || '1:1'),
452454 personGeneration: !isDeprecated && personGeneration ? 'allow_adult'personGeneration : undefined,
453455 language: isVertex ? 'auto' : undefined,
454456 safetySetting: !isDeprecated ? (isVertex ? 'block_only_high' : 'block_low_and_above') : undefined,
455457 addWatermark: isVertex ? false : undefined,