Nodes/Prompt808/Generate Prompt
ComfyUI Node

Generate Prompt

The node that turns your reference-image library into a finished prompt — no API key required

By Machete3000·Created 7 months ago·Updated 5 months ago· 3
Generate Prompt
  • libraries
  • prompt
  • negative_prompt
  • status
library(no libraries)
prompt_typeAny
archetypeAny
archetype_influence70
moodAny
llm_modelNone
enrichmentAny
quantizationFP16
temperature0.70
max_tokens1024
api_urlhttp://127.0.0.1:1234
keep_model_loadedfalse
prefix
suffix
seed0

The name makes it sound like a hosted service - drop an image in, get a prompt back from the cloud. It isn't. Prompt808 Generate reads a library of elements you've built yourself and composes a finished prompt plus a negative prompt, entirely on your machine. No API key, no per-call cost. If you've ever burned an evening trying to reverse-engineer why a reference image works - the light, the lens, the palette, the mood - this is that job automated, and the result plugs into a CLIP Text Encode node like any other prompt.

How it works

The node is the output end of the Prompt808 pack. The interesting half - the vision model - lives in the pack's sidebar panel: you drop in reference photos or artwork, a Qwen3-VL model extracts structured elements (lighting, composition, palette, mood, camera, pose, clothing…) and files them into a library. Generate is the consumer of all that. It pulls elements from the library, weights them by how often they actually show up in your reference set, then either concatenates them with style-specific phrasing (the "simple" path) or hands the selected elements to a small text LLM to write natural prose. Which path you get is decided by a single input: llm_model.

The inputs that matter

Everything is exposed as a widget, which is the point - your whole generation config sits visible in the graph instead of buried in a settings drawer. For a first workflow you really touch four:

  • library - which library to draw from, or "All" to merge everything in one shot.
  • prompt_type - the style register (Photo-Cinematic, Photo-Fine Art, Native, …). Native means "truthful to the source medium," which is the right default mental model.
  • llm_model - None = simple composition, no LLM. API = route composition through an OpenAI-compatible server (LM Studio, Ollama, llama.cpp, vLLM) at api_url, default http://127.0.0.1:1234, which is exactly LM Studio's local server. Everything else is a local HuggingFace download.
  • prefix / suffix - text glued onto the start and end of the prompt. This is where a LoRA trigger word goes, or your quality tags.

The rest are worth knowing but not tuning on day one: archetype plus archetype_influence bias selection toward a scene-type cluster (at 100%, only archetype-matched elements are included; at 0%, uniform); mood nudges atmosphere; enrichment sets how much creative license the LLM takes (Baseline → Lyrical/Freeform); and seed gives you deterministic reruns. keep_model_loaded leaves the LLM offloaded to RAM between runs so the next generation starts faster.

Wiring it up

Three STRING outputs: prompt, negative_prompt, and status - a multiline log of what was actually used (library, style, archetype, model, seed), which is genuinely handy when a result surprises you. Wire the first two into your CLIP Text Encode nodes like any other text source. The whole pipeline here is text-in, text-out upstream of the sampler, the same slot the KB's prompt-enhancement nodes occupy - except you're not describing an idea, you're sampling from your own image-derived vocabulary.

Installing it

Search "Prompt808" in ComfyUI Manager, or:

cd ComfyUI/custom_nodes
git clone https://github.com/Machete3000/Prompt808
pip install -r Prompt808/requirements.txt

Then restart ComfyUI. Note the dependency list: transformers, torch, bitsandbytes, sentence-transformers, scikit-learn. It's a chunky install, and the local-HF path downloads models from HuggingFace on first use - the default vision model is Qwen3-VL 8B (≈12 GB VRAM), with FP8 variants around 7.5 GB and 32B options up near 28 GB. Analysis wants 8 GB+ VRAM; generation alone can run on 1 GB if you stick with the 0.6B text model. That's the classic trade the author leans into: fully self-contained, or point it at an Ollama/LM Studio server for the 10–20× faster API path the README recommends.

Where people get burned

The dropdown reads "(no libraries)" until you open the Prompt808 sidebar (the camera icon) and actually create a library and analyze some images - the node hard-errors on an empty library, so there's no silent blank-prompt failure mode, just an annoying one. If you saw "Photo-Boudoir" or "Sensual" moods earlier and they've since vanished, that's the NSFW toggle under Settings > Prompt808 > General doing its job; it hides adult styles from the dropdowns until you enable it. And if you're on an older card, don't let it default to a 32B model - start with the FP8 8B, and leave keep_model_loaded off unless you like 20-second pauses. If the API path seems dead, remember the default api_url only works while LM Studio's local server is actually running.

That's the pitch: analyze once, generate forever, and never type "cinematic film still, volumetric light, teal and orange" by hand again.

CategoryPrompt808

Inputs (16)

NameTypeDefaultDescription
librariesoptP808_LIBRARIESConnect a Library Select node for multi-library generation
libraryoptCOMBO(no libraries)No libraries — open the Prompt808 sidebar (camera icon) to create one
prompt_typeoptCOMBOAnyPrompt style (Cinematic, Documentary, etc.)
archetypeoptCOMBOAnyArchetype to filter elements by
archetype_influenceoptINT700–100How strongly the selected archetype biases element selection (0-100%). Controls two things: (1) per-category probability of picking an archetype-matched element vs. a random pool element, and (2) minimum inclusion rate for categories the archetype covers -- e.g. a pose-only archetype at 80% guarantees poses appear in at least 80% of prompts. At 100%, ONLY archetype-matched categories are included. Has no effect when archetype is None.
moodoptCOMBOAnyMood modifier for the generated prompt
llm_modeloptCOMBONoneLLM model for prompt composition. API (recommended) = OpenAI-compatible server (LM Studio, Ollama, llama.cpp, vLLM) at the api_url below — typically 10-20x faster than the local HF path on the same GPU. None = simple mode (no LLM). The other entries are local HF models — useful for self-contained installs but slower than a llama.cpp/GGUF backend.
enrichmentoptCOMBOAnyCreative enrichment level for LLM composition
quantizationoptCOMBOFP16LLM quantization (FP16, FP8, 8-bit, 4-bit)
temperatureoptFLOAT0.700.1–1.5LLM sampling temperature (higher = more creative)
max_tokensoptINT1024128–2048Maximum tokens for LLM generation
api_urloptSTRINGhttp://127.0.0.1:1234Server URL for API mode (used when llm_model is set to API). Works with LM Studio, Ollama, llama.cpp, vLLM, or any OpenAI-compatible endpoint. Default points to LM Studio's local server. Ignored when using a local HF model.
keep_model_loadedoptBOOLEANfalseKeep LLM offloaded to CPU RAM after generation (faster next run)
prefixoptSTRINGText prepended to the generated prompt (e.g. LoRA trigger word)
suffixoptSTRINGText appended to the generated prompt (e.g. quality tags)
seedoptINT00–4294967295Random seed for deterministic generation

Outputs (3)

NameTypeDescription
promptSTRINGGenerated prompt
negative_promptSTRINGNegative prompt (terms to avoid)
statusSTRINGGeneration status and archetype used