1.3.12 • Published 7 months ago

sd-wildcards-utils v1.3.12

Weekly downloads
-
License
ISC
Repository
github
Last release
7 months ago

README.md

Parse Stable Diffusion wildcards source to a YAML object.

https://civitai.com/models/449400

install

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)

SYNTAX

OTHERS

1.3.10

7 months ago

1.3.12

7 months ago

1.3.7

9 months ago

1.3.6

10 months ago

1.3.5

10 months ago

1.3.4

10 months ago

1.3.2

11 months ago

1.3.1

11 months ago

1.2.1

12 months ago

1.1.1

12 months ago

1.0.29

1 year ago

1.0.28

1 year ago

1.0.27

1 year ago

1.0.26

1 year ago

1.0.25

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.22

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago