Nodes/Nynxz H3/H3 Rewrite Clean
ComfyUI Node

H3 Rewrite Clean

Strip the chat off the rewriter's answer

By Nynxz·Created about a month ago·Updated 26 days ago· 4
H3 Rewrite Clean
    • prompt
    • integrated_multimodal_description
    • overall_soundscape
    • non_diegetic_music
    generated_text

    A chat model doesn't hand you a clean prompt. It hands you chat - a preamble, code fences, maybe a "Here's your enhanced prompt:" flourish - and all of it bleeds straight into your conditioning if nothing strips it. H3 Rewrite Clean is the counterpart to H3 Rewrite Prompt: take the raw text straight out of Generate Text, get back the production prompt.

    How it works

    One input, generated_text (straight from Generate Text), and four outputs:

    • prompt - the trimmed production prompt, chat tokens, fences and preamble gone.
    • integrated_multimodal_description - the first of the rewriter's three split fields.
    • overall_soundscape - the second.
    • non_diegetic_music - the third.

    The rewriter LoRA was trained to answer in three parts, and this node splits them out so you can use them separately - feed the whole thing to H3 Encode, or grab just the soundscape for an audio-focused pass. Text it doesn't recognise passes through unchanged, which is the sane failure mode: you never lose the rewriter's answer because the cleaner got confused about its format.

    Why you need it at all

    The failure mode it prevents is the classic one from prompt-enhancer history: an LLM's conversational scaffolding becomes literal prompt tokens, which is worse than no enhancer at all. H3's text encoder is a language model reading an instruction, so a stray assistant: or a markdown fence isn't just ugly - it's conditioning the model. If you've ever watched a "prompt enhancement" workflow produce gibberish for no visible reason, this is the step that was missing.

    Install

    Part of the NynxzH3 pack - ComfyUI Manager → "Nynxz H3", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Nynxz/ComfyUI-NynxzH3
    

    Restart. Pure Python, no dependencies, ComfyUI 0.30.0+. It's just string handling - nothing to download, no model files.

    The one-liner

    Wire generated_text from Generate Text, send prompt to H3 Encode, and keep the three split fields for when you want to touch the soundscape separately. It's a small node, but it's the difference between a rewriter that works and a rewriter that poisons its own output.

    CategoryNynxz/H3/Prompt

    Inputs (1)

    NameTypeDefaultDescription
    generated_textSTRINGStraight from Generate Text.

    Outputs (4)

    NameTypeDescription
    promptSTRING
    integrated_multimodal_descriptionSTRING
    overall_soundscapeSTRING
    non_diegetic_musicSTRING