Nodes/Dream Project Animation Nodes/⚅ Random Prompt Words
ComfyUI Node

⚅ Random Prompt Words

Let your prompts improvise between frames

By alt-key-project·Created 3 years ago·Updated 2 years ago· 114
⚅ Random Prompt Words
  • partial_prompt
  • partial_prompt
words
separator,
samples1
min_weight1.00
max_weight1.00
seed0

Deforum-style animation is built on a dirty secret: every frame is a fresh generation, and if every frame gets the same prompt you get a slideshow, not motion. The trick is to change something small every frame so the sequence evolves organically. Random Prompt Words [Dream] is the something. Feed it a bucket of words and it re-rolls a handful into your prompt on every run, so frame 37 isn't a carbon copy of frame 36.

It's part of the Dream Project Animation Nodes pack from Alt Key Project - the set of utilities the author built to make music videos for his own channel, and they're all wired around one idea: the frame counter driving parameters that change over time.

How it works

You hand it a block of text (words), and it splits it on a separator (, by default), strips whitespace, and throws away duplicates. Then it draws samples distinct words - no repeats within one frame - and gives each a weight drawn uniformly from min_weight to max_weight. Everything is driven by its own seeded RNG, so the same seed always produces the same picks.

The output isn't a string. It's a partial_prompt, which is this pack's way of chaining weighted prompt fragments together. That's the whole architecture: Random Prompt Words (and Build Prompt) pile fragments onto a growing prompt, and a Finalize Prompt [Dream] node turns the pile into the actual positive/negative text that goes into your CLIP Text Encode.

The inputs that matter

  • words - your vocabulary, one per line or comma-separated. This is the whole game; a bigger list means more variety.
  • samples - how many words to draw per frame. Default 1; keep it small unless you want chaos.
  • min_weight / max_weight - both default to 1, which means every word is neutral. If you want the picked words to actually pop, set max_weight higher than 1. Setting a range gives you varying emphasis frame to frame.
  • seed - the random source. Leave at 0 and the picks are the same every run, which is what you want while tuning.
  • separator - default ,, but you can use any delimiter you like.

The optional partial_prompt input is how you chain: wire another fragment builder's output in here and your fragments accumulate.

Where it wires in

partial_prompt out → Finalize Prompt [Dream] → CLIP Text Encode. If you're using the pack's prompt-morphing example workflow, you'll also see curves driving other nodes' weights while this one supplies the vocabulary roulette.

Installing it

Ships with Dream Project Animation Nodes:

  • ComfyUI Manager - search Dream Project Animation, install, restart.
  • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/alt-key-project/comfyui-dream-project, then pip install -r requirements.txt, restart.

No model downloads. The requirements are imageio, pilgram, scipy, numpy<2.0, torchvision and evalidate - nothing heavy.

Common issues

The #1 mistake is wiring partial_prompt straight into a CLIP Text Encode node and wondering why nothing happens. It's not a string yet - it has to go through Finalize Prompt. If you set samples higher than the number of unique words you typed, the node silently caps it, so a tiny vocabulary gives you less variety than you asked for. And if you want the randomness to change every frame rather than repeat, drive the seed from something that varies (a frame counter or a random seed node) instead of leaving it fixed.

Category✨ Dream/☯ conditioning

Inputs (7)

NameTypeDefaultDescription
wordsSTRING
separatorSTRING,
samplesINT11–100
min_weightFLOAT1.00-10–10
max_weightFLOAT1.00-10–10
seedINT00–18446744073709550000
partial_promptoptPARTIAL_PROMPT

Outputs (1)

NameTypeDescription
partial_promptPARTIAL_PROMPT