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 🙏

© 2024 – Pkg Stats / Ryan Hefner

img2prompt

v1.1.1

Published

Read the prompt information for generating images from stable diffusion.

Downloads

18

Readme

img2prompt

Read the prompt information for generating images from stable diffusion.

demo

Install

npm i img2prompt

# or
pnpm add img2prompt

# or
yarn add img2prompt

Usage

ts

import path from 'path'
import { readImage } from 'img2prompt'
;(async () => {
  console.log('prompt info', await readImage(path.join(__dirname, './a.png')))
})()

commonjs

const path = require('path')
const { readImage } = require('img2prompt')

;(async () => {
  console.log('prompt info', await readImage(path.join(__dirname, './a.png')))
})()

output

info masterpiece, best quality, official art, 8k wallpaper, highly detailed, illustration, (((1 girl))), white hair, long hair, detailed eyes, forrest, bare shoulders, hanfu,lakes, pure, soft smile,bamboo, <lora:clearvae_main:0.3> ,<lora:Moxin_10:0.4> , <lora:elegantHanfuRuqun_v10:0.3>,
Negative prompt: fat, naked, nude, paintings, sketches, (worst quality:2), (low quality:2), (normal quality:2), lowres, ((monochrome)), ((grayscale)), bad anatomy, DeepNegative, lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, bad feet, cropped, poorly drawn hands, poorly drawn face, mutation, deformed, extra fingers, extra limbs, extra arms, extra legs, malformed limbs, fused fingers, too many fingers, long neck, cross-eyed, mutated hands, polar lowres, bad body, bad proportions, gross proportions, text, error, missing fingers, missing arms, missing legs,
Steps: 25, Sampler: Euler a, CFG scale: 5, Seed: 356983177, Size: 768x1080, Model hash: 7107c05c1c, Model: dalcefoPainting_3rd, Hashes: {"lora:clearvae_main": "600345c503", "lora:Moxin_10": "3fd52c707c", "lora:elegantHanfuRuqun_v10": "495901d34f", "model": "7107c05c1c"}

use readImageV2

import path from 'path'
import { readImageV2 } from '../src'
;(async () => {
  console.log('info', await readImageV2(path.join(__dirname, './a.png')))
})()

output

{
  prompt: '(masterpiece),(best quality),(ultra-detailed), (full body:1.2), 1girl,chibi,cute, smile, open mouth, flower, outdoors, hanfu, music, jacket, blush, tree, :3, shirt, longhair, cherry blossoms, green headwear, blurry, white hair, blush stickers, long sleeves, bangs, black hair, pink flower, (beautiful detailed face), (beautiful detailed eyes),  <lora:blindbox_v1mix:1>,',
  negativePrompt: '(low quality:1.3), (worst quality:1.3), fat,  easynegative',
  sampler: 'euler a',
  cfgScale: '5',
  seed: '1640334232',
  size: '768x768',
  modelHash: '4199bcdd14',
  model: 'revanimated_v122',
  steps: '30'
}

License

MIT

keywords

  • stable diffusion
  • prompt
  • img2prompt
  • midjourney
  • get prompt
  • generate prompt
  • stable diffusion prompt
  • text to img
  • img to text
  • img2text
  • text2img