Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@bluelovers/auto1111-pnginfo

bluelovers215MIT2.0.5TypeScript support: included

an extreremely minimalistic js library to extract PNG info from auto1111 gens

automatic1111, auto1111, png, info, pnginfo, stable, diffusion, webui, sdwebui, sd, prompt, prompts, Stable Diffusion web UI, Stable Diffusion, create-by-yarn-tool, create-by-tsdx

readme

auto1111-pnginfo

an extreremely minimalistic js library to extract PNG info from auto1111 gens

it works on my machine, there's also a memory leak

details

this is an extremely simple library written to extract generation data from pngs generated by auto1111, it works both in the browser and in nodejs (probably deno too?)

as far as I can tell this works "correctly" with every PNG i've ever generated, and that's good enough for me

usage

import fs from 'fs/promises'
import parseFromImageBuffer from '@bluelovers/auto1111-pnginfo'

const file = await fs.readFile('generate_waifu.png')
const info = parseFromImageBuffer(file)

console.log(info)

notes

PNG Info is actually broken in auto1111, so this aims to be broken the same way. If you have a multi line prompt with the last line starting with Negative prompt: that will end up as the negative prompt in the generation, rather than part of the positive prompt. You can also put the Steps/Sampler etc into the negatives and get the same effect. I'm sure there are many other edge cases. Oh yeah also this probably doesn't work on a big endian arch.

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

2.0.4 (2024-06-11)

📦 Code Refactoring

  • code splitting and add Generator fn (1397b29)

2.0.3 (2024-05-18)

✨ Features

  • support \u200b\u200b\u200b\n zero-width space (32508aa)

2.0.2 (2024-05-10)

🚨 Tests

2.0.1 (2024-05-10)

BREAKING CHANGES

  • rewrite and fix bugs

📦 Code Refactoring

🛠 Build System

1.0.5 (2024-05-10)

🐛 Bug Fixes

📦 Code Refactoring

  • code splitting and update support \x00\x00\x00 (b144fd3)
  • tsdx (372e5ef)

🛠 Build System

🔖 Miscellaneous

  • Update README.md (7d58bda)
  • some dumb check to not crash on non-auto pngs (probably still crashes) (8d0ddf4)
  • add an exception for some weird trailing : edgecase (284f277)
  • check png magic so it returns null if it's not a png (469a67c)
  • Create package.json (a8ff2d2)
  • Update README.md (75d92ce)
  • rename repo because npm is trash and there'a a garbage 8 year old package that hasn't been updated squatting this name (84d5419)
  • initial commit (7ce6255)
  • Initial commit (65b34b3)