npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

sd-wildcards-utils

v1.4.1

Published

Parse Stable Diffusion wildcards source to a YAML object.

Readme

README.md

Parse Stable Diffusion wildcards source to a YAML object.

https://civitai.com/models/449400

Features

  • Parse Wildcards YAML: Parse Stable Diffusion wildcards YAML files into structured data
  • Validate Syntax: Validate wildcards syntax with detailed error messages
  • Format & Normalize: Format and normalize wildcards prompts for consistency
  • Merge Documents: Merge multiple wildcard documents intelligently
  • Safe Key Handling: Automatic key validation and quote handling

Documentation

Installation

yarn add sd-wildcards-utils
yarn-tool add sd-wildcards-utils
yt add sd-wildcards-utils

Demo

import { parseWildcardsYaml, stringifyWildcardsYamlData } from 'sd-wildcards-utils';

let input = `
xxx:
  a:
    - >-
      (silhouette:1.2), jianying,
      1girl, nude,
      (in river), splash,
      ({sun rays, sunset|moonlight|dawn|twilight} background, low horizon),
      backlighting,
      contour light, body contour light, light particles,
      __lazy-wildcards/prompts/hair__,
      __lazy-wildcards/dataset/background-color__,
      (flower, falling petals, petals on liquid, petals, cherry blossom:0.8)
    - >-
      (silhouette:1.2), jianying,
      1girl, nude,
      (in river), splash,
      ({sun rays, sunset|moonlight|dawn|twilight} background, low horizon),
      backlighting,
      contour light, body contour light, light particles,
      __lazy-wildcards/prompts/hair__,
      __lazy-wildcards/dataset/background-color__,
      (flower, falling petals, petals on liquid, petals, cherry blossom:0.8)
    - "(silhouette:1.2), jianying, 1girl, nude, (in river), splash, ({sun rays, sunset|moonlight|dawn|twilight} background, low horizon), backlighting, contour light, body contour light, light particles, __lazy-wildcards/prompts/hair__, __lazy-wildcards/dataset/background-color__, (flower, falling petals, petals on liquid, petals, cherry blossom:0.8)"
    - |-
      (silhouette:1.2), jianying, 1girl, nude, (in river), splash, ({sun rays, sunset|moonlight|dawn|twilight} background, low horizon), backlighting, contour light, body contour light, light particles, __lazy-wildcards/prompts/hair__, __lazy-wildcards/dataset/background-color__, (flower, falling petals, petals on liquid, petals, cherry blossom:0.8)
`;

let doc = parseWildcardsYaml(input);
doc.contents;
let node = doc.getIn(['xxx', 'a']);
// @ts-ignore
let items = node.items;
console.dir(items, {
	depth: null,
});

console.log(`============`)

let out = doc.toString();

console.log(out)

console.log(`============`)

console.log(stringifyWildcardsYamlData(doc))
============
xxx:
  a:
    - >-
      (silhouette:1.2), jianying, 1girl, nude, (in river), splash, ({sun rays,
      sunset|moonlight|dawn|twilight} background, low horizon), backlighting,
      contour light, body contour light, light particles,
      __lazy-wildcards/prompts/hair__,
      __lazy-wildcards/dataset/background-color__, (flower, falling petals,
      petals on liquid, petals, cherry blossom:0.8)
    - >-
      (silhouette:1.2), jianying, 1girl, nude, (in river), splash, ({sun rays,
      sunset|moonlight|dawn|twilight} background, low horizon), backlighting,
      contour light, body contour light, light particles,
      __lazy-wildcards/prompts/hair__,
      __lazy-wildcards/dataset/background-color__, (flower, falling petals,
      petals on liquid, petals, cherry blossom:0.8)
    - "(silhouette:1.2), jianying, 1girl, nude, (in river), splash, ({sun rays,
      sunset|moonlight|dawn|twilight} background, low horizon), backlighting,
      contour light, body contour light, light particles,
      __lazy-wildcards/prompts/hair__,
      __lazy-wildcards/dataset/background-color__, (flower, falling petals,
      petals on liquid, petals, cherry blossom:0.8)"
    - |-
      (silhouette:1.2), jianying, 1girl, nude, (in river), splash, ({sun rays, sunset|moonlight|dawn|twilight} backgroun
nd, low horizon), backlighting, contour light, body contour light, light particles, __lazy-wildcards/prompts/hair__, __la
azy-wildcards/dataset/background-color__, (flower, falling petals, petals on liquid, petals, cherry blossom:0.8)

============
xxx:
  a:
    - >-
      (silhouette:1.2), jianying, 1girl, nude, (in river), splash, ({sun rays,
      sunset|moonlight|dawn|twilight} background, low horizon), backlighting,
      contour light, body contour light, light particles,
      __lazy-wildcards/prompts/hair__,
      __lazy-wildcards/dataset/background-color__, (flower, falling petals,
      petals on liquid, petals, cherry blossom:0.8)

