Nodes/ComfyUI-UniversalRemove/UR Remove Prompt Builder
ComfyUI Node

UR Remove Prompt Builder

The name is a lie — this node removes nothing, it writes your prompts

By fengwk·Created 2 months ago·Updated 2 months ago· 0
UR Remove Prompt Builder
    • segmentation_prompt
    • remove_positive_prompt
    • remove_negative_prompt
    target_promptobject to remove
    scene_hint
    preserve_prompt
    extra_negative_prompt
    fill_mode
    masked_edit_onlytrue

    Read the name carefully: this node does not remove anything. It's a prompt formatter. Give it a description of the thing you want gone, and it hands back three ready-made prompt strings aimed at different stages of a remove pipeline. No model runs, no API is called, nothing is deleted. It's the pack's way of keeping prompt phrasing consistent so you don't have to remember what a segmentation model expects versus what an inpaint model expects.

    That might sound underwhelming, but it's genuinely the right shape for this pack. UniversalRemove deliberately ships no detector and no segmenter - the author's stated design boundary is that finding the target is a detection/segmentation problem that should stay pluggable. This node is the glue that makes your own text-to-mask model and your own inpaint model agree on the words.

    How it works

    Pure string templating, and the source is short enough to read in one sitting. You feed in what you're removing, and it composes three outputs:

    • segmentation_prompt - just your target, verbatim. This goes to whatever text-prompted segmenter you use (a Grounded SAM-style setup, a SAM node with text prompts, whatever outputs a MASK). The idea is that the same phrase that selects the object gets reused downstream.
    • remove_positive_prompt - a sentence built around "Remove {target} from the masked region," plus extra clauses depending on your settings.
    • remove_negative_prompt - the builder's baked-in denylist: artifacts, ghosting, duplicate subject, warped anatomy, broken perspective, extra text, watermark, subtitle, logo, blur, low quality, plus anything you add.

    The inputs that matter

    Three of them do the real work:

    • target_prompt - the object to remove. Default is object to remove, which is a great way to produce a useless prompt if you forget to change it.
    • fill_mode - how the model should think about what goes behind the removed thing. background_reconstruct asks for a plausible background, clean_plate wants a clean plate matching the surrounding scene, direct_replace just wants visually coherent content. Pick based on whether you're erasing a watermark (clean plate) or a person (background reconstruct).
    • masked_edit_only - on by default, and it matters more than people expect. It appends "only modify the masked region and keep unmasked content unchanged" to the positive prompt. The whole reason masked editing still exists in the age of instruction-editing models is bit-identical unmasked pixels; this is that philosophy as a prompt clause.

    scene_hint, preserve_prompt, and extra_negative_prompt are optional context slots. Scene hint describes the environment ("night city street") so the reconstruction has something to match; preserve is for things like "keep the lighting and camera framing."

    Wiring it up

    • segmentation_prompt → your text-segmentation node → MASK → UR Mask Processor / UR Keyframe Prep.
    • remove_positive_prompt and remove_negative_prompt → the text encoder of your keyframe inpaint/edit model.

    Common issues

    The trap is expecting agency from a string. People wire this up, run, and wonder why nothing got removed - because the removal happens downstream in your inpaint model, not here. Second, remember the segmentation prompt and the remove prompt are consumed by different models, so don't paste the same string into both. And third: that baked-in negative list is opinionated. It's tuned for object removal and it's mostly fine, but if your model already has strong negatives you might find it redundant rather than harmful. It's a convenience, not a doctrine.

    CategoryUniversal Remove

    Inputs (6)

    NameTypeDefaultDescription
    target_promptSTRINGobject to remove
    scene_hintSTRING
    preserve_promptSTRING
    extra_negative_promptSTRING
    fill_modeCOMBO3 options: background_reconstruct, clean_plate, direct_replace
    masked_edit_onlyBOOLEANtrue

    Outputs (3)

    NameTypeDescription
    segmentation_promptSTRING
    remove_positive_promptSTRING
    remove_negative_promptSTRING