You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I encounter an unhandled error with some prompts when trying to generate an image. Here is the stack trace:
TypeError: Cannot read properties of undefined (reading 'map') at file:///Users/USERNAME/code/codezero/codezero-deno/node_modules/.deno/@genkit-ai+vertexai@1.0.5/node_modules/@genkit-ai/vertexai/lib/imagen.js:200:47 at Object.runMicrotasks (ext:core/01_core.js:683:26) at processTicksAndRejections (ext:deno_node/_next_tick.ts:59:10) at runNextTicks (ext:deno_node/_next_tick.ts:76:3) at eventLoopTick (ext:core/01_core.js:182:21) at async file:///Users/USERNAME/code/codezero/codezero-deno/node_modules/.deno/@genkit-ai+core@1.0.5/node_modules/@genkit-ai/core/lib/action.js:204:14 at async file:///Users/USERNAME/code/codezero/codezero-deno/node_modules/.deno/@genkit-ai+core@1.0.5/node_modules/@genkit-ai/core/lib/action.js:125:27 at async file:///Users/USERNAME/code/codezero/codezero-deno/node_modules/.deno/@genkit-ai+core@1.0.5/node_modules/@genkit-ai/core/lib/tracing/instrumentation.js:65:16 at async file:///Users/USERNAME/code/codezero/codezero-deno/node_modules/.deno/@genkit-ai+core@1.0.5/node_modules/@genkit-ai/core/lib/tracing/instrumentation.js:88:24 at async runInNewSpan (file:///Users/USERNAME/code/codezero/codezero-deno/node_modules/.deno/@genkit-ai+core@1.0.5/node_modules/@genkit-ai/core/lib/tracing/instrumentation.js:77:10)"
Expected behavior
I expect either the image to be generated, or an error message explaining what the error is.
Runtime (please complete the following information):
OS: MacOS
Version 11.7.10
** Node version
v20.17.0
Additional context
When using a 'bad' word in the prompt, I do get a proper error message: "Image generation failed with the following error: The prompt could not be submitted. Your current safety filter threshold prohibited one or more words in this prompt. If you think this was an error, send feedback. Support codes: 78610348, 32635315"
Some prompt work perfectly fine, like "a cat playing piano", but some prompt trigger the error described, innocent prompts like "a coach" or "a yoga pose".
The text was updated successfully, but these errors were encountered:
Describe the bug
I encounter an unhandled error with some prompts when trying to generate an image. Here is the stack trace:
TypeError: Cannot read properties of undefined (reading 'map') at file:///Users/USERNAME/code/codezero/codezero-deno/node_modules/.deno/@genkit-ai+vertexai@1.0.5/node_modules/@genkit-ai/vertexai/lib/imagen.js:200:47 at Object.runMicrotasks (ext:core/01_core.js:683:26) at processTicksAndRejections (ext:deno_node/_next_tick.ts:59:10) at runNextTicks (ext:deno_node/_next_tick.ts:76:3) at eventLoopTick (ext:core/01_core.js:182:21) at async file:///Users/USERNAME/code/codezero/codezero-deno/node_modules/.deno/@genkit-ai+core@1.0.5/node_modules/@genkit-ai/core/lib/action.js:204:14 at async file:///Users/USERNAME/code/codezero/codezero-deno/node_modules/.deno/@genkit-ai+core@1.0.5/node_modules/@genkit-ai/core/lib/action.js:125:27 at async file:///Users/USERNAME/code/codezero/codezero-deno/node_modules/.deno/@genkit-ai+core@1.0.5/node_modules/@genkit-ai/core/lib/tracing/instrumentation.js:65:16 at async file:///Users/USERNAME/code/codezero/codezero-deno/node_modules/.deno/@genkit-ai+core@1.0.5/node_modules/@genkit-ai/core/lib/tracing/instrumentation.js:88:24 at async runInNewSpan (file:///Users/USERNAME/code/codezero/codezero-deno/node_modules/.deno/@genkit-ai+core@1.0.5/node_modules/@genkit-ai/core/lib/tracing/instrumentation.js:77:10)"
To Reproduce
I followed the sample code on https://firebase.google.com/docs/genkit/models#generating-media, here is the code to reproduce the error:
`const ai = genkit({
plugins: [
googleAI({ apiKey: 'XXX' }),
vertexAI({ location: 'us-central1', projectId: 'PROJECT_NAME'}),
],
model: gemini20Flash,
})
const response = await ai.generate({
model: imagen3Fast,
prompt: 'a coach',
output: { format: 'media' },
})
`
Expected behavior
I expect either the image to be generated, or an error message explaining what the error is.
Runtime (please complete the following information):
** Node version
Additional context
When using a 'bad' word in the prompt, I do get a proper error message: "Image generation failed with the following error: The prompt could not be submitted. Your current safety filter threshold prohibited one or more words in this prompt. If you think this was an error, send feedback. Support codes: 78610348, 32635315"
Some prompt work perfectly fine, like "a cat playing piano", but some prompt trigger the error described, innocent prompts like "a coach" or "a yoga pose".
The text was updated successfully, but these errors were encountered: