Members
(constant) MAX_GROUP_DEPTH
- Description:
Recursion cutoff for group-includes-group nesting.
- Source:
Recursion cutoff for group-includes-group nesting.
(constant) NSFW_TOKEN :RegExp
- Description:
Matches an
nsfwtoken: a standalone word in a list name, delimited by a path separator, dash, dot, underscore, or the start/end of the string. Sod/general-nsfw,clothes-nsfw,foo.nsfw.barall match, butnsfwishdoes not.
- Source:
Matches an nsfw token: a standalone word in a list name, delimited by a path
separator, dash, dot, underscore, or the start/end of the string. So
d/general-nsfw, clothes-nsfw, foo.nsfw.bar all match, but nsfwish does not.
Type:
- RegExp
(constant) RESERVED_ANY :string
- Description:
Reserved wildcard base:
{#any}(and{#any-sfw}/{#any-nsfw}) is not a file — it runs one random generator drawn from the whole v2 catalog, mode-aware. Reserved like the lists'{keyword}.
- Source:
Reserved wildcard base: {#any} (and {#any-sfw} / {#any-nsfw}) is not a file — it
runs one random generator drawn from the whole v2 catalog, mode-aware. Reserved like the
lists' {keyword}.
Type:
- string
(constant) RESERVED_WILDCARD :string
- Description:
Reserved wildcard base.
{keyword}(and{keyword-sfw}/{keyword-nsfw}) are not files — they resolve to a random word drawn from ALL loaded vocabulary (mode-aware). The name is reserved: it always supersedes any list literally namedkeyword, silently (no error), the same waynsfwis a reserved filename token.
- Source:
Reserved wildcard base. {keyword} (and {keyword-sfw} / {keyword-nsfw}) are
not files — they resolve to a random word drawn from ALL loaded vocabulary
(mode-aware). The name is reserved: it always supersedes any list literally named
keyword, silently (no error), the same way nsfw is a reserved filename token.
Type:
- string
(constant) RNG
- Description:
Default randomness (Math.random-based, matching the v2 generators' lodash usage).
- Source:
Default randomness (Math.random-based, matching the v2 generators' lodash usage).
(constant) SFW_SUFFIX
- Description:
Suffix tokens that select an exclusive SFW or NSFW-inclusive variant.
- Source:
Suffix tokens that select an exclusive SFW or NSFW-inclusive variant.
(constant) browserLoader :object
- Description:
Browser data loader for the engine: Vite
import.meta.globbundles. ImplementsreadExpansion,readListLines,listNames,expansionNames,loadDynamicPrompt,dynamicPromptNames,presetNames,loadPreset.
- Source:
Browser data loader for the engine: Vite import.meta.glob bundles. Implements
readExpansion, readListLines, listNames, expansionNames, loadDynamicPrompt,
dynamicPromptNames, presetNames, loadPreset.
Type:
- object
(constant) dynPromptTags :Object.<string, {category: (string|undefined), anime: (boolean|undefined), nsfw: (boolean|undefined)}>
- Description:
Per-generator tag metadata (the analog of
listTags): a category plus anime/nsfw flags, for UI badges and docs. The category is normally derivable from the folder; this map only needs entries that carry extra flags. Anything absent defaults to{ anime:false, nsfw:false }.
- Source:
Per-generator tag metadata (the analog of listTags): a category plus anime/nsfw
flags, for UI badges and docs. The category is normally derivable from the folder; this
map only needs entries that carry extra flags. Anything absent defaults to
{ anime:false, nsfw:false }.
Type:
- Object.<string, {category: (string|undefined), anime: (boolean|undefined), nsfw: (boolean|undefined)}>
(constant) listTags :Object.<string, {category: (string|undefined), anime: (boolean|undefined), nsfw: (boolean|undefined)}>
- Description:
Per-list metadata. Any list not listed here defaults to { anime:false, nsfw:false }.
nsfw:truemeans the list as a whole leans adult (still drawn only when includeAdult is on if it is also gated).
- Source:
Per-list metadata. Any list not listed here defaults to
{ anime:false, nsfw:false }. nsfw:true means the list as a whole leans
adult (still drawn only when includeAdult is on if it is also gated).
Type:
- Object.<string, {category: (string|undefined), anime: (boolean|undefined), nsfw: (boolean|undefined)}>
(constant) nodeLoader :object
- Description:
Node data loader for the engine: filesystem reads +
createRequiredynamic-prompt loading. ImplementsreadExpansion,readListLines,listNames,expansionNames,loadDynamicPrompt,dynamicPromptNames.
- Source:
Node data loader for the engine: filesystem reads + createRequire dynamic-prompt
loading. Implements readExpansion, readListLines, listNames, expansionNames,
loadDynamicPrompt, dynamicPromptNames.
Type:
- object
Methods
_displayProgress(noBack, isUpscale, isAnim)
- Description:
Display progress.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
noBack |
boolean | |
isUpscale |
boolean | |
isAnim |
boolean |
_reIndexToUrl(url)
- Description:
Re index to url.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
url |
string |
_reindexHome()
- Description:
Reindex home.
- Source:
actionMenuSelection()
- Description:
Action menu selection.
- Source:
addRemoveButton()
- Description:
Add remove button.
- Source:
adultAllowed() → {boolean}
- Source:
Returns:
Whether adult/explicit lists and prompts are enabled.
- Type
- boolean
allListNames(names) → {Array.<string>}
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
names |
Array.<string> | The on-disk list + group names (no extension). |
Returns:
De-duplicated, in the guaranteed natural order (compareNames).
- Type
- Array.<string>
artistRepeater(artist, alias, settings) → {string}
- Description:
Emit a random number of artist tokens — gated by
settings.includeArtistand a 50% coin flip — betweensettings.minArtistandsettings.maxArtist.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
artist |
string | The repeat target. |
alias |
boolean | Whether to resolve via the alias. |
settings |
object | The merged generation settings. |
Returns:
The joined artist tokens (possibly "").
- Type
- string
autoGroupListDirs(listNames, enableDirsopt, disableDirsopt) → {Array.<string>}
- Description:
Folders that are IMPLIED groups: a folder with 2+ direct list files is auto-marked (referenceable as
{folder}= union of its own lists). Anenable-group-listmarker forces a folder on (even with one list); adisable-group-listmarker forces it off. Does NOT stack — only the folder's own direct lists count, not its subfolders.
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
listNames |
Array.<string> | Logical LIST names (txt-derived; groups excluded). |
|
enableDirs |
Array.<string> |
<optional> |
Folders forced on ( |
disableDirs |
Array.<string> |
<optional> |
Folders forced off ( |
Returns:
The implied-group folder paths.
- Type
- Array.<string>
breakdownData(txt, name, settings, imageSettings, upscaleSettings) → {object}
- Description:
Parse the lines of an AUTOMATIC1111 parameters block into the JSON sidecar shape (prompt, negative prompt, steps, sampler, cfg, seed, size, model, denoising, …).
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
txt |
Array.<string> | The metadata lines (prompt first, negative second). |
name |
string | The file id (stored as |
settings |
object | The merged generation settings. |
imageSettings |
object | The image settings. |
upscaleSettings |
object | The upscale settings. |
Returns:
The reconstructed sidecar JSON.
- Type
- object
buildIndexes(settings, directoryName) → {void}
- Description:
Walk the output directory and index every sidecar file (non-recursive).
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
settings |
object | The full settings. |
directoryName |
string | The output directory. |
Returns:
- Type
- void
buildTree(lines, depth, startopt) → {Object}
- Description:
Recursively group depth-tagged lines into
{ line, children }nodes.
- Source:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
lines |
Array | The (remaining) lexed lines. |
||
depth |
number | The depth level being collected. |
||
start |
number |
<optional> |
0
|
Index to start from. |
Returns:
Nodes at this depth and the next index.
- Type
- Object
charRank(ch) → {number}
- Description:
Class rank for a single character: symbols (0) sort before digits (1) before letters (2). Gives a guaranteed, predictable ordering.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
ch |
string | A single character. |
Returns:
0 symbol, 1 digit, 2 letter.
- Type
- number
check(name, imageSettings) → {boolean}
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | The image file id. |
imageSettings |
object | The image settings ( |
Returns:
Whether an unconverted <name>.txt sidecar exists.
- Type
- boolean
classifyRemoval(line, optsopt) → {Object|null}
- Description:
Classify a single list line for removal.
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
line |
string | Raw line. |
|||||||||||
opts |
object |
<optional> |
Properties
|
Returns:
Category + matched term, or null when clean.
- Type
- Object | null
clearImages()
- Description:
Clear images.
- Source:
compareNames(a, b) → {number}
- Description:
Natural-order comparator giving a GUARANTEED load/precedence order: symbols first, then numbers in true numeric order (so
2before10), then letters alphabetically. Lets users engineer a deterministic default by prefixing a name with a symbol or number.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
a |
string | First name. |
b |
string | Second name. |
Returns:
Negative, zero, or positive.
- Type
- number
compileDpl(source, bridgeopt) → {Object}
- Description:
Compile a
.dplsource into a dynamic-prompt module object (same shape as a JS generator).
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
source |
string | The |
|
bridge |
object |
<optional> |
Optional JS bridge: |
Returns:
The module.
- Type
- Object
completePage()
- Description:
Complete page.
- Source:
computeButtonNames(names, forcedDirsopt) → {Object.<string, string>}
- Description:
Compute the SHORTEST unambiguous display token for each list, for editor buttons. By default a list shows just its filename; a name only grows a folder prefix when it would otherwise be ambiguous.
Two stages:
- Manual prefix (
.force-prefix) — any name under a folder marked with a.force-prefixfile shows its path from the highest such ancestor down (e.g.danbooru/d/general→d/general). These are excluded from the auto step, so they never push a prefix onto anyone else. - Auto prefix — the rest start at the bare filename; whenever two share a token they each step out one more folder until distinct.
A final pass guarantees every token
resolveName()s back to its own canonical name (lengthening if a forced/other name would otherwise shadow it).- Manual prefix (
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
names |
Array.<string> | Canonical (logical) list names. |
|
forcedDirs |
Array.<string> |
<optional> |
Folders that contain a |
Returns:
Map of canonical name → display token.
- Type
- Object.<string, string>
configure(_loader) → {void}
- Description:
Inject the data loader (fs in Node, glob in the browser). Call once before
loadAll().
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
_loader |
object | The loader implementation. |
Returns:
- Type
- void
convert(name, txt, settings, imageSettings, upscaleSettings) → {object}
- Description:
Convert a legacy
.txtmetadata sidecar to.json(replacing the file on disk), or parse provided text.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | The image file id. |
txt |
string | undefined | Raw metadata text, or undefined to read |
settings |
object | The merged generation settings. |
imageSettings |
object | The image settings ( |
upscaleSettings |
object | The upscale settings. |
Returns:
The converted sidecar JSON.
- Type
- object
convertToPath(name) → {string}
- Description:
Map a
user--prefixed dynamic-prompt name to itsuser-submitted/path.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | The dynamic-prompt key. |
Returns:
The resolved path key.
- Type
- string
copyPrompt()
- Description:
Copy prompt.
- Source:
copyShareLink()
- Description:
Copy share link.
- Source:
createEngine(loader) → {Object}
- Description:
Create a framework-agnostic prompt engine that runs the same pipeline as the CLI.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
loader |
object | Data-access loader (Node fs or browser glob): |
Returns:
The engine API.
- Type
- Object
createListStore(loader) → {Object}
- Description:
Create a loader-backed list store with the original once-only depletion + alias behaviour.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
loader |
object | Data loader ( |
Returns:
The store API.
- Type
- Object
danbooruReplacer(prompt, settings) → {string}
- Description:
When an anime/danbooru keyword dict is active, rewrite a trailing
, Personto{d-person}so the anime character list is used instead of the generic person list.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
prompt |
string | The prompt fragment. |
settings |
object | The merged generation settings ( |
Returns:
The (possibly) substituted prompt.
- Type
- string
dataRefreshComplete(data)
- Description:
Data refresh complete.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
data |
object |
deepLink(fromName, toName, linkType) → {void}
- Description:
Record a deep link from one file to another under a link type, creating the placeholder/array as needed.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
fromName |
string | The parent file id. |
toName |
string | object | The linked file (id or |
linkType |
string | The relation ( |
Returns:
- Type
- void
dirOpen(dirPath) → {Buffer|undefined}
- Description:
Open a folder in the OS file explorer (cross-platform).
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
dirPath |
string | The directory to open. |
Returns:
The execSync result, or undefined on (often benign) error.
- Type
- Buffer | undefined
displayProgress(noBack, isUpscale, isAnim)
- Description:
Display progress.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
noBack |
boolean | |
isUpscale |
boolean | |
isAnim |
boolean |
downloadLists()
- Description:
Download lists.
- Source:
downloadSettings()
- Description:
Download settings.
- Source:
dynGroupDirs(names, enableDirsopt, disableDirsopt) → {Array.<string>}
- Description:
The category folders that are IMPLIED groups: a v2 folder with 2+ generators. Reuses the list rule (
autoGroupListDirs) over the v2 names only (v1/ is excluded — it is reached via{#name-v1}, never grouped). Marker dirs force a folder on/off.
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
names |
Array.<string> | All dynamic-prompt catalog names. |
|
enableDirs |
Array.<string> |
<optional> |
Folders forced on ( |
disableDirs |
Array.<string> |
<optional> |
Folders forced off ( |
Returns:
The implied-group folder paths.
- Type
- Array.<string>
dynGroupMembers(dir, names) → {Array.<string>}
- Description:
Direct-child generator names of a group folder (NOT descendants — groups don't stack).
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
dir |
string | The folder path (e.g. "v2/scene"). |
names |
Array.<string> | All dynamic-prompt catalog names. |
Returns:
The member generator keys.
- Type
- Array.<string>
editIn(settings, keyword) → {string}
- Description:
Prompt-editing "edit-in":
[kw:n]— kw appears after step n.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
settings |
object | The merged generation settings ( |
keyword |
string | The keyword. |
Returns:
The edit-in form.
- Type
- string
editOut(settings, keyword) → {string}
- Description:
Prompt-editing "edit-out":
[kw::n]— kw drops at step n.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
settings |
object | The merged generation settings ( |
keyword |
string | The keyword. |
Returns:
The edit-out form.
- Type
- string
epochToDateString(epochTimestamp) → {*}
- Description:
Epoch to date string.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
epochTimestamp |
number |
Returns:
- Type
- *
(async) execApp() → {Promise.<object>}
- Description:
Spawn the CLI (
node . --flags) with the currentargsto perform the actual generation, trackingexecAppOngoing.
- Source:
Returns:
The exec result ({stdout, stderr} on success, or {error}).
- Type
- Promise.<object>
(async) execMagick(argsopt, fileNamesopt, outputopt, silentopt) → {Promise.<object>}
- Description:
Run an ImageMagick (
magick) command, auto-quoting args that need it.
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
args |
object |
<optional> |
Flag→value map (rendered as |
fileNames |
Array.<string> |
<optional> |
Input filenames. |
output |
string |
<optional> |
Output filename. |
silent |
boolean |
<optional> |
Suppress logging. |
Returns:
The exec result ({stdout, stderr} on success, or {error}).
- Type
- Promise.<object>
expandDynamicPromptV1(name, settings, imageSettings, upscaleSettings) → {string}
- Description:
Load and run a frozen v1 dynamic-prompt plugin (
#name-v1); v1 bakes in fx and artists, so auto-add is forced off.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | The dynamic-prompt name (a trailing |
settings |
object | The merged generation settings. |
imageSettings |
object | The image settings. |
upscaleSettings |
object | The upscale settings. |
Returns:
The generated prompt fragment.
- Type
- string
expandDynamicPromptV2(name, settings, imageSettings, upscaleSettings) → {string}
- Description:
Load and run a v2 dynamic-prompt plugin (
#name), applying danbooru substitution.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | The dynamic-prompt name (a trailing |
settings |
object | The merged generation settings. |
imageSettings |
object | The image settings. |
upscaleSettings |
object | The upscale settings. |
Returns:
The generated prompt fragment.
- Type
- string
expandExpansion(name, settings) → {string}
- Description:
Read an expansion file's raw text.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | The expansion name (file |
settings |
object | The merged generation settings (for |
Returns:
The file contents.
- Type
- string
extendAnim(isSelect)
- Description:
Extend anim.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
isSelect |
boolean |
fillListData(el)
- Description:
Fill list data.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
el |
object |
fillSettingValue(el)
- Description:
Fill setting value.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
el |
object |
find(regex, str, defopt) → {*}
- Description:
Match a regex against a string and return its first capture group, or a default.
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
regex |
RegExp | The pattern (capture group 1 is returned). |
|
str |
string | The string to search. |
|
def |
* |
<optional> |
The fallback when there is no match. |
Returns:
The captured value, or def.
- Type
- *
gatePool(names, isGated) → {Array.<string>}
- Description:
Drop gated (adult) names from a pool unless
includeAdultis on.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
names |
Array.<string> | The candidate names. |
isGated |
function | Predicate: true if a name is adult-gated. |
Returns:
The filtered pool.
- Type
- Array.<string>
generate()
- Description:
Generate.
- Source:
generationProgress()
- Description:
Generation progress.
- Source:
getGalleryEl(prompt, imgSrc, width, height, name) → {*}
- Description:
Get gallery el.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
prompt |
string | |
imgSrc |
string | |
width |
number | |
height |
number | |
name |
string |
Returns:
- Type
- *
getListFiles(settings) → {Array.<string>}
- Description:
Recursively list every
.txtunder the list dir as a "/"-joined relative name (e.g.danbooru/general), so lists can be organized into nested folders.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
settings |
object | The merged generation settings ( |
Returns:
The list names (no extension), full relative paths.
- Type
- Array.<string>
(async) getProgress() → {Promise.<object>}
- Description:
Get generation progress (from the CLI progress server, or a stopped-state default), with the server's own
execOngoingflag merged in.
- Source:
Returns:
The progress payload.
- Type
- Promise.<object>
(async) getProgressRequest() → {Promise.<(object|undefined)>}
- Description:
Fetch generation progress from the CLI's progress server (port
portProgress).
- Source:
Returns:
The progress payload, or undefined if unreachable.
- Type
- Promise.<(object|undefined)>
getRndSalt() → {string}
- Source:
Returns:
A fresh random salt token like [1234567890].
- Type
- string
getUrlParameters() → {*}
- Description:
Get url parameters.
- Source:
Returns:
- Type
- *
hasNsfwToken(name) → {boolean}
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | A list/group name. |
Returns:
Whether the name carries an nsfw token.
- Type
- boolean
hasVariantSuffix(name) → {boolean}
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | A list/group name. |
Returns:
Whether it ends in an explicit -sfw/-nsfw variant suffix.
- Type
- boolean
homeFeed()
- Description:
Home feed.
- Source:
imagesChanged()
- Description:
Images changed.
- Source:
impliedGroupMembers(dir, readers) → {Array.<string>}
- Description:
Member reference lines for an IMPLIED group (a
.force-group-listfolder): the folder's OWN direct list files only (NOT descendants — implied groups don't stack), de-duplicated to base names (so-sfw/-nsfwpairs become one member resolved mode-aware), excluding real groups. The result feeds the normal group-union path.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
dir |
string | The folder path. |
readers |
Object |
Returns:
Member reference lines.
- Type
- Array.<string>
indexFile(settings, filePath) → {void}
- Description:
Index one
output/*.jsonsidecar: register its paths + keywords and wire up its deep links to parents (upscale / variation / reroll / animation). Upscales are linked to their original, not indexed as their own entry.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
settings |
object | The full settings ( |
filePath |
string | The sidecar path. |
Returns:
- Type
- void
init(_settings) → {void}
- Description:
Provide the settings accessor used during suggestion cleanup.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
_settings |
function | The |
Returns:
- Type
- void
initiateReindex()
- Description:
Initiate reindex.
- Source:
insertSelected()
- Description:
Insert selected.
- Source:
insertSettings(obj, useAll)
- Description:
Insert settings.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
obj |
object | |
useAll |
boolean |
insertStoredPrompt()
- Description:
Insert stored prompt.
- Source:
isGatedDynPrompt(name) → {boolean}
- Description:
Gate a dynamic prompt behind
includeAdultAUTOMATICALLY by its name token — the same rule lists/expansions use (isGatedList) — so a generator named e.g.subject/nude-nsfwis hidden/empty when adult is off, with no hardcoded list to keep in sync. The legacygatedDynPromptsarray is still honored as an extra escape hatch.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | A dynamic-prompt name (path or token). |
Returns:
Whether the dynamic prompt is gated behind includeAdult.
- Type
- boolean
isGatedList(name) → {boolean}
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | A list/group name. |
Returns:
Whether the list is gated behind includeAdult (by nsfw token).
- Type
- boolean
isNsfw(line) → {boolean}
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
line |
string | Raw line. |
Returns:
True if the line reads as ordinary NSFW (adult/nudity). Used for the SFW/NSFW split, NOT for removal.
- Type
- boolean
isReservedAny(name) → {boolean}
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | A dynamic-prompt reference (may carry a |
Returns:
Whether it is the reserved {#any} wildcard (any variant).
- Type
- boolean
isReservedWildcard(name) → {boolean}
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | A reference (may carry a |
Returns:
Whether it is the reserved keyword wildcard (any variant).
- Type
- boolean
joinPieces(pieces) → {string}
- Description:
Weighted-sort a list of
{ weight, text }pieces (stable; ties keep document order) and join the non-empty ones with ", ".
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
pieces |
Array.<{weight: number, text: string}> | The collected layer pieces. |
Returns:
The joined layer text.
- Type
- string
keywordRepeater(keyword, alias, settings) → {string}
- Description:
Emit a random number of keyword tokens, between
settings.keywordCountandsettings.keywordMaxCount.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
keyword |
string | The repeat target. |
alias |
boolean | Whether to resolve via the alias. |
settings |
object | The merged generation settings. |
Returns:
The joined keyword tokens.
- Type
- string
labelSettings()
- Description:
Label settings.
- Source:
lazyReloadListFile(settings, name) → {void}
- Description:
Mark a list slot empty so it is lazily re-read from disk on next pull.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
settings |
object | The merged generation settings. |
name |
string | The list name. |
Returns:
- Type
- void
lexLines(body) → {Array.<{depth: number, text: string, raw: string}>}
- Description:
Turn the body into indentation-tagged raw lines. The indent unit is the first indented line's leading whitespace (tab or N spaces), per the spec; depth = indent / unit.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
body |
string | The DPL body (front-matter removed). |
Returns:
Non-blank logical lines.
- Type
- Array.<{depth: number, text: string, raw: string}>
loadAll() → {void}
- Description:
Load the dynamic-prompt, expansion, and list catalogs.
- Source:
Returns:
- Type
- void
loadData()
- Description:
Load data.
- Source:
loadDynPromptList() → {object}
- Description:
Classify every dynamic prompt into full / partial (plus the v1 and user-submitted buckets) — the lists used by
promptSuggestion()and the web file pickers.
- Source:
Returns:
{fullRegular, partialRegular, userFiles, v1Files, all}.
- Type
- object
loadExpansionFileList() → {Array.<string>}
- Source:
Returns:
The expansion names (cached).
- Type
- Array.<string>
loadImageFeed()
- Description:
Load image feed.
- Source:
loadListFileList() → {Array.<string>}
- Description:
Load the list names (and cache the artist-excluded subset).
- Source:
Returns:
The list names.
- Type
- Array.<string>
loadResults()
- Description:
Load results.
- Source:
loadSearchQuery(query)
- Description:
Load search query.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
query |
string |
logicalListNames(physical) → {Array.<string>}
- Description:
Turn the physical on-disk names into the LOGICAL reference set, the names the rest of the app sees. A mixed list is stored as two files,
<base>-sfwand<base>-nsfw, with NO<base>file — the bare{base}is implicit, and this exposes all three references (base,base-sfw,base-nsfw). A standalone<base>-nsfwwith no<base>-sfwcounterpart is exposed only by its gated-nsfwname (NSFW-only).Safety rule: a plain
<p>file is only a normal SFW list when it has NO<p>-nsfwsibling; if such a sibling exists the plain file is IGNORED (not exposed, not loaded), to force the explicit-sfw/-nsfwsplit. Only<base>-sfwcounts as an SFW source — a stray<base>next to<base>-nsfwdoes not.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
physical |
Array.<string> | The on-disk list + group names (no extension). |
Returns:
Logical names, de-duplicated, in guaranteed natural order.
- Type
- Array.<string>
makeAnimations()
- Description:
Make animations.
- Source:
makeArt()
- Description:
Make art.
- Source:
makeArt()
- Description:
Make art.
- Source:
makeDynamicPromptStage(loader) → {function}
- Description:
Build the
#namedynamic-prompt stage bound to a loader (loader-injected port; suffix-resolved v2 / frozen v1, auto-fx/artists, danbooru substitution).
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
loader |
object | The loader ( |
Returns:
The stage (prompt, settings, imageSettings, upscaleSettings) => string.
- Type
- function
makeExpansionStage(loader) → {function}
- Description:
Build the
<name>expansion stage bound to a loader (loader-injected port, LoRA-safe).
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
loader |
object | The loader ( |
Returns:
The expansion stage (prompt, settings) => string.
- Type
- function
makeListStage(store) → {function}
- Description:
Build the
{name}list stage bound to a list store (loader-injected port).
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
store |
object | The list store ( |
Returns:
The list stage (prompt, settings) => string.
- Type
- function
makeVariations()
- Description:
Make variations.
- Source:
module:web-app/components/Gallery(props) → {JSX.Element|null}
Parameters:
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
props |
object |
Properties
|
Returns:
The gallery, or null when there are no images.
- Type
- JSX.Element | null
module:web-app/components/Home(props) → {JSX.Element}
- Description:
The compose workspace.
- Source:
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object |
Properties
|
Returns:
- Type
- JSX.Element
module:web-app/components/Settings(props) → {JSX.Element}
- Description:
The full settings form.
- Source:
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object |
Properties
|
Returns:
- Type
- JSX.Element
module:web-app/components/WrapperFab(props) → {JSX.Element}
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object |
Properties
|
Returns:
- Type
- JSX.Element
nameToData(settings, name, skipAliasCheckopt) → {Object}
- Description:
Resolve a list name (handling the
keyword/artistaliases) to its in-memory array.
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
settings |
object | The merged generation settings. |
|
name |
string | The requested list name or alias. |
|
skipAliasCheck |
boolean |
<optional> |
Skip alias resolution (used after a reload). |
Returns:
The resolved list handle.
- Type
- Object
nlpProcess(word) → {string}
- Description:
Reduce a word to its noun-singular or verb-infinitive form via compromise. (Currently unused — kept for reference; too slow to run per keyword.)
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
word |
string | The word. |
Returns:
The normalized word (or the original).
- Type
- string
normalize(line) → {string}
- Description:
Normalize a raw list line to a lowercase, single-spaced token string.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
line |
string | Raw line. |
Returns:
Normalized form, e.g. "long hair".
- Type
- string
onMinusStepperClick(input)
- Description:
On minus stepper click.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
input |
object |
onMinusStepperClick(input)
- Description:
On minus stepper click.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
input |
object |
onNumberChangeWStep()
- Description:
On number change wstep.
- Source:
onNumberChangeWStep()
- Description:
On number change wstep.
- Source:
onPageButtonClick()
- Description:
On page button click.
- Source:
onPlusStepperClick(input)
- Description:
On plus stepper click.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
input |
object |
onPlusStepperClick(input)
- Description:
On plus stepper click.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
input |
object |
onPromptSelectionChange()
- Description:
On prompt selection change.
- Source:
onReindexButton()
- Description:
On reindex button.
- Source:
onReroll()
- Description:
On reroll.
- Source:
onRerollSelect()
- Description:
On reroll select.
- Source:
onSettingsDownload()
- Description:
On settings download.
- Source:
onVariationSelectionChange()
- Description:
On variation selection change.
- Source:
parseFrontMatter(source) → {Object}
- Description:
Split a leading
---YAML-ish front-matter block from the body.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
source |
string | The raw |
Returns:
Parsed key/value meta and the remaining body.
- Type
- Object
parseNode(node) → {object}
- Description:
Parse one tree node's text into a typed descriptor (weight/gate/repeat/choice/ref/payload).
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
node |
Object | A raw tree node. |
Returns:
The typed node (with parsed children).
- Type
- object
parseSections(lines) → {object}
- Description:
Parse the lexed lines into
{ sectionName: nodeTree }. A heading is a text line whose next line is={3,};Startis the entry section. Lines under a heading nest by depth.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
lines |
Array | Lexed lines from lexLines. |
Returns:
Map of section name -> array of child nodes.
- Type
- object
performRandomGenerate()
- Description:
Perform random generate.
- Source:
performRandomSearch()
- Description:
Perform random search.
- Source:
performSearch()
- Description:
Perform search.
- Source:
pickerListNames() → {Array.<string>}
- Description:
The list names to show in the web picker, honoring adult mode. When adult is off, every name carrying an
nsfwtoken is hidden (the app behaves as if it doesn't exist). When on, each base that has a<base>-nsfwsibling also offers the explicit<base>-sfwreference, so the picker shows all three (default / SFW-only / NSFW).
- Source:
Returns:
The picker-facing list names, in load order.
- Type
- Array.<string>
populateSettingsList()
- Description:
Populate settings list.
- Source:
postBuildIndexes() → {void}
- Description:
Final pass: compute each animation's highest frame number from its frames.
- Source:
Returns:
- Type
- void
presetSelected()
- Description:
Preset selected.
- Source:
(async) processBatch(index, total) → {Promise.<void>}
- Description:
Build one prompt through the prompt-module pipeline and, when
generateImagesis on and mode is StableDiffusion, generate its image(s).
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
index |
number | The 0-based prompt index in the batch. |
total |
number | The total prompt count. |
Returns:
- Type
- Promise.<void>
processGroup(settings, defSettings, groupName, diff) → {void}
- Description:
Copy the keys of one settings group that differ from the defaults into
diff.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
settings |
object | The live settings. |
defSettings |
object | The default settings. |
groupName |
string | The group ("settings", "imageSettings", …). |
diff |
object | The accumulating diff object (mutated). |
Returns:
- Type
- void
processImageFeed(files)
- Description:
Process image feed.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
files |
object |
processMdj(settings, lessEmphasis, keyword) → {string}
- Description:
Midjourney emphasis: append
::factor, factor = 1.05·N up (or its reciprocal down); N is rolled byemphasisLevelChanceup toemphasisMaxLevels.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
settings |
object | The merged generation settings. |
lessEmphasis |
boolean | De-emphasize rather than emphasize. |
keyword |
string | The keyword to weight. |
Returns:
The weighted keyword.
- Type
- string
processNAI(settings, lessEmphasis, keyword) → {string}
- Description:
NovelAI emphasis: same nested-bracket leveling as SD (the list stage later rewrites
()to{}for NovelAI).
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
settings |
object | The merged generation settings. |
lessEmphasis |
boolean | De-emphasize rather than emphasize. |
keyword |
string | The keyword to wrap. |
Returns:
The wrapped keyword.
- Type
- string
processRepeat(count, keyword, alias) → {string}
- Description:
Build a comma-joined run of
countlist tokens.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
count |
number | How many tokens to emit (<= 0 yields ""). |
keyword |
string | The repeat target ("keyword" or "artist"). |
alias |
boolean | Whether to resolve via the keyword/artist alias. |
Returns:
The joined {token}, {token}, … string.
- Type
- string
processSd(settings, lessEmphasis, keyword) → {string}
- Description:
StableDiffusion emphasis: wrap the keyword in N nested
()(emphasis) or[](de-emphasis); N is rolled byemphasisLevelChanceup toemphasisMaxLevels.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
settings |
object | The merged generation settings. |
lessEmphasis |
boolean | De-emphasize ( |
keyword |
string | The keyword to wrap. |
Returns:
The wrapped keyword.
- Type
- string
promptSuggestion(fullopt) → {string}
- Description:
Build a random prompt suggestion (the engine behind
#random): one to three full dynamic prompts, sometimes AND-weighted, with optional garnish, then cleaned up.
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
full |
boolean |
<optional> |
Use the richer multi-prompt form. |
Returns:
The suggested prompt.
- Type
- string
pull(settings, name) → {string}
- Description:
Pull a random entry from a list, with once-only depletion and auto-reload when the list empties. Artist lists return "" when
includeArtistis off.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
settings |
object | The merged generation settings. |
name |
string | The list name or alias. |
Returns:
A random list entry, or "".
- Type
- string
query(keywords) → {Array.<object>}
- Description:
Search the index for images matching all query keywords (set intersection).
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
keywords |
string | The search query. |
Returns:
The matching file records (shuffled, de-duplicated by image).
- Type
- Array.<object>
randomName()
- Description:
Random name.
- Source:
reIndexToUrl(url)
- Description:
Re index to url.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
url |
string |
readListFile(settings, name) → {void}
- Description:
Load a list file fully into memory (under the artist or keyword bucket).
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
settings |
object | The merged generation settings. |
name |
string | The list name. |
Returns:
- Type
- void
readSfwBase(base, readers) → {Array.<string>|null}
- Description:
Read a plain list's SFW base lines. Safety rule: when a
<base>-nsfwsibling exists, a plain<base>.txtis IGNORED — the SFW source must be the explicit<base>-sfw.txt. This enforces the naming split so a stray<base>.txtcan never leak as SFW alongside NSFW (a lone<base>.txtbeside<base>-nsfw.txtis thus treated as NSFW-only). With no<base>-nsfwsibling, a plain<base>.txtis a normal SFW list (with<base>-sfw.txtas a fallback). Returnsnullwhen no SFW source exists, else an array (possibly empty).
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
base |
string | Canonical base name (no sfw/nsfw suffix). |
readers |
Object |
Returns:
- Type
- Array.<string> | null
rebuildIndexes(settings) → {void}
- Description:
Rebuild the whole index from
output/*.json: build, validate, post-process, and re-index (up to 5×) while self-healing keeps changing the data.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
settings |
object | The full settings. |
Returns:
- Type
- void
reindexHome()
- Description:
Reindex home.
- Source:
reindexProgress()
- Description:
Reindex progress.
- Source:
reloadListFiles(settings) → {void}
- Description:
Lazily clear every list (forces a fresh draw set on the next prompt).
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
settings |
object | The merged generation settings. |
Returns:
- Type
- void
reloadPromptFunc(list) → {void}
- Description:
Refill the per-pull pool of randomizers so each gets a turn before any repeats.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
list |
Array.<function()> | The mode-appropriate randomizer set to clone into the pool. |
Returns:
- Type
- void
reloadSettings() → {void}
- Description:
(Re)build the live settings object: clone the defaults, merge
user-settings.json, and migrate a legacyuser-settings.jsif present.
- Source:
Returns:
- Type
- void
removeDeepLink(settings, fileName, oneToOneName) → {void}
- Description:
Strip a now-invalid relationship field from a sidecar on disk (minimal rewrite) and flag that a re-index is needed.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
settings |
object | The full settings. |
fileName |
string | The file id. |
oneToOneName |
string | The field to remove (e.g. |
Returns:
- Type
- void
removeSettingOnClick()
- Description:
Remove setting on click.
- Source:
renderInlineBody()
- Description:
Render the payload text of a node, substituting inline
{js:path}via the bridge.
- Source:
renderNode(node, ctx) → {string}
- Description:
Render a single parsed node to a string (without its sibling gate, which the caller applied).
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
node |
object | A parsed node. |
ctx |
object | The render context. |
Returns:
The node's text contribution.
- Type
- string
renderNodes(nodes, ctx) → {string}
- Description:
Render an array of sibling nodes into one layer string (gates, choices, repeats, refs, weighted local sort).
autotracks the running auto-weight (starts at 1000).
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
nodes |
Array | Parsed sibling nodes. |
ctx |
object | The render context (settings, rng, bridge, sections). |
Returns:
The layer's rendered, weight-sorted text.
- Type
- string
renderRef()
- Description:
Resolve a reference node (call/insert/js-block) to a string.
- Source:
requireLoader() → {object}
- Source:
Throws:
-
If
configure()has not been called. - Type
- Error
Returns:
The configured loader.
- Type
- object
rerollPrompt(isSelect)
- Description:
Reroll prompt.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
isSelect |
boolean |
resetSavePreset()
- Description:
Reset save preset.
- Source:
resolveListLines(name, readers, includeAdultopt, forcedopt, depthopt, seenopt) → {Array.<string>|null}
- Description:
Resolve a list/group reference to its lines, honoring the SFW/NSFW naming model and the
includeAdultmode. No runtime content filtering — NSFW is a separate preprocessed<base>-nsfw.txtfile that is simply included or not.Semantics (per reference):
{name}→ SFW only when adult is off; SFW +<name>-nsfwwhen on.{name-sfw}→ SFW base only (always; the explicit SFW-exclusive reference).{name-nsfw}→ nothing when adult is off (acts as if it doesn't exist); SFW +<name>-nsfwwhen on (the SFW base is auto-tacked on).
Groups propagate the resolved variant to their members, so
{d}(off) is all-SFW,{d}(on) includes NSFW, and{d-sfw}is SFW even when on.
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
name |
string | Canonical list/group name (may carry a |
|
readers |
Object | ||
includeAdult |
boolean |
<optional> |
Whether adult/NSFW content is enabled. |
forced |
"sfw" | "full" | null |
<optional> |
Variant forced by a parent group (internal). |
depth |
number |
<optional> |
Current group-nesting depth (internal). |
seen |
Set.<string> |
<optional> |
Cycle guard (internal). |
Returns:
Resolved lines, or null if a plain list is missing.
- Type
- Array.<string> | null
resolveName(ref, names) → {string}
- Description:
Resolve a list reference to a canonical list name by PATH-SUFFIX matching, so a prompt can use a bare filename (
general), a partial path (danbooru/general), or a full path — and folders can be nested arbitrarily deep. An exact match wins; otherwise any name whose path ends with/<ref>matches, and the shallowest (fewest folders), then alphabetically-first, match is chosen for determinism.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
ref |
string | The reference as written in the prompt. |
names |
Array.<string> | All known canonical names (physical paths + virtual names). |
Returns:
The resolved canonical name (or ref unchanged if nothing matches).
- Type
- string
resultsLoaded(results)
- Description:
Results loaded.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
results |
object |
returnValToSetting()
- Description:
Return val to setting.
- Source:
returnValToSetting()
- Description:
Return val to setting.
- Source:
(async) run() → {Promise.<void>}
- Description:
Run the full generate loop: clear results, then build
promptCountprompts (reloading lists between prompts as configured), awaiting each batch in turn.
- Source:
Returns:
- Type
- Promise.<void>
sampleFile(name, settings, emphasisopt) → {string}
- Description:
Pull one random entry from list
name, optionally applying a single randomizer (emphasis / editing / alternating, chosen without replacement) and resolving any nested{list}tokens the randomizer leaves behind.
- Source:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
name |
string | The list name to pull from. |
||
settings |
object | The merged generation settings. |
||
emphasis |
boolean |
<optional> |
true
|
Whether this keyword is eligible for randomization. |
Returns:
The (possibly randomized) keyword.
- Type
- string
saveExpansion()
- Description:
Save expansion.
- Source:
savePreset()
- Description:
Save preset.
- Source:
saveSetting(path, value)
- Description:
Save setting.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
path |
string | |
value |
* |
saveSetting(path, value)
- Description:
Save setting.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
path |
string | |
value |
* |
saveSettings() → {void}
- Description:
Persist
userSettings()touser-settings.json.
- Source:
Returns:
- Type
- void
saveState()
- Description:
Save state.
- Source:
searchboxKeyPress(event)
- Description:
Searchbox key press.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
event |
Event |
selectAnimation()
- Description:
Select animation.
- Source:
selectUpscale()
- Description:
Select upscale.
- Source:
selectVariations()
- Description:
Select variations.
- Source:
sendLegacyTxtNotice() → {void}
- Description:
Print the legacy-txt conversion notice once per process.
- Source:
Returns:
- Type
- void
setValToSetting()
- Description:
Set val to setting.
- Source:
setupNumberSteppers()
- Description:
Setup number steppers.
- Source:
setupNumberSteppers()
- Description:
Setup number steppers.
- Source:
showSettingOnSelect()
- Description:
Show setting on select.
- Source:
startCase(text) → {*}
- Description:
Start case.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
text |
string |
Returns:
- Type
- *
startCase(text) → {*}
- Description:
Start case.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
text |
string |
Returns:
- Type
- *
startProgress() → {void}
- Description:
Create the four cli-progress bars (sampler / batch / total / prompts), seed the
imageSettings.progress*fields, and begin polling.
- Source:
Returns:
- Type
- void
stopProgress() → {void}
- Description:
Tear down the progress bars and clear the
imageSettings.progress*fields.
- Source:
Returns:
- Type
- void
swapOut(settings, keyword) → {string}
- Description:
Prompt-editing "swap":
[kw:kw:n]— re-assert the keyword at step n.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
settings |
object | The merged generation settings ( |
keyword |
string | The keyword. |
Returns:
The swap form.
- Type
- string
toComparitiveKeywords(prompt) → {Array.<string>}
- Description:
Tokenize a search query into comparison keywords (word-boundary only, so
girland1girlboth match), de-duplicated.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
prompt |
string | The query text. |
Returns:
The query keywords.
- Type
- Array.<string>
toKeywords(prompt) → {Array.<string>}
- Description:
Tokenize a prompt into the de-duplicated, sorted keyword list used for the index (splits on word and letter boundaries; drops 1-char and pure-digit tokens).
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
prompt |
string | The prompt text. |
Returns:
The keywords.
- Type
- Array.<string>
toggleDetailedProgress()
- Description:
Toggle detailed progress.
- Source:
updateFiles(directoryName) → {void}
- Description:
Recursively copy legacy
.txtoutput sidecars to.jsonand remove the.txt.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
directoryName |
string | The directory to walk. |
Returns:
- Type
- void
(async) updateProgress() → {Promise.<void>}
- Description:
Poll the SD WebUI
/progressendpoint and push the numbers into the cli-progress bars andimageSettings.progress*; reschedules itself while a render is ongoing.
- Source:
Returns:
- Type
- Promise.<void>
updateSearchSuggestion()
- Description:
Update search suggestion.
- Source:
updateStats()
- Description:
Update stats.
- Source:
(async) upscale(fileId) → {Promise.<void>}
- Description:
Upscale an already-generated image by file id.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
fileId |
string | number | The image file id. |
Returns:
- Type
- Promise.<void>
upscaleFile()
- Description:
Upscale file.
- Source:
userSettings() → {void}
- Description:
Create
user-settings.jsonfromdefault-user-settings.jsonif it is missing.
- Source:
Returns:
- Type
- void
userSettings() → {object}
- Description:
Compute the settings that differ from defaults, with internal-only / runtime fields (progress, lastCmd, animation bookkeeping, …) stripped.
- Source:
Returns:
The persistable user settings.
- Type
- object
validateDeepLink(settings, fileName, oneToOneName) → {void}
- Description:
Drop a deep link (and its on-disk field) when its target no longer exists.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
settings |
object | The full settings. |
fileName |
string | The file id. |
oneToOneName |
string | The relationship field to validate. |
Returns:
- Type
- void
validateIndexes(settings) → {void}
- Description:
Validate every indexed file: drop placeholders with no image, promote orphaned upscales, and prune dead deep links.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
settings |
object | The full settings. |
Returns:
- Type
- void
validateUpscaleDeepLink(settings, fileName) → {void}
- Description:
Orphan an upscale whose parent vanished: rename
<id>-upscaled→<id>and strip itsupscaleOfso it becomes a standalone index entry.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
settings |
object | The full settings. |
fileName |
string | The parent file id. |
Returns:
- Type
- void
weightOf()
- Description:
A node's explicit weight, or null (used for refs that carry a weight).
- Source:
weightedSampleN()
- Description:
Pick
ndistinct options weighted by each option's leading gate %, else uniform.
- Source: