๐ข๐ฒ Text with random Seed
Fixes the 'my loop keeps reusing one seed' problem
- text
- random_seed
If you've ever looped a batch of prompts through the same KSampler expecting a batch of different images and gotten back a set of eerily similar ones, you've hit the exact problem this node fixes. Standard advice in this community is "lock the seed, change one variable" so you can actually compare results - that's what control_after_generate: randomize is built around, and it works fine for a normal single run. But inside a Bjornulf loop node, that randomize step only fires once the entire workflow finishes, not once per iteration. So every pass through the loop, different prompt, same seed. Great for controlled comparison, useless if what you actually wanted was variety.
Text with random Seed is the node justUmen built specifically to break that pattern. Drop it inside the loop body and it forces a genuinely different seed on every iteration, so a loop over five prompts gives you five images that actually look like five different generations - not five near-duplicates wearing different hats.
How it works
You pass it a piece of text (usually whatever's coming out of your loop or prompt node) plus a seed value, and it hands back both the text - unchanged, just passed through so you can keep it in the chain - and a random_seed output that's fresh each time the node executes. Wire random_seed into your KSampler's seed input (right-click the KSampler and "convert widget to input" first if it isn't already exposed), and now every loop iteration samples with its own seed instead of inheriting the loop's static one.
The README shows exactly the failure mode this solves side by side: the same prompt-varying loop with and without this node, on both Flux and SDXL, where the same-seed version produces noticeably similar compositions across different prompts and the random-seed version doesn't.
The inputs and outputs that matter
text- whatever text is flowing through your loop; it passes through untouched.seed(default1) - the seed value going in, which the node uses as its starting point for generating a new one per call.
Two outputs: text (pass-through, so you don't have to split your wiring) and random_seed (an INT), which is the actual payload - that's what you connect to your sampler.
How to install it
Through ComfyUI Manager: search "Bjornulf_custom_nodes," install, restart ComfyUI. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/justUmen/Bjornulf_custom_nodes
then restart. This particular node has no special dependency - it's pure Python logic, no models, no external binaries. The pack-wide requirements.txt (ollama, opencv-python, ffmpeg-python, and a few more) only comes into play if you're also using the video, TTS, or AI-integration nodes elsewhere in the pack.
Common issues & troubleshooting
You wired it but still get repeated seeds. Check that random_seed is actually feeding your KSampler's seed input, not just sitting next to a KSampler whose seed widget is still set manually. The node only helps if its output is the thing actually driving the sampler.
You're using it outside a loop and wondering why it matters. It doesn't, really - outside a Bjornulf loop, ComfyUI's normal control_after_generate: randomize on a seed widget already gives you a new seed every run. This node earns its keep specifically inside the loop-per-iteration case, where that mechanism doesn't apply. If you're not looping, you probably don't need it.
Confusing this with wanting reproducibility. This node is for the opposite goal - deliberately breaking seed consistency to get variety. If you actually want to compare the effect of changing one variable while holding everything else fixed (the more common advice you'll hear), don't use this node in that loop; you want the seed to stay locked in that case, not randomized per iteration.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | โ | |
| seed | INT | 1 | โ |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| text | STRING | โ |
| random_seed | INT | โ |