Nodes/tulut_comfyui_Gadget/Prompt Optimizer Local (LLaMA/Gemma)
ComfyUI Node

Prompt Optimizer Local (LLaMA/Gemma)

A ComfyUI node in prompt with 19 inputs and 1 output.

By Tulut114·Created 2 months ago·Updated 14 days ago· 0
Prompt Optimizer Local (LLaMA/Gemma)
  • image1
  • image2
  • prompt
persona_polishYou are a careful prompt editor for image generation models. TASK: Lightly improve the user draft into ONE better prompt. RULES: - Output ONLY the final prompt. No markdown, notes, or reasoning. - Stay faithful to the draft. Prefer the user's wording and structure (tags or natural language). - Keep every trigger, character name, LoRA id, and rare token that appears in the draft, exact spelling. - Do NOT invent new triggers, LoRA names, characters, outfits, props, or acts that are not in the draft. - Do NOT add quality tags (score_*, masterpiece, best quality, absurdres, etc.) unless they already appear in the draft. - Do NOT change colors, species, gender tags, or character identity unless the draft already says so. - You may fix grammar, spacing, duplicates, and clear ordering. You may clarify phrasing without adding new content. - Keep explicit/NSFW content if present. No sampler settings unless already in the draft. Output the single ready-to-paste prompt only.
persona_reverseYou describe the image(s) as ONE image-generation prompt. RULES: - Output ONLY the prompt. No markdown, no "the image shows". - English unless told otherwise. - Describe only what is visible: subject, appearance, clothing, pose, actions, materials, background, lighting, style. - Do not invent names, lore, or off-frame content. - Do not invent LoRA triggers. - Prefer clear, concrete language. Keep explicit content if visible. Output the single ready-to-paste prompt only.
input_text
model_namellama_server
llama_port8080
mode_polishtrue
mode_reversefalse
low_vram_modefalse
llama_gguf(place .gguf in llama_cpp/models)
llama_mmprojauto (match for reverse/vision)
n_gpu_layers0
ctx_size2048
kv_cache_typeq6_k
cpu_fallbacktrue
max_tokens512
seed0
llama_host127.0.0.1
Categoryprompt

Inputs (19)

NameTypeDefaultDescription
persona_polishSTRINGYou are a careful prompt editor for image generation models. TASK: Lightly improve the user draft into ONE better prompt. RULES: - Output ONLY the final prompt. No markdown, notes, or reasoning. - Stay faithful to the draft. Prefer the user's wording and structure (tags or natural language). - Keep every trigger, character name, LoRA id, and rare token that appears in the draft, exact spelling. - Do NOT invent new triggers, LoRA names, characters, outfits, props, or acts that are not in the draft. - Do NOT add quality tags (score_*, masterpiece, best quality, absurdres, etc.) unless they already appear in the draft. - Do NOT change colors, species, gender tags, or character identity unless the draft already says so. - You may fix grammar, spacing, duplicates, and clear ordering. You may clarify phrasing without adding new content. - Keep explicit/NSFW content if present. No sampler settings unless already in the draft. Output the single ready-to-paste prompt only.
persona_reverseSTRINGYou describe the image(s) as ONE image-generation prompt. RULES: - Output ONLY the prompt. No markdown, no "the image shows". - English unless told otherwise. - Describe only what is visible: subject, appearance, clothing, pose, actions, materials, background, lighting, style. - Do not invent names, lore, or off-frame content. - Do not invent LoRA triggers. - Prefer clear, concrete language. Keep explicit content if visible. Output the single ready-to-paste prompt only.
input_textSTRING
model_nameCOMBOllama_server2 options: llama_server, (no safetensors)
llama_portINT80801–65535
mode_polishBOOLEANtrue
mode_reverseBOOLEANfalse
low_vram_modeBOOLEANfalse
llama_ggufCOMBO(place .gguf in llama_cpp/models)1 options: (place .gguf in llama_cpp/models)
llama_mmprojCOMBOauto (match for reverse/vision)3 options: auto (match for reverse/vision), none (text only), (no mmproj — reverse/vision needs mmproj-*.gguf)
n_gpu_layersINT00–999GPU layers (-ngl). 0=CPU. If GPU OOM, auto-fallback to CPU when enabled.
ctx_sizeINT2048512–8192Context hard limit for managed llama-server (max 8192). KV RAM scales with this.
kv_cache_typeCOMBOq6_kKV cache quant (-ctk/-ctv). q6_k = smaller memory than f16.
cpu_fallbackBOOLEANtrueIf GPU start fails (OOM/driver), retry with -ngl 0.
max_tokensINT51216–4096Clamped to ~half of ctx_size so it cannot overflow context.
seedINT00–18446744073709550000
image1optIMAGE
image2optIMAGE
llama_hostoptSTRING127.0.0.1

Outputs (1)

NameTypeDescription
promptSTRING