Nodes/ComfyUI-Artha-Nodes/πŸ”± Artha Gemini Subject
ComfyUI Node

πŸ”± Artha Gemini Subject

The node that writes your subject prompt for you (or reads it off a reference image)

By CyrostarΒ·Created 10 months agoΒ·Updated 8 months agoΒ· 0
πŸ”± Artha Gemini Subject
  • image
  • subject
β—„text_promptA cat with a hatβ–Ί
β—„api_keyβ–Ί
β—„modelgemini-2.5-flashβ–Ί
β—„max_tokens5000β–Ί
β—„temperature0.7β–Ί
β—„use_imagefalseβ–Ί
β—„only_maintrueβ–Ί

Artha Gemini Subject is the πŸ”± Artha pack's subject-description node: it produces a structured subject that pairs with its sibling Style node to describe what is in the frame and how it looks. Two modes, one honest split - in its simplest form it just passes your text through, and in its useful form it reads a reference image and lets Gemini write the subject description.

That pass-through mode is the first thing to know, because it's easy to misread the node as a text generator. With use_image off, whatever you type into text_prompt is what comes out the subject output. The real value is in the other mode: feed it an image, and it becomes a vision call that returns a detailed subject description you can feed into a prompt.

How it works

With use_image on and an image wired in, the node converts the tensor to PIL and sends it to Gemini with a bundled system prompt (subject or subjects, depending on only_main). The returned text is stripped of markdown artifacts (* and #) so you get clean prose, and that becomes the subject (ARTHASUBJECT) output.

The only_main toggle controls scope: true (default) asks for the single main subject in the image; false asks for all subjects. For a character shot you usually want true; for a busy scene with a crowd, flip it and let Gemini enumerate.

Inputs that matter

  • text_prompt - used directly when use_image is off, ignored (overridden by the vision call) when it's on.
  • use_image - off = text pass-through; on = Gemini reads the image.
  • only_main - single subject vs. all subjects, default true.
  • image - optional IMAGE input, only meaningful when use_image is on.
  • api_key, model, max_tokens, temperature - the shared Artha Gemini parameter block; model defaults to gemini-2.5-flash.

Output is a single subject (ARTHASUBJECT) output, which is designed to feed into other Artha prompt-compose nodes rather than straight into a text prompt. It's a custom type, so if you're not using the rest of the pack's chain, grab the text via the broader Gemini nodes instead.

Installing it

Same one-pack install as every Artha node:

cd ComfyUI/custom_nodes
git clone https://github.com/Cyrostar/ComfyUI-Artha-Nodes
pip install -r ComfyUI/custom_nodes/ComfyUI-Artha-Nodes/requirements.txt

restart ComfyUI, or search "ComfyUI-Artha-Nodes" in ComfyUI Manager. Dependencies are the standard google-genai + torch/numpy/Pillow stack - no local models. You'll need a free Gemini API key from aistudio.google.com, set in the pack's api.json as gemini_api_key, as a GEMINI_API_KEY env var, or in the node field (plain text - the pack flags it).

Common issues

  • Text comes back unchanged and you expected analysis: use_image is off, or no image is wired to the optional input. Check both.
  • Empty subject output: API key problem; the node logs the failure to the console.
  • Subject ignores your prompt in image mode: that's by design - the vision call replaces the text. If you want to steer it, edit the bundled nodes/llm/agents/subject.txt agent prompt.
  • Quota: image mode is a metered cloud call, so a big batch of references costs tokens like any other Gemini usage.

Honest verdict: if you're not using the reference-image mode or the Artha compose chain, this node is mostly a fancy pass-through. But as the "what's in this image" half of a subject+style pair, it's the one I'd reach for when a look needs to be reusable.

CategoryArtha/LLM/Gemini

Inputs (8)

NameTypeDefaultDescription
text_promptSTRINGA cat with a hatβ€”
api_keySTRINGAPI key will be visible in plain text. Consider adding your api to the api.json located inside this custom node folder.
modelCOMBOgemini-2.5-flash5 options: gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite, gemini-2.0-flash, gemini-2.0-flash-lite
max_tokensINT50001–8192For Gemini models, a token is equivalent to about 4 characters. 100 tokens is equal to about 60–80 English words.
temperatureFLOAT0.70–2A temperature of 0 means only the most likely tokens are selected. Higher values increase randomness.
use_imageBOOLEANfalseβ€”
only_mainBOOLEANtrueβ€”
imageoptIMAGEβ€”

Outputs (1)

NameTypeDescription
subjectARTHASUBJECTβ€”