π± Artha Gemini Operation
Edit text by telling it what to change, not how
- response
Artha Gemini Operation is a text editor with no find-and-replace. Instead of fiddling with regex or a replace node, you hand it a chunk of text and an instruction like "change cat to dog," "remove all the camera terms," or "make this prompt shorter and more cinematic," and Gemini performs the edit. It's the node for all the text surgery that string-manipulation nodes can't express, because the operation is described in natural language rather than code.
The description puts it plainly: "can be used to make changes on the source text like replacing, removing parts and other text operations." It's stateless - every run is a fresh edit on whatever source you feed it, with no memory of previous calls. If you're building prompt-rewriting or prompt-cleaning workflows, this is the tool.
What you set
source- the text to edit. Defaults to "A cat with a hat."instruction- what to change. Defaults to "Change cat to dog," which is a perfect first test: wire in source, set the instruction, and you've learned the whole node.api_key,model(defaultgemini-2.5-flash),max_tokens,temperature- the pack's standard API plumbing.
One output: response, the edited text as a plain string. Route it into your prompt encoder, a display node, or the next processing step.
How it works
The node sends your source and instruction to Gemini as a single request. The instruction is the steering wheel - Gemini's interpretation of it determines the whole edit, so it pays to be specific. "Replace cat with dog" is bulletproof. "Make it better" is a coin flip. The practical lesson: treat the instruction like a prompt, because that's exactly what it is. You can chain multiple operations by feeding one Operation's output into the next, which is the natural way to build a cleanup pipeline - strip the boilerplate here, then condense, then feed the result to your encoder.
Where it shines
Prompt hygiene, mostly. Your prompt-gathering process produces mess: a bloaty draft, a prompt with conflicting style words, a tag-soup that needs converting to sentences. Operation handles the edits that no deterministic node can. It's also handy for batch text transforms - same source, different instruction, variations for days.
The honest downside: it's cloud-backed, so every edit is an API call and there's no offline mode. And because Gemini is doing the editing, subtle instructions ("make the tone warmer") can produce subtly different outputs on each run - set temperature lower if you want tighter, more literal edits. An empty response is the pack's standard failure signal: the error was printed to the ComfyUI console and the node swallowed it into an empty string.
Key and install
Key resolution: the node's api_key field first, then api.json in the pack folder, then the GEMINI_API_KEY environment variable. Keep it in api.json so it doesn't ride along in a shared workflow. The node itself ships with the whole π± pack:
cd ComfyUI/custom_nodes
git clone https://github.com/Cyrostar/ComfyUI-Artha-Nodes
cd ComfyUI-Artha-Nodes
pip install -r requirements.txt
Restart ComfyUI, or install "Artha" via ComfyUI Manager. Grab a key from Google AI Studio and you're editing text by wish.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| source | STRING | A cat with a hat | β |
| instruction | STRING | Change cat to dog | β |
| api_key | STRING | API key will be visible in plain text. Consider adding your api to the api.json located inside this custom node folder. | |
| model | COMBO | gemini-2.5-flash | 5 options: gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite, gemini-2.0-flash, gemini-2.0-flash-lite |
| max_tokens | INT | 50001β8192 | For Gemini models, a token is equivalent to about 4 characters. 100 tokens is equal to about 60β80 English words. |
| temperature | FLOAT | 0.70β2 | A temperature of 0 means only the most likely tokens are selected. Higher values increase randomness. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| response | STRING | β |