Gemini Enhance Prompt:
GeminiEnhancePrompt uses a Gemini text-generation model to develop an existing prompt into a more detailed version. It sends your text along with an instruction that guides the enhancement, then returns the model’s response as text. This can help you turn a brief creative idea into a prompt you can review and use elsewhere in your workflow. The node does not guarantee a particular style or improvement: the result depends on the text you provide, the instruction, and the selected model. If the request fails or does not return usable text, the node keeps your original prompt so your workflow can continue.
Gemini Enhance Prompt Input Parameters:
prompt
The text you want Gemini to enhance. This is a required, multiline string with an empty-string default. No minimum or maximum length is specified in the node source. Describe the subject, visual details, mood, or constraints that matter to you; those details give the model a clearer starting point. The node sends this text to Gemini and also uses it as the fallback if enhancement cannot be completed.
model
The Gemini model used to generate the enhanced text. This required selection offers exactly gemini-1.5-pro-latest and gemini-2.0-flash-exp; the source does not specify a separate default or a numeric minimum or maximum. Your choice can affect the wording and detail of the result. The node passes the selected model name to Gemini without changing it, so the request also depends on that model being available to your API key.
api_key
The credential used to connect to Gemini. This optional, single-line string is displayed as a password field. Its displayed default is the value of the GEMINI_API_KEY environment variable when the node’s input definition is evaluated, or an empty string if that variable is unset; no minimum or maximum length is specified. During execution, a nonempty value entered here takes priority, while an empty value makes the node check GEMINI_API_KEY again. You need a working credential from one of those sources for enhancement to take place.
system_prompt
The instruction that tells Gemini how to approach the enhancement. This optional, multiline string defaults to ENHANCE_PROMPT_SYSTEM_PROMPT; the provided source does not show the text of that default, and it specifies no minimum or maximum length. Changing this instruction can steer the kind of rewrite you receive, such as asking for clearer visual detail or a particular tone. It is sent as Gemini’s system instruction alongside your prompt.
Gemini Enhance Prompt Output Parameters:
enhanced_prompt
A single string containing the text to use after the node runs. When Gemini returns a nonempty text response, the node removes whitespace from its beginning and end and provides the remaining text here. If Gemini returns no valid text, or if an error occurs while preparing or making the request, this output contains your original prompt instead. An unchanged result therefore does not necessarily mean Gemini chose to keep your wording; check the runtime messages if you expected a rewrite.
Gemini Enhance Prompt Usage Tips:
- Start with the details you need to preserve, such as the subject, setting, lighting, composition, and any constraints. Review the enhanced result before passing it to an image-generation step, because the node does not check whether Gemini retained every detail.
- Use
system_promptwhen you need a specific approach. For example, you can instruct Gemini to add concrete visual descriptions while preserving the original subject and avoiding new objects. - Select one of the two listed
modeloptions and test it with a short prompt first. If a request fails, check whether that model is available to your API key before changing your creative text. - Provide
api_keyin the node or setGEMINI_API_KEYin the environment where the workflow runs. A nonempty node value takes priority over the environment variable. - Compare
enhanced_promptwith your original text when troubleshooting. The node deliberately returns the original on errors or unusable responses, so a completed workflow alone does not confirm that enhancement succeeded.
Gemini Enhance Prompt Common Errors and Solutions:
Error calling Gemini API in Enhance Prompt: API key is required. Provide it in the node input or set the GEMINI_API_KEY environment variable.
- Explanation: Neither a nonempty
api_keyinput nor aGEMINI_API_KEYenvironment variable was available when the node ran. The node catches the error and returns your original prompt. - Solution: Enter a valid key in
api_key, or setGEMINI_API_KEYin the workflow’s runtime environment. Run the node again and check its messages.
Error calling Gemini API in Enhance Prompt: ...
- Explanation: This prefix is printed when an exception occurs. The details after the colon depend on the failure and are not fixed by the node source. Possible causes include a rejected credential, an unavailable selected model, a connection problem, or a service-side error. The output falls back to your original prompt.
- Solution: Read the full message after the colon. Check the credential and selected
model, confirm the runtime can reach the Gemini service, and retry. If the message indicates a temporary service or request-limit problem, wait before retrying.
Warning: Gemini API did not return valid text. Returning original prompt.
- Explanation: The request completed, but the response did not contain text that passed the node’s check. The node returns your original
promptrather than an enhanced version. - Solution: Check the runtime messages for accompanying details, then try a clear, specific prompt or the other listed model. If it continues, investigate the response through your Gemini setup; this node does not expose additional response details.
enhanced_prompt is identical to prompt
- Explanation: This is an outcome to check, not a fixed error message. The node may have returned the original because an exception occurred or Gemini supplied no valid text; it is also possible for a successful response to resemble the original.
- Solution: Look for the error or warning messages above. If none appear, make your enhancement goal more explicit in
system_promptand compare the next result.
