DP Prompt Inverter
Turn a positive prompt into its opposite
- STRING
You've got a positive prompt and you want its opposite - not gibberish, an actual semantic flip, so "bright sunny beach" becomes something like "dark stormy interior" instead of a word-scrambled mess. That's the specific job here: feed it text, get back an inverted version, useful mainly as a fast way to spin up a negative prompt from whatever you already wrote instead of typing one from scratch.
How it works
You write your input_prompt, set how aggressively it should flip concepts with inversion_strength, and pick whether the result is deterministic or varies run to run with generation_mode. There's also a use_nltk toggle - NLTK is a Python natural-language toolkit, and flipping this on switches the node to a more linguistically-aware method (parsing actual word roles) rather than a simpler pattern-based swap. Read that as "more accurate, more dependency risk" - more on that below.
Know your model before you wire this in. The whole point of an inverted prompt is usually to drop it into a negative-prompt slot, and negative prompts only do anything when classifier-free guidance is actually running an unconditioned pass - which means CFG above 1. On the growing pile of guidance-distilled models that default to CFG 1 (Z-Image Turbo, Flux 2 Klein distilled, most Lightning/Turbo/Hyper checkpoints), a negative prompt is not weakened, it's not computed at all - ComfyUI's own sampler code skips the unconditional pass outright at CFG 1. Wire this node's output into negative conditioning on one of those and you'll get zero effect no matter how good the inversion is. On SD 1.5, SDXL, Illustrious, Pony and anything else running real CFG (5-9 typically), it works as intended.
Inputs and outputs
Required:
inversion_strength(0-1, default 0.8, step 0.1) - how far the inversion pushes from the original meaning.generation_mode-fixedorrandomize(defaultrandomize); fixed gives you the same inversion for the same input, randomize varies it.use_nltk(boolean, default off) - switches to the NLTK-based inversion method.
Optional: input_prompt (multiline text) - the prompt you're inverting.
One output: a STRING, the inverted prompt - wire it into a negative-prompt input, or use it as a jumping-off point for a genuinely different scene rather than a literal negative.
Installing it
ComfyUI Manager: search ComfyUI-Desert-Pixel-Nodes, install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/DesertPixelAi/ComfyUI-Desert-Pixel-Nodes
Restart ComfyUI - no models needed, this is text processing only.
Where people get tripped up
The use_nltk toggle is the one real landmine here. NLTK often needs its own data downloads (tokenizer/tagger models) on first use, separate from the Python package install - if the package or its data isn't present, turning this on is the most likely thing to throw an import or lookup error while leaving the non-NLTK mode working fine. If you hit an error specifically after flipping that switch, that's where to look first: confirm nltk is actually installed in ComfyUI's Python environment, not just listed somewhere.
The other trap is treating the output as a magic negative prompt regardless of what model you're running. As covered above, it does real work on CFG-driven models and literally nothing on CFG-1 distilled ones - if your negative prompt slot seems to have no effect at all, check your sampler's CFG value before assuming this node is broken.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| inversion_strength | FLOAT | 0.80–1 | — |
| generation_mode | COMBO | randomize | 2 options: fixed, randomize |
| use_nltk | BOOLEAN | false | — |
| input_promptopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |