Nodes/ComfyUI AnyNode: Any Node you ask for/Any Node πŸ„ (Gemini)
ComfyUI Node

Any Node πŸ„ (Gemini)

The free-key flavor of the mushroom

By lks-aiΒ·Created 2 years agoΒ·Updated 2 years agoΒ· 547
Any Node πŸ„ (Gemini)
  • any
  • any2
  • any
  • control
β—„promptTake the input and multiply by 5β–Ί
β—„modelgemini-1.5-flashβ–Ί

Of the four AnyNode flavors, this is the one with the cheapest door price. Any Node πŸ„ (Gemini) runs the same trick as its OpenAI sibling - you prompt it in English, it has an LLM write a Python function, a sanitizer vets it, and ComfyUI executes it - but the brain is Google's Gemini, and Google hands out API keys from AI Studio without asking for a credit card. If you want to play with this pack and you don't already have an OpenAI or Anthropic key, this is the lowest-friction way in.

The inputs mirror the Claude variant: prompt (default "Take the input and multiply by 5"), a free-form model string defaulting to gemini-1.5-flash, and the optional wildcard inputs any and any2 whose types get introspected and described to the model. Outputs are any (the result) and control (the metadata dict with the generated function that feeds the pack's export tooling). Under the hood it uses the google.generativeai library - which is already in the pack's requirements.txt - and it reads GOOGLE_API_KEY from your environment. The default gemini-1.5-flash is a decent choice here: it's the cheap, fast model, and since this whole job is "write a short Python function," paying for a big model is wasted money.

Setup: search AnyNode in ComfyUI Manager or cd ComfyUI/custom_nodes && git clone https://github.com/lks-ai/anynode, restart, and set the GOOGLE_API_KEY environment variable. That's it - the README explicitly says you don't need any extra module, and since this is the same pack as the other three nodes, you get all of them in one install anyway.

Now the honest part, straight from the author's mouth: the README calls this variant "still being tested so it probably contains bugs." It was the least-polished of the launch lineup in May 2024, and the pack's last commit was June 2024, so "still being tested" became "permanently being tested." It still works - the Google API hasn't gone anywhere - but expect the odd generation to come back malformed, and lean on the same recovery trick as the rest of the family: hit Queue Prompt again and the node feeds the error back to the model to fix its own code.

Same security story as every AnyNode, so don't skip it: the sanitizer blocks dangerous calls and file/system access, but this is still AI-generated code executing inside ComfyUI. Read what it generates in the console before you reuse a function, and keep the pack pointed at a model you trust. For a zero-cost tinker session - "write me a sepia filter," "give me a Sobel edge detector" - Gemini-flash is genuinely the cheapest way to find out if the whole prompt-a-node-into-existence thing is for you.

Categoryutils

Inputs (4)

NameTypeDefaultDescription
promptSTRINGTake the input and multiply by 5β€”
modelSTRINGgemini-1.5-flashβ€”
anyopt*β€”
any2opt*β€”

Outputs (2)

NameTypeDescription
any*β€”
controlCTRLβ€”