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

auto1111-invokeai-prompt

v1.6.4

Published

This tool will help you to convert [Automatic1111](https://github.com/AUTOMATIC1111/stable-diffusion-webui) prompt to [InvokeAI](https://github.com/invoke-ai/InvokeAI) prompt

Downloads

46

Readme

About

This tool will help you to convert Automatic1111 prompt to InvokeAI prompt

Usage

Online test click here and use it directly

or download this repo and open index.html it will work locally.

Features

  • Support InvokeAI (V2 and V3)

  • Support wide conversion cases

  • Support translation from invokeai to automatic1111

  • Fetch prompt from online image

  • Copy shortcuts

  • Tokens counter

  • Prompt syntax highlights

  • Auto prompt copy

  • Weight limiters

  • Weight randomizer

Standalone (Developers)

If you want to use the translation engine in your project use converter_standalone.js or converter_standalone.ts for TypeScript

note that .ts version will report error for missing encoder function, you need to import that (GPT-Tokenizer) manually or disable the line if you're not intersted in tokens counter

//Create instance first
var invokeaiResolver = new InvokeAIPromptResolver();

//Prepare options, all keys are optional, you don't have to add all of them
var options = {
    invokeaiVersion: 3,
    rawNegative: false,
    limitWeightPositive: "$1",
    limitWeightNegative: "$1",
    randomWeight: false,
    usePowValueAlways: false,
    dynamicPrompts: true
};

//1- From auto1111 to invokeai 
var output1 = invokeaiResolver.convertAuto1111ToInvokeAI(positive, negative, options);

//2- From invokeai to auto1111
var output2 = invokeaiResolver.convertInvokeAIToAuto1111(positive, negative, options);;

//Both functions (1 & 2) returns object as below:
/*
    {
    from: {
            positive: { text: , tokens: },
            negative: { text: , tokens: },
        },
    to: {
            positive: { text: , tokens: },
            negative: { text: , tokens: },
        }
    }
*/

//Calculate tokens without translation
//Require `encoders/cl100k_base.js` to be included
var tokensOutput = invokeaiResolver.calculateInvokeAITokens(positive, negative);
//This function returns object as below:
/*
    {
        positive: { text: , tokens: },
        negative: { text: , tokens: }
    };
*/

Contribution

Feel free to submit any request or fix

if you want to make your own fork just don't remove copyright section.

Privacy

This tool works locally and doesn't send or collect any usage data or any texts

Credits

Bashar Astifan (Developer)

GPT-Tokenizer thanks to Bazyli Brzóska

Syntax highlights and code editor CodeMirror

Tooltips TippyJS

Notifications Ryan Morr

Checkbox switch Edgar

HTML page has some elements from Navneet and Trent Dec