Nodes/SillyDream Prompt Reverse/文本扩写 (SillyDream)
ComfyUI Node

文本扩写 (SillyDream)

Turn one rough line of prompt into a full paragraph, your own way

By qianchi7·Created about a month ago·Updated about a month ago· 0
文本扩写 (SillyDream)
    • expanded_text
    text
    api_urlhttp://127.0.0.1:3000
    model_namegpt-4o-mini
    api_key
    max_tokens2048
    temperature0.70
    seed0
    system_prompt你是一位提示词润色专家。把用户给出的简短描述扩写成信息更丰富、细节更具体的文生图提示词,补足材质、光线、环境、镜头与风格等要素,但不得改变原意、不得添加原文没有暗示的主体。只输出扩写后的正文。
    top_p1.00
    timeout120

    "Expand this prompt" is a one-liner that sounds trivial and isn't. SillyDreamTextExpand (文本扩写, "text expand") is the second node in the qianchi7/ComfyUI-SillyDream-PromptReverse pack: you feed it a short description, it sends the text to an OpenAI-compatible chat API, and returns a longer, more detailed prompt you can actually run. Same gateway, same key, same philosophy as its image-reverse sibling - just text in, text out.

    Same honesty as that node, too: "SillyDream" isn't a model. The node is a courier. Whatever chat model your api_url gateway exposes is what does the writing, and for this one it doesn't even need vision - a plain chat LLM handles it fine, so you can point it at a cheap small model and not feel the per-call cost.

    Why reach for it? The blank-page problem, again, but text-side. You have a vague idea - "a rainy cyberpunk street at night" - and you want a structured prompt that names materials, lighting, environment, lens and style. If your checkpoint has an LLM encoder (the Z-Image / Flux Klein generation), a second LLM writing the instruction is a translation between two things that speak the same language. It's also the natural second stage after the pack's image node: reverse the image into a prompt, then expand that prompt, then generate.

    How it works

    Plaintext in, chat-completions out:

    • Your text goes into a system_prompt + user message pair, posted to <api_url>/v1/chat/completions (the node appends the path for you - http://IP:3000 is enough).
    • temperature, top_p, seed and max_tokens ride along. seed is only sent if it's above 0, so a 0 just means "let the gateway decide."
    • The reply parser is the same forgiving one as the image node - it strips chat scaffolding and handles gateways that return content as arrays or from reasoning fields.

    The one input worth reading before you touch anything else is the default system_prompt. It tells the model it's a prompt-polish expert, told to fill in material, light, environment, lens and style - but not to change the meaning or add subjects the original text never implied. That's the author pre-answering the classic prompt-enhancer failure: subject drift, the thing that makes an "enhancer" invent content you never asked for. Leave the default in; it's doing real work.

    The inputs that matter

    • text - your starting description, multiline. Empty input errors immediately, so there's no silent no-op.
    • api_url / model_name / api_key - same trio as the image node: your gateway, the model name exactly as the gateway lists it, and a key (or blank if the gateway needs none).
    • system_prompt - the quality lever. Edit it to control output language (there's no language dropdown here) or to target a specific model's prompt style.
    • temperature / top_p / max_tokens - defaults are 0.7 / 1.0 / 2048. Lower temperature for more faithful rewrites; raise max_tokens if you want genuinely long output.

    The single output is expanded_text, a STRING - same wiring as the image node: into a text encoder or any text-socket node.

    Installing it

    One pack, both nodes. ComfyUI Manager → Install via Git URLhttps://github.com/qianchi7/ComfyUI-SillyDream-PromptReverse.git, then Restart (not Reload - nodes only scan at startup). Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/qianchi7/ComfyUI-SillyDream-PromptReverse.git
    pip install requests Pillow numpy
    

    requests, Pillow, numpy - that's all. No model downloads, no heavy dependencies. Search 文本扩写 or SillyDream after restarting.

    Troubleshooting

    Same gateway-shaped failures as its sibling, because it's the same client code:

    • 404 - model_name doesn't match your gateway's configured name.
    • 401/403 - key wrong or no access to that model.
    • 429 - rate limited; the node retries, then gives up.
    • "response isn't valid JSON" - api_url points at a web page, not the API.

    Two things that trip people specifically on this node: if you point it at a hosted, censored model, don't expect it to expand anything spicy - that's the API path's filter, not a node bug. And if the output comes back in Chinese no matter what you do, it's the default system_prompt doing its job; swap in your own English one. There's also a bundled template (工作流 → 浏览模板 → Image-Prompt-Reverse) that shows the reverse-then-expand chain wired up, worth loading once to see the pattern.

    CategoryImage/Prompt

    Inputs (10)

    NameTypeDefaultDescription
    textSTRING
    api_urlSTRINGhttp://127.0.0.1:3000
    model_nameSTRINGgpt-4o-mini
    api_keySTRING
    max_tokensINT20480–32768
    temperatureFLOAT0.700–2
    seedINT00–4294967295
    system_promptSTRING你是一位提示词润色专家。把用户给出的简短描述扩写成信息更丰富、细节更具体的文生图提示词,补足材质、光线、环境、镜头与风格等要素,但不得改变原意、不得添加原文没有暗示的主体。只输出扩写后的正文。
    top_pFLOAT1.000–1
    timeoutINT1205–1800

    Outputs (1)

    NameTypeDescription
    expanded_textSTRING