v2.51.0
Random AI prompt + image generator for the Stable Diffusion WebUI -- a CLI and a local web UI.
Pre-release software. Provided as-is under Apache-2.0.
What's new in this release
2026-07-07 — Pre-release hardening: preset-loader path-traversal fix + engine-module coverage (2.51.0)
SonarCloud (on the 2.51.0 release PR) flagged the new shared engine modules — fixed for real before
shipping rather than merging a red gate:
- Security (path traversal).
engine/presets.jsloadPreset(name)built a file path fromname,
which arrives from the/api/promptrequest body — so a craftedpresetwith../separators could
read arbitrary*.jsonfiles. It now rejects anything but a plain preset name. Regression-tested. - Coverage. The three new modules (
promptRun.js/nodeEngine.js/presets.js) weren't in the
Vitest coverage allowlist, so Sonar saw 0% on them. Added them + focused unit tests
(tests/unit/{promptRun,presets,nodeEngine}.test.js) → ~100% lines each; global thresholds hold. - False positive. Suppressed S2245 (
Math.random) forpromptRun.js's batch-seed mint — a creative
prompt seed, never security-sensitive (same as the existingrng.js/random.jssuppressions).
Full gate green (419 web + the Node suite incl. the new specs).
2026-07-07 — New targets/comfyui/ target: ComfyUI prompt-engine nodes (2.51.0)
Added a ComfyUI custom-node target (targets/comfyui/) that brings the prompt engine into ComfyUI as
natural-language-first STRING sources for a CLIP Text Encode. Prompt-side only — ComfyUI already
owns image generation, upscaling, variations, and re-roll (its native seed widget), so the target adds
just the prompt half (the DPL processor, blocks, lists, presets).
- Thin Python wrappers, no re-ported engine logic. The nodes make HTTP calls to a running app's
local backend (point-at-running-app; defaulthttp://localhost:4173, auto-detects a running app on
localhost:4173/5173, override via a Settings field /RANDOM_AI_PROMPT_URL). Two new backend routes power it —
POST /api/promptandGET /api/prompt/catalog— reusing the sharedengine/promptRun.js,
engine/nodeEngine.js, andengine/presets.js(all extracted this session so nothing is duplicated;
the CLI re-exports the same modules). Dependency-free (stdliburllib). - Nodes: a flagship natural-language
RandomAIPromptGenerator(template + seed + nsfw + preset) plus
helpersPromptList/PromptBlock/DPLExpand/PromptBatch(N variations as a list) /
CombinePrompts(join wired pieces) /ShowPrompt(display + pass-through). Re-roll is the native seed
widget (control_after_generate); presets come fromengine/data/presets(+user/presets). Every
input/output carries a tooltip + each node a description; the generator is top-level, the helpers grouped
under a submenu. (An AI-rewrite node was considered and dropped — calling a third-party API mid-graph is
off-paradigm for ComfyUI, and the plugin now makes zero third-party calls.) - Frontend extension (
web/randomAiPrompt.js): the single Settings URL field (drives dropdowns and
generation via a persisted/random_ai_prompt/config), LIVE dropdowns from the catalog (same-origin
proxy routes, avoiding CORS), the app icon + brand colours on the nodes, theShowPrompttext display,
and a status sidebar. Plus a drag-inexample_workflows/starter and an Apache-2.0LICENSE. - Verify: the engine/backend side is covered by
tests/integration/promptApi.test.js(generate, seed
reproducibility, preset apply + unknown→400, catalog); the Python + ComfyUI-runtime JS are
syntax-checked and must be validated in a running ComfyUI (manual — no CI runtime). Full gate green.
New deep-divesystems/comfyui.md; credits +CLAUDE.mdupdated; legal pages
re-checked (localhost only — no third-party data flow).
2026-07-07 — Dispose of the chaos knob; extract a shared engine-owned prompt-run (2.50.1)
Removed the chaos value for good. It was a pre-DPL knob for controlling randomization (scaling the
whole emphasis/editing/alternating envelope at once, with blocks meant to react to it) that predated the
DPL wrapper and was never liked; it was never an engine setting (engine/settings.js never had it), and
its UI control had already been unmounted on 2026-06-19. Deleted withChaos from the web facade
(targets/web/frontend/lib/promptEngine.js) and the CLI, dropped the CLI --chaos flag
(optionSpec.js), and swept the current-state docs (removed-pending-readd.md row deleted; status.md,
cli.md, dpl-language.md, prompt-dsl.md, next-steps.md, the Home.jsx comment). Left untouched:
Midjourney's own unrelated --chaos provider parameter, and the word "chaos" in the vocabulary lists /
block descriptions. Default prompt output is byte-identical (withChaos was a no-op at chaos = 1); the
snapshot + CLI reproducible-prompt tests confirm it.
In the same pass, extracted the duplicated seed/reroll prompt-run logic into a new engine-owned,
isomorphic module engine/promptRun.js (seedFor, forEngine, and a createPromptRun(engine)
factory). The web SPA facade and the CLI's promptRun.js now consume it instead of each carrying their
own copy — so the seed rules live in one place, and the upcoming ComfyUI backend prompt route can reuse
them rather than re-porting the logic a third time. No behavior change: 293 Node + 419 web tests, lint,
and doc-link checks all green.
2026-07-07 — New targets/cli/ target: the prompt command-line tool (2.50.0)
Added a command-line build target — a traditional args-and-flags CLI (prompt, package
@random-ai-prompt/cli) that generates prompts and runs them through image providers using the same
engine, providers, settings, and on-disk store as the web/desktop app (parity with both the engine
and the GUI, by default). No TUI/interactive mode — every capability is a subcommand with flags, a
--help page, colored output (picocolors; honors NO_COLOR/FORCE_COLOR), and completion for
bash, zsh, fish, and PowerShell.
- Commands:
generate(default; everyengine/settings.jsfield is a flag, plus provider/image/
rewrite knobs,--seed/--random,--nsfw,--preset,--json),list
(blocks/lists/providers/presets/dialects/samplers/settings),config,keys,rewrite,upscale,
andcompletion. - Reuse, not fork: a Node provider registry (
src/lib/providers.js) replaces the SPA's Vite-glob
registry (fs-discoversshared/<id>/config.js+_shared/settings/*.js); the CLI runs the real
backend (apiHandler.js) in-process on an ephemeral port with afetchshim, so every
provider's owncode/generate.jsruns unchanged and images save to the sharedoutput/folder with
the same sidecar the gallery reads. An ESM resolve hook (src/lib/jsonLoader.mjs) injects
type: jsonso the providers' bare JSON imports load under Node. - Shared state: CLI defaults persist to their own
clinamespace (never clobbering the GUI's
settings.json); BYOK keys are read from both stores, so keys are shared between the CLI and the app
(or supplied per-run viaPROMPT_KEY_<PROVIDERID>). Anapiprovider is only called with--images,
so a plainprompt -p openai "x"never spends credits. - Wiring/tests: root
postinstallinstalls the CLI;npm run cliruns it; the root ESLint gate
now lintstargets/cli(Node ESM) and CLI unit tests live intests/cli/cli.test.js(14 tests, in
the root Vitest gate). Seesystems/cli.md.
How to get it
Prefer not to build? Download a pre-built edition:
- Desktop app -- Windows
.msi/.exe(or a portable.zip), macOS.dmg, Linux.AppImage/.deb(attached below). Self-contained; nothing to install first. random-ai-prompt-2.51.0-online.zip-- the online edition as static files; host it anywhere, or just use https://prompt.fairyfox.io.random-ai-prompt-2.51.0.tar.gz-- source tarball (run with Node 24:npm installthennpm start).random-ai-prompt-2.51.0-docs.zip-- the generated documentation site.
What's Changed
- Release v2.51.0 — ComfyUI target + headless prompt routes by @junebug12851 in #47
Full Changelog: v2.49.6...v2.51.0