Nodes/ComfyUI_LayerStyle_Advance/LayerUtility: UserPrompt Generator Txt2Img with Reference(Advance)
ComfyUI Node Runs on cloud

LayerUtility: UserPrompt Generator Txt2Img with Reference(Advance)

Build a prompt template that also carries a style reference

By chflame163·Created 2 years ago·Updated 4 months ago· 696
LayerUtility: UserPrompt Generator Txt2Img with Reference(Advance)
    • user_prompt
    template
    reference_text
    describe1 girl
    limit_words200

    This is the sibling of UserPromptGeneratorTxt2ImgPrompt with one addition: a reference_text field. Same core idea - you're not generating anything yourself here, you're building a user_prompt string meant to feed straight into the pack's LLM nodes (Gemini, GeminiV2, ZhipuGLM4, DeepSeekAPI), which is where the actual prompt expansion happens. What this version adds is a way to anchor that expansion to a specific style, rather than leaving it to whatever the downstream model defaults to.

    Per the README, reference_text is meant as a style description - think "moody cinematic photography, teal and orange grade" or "1990s anime cel art" rather than subject matter. The subject still comes from describe; the reference steers how it should look.

    The inputs and outputs that matter

    • template - currently one option, "SD txt2img prompt".
    • reference_text - the field that distinguishes this node from its plain sibling. No default value; you're expected to fill this in with a style description. If you leave it empty, you're effectively back to the no-reference version, so there's little reason to reach for this node over the plain one unless you're actually using this field.
    • describe (default "1 girl", multiline) - the subject, same as the sibling node.
    • limit_words (default 200, range 2–999) - caps the resulting prompt length.

    Output is a single user_prompt string, wired the same way as its sibling - into the user_prompt input of a downstream Gemini/Zhipu/DeepSeek node.

    Where this actually helps

    If you're generating a batch of prompts that should all share a visual language - a consistent lighting mood, a consistent art style - but the subjects vary, this is the node that saves you from typing the style description into every single describe field by hand. Set reference_text once (or drive it from an upstream node), vary describe per image, and the style constraint carries through consistently.

    Installing it

    ComfyUI Manager: search "ComfyUI Layer Style Advance". Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/chflame163/ComfyUI_LayerStyle_Advance.git
    

    Run install_requirements.bat (or the manual pip/whl steps for a portable install) and restart. No model download, no API key needed for this node specifically - same as its sibling, the actual generation call happens downstream.

    Common issues

    Style reference doesn't seem to influence the output. Remember this node only builds the user_prompt text - whether the style comes through depends on the downstream LLM actually respecting it. If you're not seeing the reference reflected, check the raw user_prompt string this node outputs (most graph editors let you preview a STRING output) before assuming the reference field itself is broken; it may be the downstream model underweighting it.

    Getting the same generic result as the plain UserPromptGeneratorTxt2ImgPrompt node. Check reference_text actually has content - an empty reference field makes this node behave identically to its simpler sibling, just with one more unused input.

    Confusing this with an image-to-prompt node. There's no image input here, and reference_text is text, not an image reference - if you wanted to derive a prompt from a reference picture, you're looking for one of the pack's vision nodes (PromptTagger, ZhipuGLM4V, or a Gemini vision node) instead.

    Category😺dzNodes/LayerUtility/Prompt

    Inputs (4)

    NameTypeDefaultDescription
    templateCOMBO1 options: SD txt2img prompt
    reference_textSTRING
    describeSTRING1 girl
    limit_wordsINT2002–999

    Outputs (1)

    NameTypeDescription
    user_promptSTRING