Nodes/ComfyUI-decadetw-auto-prompt-llm/✨ Auto-LLM-Text-Vision
ComfyUI Node

✨ Auto-LLM-Text-Vision

One node that reads your last image, then writes your next prompt

By xlinx·Created 2 years ago·Updated 2 years ago· 32
✨ Auto-LLM-Text-Vision
  • clip
  • image_to_llm_vision
  • postive
  • negative
  • orignal-postive
  • orignal-negative
  • 🌀LLM-Text
  • 🌀LLM-Vision
  • 🌀postive+LLM-Text+LLM-Vision
◄is_trigger_every_generatedtrue►
◄llm_text_result_append_enabledtrue►
◄llm_vision_result_append_enabledtrue►
◄text_prompt_postive1girl,►
◄text_prompt_negative—►
◄llm_keep_your_prompt_aheadtrue►
◄llm_recursive_usefalse►
◄llm_apiurlhttp://localhost:1234/v1/chat/completions►
◄llm_apikeylm-studio►
◄llm_api_model_namellama3.1►
◄llm_text_max_token50►
◄llm_text_tempture0.30►
◄llm_text_system_promptYou are an AI prompt word engineer. Use the provided keywords to create a beautiful composition. Only the prompt words are needed, not your feelings. Customize the style, scene, decoration, etc., and be as detailed as possible without endings.►
◄llm_text_ur_promptA superstar on stage.►
◄llm_vision_max_token50►
◄llm_vision_tempture0.80►
◄llm_vision_system_promptThis is a chat between a user and an assistant. The assistant is helping the user to describe an image.►
◄llm_vision_ur_promptWhat's in this image?►
◄llm_before_action_cmd_feedback_type▾►
◄llm_before_action_cmd►
◄llm_post_action_cmd_feedback_type▾►
◄llm_post_action_cmd►

This is the flagship of the pack - the README's "Using LLM just-1-node" picture is this one. It's Auto-LLM-Text and Auto-LLM-Vision welded into a single node that does both halves of the trick in one pass: a vision LLM captions an image you feed it, a text LLM expands a seed idea into detail, and both results get appended to your base prompt before CLIP encodes it. If you want the full "show it a reference, get a detailed variation" workflow in one place, this is the node.

It's also the node for the storyboard/comic trick. Wire the last generated image back into image_to_llm_vision, describe it, generate the next frame, loop. The author's demo is a superstar on stage and then the crowd around her - each image grows from the previous one instead of starting from zero.

How it works

