Nodes/GraftingRayman/GR BLIP 2 Text Expander
ComfyUI Node

GR BLIP 2 Text Expander

Turn a bare-bones prompt into something with actual detail

By GraftingRayman·Created 2 years ago·Updated about a month ago· 76
GR BLIP 2 Text Expander
    • expanded_text
    text_input
    max_new_tokens50
    num_beams5
    do_sampletrue
    temperature1.00
    top_p0.90
    seed1

    This one's easy to confuse with the pack's BLIP-2 captioner, but it does the opposite job: no image input at all, just text in and richer text out. The author's own framing, from when they first shared it, is the clearest description you'll get - it's for people who write bland, short prompts and want them expanded into something with actual detail, and it can take your own short prompt and build on it or generate something from close to nothing.

    That matters for how you should think about it. BLIP-2's usual job is turning an image into a caption; here it's being run purely as a text-to-text expander, using the language side of the model without any vision input. This isn't the "BLIP is weak for captioning" conversation that shows up elsewhere in this community - that critique is about describing images for training data, which is a different job than taking a phrase you already wrote and fleshing it out. Whether the expanded result reads as an improvement over your original is going to depend a lot on what you fed it; treat it as a starting point to edit, not a finished prompt.

    How it works

    Text goes in, gets tokenized and run through BLIP-2's language decoder with standard beam-search generation, and a longer piece of text comes back out. There's no captioning step here - the vision encoder isn't in the loop at all for this node.

    The inputs and outputs that matter

    • text_input - your starting text. Leave it empty and the node has less to build from; give it a short phrase and it has something to expand.
    • max_new_tokens (default 50, up to 100) - hard cap on how much gets generated. This is a modest ceiling, so don't expect paragraph-length output; think "expanded sentence" rather than "expanded essay."
    • num_beams (default 5), do_sample (default true), temperature (default 1) and top_p (default 0.9) - the standard sampling knobs. With do_sample on, temperature and top_p actually do something; turn do_sample off and you're back to deterministic beam search regardless of what those are set to.
    • seed - for reproducible expansions when do_sample is on.

    One output: expanded_text, a plain string ready to feed into a CLIP text encode or another prompt node.

    How to install it

    ComfyUI Manager, search GraftingRayman. Manual install:

    cd ComfyUI/custom_nodes
    git clone https://github.com/GraftingRayman/ComfyUI_GraftingRayman
    

    Restart. As with every node in this pack, you need OpenAI's CLIP installed separately or the pack fails to import - portable installs run .\python_embeded\python.exe -m pip install git+https://github.com/openai/CLIP.git, system Python runs pip install git+https://github.com/openai/CLIP.git.

    Common issues & troubleshooting

    Pack doesn't load. Same root cause as every other node here - check your console for the CLIP import failure and run the pip install above.

    Output feels short or cuts off mid-thought. max_new_tokens caps at 100, which isn't a lot of room. If you need a genuinely long, elaborate prompt, this node's ceiling is going to be the limit, not the model's ability.

    Results are inconsistent between runs on the same input. That's do_sample doing its job - it's on by default, so temperature and top_p introduce real variation. Turn do_sample off if you want the same input to reliably produce the same expansion.

    Expansion doesn't build on your text the way you expected. This is a small, general-purpose language model, not an instruction-tuned assistant - it won't reliably follow explicit instructions embedded in your prompt the way a chat-tuned LLM would. Treat the output as raw material to edit rather than a finished result.

    CategoryGraftingRayman/Text Processing

    Inputs (7)

    NameTypeDefaultDescription
    text_inputSTRING
    max_new_tokensINT501–100
    num_beamsINT51–10
    do_sampleBOOLEANtrue
    temperatureFLOAT1.000.1–2
    top_pFLOAT0.900.1–1
    seedINT11–18446744073709550000

    Outputs (1)

    NameTypeDescription
    expanded_textSTRING