Nodes/🐰 MaraScott Nodes/🐰 Prompt From Image - McPrompty - v1 /p
ComfyUI Node

🐰 Prompt From Image - McPrompty - v1 /p

Turn any image into a working prompt β€” no API key required

By MaraScottΒ·Created 3 years agoΒ·Updated 10 months agoΒ· 179
🐰 Prompt From Image - McPrompty - v1 /p
  • image
  • Prompt
β—„vision_llm_modelmicrosoft/Florence-2-largeβ–Ί
β—„llm_modelllama3-70b-8192β–Ί

This node is the "McPrompty" part of the MaraScott pack - a one-click image-to-prompt tool that sits inside ComfyUI and produces a prompt string from any image you feed it. The pitch: drop in a reference, get out a caption you can drop into a KSampler. The reality is a bit more layered, and the layers are worth understanding before you trust the output.

How it actually works

It's a two-stage pipeline under the hood:

  1. A vision model captions the image. The default is microsoft/Florence-2-large, a Microsoft vision model that runs locally (via the pack's pinned transformers). It's asked for a <MORE_DETAILED_CAPTION> - that's Florence-2's built-in "describe this thoroughly" task, which is a solid choice for prompt-building because it gives you more than a sentence.
  2. An LLM optionally polishes the caption. The default llm_model is llama3-70b-8192, served by Groq (that's the 8192-token context window giving it away). It gets instructions like "if the tile caption describes something different from the full image, correct it," which is clearly designed for the tile-prompting workflows this pack does.

Here's the part people miss: the Groq stage only runs if you have a GROQ_API_KEY environment variable set. No key, and the node happily falls back to returning the raw Florence-2 caption. So the node works out of the box with zero configuration - you just get the caption without the LLM polish. Set the key if you want the smarter pass; skip it if you're fine with the caption.

Inputs and output

  • image - any IMAGE tensor (wire in your Load Image, or the pack's Load Image v1).
  • vision_llm_model - Florence-2 by default. The dropdown is limited to what the pack supports, so don't expect a huge list.
  • llm_model - the Groq model for the polish pass.
  • Prompt - the only output: a STRING you wire into CLIP Text Encode (or the pack's Text Concatenate for assembling).

What to watch for

The honest caveats, from how the code is written:

  • First run downloads Florence-2. The model isn't bundled - the pack's prestartup script registers a models path and it pulls from HuggingFace on first use. Budget a few hundred MB and a couple of minutes.
  • It's a caption, not your prompt. Florence-2 describes what's there. If your reference is stylized or you want a specific style, treat the output as a starting point and edit it - the pack's own McBoaty docs describe the LLM tile-prompting as "not accurate and will be improved in the future."
  • transformers is pinned to 4.37.2 in the pack's requirements. That's old, and if another pack needs a newer version, the pack install order can bite you. If the node throws transformer errors, that pin is the first suspect.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/MaraScott/ComfyUI_MaraScott_Nodes

Restart ComfyUI, or ComfyUI Manager β†’ search "MaraScott". Want the Groq pass? Set GROQ_API_KEY in your environment (and optionally ollama running locally for the sibling Ollama-vision features in the McBoaty configurator).

Verdict: genuinely useful for kicking off a caption-based workflow, and refreshingly honest that it works without any key. Just don't expect it to write your masterpiece prompt - expect it to describe the image, which is a lot closer to useful than blank.

Category🐰 MaraScott/Prompt

Inputs (3)

NameTypeDefaultDescription
imageIMAGEβ€”
vision_llm_modelCOMBOmicrosoft/Florence-2-large1 options: microsoft/Florence-2-large
llm_modelCOMBOllama3-70b-81921 options: llama3-70b-8192

Outputs (1)

NameTypeDescription
PromptSTRINGβ€”