Same engine as the rest of the pack: one OpenAI-compatible HTTP call builds the text payload (your llm_text_ur_prompt + system prompt), and a second builds the vision payload (your image as a base64 PNG data URI inside the message's image_url block). Both replies get parsed from choices[0].message.content, joined, and your base positive prompt is kept at the front (llm_keep_your_prompt_ahead, on by default). The whole assembled string is then tokenized and CLIP-encoded into CONDITIONING.

The detail people trip over: both calls use the same llm_api_model_name. Load a vision-capable model in LM Studio or ollama and both halves work - it can handle a plain text-only request fine, it just won't need the image. If you load a text-only model, the vision half returns garbage.

The inputs that matter

  • is_trigger_every_generated - the one that decides if the LLM actually gets called. On (default), the node re-asks the LLM on every queue run. Off, ComfyUI treats the result as cacheable and won't re-call unless the graph changes. If your batch comes out identical and you don't know why, this is why.
  • image_to_llm_vision (IMAGE) - the reference image. The last output of a generation, a magazine scan, whatever the captioner should look at.
  • llm_text_ur_prompt / llm_vision_ur_prompt - the two creative inputs: what you want written ("a superstar on stage.") and what you want asked about the image ("What's in this image?").
  • llm_text_result_append_enabled / llm_vision_result_append_enabled - independent toggles for whether each half's output lands in the prompt. Turn one off to emulate its sibling nodes.
  • llm_recursive_use - chains the previous combined result into the next call. This is what makes the comic loop carry a story; it's also what makes it drift into nonsense on a long batch.

Outputs and wiring

Same seven outputs as every node in the pack, all three strings and both conditionings present:

  • postive / negative (CONDITIONING) → sampler. Negative is your text_prompt_negative, untouched.
  • 🌀LLM-Text and 🌀LLM-Vision (STRING) - the two raw replies, for inspection.
  • 🌀postive+LLM-Text+LLM-Vision (STRING) - your base prompt plus both replies, the actual text that got encoded.

Install

Same as its siblings: ComfyUI Manager → search auto → ComfyUI-decadetw-auto-prompt-llm → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/xlinx/ComfyUI-decadetw-auto-prompt-llm
# restart ComfyUI

No heavy Python deps (requirements.txt is just numpy; requests and Pillow are already in ComfyUI). The real prerequisite is a vision model loaded in LM Studio (port 1234, the default) or ollama (port 11434). The README's picks run from llava-phi-3-mini (~7GB) down to Eris_PrimeV4-Vision-32k-7B IQ3_XXS (~2.8GB) for tight VRAM.

Common issues

  • [Auto-LLM][Result][Missing LLM-...] shows up in the prompt - server down, wrong URL, or wrong model name. The node encodes the error string into your conditioning instead of crashing.
  • Everything comes out the same. is_trigger_every_generated is off. Turn it on.
  • Vision half returns nonsense. Text-only model loaded; pick a vision model for llm_api_model_name.
  • Replies are short. Both max-token fields default to 50; raise them for longer prose.
  • llm_before_action_cmd / llm_post_action_cmd execute real shell commands and the README calls the security risk out itself. Treat those fields like code - because they are. Don't run this pack on an internet-exposed ComfyUI instance.
Category🧩 Auto-Prompt-LLM

Inputs (24)

NameTypeDefaultDescription
clipCLIP—
image_to_llm_visionIMAGE—
is_trigger_every_generatedBOOLEANtrue—
llm_text_result_append_enabledBOOLEANtrue—
llm_vision_result_append_enabledBOOLEANtrue—
text_prompt_postiveSTRING1girl,—
text_prompt_negativeSTRING—
llm_keep_your_prompt_aheadBOOLEANtrue—
llm_recursive_useBOOLEANfalse—
llm_apiurlSTRINGhttp://localhost:1234/v1/chat/completions—
llm_apikeySTRINGlm-studio—
llm_api_model_nameSTRINGllama3.1—
llm_text_max_tokenINT5010–1024—
llm_text_temptureFLOAT0.30-2–2—
llm_text_system_promptSTRINGYou are an AI prompt word engineer. Use the provided keywords to create a beautiful composition. Only the prompt words are needed, not your feelings. Customize the style, scene, decoration, etc., and be as detailed as possible without endings.—
llm_text_ur_promptSTRINGA superstar on stage.—
llm_vision_max_tokenINT5010–1024—
llm_vision_temptureFLOAT0.80-2–2—
llm_vision_system_promptSTRINGThis is a chat between a user and an assistant. The assistant is helping the user to describe an image.—
llm_vision_ur_promptSTRINGWhat's in this image?—
llm_before_action_cmd_feedback_typeCOMBO4 options: Pass, just-call, LLM-USER-PROMPT, LLM-VISION-IMG_PATH
llm_before_action_cmdSTRING—
llm_post_action_cmd_feedback_typeCOMBO4 options: Pass, just-call, LLM-USER-PROMPT, LLM-VISION-IMG_PATH
llm_post_action_cmdSTRING—

Outputs (7)

NameTypeDescription
postiveCONDITIONING—
negativeCONDITIONING—
orignal-postiveSTRING—
orignal-negativeSTRING—
🌀LLM-TextSTRING—
🌀LLM-VisionSTRING—
🌀postive+LLM-Text+LLM-VisionSTRING—