API Reference

Core Functions

| Function | Description | |----------|-------------| | parseWildcardsYaml | Parse wildcards YAML string into a Document object | | stringifyWildcardsYamlData | Format and stringify wildcards YAML data | | mergeWildcardsYAMLDocumentRoots | Merge multiple wildcard documents (flat merge) | | mergeFindSingleRoots | Merge wildcard documents with path matching (deep merge) |

Validation Functions

| Function | Description | |----------|-------------| | normalizeDocument | Normalize and validate a YAML Document | | checkWildcardsYamlData | Validate wildcards data structure |

Options

Stringify Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | minifyPrompts | boolean | false | Compress prompt content | | allowEmptyDocument | boolean | false | Allow empty documents | | allowUnsafeKey | boolean | false | Allow unsafe keys | | blockQuote | boolean | true | Use block quotes for multiline strings | | lineWidth | number | 80 | Line width limit (0 = no limit) |

See Format Documentation for complete options reference.

import { parseWildcardsYaml, stringifyWildcardsYamlData } from 'sd-wildcards-utils';

let input = `
xxx:
  a:
    - >-
      (silhouette:1.2), jianying,
      1girl, nude,
      (in river), splash,
      ({sun rays, sunset|moonlight|dawn|twilight} background, low horizon),
      backlighting,
      contour light, body contour light, light particles,
      __lazy-wildcards/prompts/hair__,
      __lazy-wildcards/dataset/background-color__,
      (flower, falling petals, petals on liquid, petals, cherry blossom:0.8)
    - >-
      (silhouette:1.2), jianying,
      1girl, nude,
      (in river), splash,
      ({sun rays, sunset|moonlight|dawn|twilight} background, low horizon),
      backlighting,
      contour light, body contour light, light particles,
      __lazy-wildcards/prompts/hair__,
      __lazy-wildcards/dataset/background-color__,
      (flower, falling petals, petals on liquid, petals, cherry blossom:0.8)
    - "(silhouette:1.2), jianying, 1girl, nude, (in river), splash, ({sun rays, sunset|moonlight|dawn|twilight} background, low horizon), backlighting, contour light, body contour light, light particles, __lazy-wildcards/prompts/hair__, __lazy-wildcards/dataset/background-color__, (flower, falling petals, petals on liquid, petals, cherry blossom:0.8)"
    - |-
      (silhouette:1.2), jianying, 1girl, nude, (in river), splash, ({sun rays, sunset|moonlight|dawn|twilight} background, low horizon), backlighting, contour light, body contour light, light particles, __lazy-wildcards/prompts/hair__, __lazy-wildcards/dataset/background-color__, (flower, falling petals, petals on liquid, petals, cherry blossom:0.8)
`;

let doc = parseWildcardsYaml(input);
doc.contents;
let node = doc.getIn(['xxx', 'a']);
// @ts-ignore
let items = node.items;
console.dir(items, {
	depth: null,
});

console.log(`============`)

let out = doc.toString();

console.log(out)

console.log(`============`)

console.log(stringifyWildcardsYamlData(doc))

Key Safety Rules

Keys must follow safety rules to use without quotes:

Allowed characters:

  • Letters: a-z, A-Z
  • Numbers: 0-9
  • Special characters: _, /

Not allowed patterns:

  • Starting or ending with non-alphanumeric characters
  • Double underscores __
  • Double periods ..
  • Double hyphens --
  • Double slashes //
  • Consecutive dots, underscores, or hyphens
  • Path combinations like [._-]/ or /[._-]
  • Keys containing . or - (e.g., style.main, style-main) are considered unsafe and will be quoted

Example:

# Safe keys (no quotes needed)
safe_key: value
key/sub: value
key_sub: value

# Unsafe keys (quotes required)
"style.main": value
"style-main": value
"key with spaces": value

License

MIT

Related Resources

Documentation

External Links

  • Dynamic Prompts Syntax

  • YAML Format Reference

  • Civitai Model

  • Gist Reference

  • https://eemeli.org/yaml/#yaml

  • https://civitai.com/models/449400

  • https://gist.github.com/bluelovers/5dd82472d21cbaa7203b36c34612434b

  • https://civitai.com/user/C0rn_Fl4k3s/models

  • https://civitai.com/models/138970/billions-of-wildcards-character-vehicle-scenery-building-creature-scifi-fantasy-magic-all-you-want

  • https://github.com/sdbds/stable-diffusion-webui-wildcards

  • https://civitai.com/models/934903

  • https://civitai.com/models/863333

  • https://civitai.com/models/272654?modelVersionId=317312