Gemini API (World Weaver)
A Gemini call you can actually wire into a graph
- image
- text
World Weaver's whole system leans on an LLM: a vision model reads a reference image and turns it into the character's written "DNA," and another call directs the scene from text. This node is where those calls happen. It's a direct Gemini API client with a system prompt, an optional image input, and one text output - no models to download, just a Google API key and an internet connection.
It's also the pack's fiddliest piece, and the fiddliness is all in the setup. The node itself, once configured, is pleasant: Gemini 2.5 Flash is fast and cheap, the image input makes the Prompt Helper workflow work, and having the call sit inside the graph means the result flows straight into your prompt encoder instead of you copy-pasting from a browser.
How it works
The node builds a google-genai client, stuffs your system prompt in as the system instruction, and fires a generate_content call. The inputs you'll actually set:
system_prompt- this is the brain. The pack ships a tuned one (a Flux/T5-XXL prompting prompt that forces a 200–400 token, photoreal, uncensored output). You can paste any system prompt here.model-gemini-2.5-flash-liteorgemini-2.5-flash.max_output_tokens,temperature,top_p,top_k- the usual knobs; defaults are 1024, 0.9, 0.9, 50.api_key_selection- a dropdown of keys from your config file (more on that below).- Optional:
user_instructions(extra direction appended to the request),image(an IMAGE - it's resized via PIL if you setresize_image_toto 512/768/1024, which keeps your API bill down),thinking_mode(enable/disable), andsafety_threshold(from "Block None" up to "Block High").
The single output, text, is Gemini's reply. In the pack's workflows it feeds Master Key or a concatenate node and then into the prompt encoder. One honest detail: the seed input exists in the UI but the current code never forwards it to the API, so don't expect it to make outputs deterministic. And if you feed neither a system prompt, user instructions, nor an image, you get an error - something has to actually ask the question.
Installing it and the key config (read this)
Install the pack: ComfyUI Manager, search "world weaver", install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/Creepybits/World_weaver
Restart, and let pip pull in google-genai plus the rest of the pack's requirements. No model downloads.
Then the part that trips everyone. The code hardcodes the config path as C:\PATH\TO\YOUR\API_KEY\api_keys_config.json - a literal placeholder. Meanwhile the README tells you to edit custom_nodes/Creepy_nodes/assets/scripts/api_keys_config.json, which is wrong on two counts (that's the pack's old name, and it's not where the code looks). The repo ships a config at assets/scripts/api_keys_config.json with placeholder paths pointing at text files containing your keys. So, pick one:
- Edit
API_CONFIG_PATHat the top ofGeminiAPI.pyto point at your actual config file, or - Create the config file at exactly the hardcoded path, with entries that point at
.txtfiles holding your key.
The config format is a JSON map of display name to key-file path:
{
"Gemini Free": "C:\\Users\\you\\keys\\gemini_free.txt",
"Gemini Paid": "C:\\Users\\you\\keys\\gemini_paid.txt"
}
Grab a key from Google AI Studio. Restart ComfyUI. If the dropdown says "Config not found," the config file isn't at the hardcoded path - that's the signal you've hit this exact bug.
Where people get burned
- "Config not found" - see above. This is the number-one support issue and it's a path bug, not a permissions one.
- "API key not found" - the config loaded but the key file it points to doesn't exist or is empty. Windows paths in JSON need escaped backslashes (
\\). - Rate limits - the pack adds a Delay Text Node in front of these calls for a reason. Free-tier Gemini throttles; space your calls out.
- Output to nothing - the node returns error text as its
textoutput rather than crashing, so a failed call can look like a weird prompt. Watch forAPI Error:in the output. - Thinking mode -
enablerequests reasoning, which costs more tokens; keepmax_output_tokenssane (4096 is the built-in budget reference) or responses get cut off.
Honestly, the Gemini node is the heart of the system and the best argument for it: having a vision model that reads your reference image and writes the character description is where World Weaver's "text DNA" actually gets born. It just needs ten minutes of key wrangling before it'll talk to you.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| system_prompt | STRING | — | |
| model | COMBO | 2 options: gemini-2.5-flash-lite, gemini-2.5-flash | |
| max_output_tokens | INT | 10241–8192 | — |
| temperature | FLOAT | 0.90–2 | — |
| top_p | FLOAT | 0.900–1 | — |
| seed | INT | 00–18446744073709550000 | — |
| top_k | INT | 501–100 | — |
| api_key_selection | COMBO | 1 options: Config not found | |
| user_instructionsopt | STRING | — | |
| imageopt | IMAGE | — | |
| resize_image_toopt | COMBO | None | 4 options: None, 512, 768, 1024 |
| thinking_modeopt | COMBO | disable | 2 options: disable, enable |
| safety_thresholdopt | COMBO | Block None | 4 options: Block None, Block Low, Block Medium, Block High |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |