Giter Site home page Giter Site logo

animerl / novelai-2-local-prompt Goto Github PK

View Code? Open in Web Editor NEW
69.0 4.0 13.0 29 KB

Script for Stable-Diffusion WebUI (AUTOMATIC1111) to convert the prompt format used by NovelAI.

License: The Unlicense

JavaScript 100.00%
novelai automatic1111 stable-diffusion tool script

novelai-2-local-prompt's Introduction

novelai-2-local-prompt

Script for Stable-Diffusion WebUI (AUTOMATIC1111) to convert the prompt format used by NovelAI.
English 日本語

tldr

Add a button to convert the prompts used in NovelAI for use in the WebUI.
In addition, add a button that allows you to recall a previously used prompt.
NovelAIで使われるプロンプトを、WebUIで使えるように変換するボタンを追加します。
加えて、前に使ったプロンプトを呼び戻すことができるボタンも追加します。

Credits

https://rentry.org/43zdr
https://github.com/naisd5ch/novel-ai-5ch-wiki-js
nan-J NovelAI club

en

INSTALL

Put nai2local.js into your stable-diffusion-webui/javascript
Recommended: Use WebUI's Extensions tab
(Alternative):git clone https://github.com/animerl/novelai-2-local-prompt.git extensions/novelai-2-local-prompt

Usage

Simply click on NAIConvert. It will automatically process the brackets, prefix them with a quality tag, and insert a default value in the negative prompt. Multipliers are rounded off to four decimal places.

(a),{b},[c]
↓NAIConvert
masterpiece, best quality,
\(a\),(b:1.05),(c:0.9524)

Click History to call back previously generated prompts, starting with the newest. The default maximum number of saves is 10(MaxHistory).

ja

INSTALL

nai2local.jsstable-diffusion-webui/javascriptに入れてください。
推奨: WebUIのExtensionsタブからインストール。
もしくは、手動で:git clone https://github.com/animerl/novelai-2-local-prompt.git extensions/novelai-2-local-prompt

NAIConvertをクリックすると、自動で括弧が処理され、quality tagが追加され、ネガティブプロンプトにNovelAIが利用しているものが自動で追加されます。 ワードに対して適用される倍数は、小数点以下4桁で丸めています。

(a),{b},[c]
↓NAIConvert
masterpiece, best quality,
\(a\),(b:1.05),(c:0.9524)

Historyをクリックすると、前に生成したプロンプトを新しいものから順に呼び出します。最大保存数はデフォルトで10です(MaxHistory)

novelai-2-local-prompt's People

Contributors

animerl avatar el-bad avatar seedmanc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

novelai-2-local-prompt's Issues

May I ask that how it handles prompt like (())

Like this one:

((masterpiece)), best quality, (((extremely detailed CG))), ((ultra-detailed)), ((highres)), ((extremely_detailed_eyes_and_face))

It turns to

\(\(masterpiece\)\), best quality, \(\(\(extremely detailed CG\)\)\), \(\(ultra-detailed\)\), \(\(highres\)\), \(\(extremely_detailed_eyes_and_face\)\)

Is that correct?

Issues with AUTOMATIC111

Since the latest update of the stable diffusion webui, the "NAIConvert" button has disappeared for me. There is a NAIConvertHistory (which I hadn't actually seen before) but no way that I can see to do an NAIConvert.

image

[Request] Add more simple description

sample:
NovelAIで使われるプロンプトを、WebUIで使えるように変換するボタンを追加します。
加えて、前に使ったプロンプトを呼び戻すことができるボタンも追加します。

Add a button to convert the prompts used in NovelAI for use in the WebUI.
In addition, add a button that allows you to recall a previously used prompt.

Known issues and Re-implementing in Python

  • Rewrite the code in Python
    • Standard bracket conversion
    • Escape literal round brackets (parentheses) and replace _ to " "(space)
      • ex: XXX_(YYY)→XXX \(YYY\)
    • Add quality tag(s)
    • (Issue) Detects and warns of bracket inconsistencies
      • Implement function
    • Add API endpoints (#4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.