ComfyUI Node

Llama 3.1 8B Prompt Enhancer

A cheap way to stop writing bad prompts yourself

By Runware·Created 2 years ago·Updated about a month ago· 140
Llama 3.1 8B Prompt Enhancer
    • text
    prompt
    promptMaxLengthfalse
    promptMaxLength_value12
    promptVersions1

    Half the "why is my output garbage" posts on r/comfyui are really "why is my prompt garbage." This node is Runware's answer: a Llama 3.1 8B running in the cloud that takes your rough idea and returns an expanded, better-written version. It's not a model node - it's a text utility that sits upstream of one. Write "cat astronaut on a bike, cinematic," get back something with lighting, lens, mood, and composition details worth feeding to a real generator.

    The output is plain text (STRING), which is exactly why it's useful: wire it straight into the positivePrompt of any other node in this pack - Krea, LTX, Kling, whatever - or into a local model's prompt. It runs as a promptEnhance task on Runware's cloud, so it needs the same API key as everything else, and each call is a (tiny) charge.

    How it works

    The node builds a request for model AIR runware:llama-3-1-8b@prompt-enhancer and sends it over REST through the runware-sdk, then returns the enhanced text as a single text output. Inputs are minimal:

    • prompt - required, the raw idea. Multiline, so paste whatever you've got.
    • promptMaxLength + promptMaxLength_value - a gated control, off by default. Flip it on to cap the enhanced prompt's length; the value defaults to 12 (words, roughly - think "keep it short").
    • promptVersions - how many variations to generate, default 1. Ask for a couple if you want options to choose between.

    Where it fits

    The cleanest workflow is a three-node chain: this node → your generator. It's also a nice way to normalize prompts before batch work, so every generation in a series shares the same descriptive texture instead of whatever you typed at 2am. If you're testing, remember promptVersions multiplies the API calls, and the node's printed cost line will remind you.

    Installing it

    Part of the Runware/ComfyUI-Runware pack, installed once for every node:

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

    Restart, then set your key in ComfyUI Settings → Runware API key, via RUNWARE_API_KEY, or with runware auth login.

    Where people get burned

    Expecting it to understand your niche. Llama 3.1 8B is a good general enhancer, not a style oracle - if you're doing a highly specific art style or character, feed it enough context in the raw prompt or it'll polish the vagueness into fancier vagueness. Also don't leave promptVersions at 10 by reflex; each version is a separate call, and on a cloud service "separate call" means "separate line item."

    CategoryRunware/Text/runware

    Inputs (4)

    NameTypeDefaultDescription
    promptSTRINGThe text prompt to enhance.
    promptMaxLengthoptBOOLEANfalseEnable to set promptMaxLength. Off uses the model's default.
    promptMaxLength_valueoptINT1212–400Maximum length of the enhanced prompt.
    promptVersionsoptINT11–5Number of enhanced prompt variations to generate.

    Outputs (1)

    NameTypeDescription
    textSTRING